Merge pull request #14911 from Budibase/2.33.4-uno-revert-4

Revert to state from 2.33.4.
This commit is contained in:
Adria Navarro 2024-10-29 18:01:56 +01:00 committed by GitHub
commit 4c977942f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 29 additions and 51 deletions

View File

@ -3,7 +3,7 @@ name: Deploy QA
on: on:
push: push:
branches: branches:
- feature/automation-branching-ux - v3-ui
workflow_dispatch: workflow_dispatch:
jobs: jobs:

View File

@ -22,7 +22,7 @@ RUN ./scripts/removeWorkspaceDependencies.sh packages/worker/package.json
RUN jq 'del(.scripts.postinstall)' package.json > temp.json && mv temp.json package.json RUN jq 'del(.scripts.postinstall)' package.json > temp.json && mv temp.json package.json
RUN ./scripts/removeWorkspaceDependencies.sh package.json RUN ./scripts/removeWorkspaceDependencies.sh package.json
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production --frozen-lockfile --network-concurrency 1 RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production --frozen-lockfile
# copy the actual code # copy the actual code
COPY packages/server/dist packages/server/dist COPY packages/server/dist packages/server/dist

View File

@ -22,4 +22,4 @@
"loadEnvFiles": false "loadEnvFiles": false
} }
} }
} }

View File

@ -219,10 +219,7 @@ export function getBuiltinRole(roleId: string): Role | undefined {
export function builtinRoleToNumber(id: string) { export function builtinRoleToNumber(id: string) {
const builtins = getBuiltinRoles() const builtins = getBuiltinRoles()
const MAX = Object.values(builtins).length + 1 const MAX = Object.values(builtins).length + 1
if ( if (id === BUILTIN_IDS.ADMIN || id === BUILTIN_IDS.BUILDER) {
compareRoleIds(id, BUILTIN_IDS.ADMIN) ||
compareRoleIds(id, BUILTIN_IDS.BUILDER)
) {
return MAX return MAX
} }
let role = builtins[id], let role = builtins[id],
@ -259,9 +256,7 @@ export async function roleToNumber(id: string) {
// find the built-in roles, get their number, sort it, then get the last one // find the built-in roles, get their number, sort it, then get the last one
const highestBuiltin: number | undefined = role.inherits const highestBuiltin: number | undefined = role.inherits
.map(roleId => { .map(roleId => {
const foundRole = hierarchy.find(role => const foundRole = hierarchy.find(role => role._id === roleId)
compareRoleIds(role._id!, roleId)
)
if (foundRole) { if (foundRole) {
return findNumber(foundRole) + 1 return findNumber(foundRole) + 1
} }
@ -385,7 +380,7 @@ async function getAllUserRoles(
): Promise<RoleDoc[]> { ): Promise<RoleDoc[]> {
const allRoles = await getAllRoles() const allRoles = await getAllRoles()
// admins have access to all roles // admins have access to all roles
if (compareRoleIds(userRoleId, BUILTIN_IDS.ADMIN)) { if (userRoleId === BUILTIN_IDS.ADMIN) {
return allRoles return allRoles
} }
@ -496,21 +491,17 @@ export async function getAllRoles(appId?: string): Promise<RoleDoc[]> {
// need to combine builtin with any DB record of them (for sake of permissions) // need to combine builtin with any DB record of them (for sake of permissions)
for (let builtinRoleId of externalBuiltinRoles) { for (let builtinRoleId of externalBuiltinRoles) {
const builtinRole = builtinRoles[builtinRoleId] const builtinRole = builtinRoles[builtinRoleId]
const dbBuiltin = roles.filter(dbRole => const dbBuiltin = roles.filter(
compareRoleIds(dbRole._id!, builtinRoleId) dbRole =>
getExternalRoleID(dbRole._id!, dbRole.version) === builtinRoleId
)[0] )[0]
if (dbBuiltin == null) { if (dbBuiltin == null) {
roles.push(builtinRole || builtinRoles.BASIC) roles.push(builtinRole || builtinRoles.BASIC)
} else { } else {
// remove role and all back after combining with the builtin // remove role and all back after combining with the builtin
roles = roles.filter(role => role._id !== dbBuiltin._id) roles = roles.filter(role => role._id !== dbBuiltin._id)
dbBuiltin._id = getExternalRoleID(builtinRole._id!, dbBuiltin.version) dbBuiltin._id = getExternalRoleID(dbBuiltin._id!, dbBuiltin.version)
roles.push({ roles.push(Object.assign(builtinRole, dbBuiltin))
...builtinRole,
...dbBuiltin,
name: builtinRole.name,
_id: getExternalRoleID(builtinRole._id!, builtinRole.version),
})
} }
} }
// check permissions // check permissions
@ -553,9 +544,9 @@ export class AccessController {
if ( if (
tryingRoleId == null || tryingRoleId == null ||
tryingRoleId === "" || tryingRoleId === "" ||
compareRoleIds(tryingRoleId, BUILTIN_IDS.BUILDER) || tryingRoleId === userRoleId ||
compareRoleIds(userRoleId!, tryingRoleId) || tryingRoleId === BUILTIN_IDS.BUILDER ||
compareRoleIds(userRoleId!, BUILTIN_IDS.BUILDER) userRoleId === BUILTIN_IDS.BUILDER
) { ) {
return true return true
} }

View File

@ -38,10 +38,6 @@
let loaded = false let loaded = false
$: app = $appsStore.apps.find(app => $appStore.appId?.includes(app.appId)) $: app = $appsStore.apps.find(app => $appStore.appId?.includes(app.appId))
$: licensePlan = $auth.user?.license?.plan $: licensePlan = $auth.user?.license?.plan
// Reset the page every time that a filter gets updated
$: pageInfo.reset(), automationId, status, timeRange
$: page = $pageInfo.page $: page = $pageInfo.page
$: fetchLogs(automationId, status, page, timeRange) $: fetchLogs(automationId, status, page, timeRange)
$: isCloud = $admin.cloud $: isCloud = $admin.cloud

View File

@ -71,6 +71,7 @@
] ]
let userData = [] let userData = []
let invitesLoaded = false let invitesLoaded = false
let tenantOwnerLoaded = false
let pendingInvites = [] let pendingInvites = []
let parsedInvites = [] let parsedInvites = []
@ -99,9 +100,13 @@
$: pendingSchema = getPendingSchema(schema) $: pendingSchema = getPendingSchema(schema)
$: userData = [] $: userData = []
$: inviteUsersResponse = { successful: [], unsuccessful: [] } $: inviteUsersResponse = { successful: [], unsuccessful: [] }
$: setEnrichedUsers($fetch.rows, tenantOwner) $: setEnrichedUsers($fetch.rows, tenantOwnerLoaded)
const setEnrichedUsers = async (rows, owner) => { const setEnrichedUsers = async rows => {
if (!tenantOwnerLoaded) {
enrichedUsers = []
return
}
enrichedUsers = rows?.map(user => { enrichedUsers = rows?.map(user => {
let userGroups = [] let userGroups = []
$groups.forEach(group => { $groups.forEach(group => {
@ -113,9 +118,7 @@
}) })
} }
}) })
if (owner) { user.tenantOwnerEmail = tenantOwner?.email
user.tenantOwnerEmail = owner.email
}
const role = Constants.ExtendedBudibaseRoleOptions.find( const role = Constants.ExtendedBudibaseRoleOptions.find(
x => x.value === users.getUserRole(user) x => x.value === users.getUserRole(user)
) )
@ -319,21 +322,12 @@
try { try {
await groups.actions.init() await groups.actions.init()
groupsLoaded = true groupsLoaded = true
} catch (error) {
notifications.error("Error fetching user group data")
}
try {
pendingInvites = await users.getInvites() pendingInvites = await users.getInvites()
invitesLoaded = true invitesLoaded = true
} catch (err) {
notifications.error("Error fetching user invitations")
}
try {
tenantOwner = await users.getAccountHolder() tenantOwner = await users.getAccountHolder()
} catch (err) { tenantOwnerLoaded = true
if (err.status !== 404) { } catch (error) {
notifications.error("Error fetching account holder") notifications.error("Error fetching user group data")
}
} }
}) })
</script> </script>

View File

@ -113,10 +113,7 @@
$: debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) $: debouncedFetchRows(searchTerm, primaryDisplay, defaultValue)
const forceFetchRows = async () => { const forceFetchRows = async () => {
// if the filter has changed, then we need to reset the options, clear the selection, and re-fetch
optionsObj = {}
fieldApi?.setValue([]) fieldApi?.setValue([])
selectedValue = []
debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) debouncedFetchRows(searchTerm, primaryDisplay, defaultValue)
} }
const fetchRows = async (searchTerm, primaryDisplay, defaultVal) => { const fetchRows = async (searchTerm, primaryDisplay, defaultVal) => {

View File

@ -32,7 +32,7 @@ export default class UserFetch extends DataFetch {
const { cursor, query } = get(this.store) const { cursor, query } = get(this.store)
let finalQuery let finalQuery
// convert old format to new one - we now allow use of the lucene format // convert old format to new one - we now allow use of the lucene format
const { appId, paginated, ...rest } = query || {} const { appId, paginated, ...rest } = query
if (!QueryUtils.hasFilters(query) && rest.email != null) { if (!QueryUtils.hasFilters(query) && rest.email != null) {
finalQuery = { string: { email: rest.email } } finalQuery = { string: { email: rest.email } }
} else { } else {

@ -1 +1 @@
Subproject commit 2ab8536b6005576684810d774f1ac22239218546 Subproject commit f6aebba94451ce47bba551926e5ad72bd75f71c6

View File

@ -41,7 +41,7 @@ RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
RUN ./scripts/removeWorkspaceDependencies.sh package.json RUN ./scripts/removeWorkspaceDependencies.sh package.json
# Install yarn packages with caching # Install yarn packages with caching
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000 --network-concurrency 1 \ RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000 \
&& yarn cache clean \ && yarn cache clean \
&& apk del g++ make python3 jq \ && apk del g++ make python3 jq \
&& rm -rf /tmp/* /root/.node-gyp /usr/local/lib/node_modules/npm/node_modules/node-gyp && rm -rf /tmp/* /root/.node-gyp /usr/local/lib/node_modules/npm/node_modules/node-gyp

View File

@ -24,7 +24,7 @@ COPY packages/worker/dist/yarn.lock .
RUN ../scripts/removeWorkspaceDependencies.sh package.json RUN ../scripts/removeWorkspaceDependencies.sh package.json
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000 --network-concurrency 1 RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
# Remove unneeded data from file system to reduce image size # Remove unneeded data from file system to reduce image size
RUN apk del .gyp \ RUN apk del .gyp \
&& yarn cache clean && yarn cache clean