Merge branch 'master' of github.com:Budibase/budibase into remove-airtable-from-data-source-ui

This commit is contained in:
mike12345567 2024-02-22 16:54:20 +00:00
commit 2f6df51e2c
6 changed files with 37 additions and 6 deletions

View File

@ -1,12 +1,12 @@
import Joi, { ObjectSchema } from "joi"
import { BBContext } from "@budibase/types"
import Joi from "joi"
import { Ctx } from "@budibase/types"
function validate(
schema: Joi.ObjectSchema | Joi.ArraySchema,
property: string
) {
// Return a Koa middleware function
return (ctx: BBContext, next: any) => {
return (ctx: Ctx, next: any) => {
if (!schema) {
return next()
}
@ -30,7 +30,6 @@ function validate(
const { error } = schema.validate(params)
if (error) {
ctx.throw(400, `Invalid ${property} - ${error.message}`)
return
}
return next()
}

View File

@ -58,7 +58,7 @@ export const useCloudFree = () => {
// FEATURES
const useFeature = (feature: Feature) => {
const license = cloneDeep(UNLIMITED_LICENSE)
const license = cloneDeep(getCachedLicense() || UNLIMITED_LICENSE)
const opts: UseLicenseOpts = {
features: [feature],
}

@ -1 +1 @@
Subproject commit 60e47a8249fd6291a6bc20fe3fe6776b11938fa1
Subproject commit 183b35d3acd42433dcb2d32bcd89a36abe13afec

View File

@ -654,6 +654,26 @@ describe("scim", () => {
totalResults: groupCount,
})
})
it("can fetch groups even if internal groups exist", async () => {
mocks.licenses.useGroups()
await config.api.groups.saveGroup(structures.userGroups.userGroup())
await config.api.groups.saveGroup(structures.userGroups.userGroup())
const response = await getScimGroups()
expect(response).toEqual({
Resources: expect.arrayContaining(groups),
itemsPerPage: 25,
schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
startIndex: 1,
totalResults: groupCount,
})
expect((await config.api.groups.fetch()).body.data).toHaveLength(
25 + 2 // scim groups + internal groups
)
})
})
})

View File

@ -53,4 +53,12 @@ export class GroupsAPI extends TestAPI {
.expect("Content-Type", /json/)
.expect(200)
}
fetch = ({ expect } = { expect: 200 }) => {
return this.request
.get(`/api/global/groups`)
.set(this.config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(expect)
}
}

View File

@ -10,3 +10,7 @@ _Describe the problem or feature in addition to a link to the relevant github is
## Screenshots
_If a UI facing feature, a short video of the happy path, and some screenshots of the new functionality._
## Launchcontrol
_Add a small description in layman's terms of what this PR achieves. This will be used in the release notes._