Skip to content

Commit 9ed839f

Browse files
vishesh92dhslove
authored andcommitted
Update search filter size dynamically (apache#12552)
1 parent bcaf057 commit 9ed839f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
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: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
<template>
1919
<div>
20-
<a-affix :offsetTop="this.$store.getters.maintenanceInitiated || this.$store.getters.shutdownTriggered ? 103 : 78">
21-
<a-card
22-
class="breadcrumb-card"
23-
style="z-index: 10"
24-
>
20+
<a-affix
21+
:key="'affix-' + showSearchFilters"
22+
:offsetTop="this.$store.getters.maintenanceInitiated || this.$store.getters.shutdownTriggered ? 103 : 78"
23+
>
24+
<a-card class="breadcrumb-card" style="z-index: 10">
2525
<a-row>
2626
<a-col
2727
:span="device === 'mobile' ? 24 : 12"
@@ -153,8 +153,8 @@
153153
</a-col>
154154
</a-row>
155155
<a-row
156-
v-if="!dataView && $config.showSearchFilters"
157-
style="min-height: 36px; padding-top: 12px;"
156+
v-if="showSearchFilters"
157+
style="min-height: 36px; padding-top: 12px; padding-left: 12px;"
158158
>
159159
<search-filter
160160
:filters="getActiveFilters()"
@@ -1130,6 +1130,10 @@ export default {
11301130
}
11311131
},
11321132
computed: {
1133+
showSearchFilters () {
1134+
const excludedKeys = ['page', 'pagesize', 'q', 'keyword', 'tags', 'projectid']
1135+
return !this.dataView && this.$config.showSearchFilters && this.getActiveFilters().some(f => !excludedKeys.includes(f.key))
1136+
},
11331137
hasSelected () {
11341138
return this.selectedRowKeys.length > 0
11351139
},

0 commit comments

Comments
 (0)