chore: upgrade eslint, babel, and prettier (#12393)

This commit is contained in:
Jesse Yang
2021-01-10 17:26:35 -08:00
committed by GitHub
parent 6bee3a0581
commit 9acf48fd1e
69 changed files with 4563 additions and 1964 deletions

View File

@@ -184,9 +184,8 @@ export default class ResultSet extends React.PureComponent<
}
}
getDefaultDatasetName = () => {
return `${this.props.query.tab} ${moment().format('MM/DD/YYYY HH:mm:ss')}`;
};
getDefaultDatasetName = () =>
`${this.props.query.tab} ${moment().format('MM/DD/YYYY HH:mm:ss')}`;
handleOnChangeAutoComplete = () => {
this.setState({ datasetToOverwrite: {} });
@@ -341,9 +340,7 @@ export default class ResultSet extends React.PureComponent<
handleFilterAutocompleteOption = (
inputValue: string,
option: { value: string; datasetId: number },
) => {
return option.value.toLowerCase().includes(inputValue.toLowerCase());
};
) => option.value.toLowerCase().includes(inputValue.toLowerCase());
clearQueryResults(query: Query) {
this.props.actions.clearQueryResults(query);

View File

@@ -91,84 +91,82 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
filterAutocompleteOption,
userDatasetOptions,
onChangeAutoComplete,
}) => {
return (
<StyledModal
show={visible}
title="Save or Overwrite Dataset"
onHide={onHide}
footer={
<>
{!shouldOverwriteDataset && (
<Button
disabled={disableSaveAndExploreBtn}
buttonSize="medium"
buttonStyle="primary"
onClick={onOk}
>
{t('Save & Explore')}
</Button>
)}
{shouldOverwriteDataset && (
<>
<Button buttonSize="medium" onClick={handleOverwriteCancel}>
Back
</Button>
<Button
className="md"
buttonSize="medium"
buttonStyle="primary"
onClick={handleOverwriteDataset}
disabled={disableSaveAndExploreBtn}
>
{t('Overwrite & Explore')}
</Button>
</>
)}
</>
}
>
<Styles>
}) => (
<StyledModal
show={visible}
title="Save or Overwrite Dataset"
onHide={onHide}
footer={
<>
{!shouldOverwriteDataset && (
<div className="smd-body">
<div className="smd-prompt">
Save this query as virtual dataset to continue exploring.
</div>
<Radio.Group
onChange={handleSaveDatasetRadioBtnState}
value={saveDatasetRadioBtnState}
>
<Radio className="smd-radio" value={1}>
Save as new
<Input
className="smd-input"
defaultValue={defaultCreateDatasetValue}
onChange={handleDatasetNameChange}
disabled={saveDatasetRadioBtnState !== 1}
/>
</Radio>
<Radio className="smd-radio" value={2}>
Overwrite existing
<AutoComplete
className="smd-autocomplete"
options={userDatasetOptions}
onSelect={handleOverwriteDatasetOption}
onSearch={handleSaveDatasetModalSearch}
onChange={onChangeAutoComplete}
placeholder="Select or type dataset name"
filterOption={filterAutocompleteOption}
disabled={saveDatasetRadioBtnState !== 2}
/>
</Radio>
</Radio.Group>
</div>
<Button
disabled={disableSaveAndExploreBtn}
buttonSize="medium"
buttonStyle="primary"
onClick={onOk}
>
{t('Save & Explore')}
</Button>
)}
{shouldOverwriteDataset && (
<div className="smd-overwrite-msg">
Are you sure you want to overwrite this dataset?
</div>
<>
<Button buttonSize="medium" onClick={handleOverwriteCancel}>
Back
</Button>
<Button
className="md"
buttonSize="medium"
buttonStyle="primary"
onClick={handleOverwriteDataset}
disabled={disableSaveAndExploreBtn}
>
{t('Overwrite & Explore')}
</Button>
</>
)}
</Styles>
</StyledModal>
);
};
</>
}
>
<Styles>
{!shouldOverwriteDataset && (
<div className="smd-body">
<div className="smd-prompt">
Save this query as virtual dataset to continue exploring.
</div>
<Radio.Group
onChange={handleSaveDatasetRadioBtnState}
value={saveDatasetRadioBtnState}
>
<Radio className="smd-radio" value={1}>
Save as new
<Input
className="smd-input"
defaultValue={defaultCreateDatasetValue}
onChange={handleDatasetNameChange}
disabled={saveDatasetRadioBtnState !== 1}
/>
</Radio>
<Radio className="smd-radio" value={2}>
Overwrite existing
<AutoComplete
className="smd-autocomplete"
options={userDatasetOptions}
onSelect={handleOverwriteDatasetOption}
onSearch={handleSaveDatasetModalSearch}
onChange={onChangeAutoComplete}
placeholder="Select or type dataset name"
filterOption={filterAutocompleteOption}
disabled={saveDatasetRadioBtnState !== 2}
/>
</Radio>
</Radio.Group>
</div>
)}
{shouldOverwriteDataset && (
<div className="smd-overwrite-msg">
Are you sure you want to overwrite this dataset?
</div>
)}
</Styles>
</StyledModal>
);

View File

@@ -79,13 +79,11 @@ export default function SaveQuery({
const [showSave, setShowSave] = useState<boolean>(false);
const isSaved = !!query.remoteId;
const queryPayload = () => {
return {
...query,
title: label,
description,
};
};
const queryPayload = () => ({
...query,
title: label,
description,
});
const close = () => {
setShowSave(false);
@@ -113,47 +111,45 @@ export default function SaveQuery({
setShowSave(!showSave);
};
const renderModalBody = () => {
return (
<FormGroup bsSize="small">
<Row>
<Col md={12}>
<small>
<FormLabel htmlFor="embed-height">{t('Name')}</FormLabel>
</small>
<FormControl type="text" value={label} onChange={onLabelChange} />
</Col>
</Row>
<br />
<Row>
<Col md={12}>
<small>
<FormLabel htmlFor="embed-height">{t('Description')}</FormLabel>
</small>
<FormControl
rows={5}
componentClass="textarea"
value={description}
onChange={onDescriptionChange}
/>
</Col>
</Row>
{saveQueryWarning && (
<>
const renderModalBody = () => (
<FormGroup bsSize="small">
<Row>
<Col md={12}>
<small>
<FormLabel htmlFor="embed-height">{t('Name')}</FormLabel>
</small>
<FormControl type="text" value={label} onChange={onLabelChange} />
</Col>
</Row>
<br />
<Row>
<Col md={12}>
<small>
<FormLabel htmlFor="embed-height">{t('Description')}</FormLabel>
</small>
<FormControl
rows={5}
componentClass="textarea"
value={description}
onChange={onDescriptionChange}
/>
</Col>
</Row>
{saveQueryWarning && (
<>
<br />
<div>
<Row>
<Col md={12}>
<small>{saveQueryWarning}</small>
</Col>
</Row>
<br />
<div>
<Row>
<Col md={12}>
<small>{saveQueryWarning}</small>
</Col>
</Row>
<br />
</div>
</>
)}
</FormGroup>
);
};
</div>
</>
)}
</FormGroup>
);
return (
<Styles className="SaveQuery">