mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Manage Users Page: Fix teams header to render on refresh (#1687)
* Fix teams header to render on refresh
This commit is contained in:
parent
3c9d7fd4bb
commit
93ace41f2b
2 changed files with 15 additions and 11 deletions
|
|
@ -83,17 +83,13 @@ export class UserManagementPage extends Component {
|
|||
userEditing: null,
|
||||
usersEditing: [],
|
||||
};
|
||||
|
||||
const { isBasicTier } = props;
|
||||
|
||||
// done as an instance variable as these headers will not change, so dont
|
||||
// want to recalculate on re-renders.
|
||||
this.tableHeaders = generateTableHeaders(this.onActionSelect, isBasicTier);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(teamActions.loadAll({}));
|
||||
const { dispatch, isBasicTier } = this.props;
|
||||
if (isBasicTier) {
|
||||
dispatch(teamActions.loadAll({}));
|
||||
}
|
||||
}
|
||||
|
||||
onEditUser = (formData) => {
|
||||
|
|
@ -544,7 +540,6 @@ export class UserManagementPage extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
tableHeaders,
|
||||
renderCreateUserModal,
|
||||
renderEditUserModal,
|
||||
renderDeleteUserModal,
|
||||
|
|
@ -554,7 +549,16 @@ export class UserManagementPage extends Component {
|
|||
onTableQueryChange,
|
||||
onActionSelect,
|
||||
} = this;
|
||||
const { loadingTableData, users, invites, currentUser } = this.props;
|
||||
|
||||
const {
|
||||
loadingTableData,
|
||||
users,
|
||||
invites,
|
||||
currentUser,
|
||||
isBasicTier,
|
||||
} = this.props;
|
||||
|
||||
const tableHeaders = generateTableHeaders(onActionSelect, isBasicTier);
|
||||
|
||||
let tableData = [];
|
||||
if (!loadingTableData) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ interface IUserTableData {
|
|||
// more info here https://react-table.tanstack.com/docs/api/useTable#cell-properties
|
||||
const generateTableHeaders = (
|
||||
actionSelectHandler: (value: string, user: IUser | IInvite) => void,
|
||||
isBasicTier = false
|
||||
isBasicTier: boolean
|
||||
): IDataColumn[] => {
|
||||
const tableHeaders: IDataColumn[] = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue