diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 4c5cc94d2b..4b9ebf1e5d 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -108,7 +108,7 @@ jobs: - name: Pull testcontainers images run: | docker pull testcontainers/ryuk:0.5.1 & - docker pull budibase/couchdb:v3.3.3 & + docker pull budibase/couchdb:v3.3.3-sqs-v2.1.1 & docker pull redis & wait $(jobs -p) @@ -179,7 +179,7 @@ jobs: docker pull minio/minio & docker pull redis & docker pull testcontainers/ryuk:0.5.1 & - docker pull budibase/couchdb:v3.3.3 & + docker pull budibase/couchdb:v3.3.3-sqs-v2.1.1 & wait $(jobs -p) diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index dde912410c..2c1525bd90 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -641,7 +641,7 @@ couchdb: # @ignore repository: budibase/couchdb # @ignore - tag: v3.3.3 + tag: v3.3.3-sqs-v2.1.1 # @ignore pullPolicy: Always diff --git a/globalSetup.ts b/globalSetup.ts index aa1cb00fe1..5d8b0381c0 100644 --- a/globalSetup.ts +++ b/globalSetup.ts @@ -46,7 +46,7 @@ export default async function setup() { await killContainers(containers) try { - const couchdb = new GenericContainer("budibase/couchdb:v3.3.3") + const couchdb = new GenericContainer("budibase/couchdb:v3.3.3-sqs-v2.1.1") .withExposedPorts(5984, 4984) .withEnvironment({ COUCHDB_PASSWORD: "budibase", diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index dfcfe566bd..ded0bc17dc 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,4 +1,4 @@ -ARG BASEIMG=budibase/couchdb:v3.3.3 +ARG BASEIMG=budibase/couchdb:v3.3.3-sqs-v2.1.1 FROM node:20-slim as build # install node-gyp dependencies diff --git a/packages/backend-core/tests/core/utilities/mocks/licenses.ts b/packages/backend-core/tests/core/utilities/mocks/licenses.ts index 2d8e81d125..bc9a3b635c 100644 --- a/packages/backend-core/tests/core/utilities/mocks/licenses.ts +++ b/packages/backend-core/tests/core/utilities/mocks/licenses.ts @@ -102,10 +102,6 @@ export const useAppBuilders = () => { return useFeature(Feature.APP_BUILDERS) } -export const useViewReadonlyColumns = () => { - return useFeature(Feature.VIEW_READONLY_COLUMNS) -} - // QUOTAS export const setAutomationLogsQuota = (value: number) => { diff --git a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte index b56c5f6568..90e5e216f3 100644 --- a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte @@ -1,6 +1,6 @@
@@ -41,9 +35,5 @@
- + diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index f24ff0ae10..f2aeffb9f4 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -58,7 +58,6 @@ export let buttons = null export let darkMode export let isCloud = null - export let allowViewReadonlyColumns = false export let rowConditions = null // Unique identifier for DOM nodes inside this instance @@ -115,7 +114,6 @@ buttons, darkMode, isCloud, - allowViewReadonlyColumns, rowConditions, }) @@ -157,7 +155,7 @@
- +
diff --git a/packages/server/src/api/routes/tests/viewV2.spec.ts b/packages/server/src/api/routes/tests/viewV2.spec.ts index 9313e3ab4d..aaaf03c113 100644 --- a/packages/server/src/api/routes/tests/viewV2.spec.ts +++ b/packages/server/src/api/routes/tests/viewV2.spec.ts @@ -310,10 +310,6 @@ describe.each([ }) describe("readonly fields", () => { - beforeEach(() => { - mocks.licenses.useViewReadonlyColumns() - }) - it("readonly fields are persisted", async () => { const table = await config.api.table.save( saveTableRequest({ @@ -437,7 +433,7 @@ describe.each([ }) }) - it("readonly fields cannot be used on free license", async () => { + it("readonly fields can be used on free license", async () => { mocks.licenses.useCloudFree() const table = await config.api.table.save( saveTableRequest({ @@ -467,11 +463,7 @@ describe.each([ } await config.api.viewV2.create(newView, { - status: 400, - body: { - message: "Readonly fields are not enabled", - status: 400, - }, + status: 201, }) }) }) @@ -514,7 +506,6 @@ describe.each([ }) it("display fields can be readonly", async () => { - mocks.licenses.useViewReadonlyColumns() const table = await config.api.table.save( saveTableRequest({ schema: { @@ -589,7 +580,6 @@ describe.each([ }) it("can update all fields", async () => { - mocks.licenses.useViewReadonlyColumns() const tableId = table._id! const updatedData: Required = { @@ -803,71 +793,6 @@ describe.each([ ) }) - it("cannot update views with readonly on on free license", async () => { - mocks.licenses.useViewReadonlyColumns() - - view = await config.api.viewV2.update({ - ...view, - schema: { - id: { visible: true }, - Price: { - visible: true, - readonly: true, - }, - }, - }) - - mocks.licenses.useCloudFree() - await config.api.viewV2.update(view, { - status: 400, - body: { - message: "Readonly fields are not enabled", - }, - }) - }) - - it("can remove readonly config after license downgrade", async () => { - mocks.licenses.useViewReadonlyColumns() - - view = await config.api.viewV2.update({ - ...view, - schema: { - id: { visible: true }, - Price: { - visible: true, - readonly: true, - }, - Category: { - visible: true, - readonly: true, - }, - }, - }) - mocks.licenses.useCloudFree() - const res = await config.api.viewV2.update({ - ...view, - schema: { - id: { visible: true }, - Price: { - visible: true, - readonly: false, - }, - }, - }) - expect(res).toEqual( - expect.objectContaining({ - ...view, - schema: { - id: { visible: true }, - Price: { - visible: true, - readonly: false, - }, - }, - }) - ) - }) - isInternal && it("updating schema will only validate modified field", async () => { let view = await config.api.viewV2.create({ @@ -1047,7 +972,6 @@ describe.each([ }) it("should be able to fetch readonly config after downgrades", async () => { - mocks.licenses.useViewReadonlyColumns() const res = await config.api.viewV2.create({ name: generator.name(), tableId: table._id!, @@ -1113,8 +1037,6 @@ describe.each([ }) it("rejects if field is readonly in any view", async () => { - mocks.licenses.useViewReadonlyColumns() - await config.api.viewV2.create({ name: "view a", tableId: table._id!, @@ -1539,7 +1461,6 @@ describe.each([ }) it("can't persist readonly columns", async () => { - mocks.licenses.useViewReadonlyColumns() const view = await config.api.viewV2.create({ tableId: table._id!, name: generator.guid(), @@ -1608,7 +1529,6 @@ describe.each([ }) it("can't update readonly columns", async () => { - mocks.licenses.useViewReadonlyColumns() const view = await config.api.viewV2.create({ tableId: table._id!, name: generator.guid(), diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts index 5accc98854..de3579f7fd 100644 --- a/packages/server/src/sdk/app/views/index.ts +++ b/packages/server/src/sdk/app/views/index.ts @@ -1,5 +1,4 @@ import { - BasicViewUIFieldMetadata, FieldType, RelationSchemaField, RenameColumn, @@ -11,7 +10,6 @@ import { ViewV2Enriched, } from "@budibase/types" import { HTTPError } from "@budibase/backend-core" -import { features } from "@budibase/pro" import { helpers, PROTECTED_EXTERNAL_COLUMNS, @@ -111,15 +109,8 @@ async function checkReadonlyFields( ) } - if (viewFieldSchema.readonly) { - if ( - !(await features.isViewReadonlyColumnsEnabled()) && - !(tableFieldSchema as BasicViewUIFieldMetadata).readonly - ) { - throw new HTTPError(`Readonly fields are not enabled`, 400) - } - - if (!viewFieldSchema.visible) { + if (viewSchema[field].readonly) { + if (!viewSchema[field].visible) { throw new HTTPError( `Field "${field}" must be visible if you want to make it readonly`, 400 diff --git a/scripts/build-single-image-sqs.sh b/scripts/build-single-image-sqs.sh index 502ba5fa14..40b97013a1 100644 --- a/scripts/build-single-image-sqs.sh +++ b/scripts/build-single-image-sqs.sh @@ -2,4 +2,4 @@ yarn build:apps version=$(./scripts/getCurrentVersion.sh) -docker build -f hosting/single/Dockerfile -t budibase:sqs --build-arg BUDIBASE_VERSION=$version --build-arg TARGETBUILD=single --build-arg BASEIMG=budibase/couchdb:v3.3.3-sqs . +docker build -f hosting/single/Dockerfile -t budibase:sqs --build-arg BUDIBASE_VERSION=$version --build-arg TARGETBUILD=single --build-arg BASEIMG=budibase/couchdb:v3.3.3-sqs-v2.1.1 .