Skip to content

Commit

Permalink
temporarily change bucket name from project_folder to shared until ba…
Browse files Browse the repository at this point in the history
…ckend makes update
  • Loading branch information
Derek Luu committed Apr 17, 2024
1 parent fda6b23 commit 0b7ab6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/components/src/Aggs/TermAgg.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ const MoreOrLessButton = ({ howManyMore, isMore, onClick }) => (

const decorateBuckets = ({ buckets, searchText }) => {
const namedFilteredBuckets = buckets
.map((b) => ({ ...b, name: b.key_as_string || b.key }))
.map((b) => {
const key = b.key_as_string || b.key;
const name = key.trim() === 'project_folder' ? 'shared' : key;
return { ...b, name: name };
})
.filter((b) => !searchText || internalTranslateSQONValue(b.name).match(strToReg(searchText)));
const [missing, notMissing] = partition(namedFilteredBuckets, {
name: '__missing__',
Expand Down Expand Up @@ -133,7 +137,7 @@ const TermAgg = ({
setToggleSelectDeselect,
type,
}) => {
const decoratedBuckets = decorateBuckets({ buckets, searchText });
const decoratedBuckets = decorateBuckets({ buckets, searchText }); // aggs response has the bucket key which contains all the values
const dotField = field.replace(/__/g, '.');
const isExclude = externalIsExclude({ field: dotField }) || stateIsExclude;
const hasSearchHit =
Expand Down

0 comments on commit 0b7ab6e

Please sign in to comment.