graceguo-supercat commented on a change in pull request #11951:
URL: 
https://github.com/apache/incubator-superset/pull/11951#discussion_r539770997



##########
File path: superset-frontend/src/dashboard/components/SaveModal.tsx
##########
@@ -18,42 +18,64 @@
  */
 /* eslint-env browser */
 import React from 'react';
-import PropTypes from 'prop-types';
 import { FormControl, FormGroup, Radio } from 'react-bootstrap';
 import Button from 'src/components/Button';
-import { t, CategoricalColorNamespace } from '@superset-ui/core';
-
-import ModalTrigger from '../../components/ModalTrigger';
-import Checkbox from '../../components/Checkbox';
-import { SAVE_TYPE_OVERWRITE, SAVE_TYPE_NEWDASHBOARD } from 
'../util/constants';
-
-const propTypes = {
-  addSuccessToast: PropTypes.func.isRequired,
-  addDangerToast: PropTypes.func.isRequired,
-  dashboardId: PropTypes.number.isRequired,
-  dashboardTitle: PropTypes.string.isRequired,
-  dashboardInfo: PropTypes.object.isRequired,
-  expandedSlices: PropTypes.object.isRequired,
-  layout: PropTypes.object.isRequired,
-  saveType: PropTypes.oneOf([SAVE_TYPE_OVERWRITE, SAVE_TYPE_NEWDASHBOARD]),
-  triggerNode: PropTypes.node.isRequired,
-  customCss: PropTypes.string.isRequired,
-  colorNamespace: PropTypes.string,
-  colorScheme: PropTypes.string,
-  onSave: PropTypes.func.isRequired,
-  canOverwrite: PropTypes.bool.isRequired,
-  refreshFrequency: PropTypes.number.isRequired,
-  lastModifiedTime: PropTypes.number.isRequired,
+import { t, CategoricalColorNamespace, JsonResponse } from '@superset-ui/core';
+
+import ModalTrigger from 'src/components/ModalTrigger';
+import Checkbox from 'src/components/Checkbox';
+import {
+  SAVE_TYPE_OVERWRITE,
+  SAVE_TYPE_NEWDASHBOARD,
+} from 'src/dashboard/util/constants';
+
+type SaveType = typeof SAVE_TYPE_OVERWRITE | typeof SAVE_TYPE_NEWDASHBOARD;
+
+type SaveModalProps = {
+  addSuccessToast: (arg: string) => void;
+  addDangerToast: (arg: string) => void;
+  dashboardId: number;
+  dashboardTitle: string;
+  dashboardInfo: Record<string, any>;
+  expandedSlices: Record<string, any>;
+  layout: Record<string, any>;
+  saveType: SaveType;
+  triggerNode: JSX.Element;
+  customCss: string;
+  colorNamespace?: string;
+  colorScheme?: string;
+  onSave: (data: any, id: number | string, saveType: SaveType) => void;
+  canOverwrite: boolean;
+  shouldPersistRefreshFrequency: boolean;
+  refreshFrequency: number;
+  lastModifiedTime: number;
+};
+
+type SaveModalState = {
+  saveType: SaveType;
+  newDashName: string;
+  duplicateSlices: boolean;
 };
 
 const defaultProps = {
   saveType: SAVE_TYPE_OVERWRITE,
   colorNamespace: undefined,
   colorScheme: undefined,
+  shouldPersistRefreshFrequency: true,

Review comment:
       why `shouldPersistRefreshFrequency` default be true?




----------------------------------------------------------------
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]

Reply via email to