From be99a6fc2ada6401f5e1d258870ca64a1ea6b669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Storl=C3=B8kken=20Melseth?= Date: Thu, 21 Sep 2023 16:53:01 +0200 Subject: [PATCH] fix: lock ALL --- src/components/AppDetails/Versions.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/AppDetails/Versions.js b/src/components/AppDetails/Versions.js index 78f5065..1a35357 100644 --- a/src/components/AppDetails/Versions.js +++ b/src/components/AppDetails/Versions.js @@ -150,6 +150,7 @@ const VersionsTable = ({ version={version.version} onSelect={setUserGroupVersionMap} versionActiveForUserGroup={versionActiveForUserGroup} + isInstalled={version.version === installedVersion} /> @@ -285,7 +286,7 @@ Versions.propTypes = { installedVersion: PropTypes.string, } -const UserGroupSelector = ({ userGroups, version, onSelect, versionActiveForUserGroup }) => { +const UserGroupSelector = ({ userGroups, version, onSelect, versionActiveForUserGroup, isInstalled }) => { const [userGroup, setUserGroup] = useState('all') const onChange = ({ selected }) => { @@ -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 ( - +