From 67ac35d732dc7a131ec5067249cdb549ed80c34f Mon Sep 17 00:00:00 2001 From: naumov Date: Fri, 22 Nov 2024 22:13:32 +0100 Subject: [PATCH 1/3] CB-5125 do not trigger logo in configuration stage --- webapp/packages/core-blocks/src/layout/AppLogo.module.css | 3 +++ webapp/packages/core-blocks/src/layout/AppLogo.tsx | 2 +- webapp/packages/plugin-top-app-bar/package.json | 1 + webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp/packages/core-blocks/src/layout/AppLogo.module.css b/webapp/packages/core-blocks/src/layout/AppLogo.module.css index 9dcd006310..0e39924945 100644 --- a/webapp/packages/core-blocks/src/layout/AppLogo.module.css +++ b/webapp/packages/core-blocks/src/layout/AppLogo.module.css @@ -10,6 +10,9 @@ display: flex; align-items: center; padding: 0 14px; +} + +.active { cursor: pointer; } diff --git a/webapp/packages/core-blocks/src/layout/AppLogo.tsx b/webapp/packages/core-blocks/src/layout/AppLogo.tsx index 0f37ddacf3..772dd982a4 100644 --- a/webapp/packages/core-blocks/src/layout/AppLogo.tsx +++ b/webapp/packages/core-blocks/src/layout/AppLogo.tsx @@ -18,7 +18,7 @@ interface Props { export const AppLogo: React.FC = function AppLogo({ title, onClick }) { const style = useS(styles); return ( -
+
); diff --git a/webapp/packages/plugin-top-app-bar/package.json b/webapp/packages/plugin-top-app-bar/package.json index b504cdb919..2d451f8086 100644 --- a/webapp/packages/plugin-top-app-bar/package.json +++ b/webapp/packages/plugin-top-app-bar/package.json @@ -18,6 +18,7 @@ "update-ts-references": "yarn run clean && typescript-resolve-references" }, "dependencies": { + "@cloudbeaver/core-administration": "^0", "@cloudbeaver/core-app": "^0", "@cloudbeaver/core-authentication": "^0", "@cloudbeaver/core-blocks": "^0", diff --git a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx index a8f4d0edd9..48f376e71a 100644 --- a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx @@ -7,6 +7,7 @@ */ import { observer } from 'mobx-react-lite'; +import { AdministrationScreenService } from '@cloudbeaver/core-administration'; import { AppLogo, useResource } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { ProductInfoResource } from '@cloudbeaver/core-root'; @@ -16,6 +17,7 @@ import { useAppVersion } from '@cloudbeaver/core-version'; export const Logo = observer(function Logo() { const productInfoResource = useResource(Logo, ProductInfoResource, undefined); const screenService = useService(ScreenService); + const administrationScreenService = useService(AdministrationScreenService); const { backendVersion, frontendVersion } = useAppVersion(true); const isSameVersion = backendVersion === frontendVersion; @@ -26,5 +28,5 @@ export const Logo = observer(function Logo() { const title = isSameVersion ? backendVersionTitle : commonVersionTitle; - return screenService.navigateToRoot()} />; + return screenService.navigateToRoot()} />; }); From 56c387bc205ce1f2fd35a533721aa98961ea8f3b Mon Sep 17 00:00:00 2001 From: naumov Date: Mon, 25 Nov 2024 15:47:57 +0100 Subject: [PATCH 2/3] CB-5125 use publicDisabled field instead --- webapp/packages/plugin-top-app-bar/package.json | 1 - webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/webapp/packages/plugin-top-app-bar/package.json b/webapp/packages/plugin-top-app-bar/package.json index 2d451f8086..b504cdb919 100644 --- a/webapp/packages/plugin-top-app-bar/package.json +++ b/webapp/packages/plugin-top-app-bar/package.json @@ -18,7 +18,6 @@ "update-ts-references": "yarn run clean && typescript-resolve-references" }, "dependencies": { - "@cloudbeaver/core-administration": "^0", "@cloudbeaver/core-app": "^0", "@cloudbeaver/core-authentication": "^0", "@cloudbeaver/core-blocks": "^0", diff --git a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx index 48f376e71a..d2c10c3525 100644 --- a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx @@ -7,17 +7,16 @@ */ import { observer } from 'mobx-react-lite'; -import { AdministrationScreenService } from '@cloudbeaver/core-administration'; import { AppLogo, useResource } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; -import { ProductInfoResource } from '@cloudbeaver/core-root'; +import { PermissionsService, ProductInfoResource } from '@cloudbeaver/core-root'; import { ScreenService } from '@cloudbeaver/core-routing'; import { useAppVersion } from '@cloudbeaver/core-version'; export const Logo = observer(function Logo() { const productInfoResource = useResource(Logo, ProductInfoResource, undefined); const screenService = useService(ScreenService); - const administrationScreenService = useService(AdministrationScreenService); + const permissionsService = useService(PermissionsService); const { backendVersion, frontendVersion } = useAppVersion(true); const isSameVersion = backendVersion === frontendVersion; @@ -28,5 +27,5 @@ export const Logo = observer(function Logo() { const title = isSameVersion ? backendVersionTitle : commonVersionTitle; - return screenService.navigateToRoot()} />; + return screenService.navigateToRoot()} />; }); From 0079b6f4c68060a22d805868f99230050bc50495 Mon Sep 17 00:00:00 2001 From: naumov Date: Mon, 25 Nov 2024 15:56:28 +0100 Subject: [PATCH 3/3] CB-5125 bind method --- webapp/packages/core-routing/src/Screen/ScreenService.ts | 2 ++ webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/packages/core-routing/src/Screen/ScreenService.ts b/webapp/packages/core-routing/src/Screen/ScreenService.ts index e73be6ce54..2de940658c 100644 --- a/webapp/packages/core-routing/src/Screen/ScreenService.ts +++ b/webapp/packages/core-routing/src/Screen/ScreenService.ts @@ -32,6 +32,8 @@ export class ScreenService { this.routerService.subscribe(this.onRouteChange.bind(this)); this.routerService.transitionTask.addHandler(this.routeTransition.bind(this)); + this.navigateToRoot = this.navigateToRoot.bind(this); + makeObservable(this, { screen: computed, }); diff --git a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx index d2c10c3525..8ad702f2c6 100644 --- a/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx @@ -27,5 +27,5 @@ export const Logo = observer(function Logo() { const title = isSameVersion ? backendVersionTitle : commonVersionTitle; - return screenService.navigateToRoot()} />; + return ; });