Merge pull request #2870 from mlorb/ml-sci-4841

Fix at long inventory name snapshot in title is not visible [SCI-4841]
This commit is contained in:
mlorb 2020-10-14 14:38:04 +02:00 committed by GitHub
commit 83ba40d135
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 28 deletions

View file

@ -453,7 +453,8 @@ var MyModuleRepositories = (function() {
FULL_VIEW_MODAL.on('show.bs.modal', function() {
FULL_VIEW_MODAL.find('.table-container').empty();
FULL_VIEW_MODAL.find('.repository-name').empty();
FULL_VIEW_MODAL.find('.repository-title').empty();
FULL_VIEW_MODAL.find('.repository-version').empty();
updateFullViewRowsCount('');
});
}
@ -518,29 +519,31 @@ var MyModuleRepositories = (function() {
function updateFullViewRowsCount(value) {
FULL_VIEW_MODAL.data('rows-count', value);
FULL_VIEW_MODAL.find('.repository-name').attr('data-rows-count', value);
FULL_VIEW_MODAL.find('.repository-version').attr('data-rows-count', value);
}
function renderFullViewRepositoryName(name, snapshotDate, assignMode) {
var title;
var repositoryName = name || FULL_VIEW_MODAL.find('.repository-name').data('repository-name');
var version;
var repositoryName = name || FULL_VIEW_MODAL.find('.repository-title').data('repository-name');
if (assignMode) {
title = I18n.t('my_modules.repository.full_view.assign_modal_header', {
repository_name: repositoryName
});
version = '';
} else if (snapshotDate) {
title = I18n.t('my_modules.repository.full_view.modal_snapshot_header', {
repository_name: repositoryName,
title = repositoryName;
version = I18n.t('my_modules.repository.full_view.modal_snapshot_header', {
snaphot_date: snapshotDate
});
} else {
title = I18n.t('my_modules.repository.full_view.modal_live_header', {
repository_name: repositoryName
});
title = repositoryName;
version = I18n.t('my_modules.repository.full_view.modal_live_header');
}
FULL_VIEW_MODAL.find('.repository-name').data('repository-name', repositoryName);
FULL_VIEW_MODAL.find('.repository-name').html(title);
FULL_VIEW_MODAL.find('.repository-title').data('repository-name', repositoryName);
FULL_VIEW_MODAL.find('.repository-title').html(title);
FULL_VIEW_MODAL.find('.repository-version').html(version);
}
function initRepoistoryAssignView() {

View file

@ -5,21 +5,9 @@
@include font-h3;
line-height: 22px;
overflow: hidden;
padding-right: 55px;
position: relative;
text-overflow: ellipsis;
white-space: nowrap;
&::after {
color: $color-alto;
content: '[' attr(data-rows-count) ']';
display: inline-block;
line-height: 22px;
padding-left: 5px;
position: absolute;
right: 0;
width: 55px;
}
}
.my-module-inventories {
@ -131,6 +119,16 @@
.assigned-repository-title {
@include my-module-repository-title;
padding-right: 2.2em;
&::after {
color: $color-alto;
content: '[' attr(data-rows-count) ']';
display: inline-block;
padding-right: .7em;
position: absolute;
right: 0;
}
}
.action-buttons {
@ -218,11 +216,26 @@
flex-grow: 1;
max-width: calc(100% - 20px);
.repository-name {
.repository-name-container {
display: flex;
}
.repository-title {
@include my-module-repository-title;
@include font-h2;
display: inline-block;
width: 100%;
}
.repository-version {
@include font-h2;
flex-shrink: 0;
padding-right: .7em;
&::after {
color: $color-alto;
content: '[' attr(data-rows-count) ']';
display: inline-block;
padding-left: .3em;
}
}
.breadcrumbs {

View file

@ -11,7 +11,8 @@
<span class="my-module" title="<%= @my_module.name %>"><%= @my_module.name %></span>
</div>
<div class="repository-name-container">
<span class="repository-name"></span>
<span class="repository-title"></span>
<span class="repository-version"></span>
</div>
</div>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>

View file

@ -811,8 +811,8 @@ en:
head_title: "%{project} | %{module} | Inventory %{repository}"
export: 'Export'
full_view:
modal_live_header: '%{repository_name}: Live version'
modal_snapshot_header: '%{repository_name}: Snapshot of %{snaphot_date}'
modal_live_header: ': Live version'
modal_snapshot_header: ': Snapshot of %{snaphot_date}'
assign_modal_header: 'Assign from %{repository_name} inventory'
snapshots:
simple_view: