From 774bc4ef933a8ffc0320341bd2cb2af3b81a9f0a Mon Sep 17 00:00:00 2001 From: Zach Wasserman Date: Wed, 16 Jun 2021 11:57:47 -0700 Subject: [PATCH] Fix loading of enroll secrets for Teams (#1113) Trigger logic based on presence of Basic tier, rather than absence of Core tier. Fixes #1100 --- .../hosts/ManageHostsPage/ManageHostsPage.jsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx index b38ebd7c60..a941989813 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx @@ -70,7 +70,7 @@ export class ManageHostsPage extends PureComponent { canAddNewLabels: PropTypes.bool, teams: PropTypes.arrayOf(teamInterface), isGlobalAdmin: PropTypes.bool, - isCoreTier: PropTypes.bool, + isBasicTier: PropTypes.bool, currentUser: userInterface, }; @@ -109,8 +109,12 @@ export class ManageHostsPage extends PureComponent { } componentDidUpdate(prevProps) { - const { dispatch, isCoreTier, canAddNewHosts } = this.props; - if (isCoreTier !== prevProps.isCoreTier && !isCoreTier && canAddNewHosts) { + const { dispatch, isBasicTier, canAddNewHosts } = this.props; + if ( + isBasicTier !== prevProps.isBasicTier && + isBasicTier && + canAddNewHosts + ) { dispatch(teamActions.loadAll({})); } } @@ -690,7 +694,7 @@ const mapStateToProps = (state, { location, params }) => { permissionUtils.isGlobalAdmin(currentUser) || permissionUtils.isGlobalMaintainer(currentUser); const isGlobalAdmin = permissionUtils.isGlobalAdmin(currentUser); - const isCoreTier = permissionUtils.isCoreTier(config); + const isBasicTier = permissionUtils.isBasicTier(config); const teams = memoizedGetEntity(state.entities.teams.data); return { @@ -711,7 +715,7 @@ const mapStateToProps = (state, { location, params }) => { canAddNewHosts, canAddNewLabels, isGlobalAdmin, - isCoreTier, + isBasicTier, teams, }; };