diff --git a/webapp/packages/core-blocks/src/PropertiesTable/PropertyItem.tsx b/webapp/packages/core-blocks/src/PropertiesTable/PropertyItem.tsx index d0d74e0690..92749ca49b 100644 --- a/webapp/packages/core-blocks/src/PropertiesTable/PropertyItem.tsx +++ b/webapp/packages/core-blocks/src/PropertiesTable/PropertyItem.tsx @@ -99,8 +99,8 @@ export const PropertyItem = observer(function PropertyItem({ )} @@ -108,7 +108,6 @@ export const PropertyItem = observer(function PropertyItem({ diff --git a/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql b/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql index be5b79b5a0..967662d498 100644 --- a/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql +++ b/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql @@ -36,13 +36,7 @@ fragment DatabaseDriver on DriverInfo { } driverProperties @include(if: $includeDriverProperties) { - id - displayName - description - category - dataType - defaultValue - validValues + ...DriverPropertyInfo } driverParameters @include(if: $includeDriverParameters) } diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts b/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts index 0cb8928df1..149aa858e6 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts @@ -7,11 +7,12 @@ */ import { FormPart, type IFormState } from '@cloudbeaver/core-ui'; import type { IExecutionContextProvider } from '@cloudbeaver/core-executor'; -import { CONNECTION_PROPERTIES_SCHEMA, ConnectionInfoPropertiesResource } from '@cloudbeaver/core-connections'; +import { CONNECTION_PROPERTIES_SCHEMA, ConnectionInfoPropertiesResource, DBDriverResource } from '@cloudbeaver/core-connections'; import type { IConnectionFormState } from '../IConnectionFormState.js'; import { runInAction, toJS } from 'mobx'; import type { ConnectionFormOptionsPart } from '../Options/ConnectionFormOptionsPart.js'; import type { schema } from '@cloudbeaver/core-utils'; +import { getObjectPropertyOptionValue } from '@cloudbeaver/core-sdk'; type ConnectionProperties = schema.infer; @@ -23,6 +24,7 @@ export class ConnectionFormDriverPropertiesPart extends FormPart, private readonly connectionInfoPropertiesResource: ConnectionInfoPropertiesResource, + private readonly dbDriverResource: DBDriverResource, private readonly optionsPart: ConnectionFormOptionsPart, ) { super(formState, getDefaultState()); @@ -69,10 +71,10 @@ export class ConnectionFormDriverPropertiesPart extends FormPart>, ): Promise {} - protected override format( + protected override async format( data: IFormState, contexts: IExecutionContextProvider>, - ): void | Promise { + ): Promise { runInAction(() => { for (const key of Object.keys(this.state!)) { if (typeof this.state[key] === 'string') { @@ -80,5 +82,29 @@ export class ConnectionFormDriverPropertiesPart extends FormPart property.id === key); + if (property && value === getObjectPropertyOptionValue(property.defaultValue)) { + delete config[key]; + } + } + + return config; } } diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/getConnectionFormDriverPropertiesPart.ts b/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/getConnectionFormDriverPropertiesPart.ts index 308aa4e6c4..0dcbd75601 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/getConnectionFormDriverPropertiesPart.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/getConnectionFormDriverPropertiesPart.ts @@ -8,7 +8,7 @@ import { createDataContext, DATA_CONTEXT_DI_PROVIDER } from '@cloudbeaver/core-data-context'; import type { IFormState } from '@cloudbeaver/core-ui'; import { ConnectionFormDriverPropertiesPart } from './ConnectionFormDriverPropertiesPart.js'; -import { ConnectionInfoPropertiesResource } from '@cloudbeaver/core-connections'; +import { ConnectionInfoPropertiesResource, DBDriverResource } from '@cloudbeaver/core-connections'; import type { IConnectionFormState } from '../IConnectionFormState.js'; import { getConnectionFormOptionsPart } from '../Options/getConnectionFormOptionsPart.js'; @@ -21,7 +21,8 @@ export function getConnectionFormDriverPropertiesPart(formState: IFormState