Skip to content

Commit 0b7ab6e

Browse files
author
Derek Luu
committed
temporarily change bucket name from project_folder to shared until backend makes update
1 parent fda6b23 commit 0b7ab6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/components/src/Aggs/TermAgg.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ const MoreOrLessButton = ({ howManyMore, isMore, onClick }) => (
7171

7272
const decorateBuckets = ({ buckets, searchText }) => {
7373
const namedFilteredBuckets = buckets
74-
.map((b) => ({ ...b, name: b.key_as_string || b.key }))
74+
.map((b) => {
75+
const key = b.key_as_string || b.key;
76+
const name = key.trim() === 'project_folder' ? 'shared' : key;
77+
return { ...b, name: name };
78+
})
7579
.filter((b) => !searchText || internalTranslateSQONValue(b.name).match(strToReg(searchText)));
7680
const [missing, notMissing] = partition(namedFilteredBuckets, {
7781
name: '__missing__',
@@ -133,7 +137,7 @@ const TermAgg = ({
133137
setToggleSelectDeselect,
134138
type,
135139
}) => {
136-
const decoratedBuckets = decorateBuckets({ buckets, searchText });
140+
const decoratedBuckets = decorateBuckets({ buckets, searchText }); // aggs response has the bucket key which contains all the values
137141
const dotField = field.replace(/__/g, '.');
138142
const isExclude = externalIsExclude({ field: dotField }) || stateIsExclude;
139143
const hasSearchHit =

0 commit comments

Comments
 (0)