mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Teams API: Free tier no longer calls team API throughout the app (#2766)
This commit is contained in:
parent
d6ab0615f8
commit
9cb128d17a
4 changed files with 4 additions and 6 deletions
1
changes/issue-2517-free-tier-no-teams-api
Normal file
1
changes/issue-2517-free-tier-no-teams-api
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Bug fix: Free Tier does not call teams API (fix: host details page, edit packs page)
|
||||
|
|
@ -172,7 +172,7 @@ const HostDetailsPage = ({
|
|||
Error,
|
||||
ITeam[]
|
||||
>("teams", () => teamAPI.loadAll(), {
|
||||
enabled: !!hostIdFromURL && isPremiumTier,
|
||||
enabled: !!hostIdFromURL && !!isPremiumTier,
|
||||
refetchOnMount: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnWindowFocus: false,
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ const EditPacksPage = ({
|
|||
["all teams"],
|
||||
() => teamsAPI.loadAll(),
|
||||
{
|
||||
enabled: !!isPremiumTier,
|
||||
select: (data: IStoredTeamsResponse) => data.teams,
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ const ManageSchedulePage = ({
|
|||
const { MANAGE_PACKS } = paths;
|
||||
const handleAdvanced = () => dispatch(push(MANAGE_PACKS));
|
||||
|
||||
const { currentUser, isOnGlobalTeam } = useContext(AppContext);
|
||||
const { currentUser, isOnGlobalTeam, isPremiumTier } = useContext(AppContext);
|
||||
|
||||
const isTeamMaintainerOrTeamAdmin = (() => {
|
||||
return !!permissionUtils.isTeamMaintainerOrTeamAdmin(currentUser, teamId);
|
||||
|
|
@ -204,10 +204,6 @@ const ManageSchedulePage = ({
|
|||
);
|
||||
}, [dispatch, teamId]);
|
||||
|
||||
const isPremiumTier = useSelector((state: IRootState) => {
|
||||
return state.app.config.tier === "premium";
|
||||
});
|
||||
|
||||
const user = useSelector(
|
||||
(state: IRootState): IUser => {
|
||||
return state.auth.user;
|
||||
|
|
|
|||
Loading…
Reference in a new issue