mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
No teams tab for Core Tier (#1001)
* Teams tab renders for basic tier only
This commit is contained in:
parent
8b13e354f8
commit
70e416f263
1 changed files with 19 additions and 5 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import React from "react";
|
||||
import { Tab, Tabs, TabList } from "react-tabs";
|
||||
import { push } from "react-router-redux";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { IConfig } from "interfaces/config";
|
||||
import permissionUtils from "utilities/permissions";
|
||||
|
||||
import PATHS from "router/paths";
|
||||
|
||||
|
|
@ -10,6 +12,12 @@ interface ISettingSubNavItem {
|
|||
pathname: string;
|
||||
}
|
||||
|
||||
interface IRootState {
|
||||
app: {
|
||||
config: IConfig;
|
||||
};
|
||||
}
|
||||
|
||||
const settingsSubNav: ISettingSubNavItem[] = [
|
||||
{
|
||||
name: "Organization settings",
|
||||
|
|
@ -19,10 +27,6 @@ const settingsSubNav: ISettingSubNavItem[] = [
|
|||
name: "Users",
|
||||
pathname: PATHS.ADMIN_USERS,
|
||||
},
|
||||
{
|
||||
name: "Teams",
|
||||
pathname: PATHS.ADMIN_TEAMS,
|
||||
},
|
||||
];
|
||||
|
||||
interface ISettingsWrapperProp {
|
||||
|
|
@ -45,6 +49,16 @@ const SettingsWrapper = (props: ISettingsWrapperProp): JSX.Element => {
|
|||
children,
|
||||
location: { pathname },
|
||||
} = props;
|
||||
|
||||
// Add Teams tab for basic tier only
|
||||
const config = useSelector((state: IRootState) => state.app.config);
|
||||
if (permissionUtils.isBasicTier(config)) {
|
||||
settingsSubNav.push({
|
||||
name: "Teams",
|
||||
pathname: PATHS.ADMIN_TEAMS,
|
||||
});
|
||||
}
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const navigateToNav = (i: number): void => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue