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:
commit
424469aa6f
|
@ -42,7 +42,7 @@
|
||||||
$: group = $groups.find(x => x._id === groupId)
|
$: group = $groups.find(x => x._id === groupId)
|
||||||
$: filtered = $users.data
|
$: filtered = $users.data
|
||||||
$: groupApps = $apps.filter(app =>
|
$: 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) {
|
if (loaded && !group?._id) {
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRoleLabel = appId => {
|
const getRoleLabel = appId => {
|
||||||
const roleId = group?.roles?.[`app_${appId}`]
|
const roleId = group?.roles?.[apps.getProdAppID(appId)]
|
||||||
const role = $roles.find(x => x._id === roleId)
|
const role = $roles.find(x => x._id === roleId)
|
||||||
return role?.name || "Custom role"
|
return role?.name || "Custom role"
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@
|
||||||
<StatusLight
|
<StatusLight
|
||||||
square
|
square
|
||||||
color={RoleUtils.getRoleColour(
|
color={RoleUtils.getRoleColour(
|
||||||
group.roles[`app_${app.appId}`]
|
group.roles[apps.getProdAppID(app.appId)]
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{getRoleLabel(app.appId)}
|
{getRoleLabel(app.appId)}
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
$: fixedAppId = apps.getProdAppID(app.devId)
|
$: fixedAppId = apps.getProdAppID(app.devId)
|
||||||
$: availableUsers = getAvailableUsers($usersFetch.rows, appUsers, data)
|
$: availableUsers = getAvailableUsers($usersFetch.rows, appUsers, data)
|
||||||
$: availableGroups = getAvailableGroups($groups, app.appId, search, data)
|
$: availableGroups = getAvailableGroups($groups, app.appId, search, data)
|
||||||
$: console.log(availableGroups)
|
|
||||||
$: valid = data?.length && !data?.some(x => !x.id?.length || !x.role?.length)
|
$: valid = data?.length && !data?.some(x => !x.id?.length || !x.role?.length)
|
||||||
$: optionSections = {
|
$: optionSections = {
|
||||||
...($licensing.groupsEnabled &&
|
...($licensing.groupsEnabled &&
|
||||||
|
@ -115,7 +114,7 @@
|
||||||
return (allGroups || []).filter(group => {
|
return (allGroups || []).filter(group => {
|
||||||
// Filter out assigned groups
|
// Filter out assigned groups
|
||||||
const appIds = groups.actions.getGroupAppIds(group)
|
const appIds = groups.actions.getGroupAppIds(group)
|
||||||
if (appIds.includes(`app_${appId}`)) {
|
if (appIds.includes(apps.getProdAppID(appId))) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue