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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
<div class="saved-filters-element"> <div class="saved-filters-element">
<span @click="loadFilters">{{ savedFilter.attributes.name }}</span> <span @click="loadFilters">{{ savedFilter.attributes.name }}</span>
<button v-if="canManageFilters" class="btn btn-light icon-btn" @click="deleteFilter"> <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> </button>
</div> </div>
</template> </template>

View file

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