ui: same filter keys for exclusion in sankey, fix meta cta

This commit is contained in:
nick-delirium 2025-02-11 16:58:37 +01:00
parent 9492234ccc
commit 7da11341cf
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 16 additions and 3 deletions

View file

@ -36,6 +36,12 @@ function ExcludeFilters(props: Props) {
<FilterItem
hideIndex={true}
filterIndex={index}
allowedFilterKeys={[
FilterKey.LOCATION,
FilterKey.CLICK,
FilterKey.INPUT,
FilterKey.CUSTOM,
]}
filter={f}
onUpdate={(f) => onUpdateFilter(index, f)}
onRemoveFilter={() => onRemoveFilter(index)}

View file

@ -231,7 +231,14 @@ function FilterModal(props: Props) {
allowedFilterKeys,
mode
);
const hasNoMeta = !filterObj['Metadata'];
const showMetaCTA = !filterObj['Metadata']
&& (allowedFilterKeys?.length
? allowedFilterKeys.includes(FilterKey.METADATA) : true)
&& (excludeCategory?.length
? !excludeCategory.includes(FilterCategory.METADATA) : true)
&& (excludeFilterKeys?.length
? !excludeFilterKeys.includes(FilterKey.METADATA) : true);
const { matchingCategories, matchingFilters } = getMatchingEntries(
searchQuery,
filterObj
@ -274,7 +281,7 @@ function FilterModal(props: Props) {
{key}
</div>
))}
{hasNoMeta ? (
{showMetaCTA ? (
<div
key={'META_CTA'}
onClick={() => setCategory('META_CTA')}
@ -324,7 +331,7 @@ function FilterModal(props: Props) {
</div>
))
: null}
{category === 'META_CTA' && hasNoMeta ? (
{category === 'META_CTA' && showMetaCTA ? (
<div
style={{
height: 300