Fix css for saved filters dropdown [SCI-6516] (#3843)

Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
aignatov-bio 2022-02-11 12:44:22 +01:00 committed by GitHub
parent 24127af83f
commit afce0e34c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 3 deletions

View file

@ -34,6 +34,7 @@
.saved-filters-list {
max-height: 300px;
overflow-y: auto;
width: 250px;
}
}
@ -77,12 +78,25 @@
.saved-filters-element {
align-items: center;
display: flex;
padding: .5em 1em;
padding: 0 1em;
cursor: pointer;
&:hover {
background: $color-concrete;
}
span {
flex-grow: 1;
}
.btn-light {
color: $color-silver-chalice;
flex-shrink: 0;
margin-left: auto;
&:hover {
color: $color-black;
}
}
}
}

View file

@ -86,6 +86,7 @@ window.initRepositoryFilter = () => {
created() {
this.dataTableElement = $($('#filterContainer').data('datatable-id'));
},
components: {
'filter-container': FilterContainer
},

View file

@ -75,7 +75,8 @@
},
data() {
return {
filters: this.defaultFilters
filters: this.defaultFilters,
savedFilterScrollbar: null
}
},
components: { ColumnElement, FilterElement, SavedFilterElement },
@ -141,6 +142,11 @@
},
toggleSavedFilters(e) {
e.stopPropagation();
if (this.savedFilterScrollbar) {
this.savedFilterScrollbar.update();
} else {
this.savedFilterScrollbar = new PerfectScrollbar($('.saved-filters-list')[0]);
}
this.closeColumnsFilters();
$('#savedFiltersContainer').toggleClass('open');
},

View file

@ -2,7 +2,7 @@
<div class="saved-filters-element">
<span @click="loadFilters">{{ savedFilter.attributes.name }}</span>
<button v-if="canManageFilters" class="btn btn-light icon-btn" @click="deleteFilter">
<i class="fas fa-trash"></i>
<i :title="i18n.t('repositories.show.filters.delete_saved_filter')" class="fas fa-trash"></i>
</button>
</div>
</template>

View file

@ -1410,6 +1410,7 @@ en:
clear: "Clear"
add_filter: "Add filter"
apply: "Show results"
delete_saved_filter: "Delete the saved filter"
repository_filter:
errors:
column_not_found: "Filtering failed because one or more columns no longer exist. Please update your filter."