mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Include select column in manage hosts for team admins (#2698)
This commit is contained in:
parent
fe23fcd3ee
commit
6998bc5d8a
4 changed files with 8 additions and 39 deletions
1
changes/fix-2686-include-host-select
Normal file
1
changes/fix-2686-include-host-select
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Include select column on manage hosts table for team admins
|
||||
|
|
@ -89,6 +89,7 @@ const setPermissions = (user: IUser, config: IConfig, teamId = 0) => {
|
|||
),
|
||||
isAnyTeamAdmin: permissions.isAnyTeamAdmin(user),
|
||||
isTeamMaintainer: permissions.isTeamMaintainer(user, teamId),
|
||||
isTeamAdmin: permissions.isTeamAdmin(user, teamId),
|
||||
isOnlyObserver: permissions.isOnlyObserver(user),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -322,7 +322,11 @@ const generateAvailableTableHeaders = (
|
|||
// In premium tier, we want to check user role to enable/disable select column
|
||||
!permissionUtils.isGlobalAdmin(currentUser) &&
|
||||
!permissionUtils.isGlobalMaintainer(currentUser) &&
|
||||
!permissionUtils.isTeamMaintainer(currentUser, currentTeam?.id || null)
|
||||
!permissionUtils.isTeamMaintainer(
|
||||
currentUser,
|
||||
currentTeam?.id || null
|
||||
) &&
|
||||
!permissionUtils.isTeamAdmin(currentUser, currentTeam?.id || null)
|
||||
) {
|
||||
if (currentColumn.id === "selection") {
|
||||
return columns;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useContext } from "react";
|
||||
import React, { useState, useContext, useEffect } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useQuery } from "react-query";
|
||||
import { InjectedRouter, Params } from "react-router/lib/Router";
|
||||
|
|
@ -900,41 +900,6 @@ const ManageHostsPage = ({
|
|||
}
|
||||
/>
|
||||
);
|
||||
// if (isPremiumTier && isLoadingTeams) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// if (!isPremiumTier) {
|
||||
// return <h1>Hosts</h1>;
|
||||
// }
|
||||
|
||||
// const teamOptions = generateTeamFilterDropdownOptions(
|
||||
// teams || [],
|
||||
// currentUser,
|
||||
// isOnGlobalTeam as boolean
|
||||
// );
|
||||
// const selectedTeamId = getValidatedTeamId(
|
||||
// teams || [],
|
||||
// (policyId && policy?.team_id) || (currentTeam?.id as number),
|
||||
// currentUser,
|
||||
// isOnGlobalTeam as boolean
|
||||
// );
|
||||
|
||||
// return (
|
||||
// <div>
|
||||
// <Dropdown
|
||||
// value={selectedTeamId}
|
||||
// placeholder={"All teams"}
|
||||
// className={`${baseClass}__team-dropdown`}
|
||||
// options={teamOptions}
|
||||
// searchable={false}
|
||||
// onChange={(newSelectedValue: number) =>
|
||||
// handleChangeSelectedTeamFilter(newSelectedValue)
|
||||
// }
|
||||
// />
|
||||
// </div>
|
||||
// );
|
||||
// };
|
||||
|
||||
const renderPoliciesFilterBlock = () => {
|
||||
const buttonText = (
|
||||
|
|
@ -1330,8 +1295,6 @@ const ManageHostsPage = ({
|
|||
);
|
||||
};
|
||||
|
||||
const selectedTeam = currentTeam?.id || 0;
|
||||
|
||||
return (
|
||||
<div className="has-sidebar">
|
||||
{renderForm()}
|
||||
|
|
|
|||
Loading…
Reference in a new issue