diff --git a/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionFormController.ts b/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionFormController.ts index e824ea2fd5..81c85aeb5c 100644 --- a/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionFormController.ts +++ b/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionFormController.ts @@ -23,13 +23,16 @@ import { IConnectionFormModel } from './IConnectionFormModel'; @injectable() export class ConnectionFormController implements IInitializableController { - @observable connectionType: EConnectionType; @observable isSaving: boolean; @observable readonly metadata: Map; readonly afterSave: IExecutor; - @computed get isDisabled(): boolean { + get connectionType(): EConnectionType { + return this.model.connection.useUrl ? EConnectionType.URL : EConnectionType.Parameters; + } + + get isDisabled(): boolean { return this.isSaving; } @@ -46,7 +49,6 @@ implements IInitializableController { private notificationService: NotificationService, private dbDriverResource: DBDriverResource ) { - this.connectionType = EConnectionType.Parameters; this.isSaving = false; this.metadata = new Map(); this.afterSave = new Executor(); @@ -65,7 +67,7 @@ implements IInitializableController { } setType = (type: EConnectionType): void => { - this.connectionType = type; + this.model.connection.useUrl = type === EConnectionType.URL; }; save = async (): Promise => { diff --git a/webapp/packages/core-sdk/src/queries/fragments/AdminConnection.gql b/webapp/packages/core-sdk/src/queries/fragments/AdminConnection.gql index b9ccd1c77f..0b6797fdab 100644 --- a/webapp/packages/core-sdk/src/queries/fragments/AdminConnection.gql +++ b/webapp/packages/core-sdk/src/queries/fragments/AdminConnection.gql @@ -6,6 +6,7 @@ fragment AdminConnection on ConnectionInfo { template connected + useUrl readOnly saveCredentials diff --git a/webapp/packages/core-sdk/src/sdk.ts b/webapp/packages/core-sdk/src/sdk.ts index 40f810223d..f2ef609cd2 100644 --- a/webapp/packages/core-sdk/src/sdk.ts +++ b/webapp/packages/core-sdk/src/sdk.ts @@ -1164,7 +1164,7 @@ export type NavGetStructContainersQueryVariables = Exact<{ export interface NavGetStructContainersQuery { navGetStructContainers: { catalogList: Array>; schemaList: Array> } } export type AdminConnectionFragment = ( - Pick + Pick & { origin: ObjectOriginInfoFragment; authProperties: Array> } ); @@ -1459,6 +1459,7 @@ export const AdminConnectionFragmentDoc = ` driverId template connected + useUrl readOnly saveCredentials host