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.

feat: show billing , settings to admin when workspace is blocked (#8291)

Yunus Me02ae9a5c434
diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx
index 5c7b4d35fc..8d80e0bbbd 100644
--- a/frontend/src/AppRoutes/Private.tsx
+++ b/frontend/src/AppRoutes/Private.tsx
@@ -126,7 +126,8 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
const isRouteEnabledForWorkspaceBlockedState =
isAdmin &&
- (path === ROUTES.ORG_SETTINGS ||
+ (path === ROUTES.SETTINGS ||
+ path === ROUTES.ORG_SETTINGS ||
path === ROUTES.BILLING ||
path === ROUTES.MY_SETTINGS);
diff --git a/frontend/src/container/SideNav/SideNav.styles.scss b/frontend/src/container/SideNav/SideNav.styles.scss
index e8c7143b6a..361f832418 100644
--- a/frontend/src/container/SideNav/SideNav.styles.scss
+++ b/frontend/src/container/SideNav/SideNav.styles.scss
@@ -889,6 +889,10 @@
.ant-dropdown-menu-item-divider {
background-color: var(--Slate-500, #161922) !important;
}
+
+ .ant-dropdown-menu-item-disabled {
+ opacity: 0.7;
+ }
}
.settings-dropdown,
diff --git a/frontend/src/container/SideNav/SideNav.tsx b/frontend/src/container/SideNav/SideNav.tsx
index 0800edb1d6..1deb6c4732 100644
--- a/frontend/src/container/SideNav/SideNav.tsx
+++ b/frontend/src/container/SideNav/SideNav.tsx
@@ -447,6 +447,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
{
key: 'workspace',
label: 'Workspace Settings',
+ disabled: isWorkspaceBlocked,
},
...(isEnterpriseSelfHostedUser || isCommunityEnterpriseUser
? [
@@ -464,7 +465,12 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
),
},
].filter(Boolean),
- [isEnterpriseSelfHostedUser, isCommunityEnterpriseUser, user.email],
+ [
+ isEnterpriseSelfHostedUser,
+ isCommunityEnterpriseUser,
+ user.email,
+ isWorkspaceBlocked,
+ ],
);
useEffect(() => {
diff --git a/frontend/src/container/SideNav/menuItems.tsx b/frontend/src/container/SideNav/menuItems.tsx
index a27c7f9bcb..633493bb7e 100644
--- a/frontend/src/container/SideNav/menuItems.tsx
+++ b/frontend/src/container/SideNav/menuItems.tsx
@@ -391,7 +391,7 @@ export const helpSupportDropdownMenuItems: SidebarItem[] = [
},
{
key: 'invite-collaborators',
- label: 'Invite a Collaborator',
+ label: 'Invite a Team Member',
icon: <Plus size={14} />,
itemKey: 'invite-collaborators',
},
diff --git a/frontend/src/pages/Settings/Settings.tsx b/frontend/src/pages/Settings/Settings.tsx
index 35677f8e9b..1f7f7c803b 100644
--- a/frontend/src/pages/Settings/Settings.tsx
+++ b/frontend/src/pages/Settings/Settings.tsx
@@ -24,7 +24,12 @@ import { getRoutes } from './utils';
function SettingsPage(): JSX.Element {
const { pathname, search } = useLocation();
- const { user, featureFlags, trialInfo } = useAppContext();
+ const {
+ user,
+ featureFlags,
+ trialInfo,
+ isFetchingActiveLicense,
+ } = useAppContext();
const { isCloudUser, isEnterpriseSelfHostedUser } = useGetTenantLicense();
const [settingsMenuItems, setSettingsMenuItems] = useState<SidebarItem[]>(
@@ -51,6 +56,21 @@ function SettingsPage(): JSX.Element {
setSettingsMenuItems((prevItems) => {
let updatedItems = [...prevItems];
+ if (trialInfo?.workSpaceBlock && !isFetchingActiveLicense) {
+ updatedItems = updatedItems.map((item) => ({
+ ...item,
+ isEnabled: !!(
+ isAdmin &&
+ (item.key === ROUTES.BILLING ||
+ item.key === ROUTES.ORG_SETTINGS ||
+ item.key === ROUTES.MY_SETTINGS ||
+ item.key === ROUTES.SHORTCUTS)
+ ),
+ }));
+
+ return updatedItems;
+ }
+
if (isCloudUser) {
if (isAdmin) {
updatedItems = updatedItems.map((item) => ({
@@ -61,7 +81,8 @@ function SettingsPage(): JSX.Element {
item.key === ROUTES.CUSTOM_DOMAIN_SETTINGS ||
item.key === ROUTES.API_KEYS ||
item.key === ROUTES.INGESTION_SETTINGS ||
- item.key === ROUTES.ORG_SETTINGS
+ item.key === ROUTES.ORG_SETTINGS ||
+ item.key === ROUTES.SHORTCUTS
? true
: item.isEnabled,
}));
@@ -72,7 +93,8 @@ function SettingsPage(): JSX.Element {
...item,
isEnabled:
item.key === ROUTES.INGESTION_SETTINGS ||
- item.key === ROUTES.INTEGRATIONS
+ item.key === ROUTES.INTEGRATIONS ||
+ item.key === ROUTES.SHORTCUTS
? true
: item.isEnabled,
}));
@@ -87,7 +109,8 @@ function SettingsPage(): JSX.Element {
item.key === ROUTES.BILLING ||
item.key === ROUTES.INTEGRATIONS ||
item.key === ROUTES.API_KEYS ||
- item.key === ROUTES.ORG_SETTINGS
+ item.key === ROUTES.ORG_SETTINGS ||
+ item.key === ROUTES.SHORTCUTS
? true
: item.isEnabled,
}));
@@ -107,7 +130,9 @@ function SettingsPage(): JSX.Element {
updatedItems = updatedItems.map((item) => ({
...item,
isEnabled:
- item.key === ROUTES.API_KEYS || item.key === ROUTES.ORG_SETTINGS
+ item.key === ROUTES.API_KEYS ||
+ item.key === ROUTES.ORG_SETTINGS ||
+ item.key === ROUTES.SHORTCUTS
? true
: item.isEnabled,
}));
@@ -125,7 +150,15 @@ function SettingsPage(): JSX.Element {
return updatedItems;
});
- }, [isAdmin, isEditor, isCloudUser, isEnterpriseSelfHostedUser]);
+ }, [
+ isAdmin,
+ isEditor,
+ isCloudUser,
+ isEnterpriseSelfHostedUser,
+ isFetchingActiveLicense,
+ trialInfo?.workSpaceBlock,
+ pathname,
+ ]);
const routes = useMemo(
() =>
diff --git a/frontend/src/pages/Settings/utils.ts b/frontend/src/pages/Settings/utils.ts
index 670744838e..567f944b68 100644
--- a/frontend/src/pages/Settings/utils.ts
+++ b/frontend/src/pages/Settings/utils.ts
@@ -32,7 +32,12 @@ export const getRoutes = (
const isEditor = userRole === USER_ROLES.EDITOR;
if (isWorkspaceBlocked && isAdmin) {
- settings.push(...organizationSettings(t));
+ settings.push(
+ ...organizationSettings(t),
+ ...mySettings(t),
+ ...billingSettings(t),
+ ...keyboardShortcuts(t),
+ );
return settings;
}