lyndsiWilliams commented on code in PR #19855: URL: https://github.com/apache/superset/pull/19855#discussion_r875098396
########## superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx: ########## @@ -17,153 +17,362 @@ * under the License. */ -import React, { FunctionComponent } from 'react'; -import { AutoCompleteProps } from 'antd/lib/auto-complete'; +import React, { FunctionComponent, useState } from 'react'; import { Radio } from 'src/components/Radio'; import { AutoComplete, RadioChangeEvent } from 'src/components'; import { Input } from 'src/components/Input'; import StyledModal from 'src/components/Modal'; import Button from 'src/components/Button'; -import { styled, t } from '@superset-ui/core'; +import { + styled, + t, + SupersetClient, + makeApi, + JsonResponse, + // DatasourceType, +} from '@superset-ui/core'; +import { useSelector } from 'react-redux'; +import moment from 'moment'; +import rison from 'rison'; +import { createDatasource } from 'src/SqlLab/actions/sqlLab'; +import { addDangerToast } from 'src/components/MessageToasts/actions'; +import { UserWithPermissionsAndRoles as User } from 'src/types/bootstrapTypes'; +import { + DatasetRadioState, + EXPLORE_CHART_DEFAULT, + DatasetOwner, + DatasetOptionAutocomplete, + Query, + SqlLabExploreRootState, + getInitialState, +} from 'src/SqlLab/types'; +// import { Dataset } from '@superset-ui/chart-controls'; +import { exploreChart } from 'src/explore/exploreUtils'; + +// type ExploreDatasource = Dataset | Query; interface SaveDatasetModalProps { visible: boolean; - onOk: () => void; onHide: () => void; - handleDatasetNameChange: (e: React.FormEvent<HTMLInputElement>) => void; - handleSaveDatasetModalSearch: (searchText: string) => Promise<void>; - filterAutocompleteOption: ( - inputValue: string, - option: { value: string; datasetId: number }, - ) => boolean; - handleSaveDatasetRadioBtnState: (e: RadioChangeEvent) => void; - handleOverwriteCancel: () => void; - handleOverwriteDataset: () => void; - handleOverwriteDatasetOption: ( - data: string, - option: Record<string, any>, - ) => void; - onChangeAutoComplete: () => void; - defaultCreateDatasetValue: string; - disableSaveAndExploreBtn: boolean; - saveDatasetRadioBtnState: number; - shouldOverwriteDataset: boolean; - userDatasetOptions: AutoCompleteProps['options']; + buttonTextOnSave: string; + buttonTextOnOverwrite: string; + modalDescription?: string; + datasource: Query; Review Comment: This was changed to a union type in [`this commit`](https://github.com/apache/superset/pull/19855/commits/1a31c5e6a5eefa39b3e5b86447e4927ac85cc46b). -- 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. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org