Skip to content

Commit 45d623e

Browse files
authored
Update search filter size dynamically (#12552)
1 parent a6ccde4 commit 45d623e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ui/src/components/view/SearchFilter.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
v-for="filter in this.searchFilters"
2525
:key="filter.key + filter.value"
2626
>
27-
<a-col v-if="!['page', 'pagesize', 'q', 'keyword', 'tags'].includes(filter.key)">
27+
<a-col v-if="!['page', 'pagesize', 'q', 'keyword', 'tags', 'projectid'].includes(filter.key)">
2828
<a-tag
2929
v-if="!filter.isTag"
3030
closable
@@ -175,6 +175,7 @@ export default {
175175
immediate: true,
176176
handler (newFilters) {
177177
const clonedFilters = newFilters.map(filter => ({ ...filter }))
178+
this.searchFilters = clonedFilters.map(f => ({ ...f }))
178179
const promises = []
179180
for (let idx = 0; idx < clonedFilters.length; idx++) {
180181
const filter = clonedFilters[idx]

ui/src/views/AutogenView.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
<template>
1919
<div>
20-
<a-affix :offsetTop="this.$store.getters.shutdownTriggered ? 103 : 78">
20+
<a-affix
21+
:key="'affix-' + showSearchFilters"
22+
:offsetTop="this.$store.getters.shutdownTriggered ? 103 : 78"
23+
>
2124
<a-card class="breadcrumb-card" style="z-index: 10">
2225
<a-row>
2326
<a-col :span="device === 'mobile' ? 24 : 12" style="padding-left: 12px; margin-top: 10px">
@@ -107,8 +110,8 @@
107110
</a-col>
108111
</a-row>
109112
<a-row
110-
v-if="!dataView && $config.showSearchFilters"
111-
style="min-height: 36px; padding-top: 12px;"
113+
v-if="showSearchFilters"
114+
style="min-height: 36px; padding-top: 12px; padding-left: 12px;"
112115
>
113116
<search-filter
114117
:filters="getActiveFilters()"
@@ -687,6 +690,10 @@ export default {
687690
}
688691
},
689692
computed: {
693+
showSearchFilters () {
694+
const excludedKeys = ['page', 'pagesize', 'q', 'keyword', 'tags', 'projectid']
695+
return !this.dataView && this.$config.showSearchFilters && this.getActiveFilters().some(f => !excludedKeys.includes(f.key))
696+
},
690697
hasSelected () {
691698
return this.selectedRowKeys.length > 0
692699
},

0 commit comments

Comments
 (0)