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