Fixing issue with multi-tenancy and groups UI - apps with multi-tenancy enabled did not appear correctly and could not be added.
This commit is contained in:
parent
61952f15af
commit
d60c5fd806
|
@ -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(apps.getProdAppID(app.appId))
|
groups.actions.getGroupAppIds(group).includes(apps.getProdAppID(app.devId))
|
||||||
)
|
)
|
||||||
$: {
|
$: {
|
||||||
if (loaded && !group?._id) {
|
if (loaded && !group?._id) {
|
||||||
|
@ -204,17 +204,17 @@
|
||||||
<StatusLight
|
<StatusLight
|
||||||
square
|
square
|
||||||
color={RoleUtils.getRoleColour(
|
color={RoleUtils.getRoleColour(
|
||||||
group.roles[apps.getProdAppID(app.appId)]
|
group.roles[apps.getProdAppID(app.devId)]
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{getRoleLabel(app.appId)}
|
{getRoleLabel(app.devId)}
|
||||||
</StatusLight>
|
</StatusLight>
|
||||||
</div>
|
</div>
|
||||||
<Icon
|
<Icon
|
||||||
on:click={e => {
|
on:click={e => {
|
||||||
groups.actions.removeApp(
|
groups.actions.removeApp(
|
||||||
groupId,
|
groupId,
|
||||||
apps.getProdAppID(app.appId)
|
apps.getProdAppID(app.devId)
|
||||||
)
|
)
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
label: app.name,
|
label: app.name,
|
||||||
value: app,
|
value: app,
|
||||||
}))
|
}))
|
||||||
$: prodAppId = selectedApp ? apps.getProdAppID(selectedApp.appId) : ""
|
|
||||||
$: confirmDisabled =
|
$: confirmDisabled =
|
||||||
(!selectingRole && !selectedApp) || (selectingRole && !selectedRoleId)
|
(!selectingRole && !selectedApp) || (selectingRole && !selectedRoleId)
|
||||||
let selectedApp, selectedRoleId
|
let selectedApp, selectedRoleId
|
||||||
let selectingRole = false
|
let selectingRole = false
|
||||||
|
|
||||||
async function appSelected() {
|
async function appSelected() {
|
||||||
|
const prodAppId = apps.getProdAppID(selectedApp.devId)
|
||||||
if (!selectingRole) {
|
if (!selectingRole) {
|
||||||
selectingRole = true
|
selectingRole = true
|
||||||
await roles.fetchByAppId(prodAppId)
|
await roles.fetchByAppId(prodAppId)
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
icon: "UserGroup",
|
icon: "UserGroup",
|
||||||
color: "var(--spectrum-global-color-blue-600)",
|
color: "var(--spectrum-global-color-blue-600)",
|
||||||
users: [],
|
users: [],
|
||||||
apps: [],
|
|
||||||
roles: {},
|
roles: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ const getProdAppID = appId => {
|
||||||
} else if (!appId.startsWith("app")) {
|
} else if (!appId.startsWith("app")) {
|
||||||
rest = appId
|
rest = appId
|
||||||
separator = "_"
|
separator = "_"
|
||||||
|
} else {
|
||||||
|
return appId
|
||||||
}
|
}
|
||||||
return `app${separator}${rest}`
|
return `app${separator}${rest}`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue