feature: adds trimming for global audit logs; makes ellipsis in the end for repo descriptions; add error message for long repo names;

This commit is contained in:
ievgenii vdovenko 2026-01-07 13:47:55 +01:00
parent 56b0678cb3
commit 6b4d63e071
6 changed files with 23 additions and 5 deletions

View file

@ -187,6 +187,7 @@ table.dataTable {
white-space: nowrap;
overflow: hidden;
max-width: 350px;
text-overflow: ellipsis;
}
}

View file

@ -37,6 +37,7 @@
</div>
<script>
$('#j_filter').autoGrowInput();
$('#j_filter').autoGrowInput();
applyMiddleCut('.rctable .td-componentname a', 80);
</script>
</%def>

View file

@ -19,7 +19,7 @@ ${h.secure_form(h.route_path('repo_create'), request=request)}
${h.select('repo_group', request.GET.get('parent_group'), c.repo_groups, class_="medium")}
<div class="repo-create-spacer"> / </div>
<div class="repo-name-input-container">
${h.text('repo_name', class_="medium", id="repo_name_input", maxlength=192)}
${h.text('repo_name', class_="medium", id="repo_name_input")}
<div id="repo_name_error" class="error" aria-live="polite" style="display:none; color: #c00; margin-top: 6px; font-size: 0.9rem;"></div>
<div class="repo-check-container check-progress" id="repo_check" style="display: none"></div>
</div>
@ -196,6 +196,22 @@ ${h.secure_form(h.route_path('repo_create'), request=request)}
let debounceTimer;
$('#repo_name_input').on('input paste', function () {
const LIMIT = 192;
const $input = $("#repo_name_input");
const $error = $("#repo_name_error");
const $saveBtn = $("#save");
const len = $input.val().length;
if (len >= LIMIT) {
$error.text("You've reached the " + LIMIT + " character limit. Please select shorter name.").show();
$saveBtn.prop("disabled", true);
return;
} else {
$error.text("").hide();
$saveBtn.prop("disabled", false);
}
let repoName = $(this).val();
if (repoName.length > 0) {
@ -284,6 +300,7 @@ ${h.secure_form(h.route_path('repo_create'), request=request)}
})
trimRepoTitleName();
});
</script>
${h.end_form()}

View file

@ -143,7 +143,6 @@ $(document).ready(function() {
$(document).on("draw.dt", function () {
applyMiddleCut('#repo_list_table .truncate a', 60);
applyMiddleCut('.truncate-wrap');
});
});

View file

@ -1223,7 +1223,7 @@
}
}
$(function () {
applyMiddleCut('#context-bar .title a');
applyMiddleCut('#context-bar .title a', 120);
});
})();

View file

@ -226,7 +226,7 @@
},
});
$(document).on("draw.dt", function () {
applyMiddleCut('.truncate-wrap .truncate a, .truncate-wrap'); // auto
applyMiddleCut('.truncate-wrap .truncate a'); // auto
});
});
</script>