-
Notifications
You must be signed in to change notification settings - Fork 47
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
[IMP] pivot: add icon to sort pivot #5363
base: master
Are you sure you want to change the base?
Conversation
ef48607
to
94c776d
Compare
this.store.addIconProvider({ | ||
component: FilterIcon, | ||
hasIcon: (getters, cellPosition) => getters.isFilterHeader(cellPosition), | ||
type: "rightIcon", | ||
}); | ||
this.store.addIconProvider({ | ||
component: DataValidationCheckbox, | ||
hasIcon: (getters, cellPosition) => getters.isCellValidCheckbox(cellPosition), | ||
type: "exclusiveIcon", | ||
}); | ||
this.store.addIconProvider({ | ||
component: DataValidationListIcon, | ||
hasIcon: (getters, cellPosition) => | ||
!getters.isReadonly() && getters.cellHasListDataValidationIcon(cellPosition), | ||
type: "rightIcon", | ||
}); |
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.
Having the overlay having to register its own providers is not the best, ideally it shouldn't have to know about them ... But we need to register them somewhere (in a component) 🤷
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.
Maybe we can have a register of icon providers somewhere and then the overlay can add all of the entries of this register in the store ?
Since 18.1, we can sort the pivot on any column. But the feature is only discoverable through the context menu of pivot cells. With this commit, we display icons that sort a pivot when its side panel is open. The icons are that were previously displayed in the `FilterOverlay` and the `DataValidationOverlay` are now displayed in the `GridCellIconOverlay`. This overlay is based on a store where we can register icon providers. The auto-resize feature also had to be transformed into a store since it depends on the grid icons. Task: 4281154
94c776d
to
6f99bcf
Compare
this.store.addIconProvider({ | ||
component: FilterIcon, | ||
hasIcon: (getters, cellPosition) => getters.isFilterHeader(cellPosition), | ||
type: "rightIcon", | ||
}); | ||
this.store.addIconProvider({ | ||
component: DataValidationCheckbox, | ||
hasIcon: (getters, cellPosition) => getters.isCellValidCheckbox(cellPosition), | ||
type: "exclusiveIcon", | ||
}); | ||
this.store.addIconProvider({ | ||
component: DataValidationListIcon, | ||
hasIcon: (getters, cellPosition) => | ||
!getters.isReadonly() && getters.cellHasListDataValidationIcon(cellPosition), | ||
type: "rightIcon", | ||
}); |
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.
Maybe we can have a register of icon providers somewhere and then the overlay can add all of the entries of this register in the store ?
this.model.dispatch("RESIZE_COLUMNS_ROWS", { | ||
elements: [row], | ||
dimension: "ROW", | ||
size: null, |
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 don't we compute the size according to the content, as done for the columns ?
Description:
description of this task, what is implemented and why it is implemented that way.
Task: 4281154
review checklist