Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: cloud header button is hidden when is license is not active (#2756)

Palash Gupta5a81f5f90b34
diff --git a/frontend/src/container/Header/index.tsx b/frontend/src/container/Header/index.tsx
index 8b906eab74..d3dcb52c99 100644
--- a/frontend/src/container/Header/index.tsx
+++ b/frontend/src/container/Header/index.tsx
@@ -8,6 +8,7 @@ import { Logout } from 'api/utils';
import ROUTES from 'constants/routes';
import Config from 'container/ConfigDropdown';
import { useIsDarkMode, useThemeMode } from 'hooks/useDarkMode';
+import useLicense, { LICENSE_PLAN_STATUS } from 'hooks/useLicense';
import {
Dispatch,
KeyboardEvent,
@@ -95,6 +96,11 @@ function HeaderContainer(): JSX.Element {
);
};
+ const { data } = useLicense();
+
+ const isLicenseActive =
+ data?.payload?.find((e) => e.isCurrent)?.status === LICENSE_PLAN_STATUS.VALID;
+
return (
<Header>
<Container>
@@ -111,9 +117,11 @@ function HeaderContainer(): JSX.Element {
</NavLink>
<Space size="middle" align="center">
- <Button onClick={onClickSignozCloud} type="primary">
- Try Signoz Cloud
- </Button>
+ {!isLicenseActive && (
+ <Button onClick={onClickSignozCloud} type="primary">
+ Try Signoz Cloud
+ </Button>
+ )}
<Config frontendId="tooltip" />
diff --git a/frontend/src/hooks/useLicense/constant.ts b/frontend/src/hooks/useLicense/constant.ts
index 7389df50df..03bbb7325c 100644
--- a/frontend/src/hooks/useLicense/constant.ts
+++ b/frontend/src/hooks/useLicense/constant.ts
@@ -1,3 +1,7 @@
export const LICENSE_PLAN_KEY = {
ENTERPRISE_PLAN: 'ENTERPRISE_PLAN',
};
+
+export const LICENSE_PLAN_STATUS = {
+ VALID: 'VALID',
+};
diff --git a/frontend/src/hooks/useLicense/index.ts b/frontend/src/hooks/useLicense/index.ts
index ca8f821267..387e93e7d6 100644
--- a/frontend/src/hooks/useLicense/index.ts
+++ b/frontend/src/hooks/useLicense/index.ts
@@ -1,6 +1,6 @@
-import { LICENSE_PLAN_KEY } from './constant';
+import { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS } from './constant';
import useLicense from './useLicense';
export default useLicense;
-export { LICENSE_PLAN_KEY };
+export { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS };