feat: persist view filters and sorts on Update View button click#1290
feat: persist view filters and sorts on Update View button click#1290charlesBochet merged 5 commits intomainfrom
Conversation
|
Hi 👋 Here's a preview environment 🚀 https://front-twentyhq-twenty-1290.env.ergomake.link Environment Summary 📑
Here are your environment's logs. For questions or comments, join Discord. Click here to disable Ergomake. |
There was a problem hiding this comment.
Nice one! A few quick comments on the naming of selectors and vocabulary diff between front and back.
When testing the feature I was surprised by a few behaviours:
- When creating a new view, I’d expect it to be selected
- After I create a filter on a new view, clicking on the “Filter button” toggles the filter&sorts bar which I find weird (Should enable new filter creation instead right ?)
- No feedback when I “Update view” => I’d expect the button to be disabled Edit: addressed with #1293 (review)
- When a view is selected, I can see a “cancel” button. I find it unclear what it does: it removes the filters and sorts of the view but does not change the “selected view” in the top bar.
|
|
||
| import { savedFiltersScopedState } from './savedFiltersScopedState'; | ||
|
|
||
| export const savedFiltersByKeyScopedState = selectorFamily({ |
| import { savedFiltersScopedState } from './savedFiltersScopedState'; | ||
|
|
||
| export const savedFiltersByKeyScopedState = selectorFamily({ | ||
| key: 'savedFiltersByKeyScopedState', |
There was a problem hiding this comment.
| key: 'savedFiltersByKeyScopedState', | |
| key: 'savedFiltersByKeyScopedSelector', |
There was a problem hiding this comment.
Done, thank you! I renamed all the other sorts and filters selectors as well.
| import { savedSortsScopedState } from './savedSortsScopedState'; | ||
|
|
||
| export const savedSortsByKeyScopedState = selectorFamily({ | ||
| key: 'savedSortsByKeyScopedState', |
There was a problem hiding this comment.
| key: 'savedSortsByKeyScopedState', | |
| key: 'savedSortsByKeyScopedSelector', |
| import { sortsScopedState } from './sortsScopedState'; | ||
|
|
||
| export const sortsOrderByScopedState = selectorFamily({ | ||
| key: 'sortsOrderByScopedState', |
There was a problem hiding this comment.
| key: 'sortsOrderByScopedState', | |
| key: 'sortsOrderByScopedSelector', |
| return availableFilter | ||
| ? ({ | ||
| displayValue: viewFilter.displayValue ?? viewFilter.value, | ||
| field: viewFilter.key, |
There was a problem hiding this comment.
Should we have back and front agree on a naming key or field ?
There was a problem hiding this comment.
Done, I renamed field to key in types Filter, FilterDefinition and FilterDefinitionByEntity. I chose to keep key because it is called key in the SortType type as well.
- Rename recoil selectors - Rename filters `field` property to `key`
5c63958 to
febc8c8
Compare
Good points!
|
I think we should rediscuss this once we have cleared the behaviors regarding the sort and filter chips bar. What opens it, what closes it? Then we can discuss Cancel button role. I would consider it separate from this PR |
Closes #1121
Closes #1123
Closes #1124
Closes #1289