Fixing display of user role in apps in the user management page.
This commit is contained in:
parent
587117064c
commit
41b8a6d55a
|
@ -68,11 +68,13 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return availableApps.map(app => {
|
return availableApps.map(app => {
|
||||||
|
const prodAppId = apps.getProdAppID(app.appId)
|
||||||
|
console.log(prodAppId)
|
||||||
return {
|
return {
|
||||||
name: app.name,
|
name: app.name,
|
||||||
devId: app.devId,
|
devId: app.devId,
|
||||||
icon: app.icon,
|
icon: app.icon,
|
||||||
role: privileged ? Constants.Roles.ADMIN : roles[app.appId],
|
role: privileged ? Constants.Roles.ADMIN : roles[prodAppId],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,21 @@ const extractAppId = id => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getProdAppID = appId => {
|
const getProdAppID = appId => {
|
||||||
if (!appId || !appId.startsWith("app_dev")) {
|
if (!appId) {
|
||||||
return appId
|
return appId
|
||||||
}
|
}
|
||||||
// split to take off the app_dev element, then join it together incase any other app_ exist
|
let rest,
|
||||||
const split = appId.split("app_dev")
|
separator = ""
|
||||||
split.shift()
|
if (appId.startsWith("app_dev")) {
|
||||||
const rest = split.join("app_dev")
|
// split to take off the app_dev element, then join it together incase any other app_ exist
|
||||||
return `${"app"}${rest}`
|
const split = appId.split("app_dev")
|
||||||
|
split.shift()
|
||||||
|
rest = split.join("app_dev")
|
||||||
|
} else if (!appId.startsWith("app")) {
|
||||||
|
rest = appId
|
||||||
|
separator = "_"
|
||||||
|
}
|
||||||
|
return `app${separator}${rest}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createAppStore() {
|
export function createAppStore() {
|
||||||
|
|
Loading…
Reference in New Issue