etr2460 commented on a change in pull request #11976:
URL:
https://github.com/apache/incubator-superset/pull/11976#discussion_r543499042
##########
File path: superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
##########
@@ -71,17 +80,23 @@ class RefreshIntervalModal extends React.PureComponent {
onSave() {
this.props.onChange(this.state.refreshFrequency, this.props.editMode);
- this.modalRef.current.close();
Review comment:
could this be `this.modalRef.current?.close();`? then you wouldn't need
the helper function
##########
File path: superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
##########
@@ -57,8 +43,31 @@ const RefreshWarningContainer = styled.div`
margin-top: ${({ theme }) => theme.gridUnit * 6}px;
`;
-class RefreshIntervalModal extends React.PureComponent {
- constructor(props) {
+type RefreshIntervalModalProps = {
+ triggerNode: JSX.Element;
+ refreshFrequency: number;
+ onChange: (refreshLimit: number, editMode: boolean) => void;
+ editMode: boolean;
+ refreshLimit?: number;
+ refreshWarning?: string;
Review comment:
same comments on this not needing to be undefined (and since
refreshWarning can be null, this should be `refreshWarning: string | null`
##########
File path: superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
##########
@@ -104,7 +119,7 @@ class RefreshIntervalModal extends React.PureComponent {
<FormLabel>{t('Refresh frequency')}</FormLabel>
<Select
options={options}
- value={this.state.refreshFrequency}
+ value={this.state.refreshFrequency as ValueType<any>}
Review comment:
is `any` the best we can do here? perhaps `string | number` since this
is human provided input
----------------------------------------------------------------
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]