mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 03: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 { hostname } = window.location;
|
||||
|
||||
const featureResponse = useGetFeatureFlag((allFlags) => {
|
||||
const isOnboardingEnabled =
|
||||
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(
|
||||
(route) => route?.key !== ROUTES.GET_STARTED,
|
||||
(route) => route?.path !== ROUTES.GET_STARTED,
|
||||
);
|
||||
|
||||
setRoutes(newRoutes);
|
||||
|
@ -40,6 +40,8 @@ function SideNav(): JSX.Element {
|
||||
featureResponse,
|
||||
} = useSelector<AppState, AppReducer>((state) => state.app);
|
||||
|
||||
const { hostname } = window.location;
|
||||
|
||||
const menuItems = useMemo(
|
||||
() =>
|
||||
defaultMenuItems.filter((item) => {
|
||||
@ -48,13 +50,16 @@ function SideNav(): JSX.Element {
|
||||
(feature) => feature.name === FeatureKeys.ONBOARDING,
|
||||
)?.active || false;
|
||||
|
||||
if (!isOnboardingEnabled) {
|
||||
if (
|
||||
!isOnboardingEnabled ||
|
||||
!(hostname && hostname.endsWith('signoz.cloud'))
|
||||
) {
|
||||
return item.key !== ROUTES.GET_STARTED;
|
||||
}
|
||||
|
||||
return true;
|
||||
}),
|
||||
[featureResponse],
|
||||
[featureResponse.data, hostname],
|
||||
);
|
||||
|
||||
const { pathname, search } = useLocation();
|
||||
|
Loading…
x
Reference in New Issue
Block a user