Skip to content

Commit

Permalink
fix: lock ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSM committed Sep 21, 2023
1 parent c52c5a3 commit be99a6f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/AppDetails/Versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const VersionsTable = ({
version={version.version}
onSelect={setUserGroupVersionMap}
versionActiveForUserGroup={versionActiveForUserGroup}
isInstalled={version.version === installedVersion}
/>
</TableCell>
<TableCell>
Expand Down Expand Up @@ -285,7 +286,7 @@ Versions.propTypes = {
installedVersion: PropTypes.string,
}

const UserGroupSelector = ({ userGroups, version, onSelect, versionActiveForUserGroup }) => {
const UserGroupSelector = ({ userGroups, version, onSelect, versionActiveForUserGroup, isInstalled }) => {

Check failure on line 289 in src/components/AppDetails/Versions.js

View workflow job for this annotation

GitHub Actions / lint

'isInstalled' is missing in props validation
const [userGroup, setUserGroup] = useState('all')

const onChange = ({ selected }) => {
Expand All @@ -294,11 +295,12 @@ const UserGroupSelector = ({ userGroups, version, onSelect, versionActiveForUser
onSelect({ [selected]: version })
}

if (versionActiveForUserGroup) {
const { displayName, id } = userGroups.find(group => group.id === versionActiveForUserGroup);
if (versionActiveForUserGroup || isInstalled) {
const { displayName, id } = versionActiveForUserGroup ?
userGroups.find(group => group.id === versionActiveForUserGroup) : { displayName: 'All user groups', id: 'ALL' };

return (
<SingleSelect dense selected={versionActiveForUserGroup} disabled>
<SingleSelect dense selected={versionActiveForUserGroup || 'ALL'} disabled>
<SingleSelectOption
dense
label={displayName}
Expand Down

0 comments on commit be99a6f

Please sign in to comment.