mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 23:15:53 +08:00
feat: signoz cloud - show cloud onboarding docs only when the domain is signoz.cloud (#3540)
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
c60f612e0e
commit
9a00998930
@ -32,6 +32,8 @@ function App(): JSX.Element {
|
|||||||
|
|
||||||
const dispatch = useDispatch<Dispatch<AppActions>>();
|
const dispatch = useDispatch<Dispatch<AppActions>>();
|
||||||
|
|
||||||
|
const { hostname } = window.location;
|
||||||
|
|
||||||
const featureResponse = useGetFeatureFlag((allFlags) => {
|
const featureResponse = useGetFeatureFlag((allFlags) => {
|
||||||
const isOnboardingEnabled =
|
const isOnboardingEnabled =
|
||||||
allFlags.find((flag) => flag.name === FeatureKeys.ONBOARDING)?.active ||
|
allFlags.find((flag) => flag.name === FeatureKeys.ONBOARDING)?.active ||
|
||||||
@ -49,9 +51,12 @@ function App(): JSX.Element {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isOnboardingEnabled) {
|
if (
|
||||||
|
!isOnboardingEnabled ||
|
||||||
|
!(hostname && hostname.endsWith('signoz.cloud'))
|
||||||
|
) {
|
||||||
const newRoutes = routes.filter(
|
const newRoutes = routes.filter(
|
||||||
(route) => route?.key !== ROUTES.GET_STARTED,
|
(route) => route?.path !== ROUTES.GET_STARTED,
|
||||||
);
|
);
|
||||||
|
|
||||||
setRoutes(newRoutes);
|
setRoutes(newRoutes);
|
||||||
|
@ -40,6 +40,8 @@ function SideNav(): JSX.Element {
|
|||||||
featureResponse,
|
featureResponse,
|
||||||
} = useSelector<AppState, AppReducer>((state) => state.app);
|
} = useSelector<AppState, AppReducer>((state) => state.app);
|
||||||
|
|
||||||
|
const { hostname } = window.location;
|
||||||
|
|
||||||
const menuItems = useMemo(
|
const menuItems = useMemo(
|
||||||
() =>
|
() =>
|
||||||
defaultMenuItems.filter((item) => {
|
defaultMenuItems.filter((item) => {
|
||||||
@ -48,13 +50,16 @@ function SideNav(): JSX.Element {
|
|||||||
(feature) => feature.name === FeatureKeys.ONBOARDING,
|
(feature) => feature.name === FeatureKeys.ONBOARDING,
|
||||||
)?.active || false;
|
)?.active || false;
|
||||||
|
|
||||||
if (!isOnboardingEnabled) {
|
if (
|
||||||
|
!isOnboardingEnabled ||
|
||||||
|
!(hostname && hostname.endsWith('signoz.cloud'))
|
||||||
|
) {
|
||||||
return item.key !== ROUTES.GET_STARTED;
|
return item.key !== ROUTES.GET_STARTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}),
|
}),
|
||||||
[featureResponse],
|
[featureResponse.data, hostname],
|
||||||
);
|
);
|
||||||
|
|
||||||
const { pathname, search } = useLocation();
|
const { pathname, search } = useLocation();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user