lyndsiWilliams commented on a change in pull request #14881:
URL: https://github.com/apache/superset/pull/14881#discussion_r660926661



##########
File path: 
superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -34,27 +45,170 @@ 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<number>(
+    CredentialInfoOptions.jsonUpload.valueOf(),
+  );
+  const [fileToUpload, setFileToUpload] = useState<string | null | undefined>(
+    null,
+  );
+  return (
+    <CredentialInfoForm>
+      {!isEditMode && (
+        <>
+          <FormLabel required>
+            How do you want to enter service account credentials?

Review comment:
       I _think_ I got them all in [`this 
commit`](https://github.com/apache/superset/pull/15463/commits/b8be120b60f52982f7135c222828b0426c322faf).

##########
File path: 
superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -68,47 +222,56 @@ const portField = ({
   changeMethods,
   getValidation,
   validationErrors,
+  db,
 }: FieldPropTypes) => (
-  <ValidatedInput
-    id="port"
-    name="port"
-    required={required}
-    validationMethods={{ onBlur: getValidation }}
-    errorMessage={validationErrors?.port}
-    placeholder="e.g. 5432"
-    className="form-group-w-50"
-    label="Port"
-    onChange={changeMethods.onParametersChange}
-  />
+  <>
+    <ValidatedInput
+      id="port"
+      name="port"
+      type="number"
+      required={required}
+      value={db?.parameters?.port as number}
+      validationMethods={{ onBlur: getValidation }}
+      errorMessage={validationErrors?.port}
+      placeholder="e.g. 5432"
+      className="form-group-w-50"
+      label="Port"
+      onChange={changeMethods.onParametersChange}
+    />
+  </>
 );
 const databaseField = ({
   required,
   changeMethods,
   getValidation,
   validationErrors,
+  db,
 }: FieldPropTypes) => (
   <ValidatedInput
     id="database"
     name="database"
     required={required}
+    value={db?.parameters?.database}
     validationMethods={{ onBlur: getValidation }}
     errorMessage={validationErrors?.database}
     placeholder="e.g. world_population"
     label="Database name"
     onChange={changeMethods.onParametersChange}
-    helpText="Copy the name of the PostgreSQL database you are trying to 
connect to."
+    helpText="Copy the name of the  database you are trying to connect to."

Review comment:
       I _think_ I got them all in [`this 
commit`](https://github.com/apache/superset/pull/15463/commits/b8be120b60f52982f7135c222828b0426c322faf).




-- 
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: [email protected]

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