Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-5125 do not trigger logo in configuration stage #3096

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webapp/packages/core-blocks/src/layout/AppLogo.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
display: flex;
align-items: center;
padding: 0 14px;
}

.active {
cursor: pointer;
}

Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/src/layout/AppLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {
export const AppLogo: React.FC<Props> = function AppLogo({ title, onClick }) {
const style = useS(styles);
return (
<div tabIndex={0} className={s(style, { container: true })} onClick={onClick}>
<div tabIndex={0} className={s(style, { container: true, active: onClick !== undefined })} onClick={onClick}>
<IconOrImage title={title} className={s(style, { logo: true })} icon="/icons/logo_sm.svg" />
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions webapp/packages/core-routing/src/Screen/ScreenService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { observer } from 'mobx-react-lite';

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 permissionsService = useService(PermissionsService);
const { backendVersion, frontendVersion } = useAppVersion(true);

const isSameVersion = backendVersion === frontendVersion;
Expand All @@ -26,5 +27,5 @@ export const Logo = observer(function Logo() {

const title = isSameVersion ? backendVersionTitle : commonVersionTitle;

return <AppLogo title={title} onClick={() => screenService.navigateToRoot()} />;
return <AppLogo title={title} onClick={permissionsService.publicDisabled ? undefined : screenService.navigateToRoot} />;
});
Loading