Skip to content

Commit

Permalink
responding to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons committed Sep 29, 2022
1 parent 7741e84 commit 1cb0d20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const AdvancedSearchAddFilterSelect = ({ selectedFilters, onFilterFieldSe
.sort((a, b) => FIELD_TO_LABEL[a].localeCompare(FIELD_TO_LABEL[b]))
.map((key) => (
<Option
// disable the `entity` option if they already have an entity filter selected
disabled={key === 'entity' && !!selectedFilters.find((filter) => filter.field === 'entity')}
value={key}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const AdvancedSearchFilterOverallUnionTypeSelect = ({ unionType, onUpdate
<StyledSelect
showArrow={false}
bordered={false}
// these values are just for display purposes- the actual value is the unionType prop
value={unionType === UnionType.AND ? 'all filters' : 'any filter'}
onChange={(newValue) => {
if ((newValue as any) !== unionType) {
Expand Down
7 changes: 3 additions & 4 deletions datahub-web-react/src/app/search/AdvancedSearchFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ export const AdvancedSearchFilters = ({
field: filterField,
values: values as string[],
value: '', // TODO(Gabe): remove once we refactor the model
condition:
FIELDS_THAT_USE_CONTAINS_OPERATOR.indexOf(filterField) > -1
? SearchCondition.Contain
: SearchCondition.Equal,
condition: FIELDS_THAT_USE_CONTAINS_OPERATOR.includes(filterField)
? SearchCondition.Contain
: SearchCondition.Equal,
};
onFilterSelect([...selectedFilters, newFilter]);
};
Expand Down

0 comments on commit 1cb0d20

Please sign in to comment.