-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(advanced search): Add component to show all advanced search filters & add new filter #6058
feat(advanced search): Add component to show all advanced search filters & add new filter #6058
Conversation
), | ||
}} | ||
labelInValue | ||
style={{ padding: 6, fontWeight: 500 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we're trying to use styled components across our React app, can we do that here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ach I wanted to do that here too but the antd Select
was overwriting them
.sort((a, b) => FIELD_TO_LABEL[a].localeCompare(FIELD_TO_LABEL[b])) | ||
.map((key) => ( | ||
<Option | ||
disabled={key === 'entity' && !!selectedFilters.find((filter) => filter.field === 'entity')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this function doing? It's a bit hard to tell what's going on
<StyledSelect | ||
showArrow={false} | ||
bordered={false} | ||
value={unionType === UnionType.AND ? 'all filters' : 'any filter'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make these strings consts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just for display purposes, so i dont think thats needed (the actual constant is UnionType). Adding a comment
border-radius: 5px; | ||
background: ${ANTD_GRAY[4]}; | ||
:hover { | ||
background: ${ANTD_GRAY[4.5]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this 4 vs 4.5 make a substantial visual difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes!
const newFilter: FacetFilterInput = { | ||
field: filterField, | ||
values: values as string[], | ||
value: '', // TODO(Gabe): remove once we refactor the model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a todo for after this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
values: values as string[], | ||
value: '', // TODO(Gabe): remove once we refactor the model | ||
condition: | ||
FIELDS_THAT_USE_CONTAINS_OPERATOR.indexOf(filterField) > -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use .includes
again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
d6d745d
to
1cb0d20
Compare
This pr adds the root component for advanced search, including add a new filter & choose union type (AND vs OR)
Checklist