Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/hooks/useTeamIdParam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ export const useTeamIdParam = ({
currentTeamName: currentTeam?.name,
currentTeamSummary: currentTeam,
isAnyTeamSelected: isAnyTeamSelected(currentTeam?.id),
isAllTeamsSelected:
!isAnyTeamSelected(currentTeam?.id) && currentTeam?.id !== 0,
isRouteOk,
isTeamAdmin:
!!currentTeam?.id && permissions.isTeamAdmin(currentUser, currentTeam.id),
Expand Down
6 changes: 3 additions & 3 deletions frontend/pages/SoftwarePage/SoftwarePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => {

const {
currentTeamId,
isAnyTeamSelected,
isAllTeamsSelected,
isRouteOk,
teamIdForApi,
userTeams,
Expand Down Expand Up @@ -318,7 +318,7 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => {

const renderPageActions = () => {
const canManageAutomations =
isGlobalAdmin && (!isPremiumTier || !isAnyTeamSelected);
isGlobalAdmin && (!isPremiumTier || isAllTeamsSelected);

const canAddSoftware =
isGlobalAdmin || isGlobalMaintainer || isTeamAdmin || isTeamMaintainer;
Expand Down Expand Up @@ -349,7 +349,7 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => {
return (
<p>
Manage software and search for installed software, OS and
vulnerabilities {isAnyTeamSelected ? "on this team" : "for all hosts"}.
vulnerabilities {isAllTeamsSelected ? "for all hosts" : "on this team"}.
</p>
);
};
Expand Down