You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/10 20:19:37 UTC

[GitHub] [incubator-superset] ktmud commented on a change in pull request #11936: chore: consolidate common code in importers

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, will be a new variable each time the parent component renders, thus always triggers a re-render of the child component.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org