Hide enroll secret for team observer; align button (#1935)

This commit is contained in:
gillespi314 2021-09-07 10:55:55 -05:00 committed by GitHub
parent 99e9e846f4
commit a64023a5af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -1381,7 +1381,7 @@ const mapStateToProps = (state, ownProps) => {
const teams = memoizedGetEntity(state.entities.teams.data);
// If there is no team_id, set selectedTeam to 0 so dropdown defaults to "All teams"
const selectedTeam = location.query?.team_id || 0;
const selectedTeam = parseInt(location.query?.team_id, 10) || 0;
const currentUser = state.auth.user;
const canAddNewHosts =
@ -1391,7 +1391,8 @@ const mapStateToProps = (state, ownProps) => {
const canEnrollHosts =
permissionUtils.isGlobalAdmin(currentUser) ||
permissionUtils.isGlobalMaintainer(currentUser) ||
(permissionUtils.isAnyTeamMaintainer(currentUser) && selectedTeam !== 0);
(selectedTeam !== 0 &&
permissionUtils.isTeamMaintainer(currentUser, selectedTeam));
const canAddNewLabels =
permissionUtils.isGlobalAdmin(currentUser) ||
permissionUtils.isGlobalMaintainer(currentUser);

View file

@ -6,6 +6,8 @@
margin-bottom: $pad-medium;
.button-wrap {
display: flex;
justify-content: flex-end;
min-width: 266px;
}
}