add developer label back and improve invite flow
This commit is contained in:
parent
6d3a7727eb
commit
c16fd53b0a
|
@ -120,7 +120,7 @@
|
|||
await usersFetch.refresh()
|
||||
|
||||
filteredUsers = $usersFetch.rows
|
||||
.filter(user => !user?.admin?.global) // filter out global admins
|
||||
.filter(user => user.email !== $auth.user.email)
|
||||
.map(user => {
|
||||
const isAdminOrGlobalBuilder = sdk.users.isAdminOrGlobalBuilder(
|
||||
user,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
admin: "Full access",
|
||||
}
|
||||
|
||||
$: role = Constants.BudibaseRoleOptions.find(
|
||||
$: role = Constants.BudibaseRoleOptionsOld.find(
|
||||
x => x.value === users.getUserRole(row)
|
||||
)
|
||||
$: value = role?.label || "Not available"
|
||||
|
|
|
@ -121,8 +121,11 @@ export function createUsersStore() {
|
|||
}
|
||||
|
||||
const getUserRole = user =>
|
||||
sdk.users.isAdminOrGlobalBuilder(user) ? "admin" : "appUser"
|
||||
|
||||
sdk.users.isAdmin(user)
|
||||
? "admin"
|
||||
: sdk.users.isBuilder(user)
|
||||
? "developer"
|
||||
: "appUser"
|
||||
const refreshUsage =
|
||||
fn =>
|
||||
async (...args) => {
|
||||
|
|
|
@ -23,6 +23,11 @@ export const BudibaseRoles = {
|
|||
Admin: "admin",
|
||||
}
|
||||
|
||||
export const BudibaseRoleOptionsOld = [
|
||||
{ label: "Developer", value: BudibaseRoles.Developer },
|
||||
{ label: "Member", value: BudibaseRoles.AppUser },
|
||||
{ label: "Admin", value: BudibaseRoles.Admin },
|
||||
]
|
||||
export const BudibaseRoleOptions = [
|
||||
{ label: "Member", value: BudibaseRoles.AppUser },
|
||||
{ label: "Admin", value: BudibaseRoles.Admin },
|
||||
|
|
|
@ -403,15 +403,15 @@ export const inviteAccept = async (
|
|||
lastName,
|
||||
password,
|
||||
email,
|
||||
admin: { global: info.admin.global || false },
|
||||
admin: { global: info?.admin?.global || false },
|
||||
roles: info.apps,
|
||||
tenantId: info.tenantId,
|
||||
}
|
||||
let builder: { global: boolean; apps?: string[] } = {
|
||||
global: info.builder.global || false,
|
||||
global: info?.builder?.global || false,
|
||||
}
|
||||
|
||||
if (info.builder.apps) {
|
||||
if (info?.builder?.apps) {
|
||||
builder.apps = info.builder.apps
|
||||
request.builder = builder
|
||||
delete info.builder.apps
|
||||
|
|
Loading…
Reference in New Issue