ktmud commented on a change in pull request #11936:
URL:
https://github.com/apache/incubator-superset/pull/11936#discussion_r540469268
##########
File path: superset-frontend/src/views/CRUD/chart/ChartList.tsx
##########
@@ -568,12 +570,22 @@ function ChartList(props: ChartListProps) {
}}
</ConfirmStatusChange>
- <ImportChartModal
- show={importingChart}
- onHide={closeChartImportModal}
+ <ImportModelsModal
+ resourceName="chart"
+ resourceLabel={t('chart')}
+ icon={<StyledIcon name="nav-charts" />}
+ passwordsNeededMessage={t(
+ 'The passwords for the databases below are needed in order to ' +
+ 'import them together with the charts. Please note that the ' +
+ '"Secure Extra" and "Certificate" sections of ' +
+ 'the database configuration are not present in export files, and '
+
+ 'should be added manually after the import if they are needed.',
+ )}
addDangerToast={addDangerToast}
addSuccessToast={addSuccessToast}
- onChartImport={handleChartImport}
+ onModelImport={handleChartImport}
+ show={importingChart}
+ onHide={closeChartImportModal}
Review comment:
Inline functions are fine for functional components. I have yet to see
it causing performance issues. The only way it could cause performance issues
is when the child component is expensive to re-render and the functional props
are the only dependency that is updating between parent re-renders.
If re-render is a real concern, the common practice is to put functions
within `useCallback`, or move them out of the functional component. Here is
this case there is no additional benefits since the named function is still
within the functional component and not wrapped with `useCallback`, will be a
new variable each time the parent component re-renders, thus always triggers a
re-render of the child component as well.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]