mikebridge commented on code in PR #44452:
URL: https://github.com/apache/superset/pull/44452#discussion_r4167636655
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -389,6 +390,14 @@ const config: ControlPanelConfig = {
'Enable server side pagination of results (experimental
feature)',
),
default: false,
+ shouldMapStateToProps: () => true,
+ mapStateToProps: state => ({
+ disabled: isServerPaginationUnsupported(state),
+ disabledReason: t(
+ 'This semantic view does not support server pagination.',
+ ),
+ resetLabel: t('Turn off server pagination'),
+ }),
Review Comment:
Agreed that these two blocks should share one helper. I would rather keep
this PR to the gate itself, so I am deferring the extraction to a follow-up
(tracked as sc-124090), which will also fold the duplicated control lookup in
the AG Grid test into a shared `findControl(name)` helper.
`isServerPaginationUnsupported` is already shared from
`@superset-ui/chart-controls`, so the two plugins evaluate the same condition
today.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]