Skip to content

Commit

Permalink
Merge pull request #95 from akhuoa/feature/search-history
Browse files Browse the repository at this point in the history
Updated search history
  • Loading branch information
alan-wu authored Jan 7, 2025
2 parents 4a27432 + 869161e commit b9d28ff
Show file tree
Hide file tree
Showing 4 changed files with 613 additions and 111 deletions.
5 changes: 5 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ declare module 'vue' {
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCol: typeof import('element-plus/es')['ElCol']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
ElIconLocation: typeof import('@element-plus/icons-vue')['Location']
ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
ElIconWarnTriangleFilled: typeof import('@element-plus/icons-vue')['WarnTriangleFilled']
Expand Down
22 changes: 20 additions & 2 deletions src/components/SearchFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export default {
showFiltersText: true,
cascadeSelected: [],
cascadeSelectedWithBoolean: [],
filterTimeout: null,
numberShown: 10,
filters: [],
facets: ['Species', 'Gender', 'Organ', 'Datasets'],
Expand Down Expand Up @@ -476,10 +477,25 @@ export default {
}
})
// if all checkboxes are checked
// there has no filter values
const filtersLength = filters.filter((item) => item.facet !== 'Show all');
if (!filtersLength.length) {
filters = [];
}
// timeout: add delay for filter checkboxes
if (this.filterTimeout) {
clearTimeout(this.filterTimeout);
}
this.$emit('loading', true) // let sidebarcontent wait for the requests
this.$emit('filterResults', filters) // emit filters for apps above sidebar
this.setCascader(filterKeys) //update our cascader v-model if we modified the event
this.cssMods() // update css for the cascader
this.filterTimeout = setTimeout(() => {
this.$emit('filterResults', filters) // emit filters for apps above sidebar
this.cssMods() // update css for the cascader
}, 600);
}
},
//this fucntion is needed as we previously stored booleans in the array of event that
Expand Down Expand Up @@ -1003,6 +1019,8 @@ export default {
.sidebar-cascader-popper .el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
--el-checkbox-checked-bg-color: #{$app-primary-color};
--el-checkbox-checked-input-border-color: #{$app-primary-color};
background-color: $app-primary-color;
border-color: $app-primary-color;
}
Expand Down
Loading

0 comments on commit b9d28ff

Please sign in to comment.