Remove single user restriction and notify users if they are the primary builder or not
This commit is contained in:
parent
2f96b797a0
commit
7f96fbf741
|
@ -15,12 +15,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const goToBuilder = () => {
|
const goToBuilder = () => {
|
||||||
if (app.lockedOther) {
|
|
||||||
notifications.error(
|
|
||||||
`App locked by ${app.lockedBy.email}. Please allow lock to expire or have them unlock this app.`
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
$goto(`../../app/${app.devId}`)
|
$goto(`../../app/${app.devId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,13 +80,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const editApp = () => {
|
const editApp = () => {
|
||||||
if (appLocked && !lockedByYou) {
|
|
||||||
const identifier = app?.lockedBy?.firstName || app?.lockedBy?.email
|
|
||||||
notifications.warning(
|
|
||||||
`App locked by ${identifier}. Please allow lock to expire or have them unlock this app.`
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
$goto(`../../../app/${app.devId}`)
|
$goto(`../../../app/${app.devId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { USERS_TABLE_SCHEMA } from "../../constants"
|
||||||
import { buildDefaultDocs } from "../../db/defaultData/datasource_bb_default"
|
import { buildDefaultDocs } from "../../db/defaultData/datasource_bb_default"
|
||||||
import { removeAppFromUserRoles } from "../../utilities/workerRequests"
|
import { removeAppFromUserRoles } from "../../utilities/workerRequests"
|
||||||
import { stringToReadStream, isQsTrue } from "../../utilities"
|
import { stringToReadStream, isQsTrue } from "../../utilities"
|
||||||
import { getLocksById } from "../../utilities/redis"
|
import { getLocksById, doesUserHaveLock } from "../../utilities/redis"
|
||||||
import {
|
import {
|
||||||
updateClientLibrary,
|
updateClientLibrary,
|
||||||
backupClientLibrary,
|
backupClientLibrary,
|
||||||
|
@ -227,6 +227,7 @@ export async function fetchAppPackage(ctx: UserCtx) {
|
||||||
screens,
|
screens,
|
||||||
layouts,
|
layouts,
|
||||||
clientLibPath,
|
clientLibPath,
|
||||||
|
hasLock: await doesUserHaveLock(application.appId, ctx.user),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,12 +35,11 @@ async function checkDevAppLocks(ctx: BBContext) {
|
||||||
if (!appId || !appId.startsWith(APP_DEV_PREFIX)) {
|
if (!appId || !appId.startsWith(APP_DEV_PREFIX)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!(await doesUserHaveLock(appId, ctx.user))) {
|
|
||||||
ctx.throw(400, "User does not hold app lock.")
|
|
||||||
}
|
|
||||||
|
|
||||||
// they do have lock, update it
|
// If this user already owns the lock, then update it
|
||||||
await updateLock(appId, ctx.user)
|
if (await doesUserHaveLock(appId, ctx.user)) {
|
||||||
|
await updateLock(appId, ctx.user)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateAppUpdatedAt(ctx: BBContext) {
|
async function updateAppUpdatedAt(ctx: BBContext) {
|
||||||
|
|
Loading…
Reference in New Issue