Skip to content
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

Conversation

gabe-lyons
Copy link
Contributor

This pr adds the root component for advanced search, including add a new filter & choose union type (AND vs OR)

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Sep 26, 2022
@github-actions
Copy link

github-actions bot commented Sep 26, 2022

Unit Test Results (build & test)

584 tests  ±0   580 ✔️ ±0   12m 52s ⏱️ ±0s
143 suites ±0       4 💤 ±0 
143 files   ±0       0 ±0 

Results for commit 1cb0d20. ± Comparison against base commit 4792ac5.

♻️ This comment has been updated with latest results.

),
}}
labelInValue
style={{ padding: 6, fontWeight: 500 }}
Copy link
Contributor

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?

Copy link
Contributor Author

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')}
Copy link
Contributor

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'}
Copy link
Contributor

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?

Copy link
Contributor Author

@gabe-lyons gabe-lyons Sep 29, 2022

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]};
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@gabe-lyons gabe-lyons force-pushed the gabe--addingAdvancedSearchFiltersComponent branch from d6d745d to 1cb0d20 Compare September 29, 2022 23:00
@gabe-lyons gabe-lyons merged commit 7359d92 into datahub-project:master Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants