From 89bfe818e0c6dafd26054192f8e8879113150b6b Mon Sep 17 00:00:00 2001 From: Wroud Date: Mon, 7 Sep 2020 00:31:39 +0300 Subject: [PATCH 1/2] fix(core-administration): users update after configuration CB-271 --- webapp/packages/core-administration/package.json | 1 + .../ServerConfiguration/ServerConfigurationService.ts | 3 +++ webapp/packages/core-authentication/src/UsersResource.ts | 7 ------- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/webapp/packages/core-administration/package.json b/webapp/packages/core-administration/package.json index adf258a365..354683b744 100644 --- a/webapp/packages/core-administration/package.json +++ b/webapp/packages/core-administration/package.json @@ -14,6 +14,7 @@ "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" }, "peerDependencies": { + "@cloudbeaver/core-authentication": "^0.1.0", "@cloudbeaver/core-blocks": "^0.1.0", "@cloudbeaver/core-di": "^0.1.0", "@cloudbeaver/core-localization": "^0.1.0", diff --git a/webapp/packages/core-administration/src/AdministrationScreen/ConfigurationWizard/Pages/ServerConfiguration/ServerConfigurationService.ts b/webapp/packages/core-administration/src/AdministrationScreen/ConfigurationWizard/Pages/ServerConfiguration/ServerConfigurationService.ts index ed5bf7bd55..83858780cd 100644 --- a/webapp/packages/core-administration/src/AdministrationScreen/ConfigurationWizard/Pages/ServerConfiguration/ServerConfigurationService.ts +++ b/webapp/packages/core-administration/src/AdministrationScreen/ConfigurationWizard/Pages/ServerConfiguration/ServerConfigurationService.ts @@ -6,6 +6,7 @@ * you may not use this file except in compliance with the License. */ +import { UsersResource } from '@cloudbeaver/core-authentication'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { IExecutor, Executor, IContextProvider } from '@cloudbeaver/core-executor'; @@ -24,6 +25,7 @@ export class ServerConfigurationService { private administrationScreenService: AdministrationScreenService, private graphQLService: GraphQLService, private notificationService: NotificationService, + private usersResource: UsersResource ) { this.state = this.administrationScreenService.getItemState('welcome', () => ({ serverConfig: { @@ -89,6 +91,7 @@ export class ServerConfigurationService { try { await this.graphQLService.gql.setDefaultNavigatorSettings({ settings: this.state.navigatorConfig }); await this.graphQLService.gql.configureServer({ configuration: this.state.serverConfig }); + this.usersResource.refreshAll(); } catch (exception) { this.notificationService.logException(exception, 'Can\'t save server configuration'); diff --git a/webapp/packages/core-authentication/src/UsersResource.ts b/webapp/packages/core-authentication/src/UsersResource.ts index 02541f888c..7d2c412b25 100644 --- a/webapp/packages/core-authentication/src/UsersResource.ts +++ b/webapp/packages/core-authentication/src/UsersResource.ts @@ -193,13 +193,6 @@ export class UsersResource extends CachedMapResource { return this.data; } - private isConnectionsLoaded(key: ResourceKey) { - if (isResourceKeyList(key)) { - return this.get(key).every(user => !!user?.grantedConnections); - } - return !!this.get(key)?.grantedConnections; - } - private isActiveUser(userId: string) { return this.authInfoService.userInfo?.userId === userId; } From 546e0c7062e19aec3abd52ecffa64839e823760c Mon Sep 17 00:00:00 2001 From: Wroud Date: Mon, 7 Sep 2020 12:49:21 +0300 Subject: [PATCH 2/2] chore: add build step to readme #154 --- webapp/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/readme.md b/webapp/readme.md index 3f3532d4dc..6daf2f8948 100644 --- a/webapp/readme.md +++ b/webapp/readme.md @@ -3,6 +3,7 @@ 1. install ```yarn``` globaly 2. execute ```yarn``` in this folder 3. execute ```lerna bootstrap``` +3. execute ```lerna run build --stream --scope=@cloudbeaver/product-default``` 4. open ```packages/product-default/lib/index.html``` or run ```npx serve packages/product-default/lib``` ## Build