Skip to content

Commit

Permalink
feat: big Query using back button (#15338)
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi authored Jun 23, 2021
1 parent c283be6 commit bc727f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ interface FieldPropTypes {
isEditMode?: boolean;
sslForced?: boolean;
defaultDBName?: string;
editNewDb?: boolean;
}

const CredentialsInfo = ({ changeMethods, isEditMode, db }: FieldPropTypes) => {
const CredentialsInfo = ({
changeMethods,
isEditMode,
db,
editNewDb,
}: FieldPropTypes) => {
const [uploadOption, setUploadOption] = useState<number>(
CredentialInfoOptions.jsonUpload.valueOf(),
);
Expand Down Expand Up @@ -95,7 +101,9 @@ const CredentialsInfo = ({ changeMethods, isEditMode, db }: FieldPropTypes) => {
</Select>
</>
)}
{uploadOption === CredentialInfoOptions.copyPaste || isEditMode ? (
{uploadOption === CredentialInfoOptions.copyPaste ||
isEditMode ||
editNewDb ? (
<div className="input-container">
<span className="label-select">Service Account</span>
<textarea
Expand Down Expand Up @@ -378,9 +386,11 @@ const DatabaseConnectionForm = ({
db,
isEditMode = false,
sslForced,
editNewDb,
}: {
isEditMode?: boolean;
sslForced: boolean;
editNewDb?: boolean;
dbModel: DatabaseForm;
db: Partial<DatabaseObject> | null;
onParametersChange: (
Expand Down Expand Up @@ -422,6 +432,7 @@ const DatabaseConnectionForm = ({
key: field,
isEditMode,
sslForced,
editNewDb,
}),
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
availableDbs?.databases?.find(
(available: { engine: string | undefined }) =>
// TODO: we need a centralized engine in one place
available.engine === (isEditMode ? db?.backend : db?.engine),
available.engine ===
(isEditMode || editNewDb ? db?.backend || db?.engine : db?.engine),
) || {};

// Test Connection logic
Expand Down Expand Up @@ -718,6 +719,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
}
getValidation={() => getValidation(db)}
validationErrors={validationErrors}
editNewDb={editNewDb}
/>
);
};
Expand Down

0 comments on commit bc727f4

Please sign in to comment.