Merge pull request #7970 from Budibase/fix/multi-tenant-groups-ui

Fix issues with multi tenant app IDs in groups UI
This commit is contained in:
Andrew Kingston 2022-09-26 15:09:43 +01:00 committed by GitHub
commit db817d7e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -42,7 +42,7 @@
$: group = $groups.find(x => x._id === groupId)
$: filtered = $users.data
$: groupApps = $apps.filter(app =>
groups.actions.getGroupAppIds(group).includes(`app_${app.appId}`)
groups.actions.getGroupAppIds(group).includes(apps.getProdAppID(app.appId))
)
$: {
if (loaded && !group?._id) {
@ -70,7 +70,7 @@
}
const getRoleLabel = appId => {
const roleId = group?.roles?.[`app_${appId}`]
const roleId = group?.roles?.[apps.getProdAppID(appId)]
const role = $roles.find(x => x._id === roleId)
return role?.name || "Custom role"
}
@ -197,7 +197,7 @@
<StatusLight
square
color={RoleUtils.getRoleColour(
group.roles[`app_${app.appId}`]
group.roles[apps.getProdAppID(app.appId)]
)}
>
{getRoleLabel(app.appId)}

View File

@ -39,7 +39,6 @@
$: fixedAppId = apps.getProdAppID(app.devId)
$: availableUsers = getAvailableUsers($usersFetch.rows, appUsers, data)
$: availableGroups = getAvailableGroups($groups, app.appId, search, data)
$: console.log(availableGroups)
$: valid = data?.length && !data?.some(x => !x.id?.length || !x.role?.length)
$: optionSections = {
...($licensing.groupsEnabled &&
@ -115,7 +114,7 @@
return (allGroups || []).filter(group => {
// Filter out assigned groups
const appIds = groups.actions.getGroupAppIds(group)
if (appIds.includes(`app_${appId}`)) {
if (appIds.includes(apps.getProdAppID(appId))) {
return false
}