Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(react): hide version info in cloud/SaaS mode (BYT-9404) (#20206)

Danny Xu8256f7dfd7f7
diff --git a/frontend/src/react/components/header/VersionMenuItem.test.tsx b/frontend/src/react/components/header/VersionMenuItem.test.tsx
index 809f57e6dc..96b49a6fc4 100644
--- a/frontend/src/react/components/header/VersionMenuItem.test.tsx
+++ b/frontend/src/react/components/header/VersionMenuItem.test.tsx
@@ -192,4 +192,24 @@ describe("VersionMenuItem", () => {
);
unmount();
});
+
+ test("hides version info in SaaS/cloud mode", () => {
+ mocks.serverInfo = {
+ version: "1.0.0",
+ gitCommit: "backend123",
+ saas: true,
+ demo: false,
+ };
+ const { container, render, unmount } = renderIntoContainer(
+ <VersionMenuItem onCloseMenu={mocks.closeMenu} />
+ );
+ render();
+
+ expect(container.textContent).not.toContain("v1.0.0");
+ expect(container.textContent).not.toContain("BE Git hash");
+ expect(container.textContent).not.toContain("FE Git hash");
+ // The plan label should still be visible.
+ expect(container.textContent).toContain("Team");
+ unmount();
+ });
});
diff --git a/frontend/src/react/components/header/VersionMenuItem.tsx b/frontend/src/react/components/header/VersionMenuItem.tsx
index 7016e9c6ce..ae7be3e8d5 100644
--- a/frontend/src/react/components/header/VersionMenuItem.tsx
+++ b/frontend/src/react/components/header/VersionMenuItem.tsx
@@ -113,29 +113,31 @@ export function VersionMenuItem({ onCloseMenu }: { onCloseMenu: () => void }) {
)}
</div>
- <button
- type="button"
- className="flex w-full items-center justify-between gap-x-2 rounded-sm px-0 py-1 text-left text-sm text-control hover:text-accent"
- onClick={() => {
- if (hasNewRelease) {
- onCloseMenu();
- setDialogOpen(true);
- }
- }}
- >
- <span className="flex items-center gap-x-2">
- {hasNewRelease ? (
- <Volume2 className="h-4 w-4 text-success" />
- ) : null}
- {formattedVersion}
- </span>
- </button>
-
{!serverInfo?.saas ? (
- <div className="mt-1 text-xs text-control-light">
- <div>BE Git hash: {gitCommitBE.slice(0, 7)}</div>
- <div>FE Git hash: {gitCommitFE.slice(0, 7)}</div>
- </div>
+ <>
+ <button
+ type="button"
+ className="flex w-full items-center justify-between gap-x-2 rounded-sm px-0 py-1 text-left text-sm text-control hover:text-accent"
+ onClick={() => {
+ if (hasNewRelease) {
+ onCloseMenu();
+ setDialogOpen(true);
+ }
+ }}
+ >
+ <span className="flex items-center gap-x-2">
+ {hasNewRelease ? (
+ <Volume2 className="h-4 w-4 text-success" />
+ ) : null}
+ {formattedVersion}
+ </span>
+ </button>
+
+ <div className="mt-1 text-xs text-control-light">
+ <div>BE Git hash: {gitCommitBE.slice(0, 7)}</div>
+ <div>FE Git hash: {gitCommitFE.slice(0, 7)}</div>
+ </div>
+ </>
) : null}
</div>