From da0376791dea2b397d52ec5f4adc05da158b6376 Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Fri, 20 Aug 2021 19:35:51 +0300 Subject: [PATCH] fix(core-connections): CB-1176 wrap config in observable --- .../ConnectionForm/ConnectionFormService.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/webapp/packages/core-connections/src/ConnectionForm/ConnectionFormService.ts b/webapp/packages/core-connections/src/ConnectionForm/ConnectionFormService.ts index d6d6cb6c88..8b9324186c 100644 --- a/webapp/packages/core-connections/src/ConnectionForm/ConnectionFormService.ts +++ b/webapp/packages/core-connections/src/ConnectionForm/ConnectionFormService.ts @@ -6,6 +6,8 @@ * you may not use this file except in compliance with the License. */ +import { observable } from 'mobx'; + import { PlaceholderContainer, TabsContainer } from '@cloudbeaver/core-blocks'; import { injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs'; @@ -130,12 +132,20 @@ export class ConnectionFormService { const config = contexts.getContext(connectionConfigContext); - if (config.credentials === undefined && credentialsState.authModelId) { - config.credentials = {}; + if (credentialsState.authModelId) { + if (config.credentials === undefined) { + config.credentials = {}; + } + + config.credentials = observable(config.credentials); } - if (config.networkHandlersConfig === undefined && credentialsState.networkHandlers.length > 0) { - config.networkHandlersConfig = []; + if (credentialsState.networkHandlers.length > 0) { + if (config.networkHandlersConfig === undefined) { + config.networkHandlersConfig = []; + } + + config.networkHandlersConfig = observable(config.networkHandlersConfig); } const result = await this.commonDialogService.open(ConnectionAuthenticationDialog, {