( + WrappedComponent: React.ComponentType
, + ) => React.ComponentClass
;
+}
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
index 5c7c729da..9125d4a02 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
@@ -16,16 +16,27 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React, { FormEvent } from 'react';
-import { SupersetTheme, JsonObject } from '@superset-ui/core';
+import React, { FormEvent, useState } from 'react';
+import { SupersetTheme, JsonObject, t } from '@superset-ui/core';
import { InputProps } from 'antd/lib/input';
+import { Switch, Select, Button } from 'src/common/components';
+import InfoTooltip from 'src/components/InfoTooltip';
import ValidatedInput from 'src/components/Form/LabeledErrorBoundInput';
+import FormLabel from 'src/components/Form/FormLabel';
+import { DeleteFilled } from '@ant-design/icons';
import {
- StyledFormHeader,
formScrollableStyles,
validatedFormStyles,
+ CredentialInfoForm,
+ toggleStyle,
+ infoTooltip,
} from './styles';
-import { DatabaseForm } from '../types';
+import { DatabaseForm, DatabaseObject } from '../types';
+
+enum CredentialInfoOptions {
+ jsonUpload,
+ copyPaste,
+}
export const FormFieldOrder = [
'host',
@@ -34,27 +45,171 @@ export const FormFieldOrder = [
'username',
'password',
'database_name',
+ 'credentials_info',
+ 'query',
+ 'encryption',
];
interface FieldPropTypes {
required: boolean;
+ hasTooltip?: boolean;
+ tooltipText?: (valuse: any) => string;
+ onParametersChange: (value: any) => string;
+ onParametersUploadFileChange: (value: any) => string;
changeMethods: { onParametersChange: (value: any) => string } & {
onChange: (value: any) => string;
- };
+ } & { onParametersUploadFileChange: (value: any) => string };
validationErrors: JsonObject | null;
getValidation: () => void;
+ db?: DatabaseObject;
+ isEditMode?: boolean;
+ sslForced?: boolean;
+ defaultDBName?: string;
+ editNewDb?: boolean;
}
+const CredentialsInfo = ({
+ changeMethods,
+ isEditMode,
+ db,
+ editNewDb,
+}: FieldPropTypes) => {
+ const [uploadOption, setUploadOption] = useState
- Need help? Learn more about connecting to {name}.
-
+ Adjust how this database will interact with SQL Lab.
+
+ Adjust performance settings of this database.
+ Add extra connection information.
- Configure how this database will function in SQL Lab.
-
- Adjust settings that will impact the performance of this
- database.
- Additional settings.
- Add connection information for other systems.
- Additional settings. STEP 2 OF 2 STEP 3 OF 3
+ Need help? Learn more about{' '}
+
+ connecting to {dbModel.name}.
+
+ STEP 2 OF 3
+ Need help? Learn more about{' '}
+
+ connecting to {dbModel.name}.
+
+ STEP 1 OF 3 Enter the required {name} credentials
- SQL Lab
+ Performance
+ Security
+ SQL Lab
- Performance
- Other
+ Security
- Other
-
+ Your database was successfully connected! Here are some optional
+ settings for your database
+
+ Enter the required {dbModel.name} credentials
+ Select a database to connect
+