mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
UI, Premium to Sandbox addendum 2: Hide Controls page (#11428)
## Addresses 2 of 2 [additional specs for premium to sandbox](https://fleetdm.slack.com/archives/C01EZVBHFHU/p1682644171632189) - Hides the Controls page in Sandbox mode ## Checklist for submitter - [x] Manual QA for all new/changed functionality Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
280e3261bf
commit
c646817bc2
3 changed files with 17 additions and 13 deletions
|
|
@ -13,7 +13,7 @@ import UserMenu from "components/top_nav/UserMenu";
|
|||
// @ts-ignore
|
||||
import OrgLogoIcon from "components/icons/OrgLogoIcon";
|
||||
|
||||
import navItems, { INavItem } from "./navItems";
|
||||
import getNavItems, { INavItem } from "./navItems";
|
||||
|
||||
interface ISiteTopNavProps {
|
||||
config: IConfig;
|
||||
|
|
@ -191,13 +191,14 @@ const SiteTopNav = ({
|
|||
);
|
||||
};
|
||||
|
||||
const userNavItems = navItems(
|
||||
const userNavItems = getNavItems(
|
||||
currentUser,
|
||||
isGlobalAdmin,
|
||||
isAnyTeamAdmin,
|
||||
isAnyTeamMaintainer,
|
||||
isGlobalMaintainer,
|
||||
isNoAccess
|
||||
isNoAccess,
|
||||
isSandboxMode
|
||||
);
|
||||
|
||||
const renderNavItems = () => {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ export default (
|
|||
isAnyTeamAdmin = false,
|
||||
isAnyTeamMaintainer = false,
|
||||
isGlobalMaintainer = false,
|
||||
isNoAccess = false
|
||||
isNoAccess = false,
|
||||
isSandboxMode = false
|
||||
): INavItem[] => {
|
||||
if (!user) {
|
||||
return [];
|
||||
|
|
@ -59,7 +60,7 @@ export default (
|
|||
regex: new RegExp(`^${URL_PREFIX}/controls/`),
|
||||
pathname: PATHS.CONTROLS,
|
||||
},
|
||||
exclude: !isMaintainerOrAdmin,
|
||||
exclude: isSandboxMode || !isMaintainerOrAdmin,
|
||||
withParams: { type: "query", names: ["team_id"] },
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -170,14 +170,16 @@ const routes = (
|
|||
</Route>
|
||||
</Route>
|
||||
|
||||
<Route path="controls" component={AuthAnyMaintainerAnyAdminRoutes}>
|
||||
<IndexRedirect to="mac-os-updates" />
|
||||
<Route component={ManageControlsPage}>
|
||||
<Route path="mac-os-updates" component={MacOSUpdates} />
|
||||
<Route path="mac-settings" component={MacOSSettings} />
|
||||
<Route path="mac-settings/:section" component={MacOSSettings} />
|
||||
<Route path="mac-setup" component={MacOSSetup} />
|
||||
<Route path="mac-setup/:section" component={MacOSSetup} />
|
||||
<Route component={ExcludeInSandboxRoutes}>
|
||||
<Route path="controls" component={AuthAnyMaintainerAnyAdminRoutes}>
|
||||
<IndexRedirect to="mac-os-updates" />
|
||||
<Route component={ManageControlsPage}>
|
||||
<Route path="mac-os-updates" component={MacOSUpdates} />
|
||||
<Route path="mac-settings" component={MacOSSettings} />
|
||||
<Route path="mac-settings/:section" component={MacOSSettings} />
|
||||
<Route path="mac-setup" component={MacOSSetup} />
|
||||
<Route path="mac-setup/:section" component={MacOSSetup} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Route>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue