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: Add an Operator Selector to data-research page #444

Merged
merged 13 commits into from
Jan 31, 2024

Conversation

yardenmezi
Copy link
Collaborator

Add the selection option of operators on the research page
image

@yardenmezi yardenmezi linked an issue Jan 28, 2024 that may be closed by this pull request
Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!
The code looks great- just please try to separate the data layer from the UI layer. having all come from the data getter could be confusing for future developers

Comment on lines 11 to 17
const allOperators = Array.from(
agencyList.map((agency) => ({
name: agency.agency_name,
id: agency.operator_ref.toString(),
})),
)
allOperators.push({ name: 'הכל', id: '' })
Copy link
Member

Choose a reason for hiding this comment

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

why do we need the הכל here?

Suggested change
const allOperators = Array.from(
agencyList.map((agency) => ({
name: agency.agency_name,
id: agency.operator_ref.toString(),
})),
)
allOperators.push({ name: 'הכל', id: '' })
const allOperators = agencyList.map((agency) => ({
name: agency.agency_name,
id: agency.operator_ref.toString(),
}))
allOperators.push({ name: 'הכל', id: '' })

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed, Thanks! (assumed the problem with adding this in this function doesn't fit the function name?)

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! It's also about the data model should not be aware of the UI options

src/pages/components/OperatorSelector.tsx Show resolved Hide resolved
src/pages/components/OperatorSelector.tsx Outdated Show resolved Hide resolved
@NoamGaash NoamGaash self-requested a review January 29, 2024 14:06
Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for adding a story

@NoamGaash NoamGaash merged commit ee2cc1b into hasadna:main Jan 31, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack bar (research graph) usability improvements
2 participants