-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add operatorId filter to ArrivalByTime widget #204
Conversation
Make operatorSelector effect on ArrivalByTimeChart. Change OperatorSelector to change to empty string if no operator selected, keeping it in line with the initial operatorId value.
✅ Deploy Preview for astonishing-pothos-5f81bd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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! see suggestions
}) { | ||
// Filter data if an operator is selected | ||
if(operatorId !== ''){ |
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.
if(operatorId !== ''){ | |
if(operatorId){ |
}) { | ||
// Filter data if an operator is selected | ||
if(operatorId !== ''){ | ||
data = data.filter( item => operatorId && item.id === operatorId); |
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.
consider useMemo
const blabla = useMemo(()=>data.filter( item => !operatorId || item.id === operatorId), [data, operatorId])
I updated the title too, it looks good but I could not verify. I couldn't get the text to update. |
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.
almost there!
I did a --amend commit, droped the title one on force pushed it. Hope it didn't mess anything up |
force push are allowed here, but there's no need to amend commits because we squash merge our PRs |
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.
Looks good
}) { | ||
|
||
const filteredData = useMemo( | ||
() => data.filter((item) => operatorId && item.id === operatorId), |
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.
why not
() => data.filter((item) => operatorId && item.id === operatorId), | |
() => data.filter((item) => !operatorId || item.id === operatorId), |
?
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.
Damn that's a smart one, haven't thought of that.
Can I still update the 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.
sure
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.
in fact, you'll need to update it anyway as the linter is failing
@NoamGaash I've tried to |
that's just a warning,
|
@NoamGaash Just know, what should I run before commiting? |
@i5x64BIT build, lint and test |
480p.mov
#148
Added a operatorId filter in Arrival widget