diff --git a/packages/builder/cypress/integration/createModel.spec.js b/packages/builder/cypress/integration/createModel.spec.js deleted file mode 100644 index 06b2420331..0000000000 --- a/packages/builder/cypress/integration/createModel.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -xcontext('Create a Model', () => { - - before(() => { - cy.visit('localhost:4001/_builder') - // https://on.cypress.io/type - cy.createApp('Model App', 'Model App Description') - }) - - // https://on.cypress.io/interacting-with-elements - it('should create a new model', () => { - - cy.createModel('dog', 'name', 'age') - - // Check if model exists - cy.get('.title').should('have.text', 'dog') - }) - it('should add a record', () => { - cy.addRecord('bob', '15') - - cy.contains('bob').should('have.text', 'bob') - }) -}) diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js new file mode 100644 index 0000000000..d44a7cc6d6 --- /dev/null +++ b/packages/builder/cypress/integration/createTable.spec.js @@ -0,0 +1,42 @@ +xcontext('Create a Table', () => { + + before(() => { + cy.visit('localhost:4001/_builder') + // https://on.cypress.io/type + cy.createApp('Table App', 'Table App Description') + }) + + // https://on.cypress.io/interacting-with-elements + it('should create a new Table', () => { + + cy.createTable('dog', 'name', 'age') + + // Check if Table exists + cy.get('.title').should('have.text', 'dog') + }) + + it('adds a new column to the table', () => { + cy.addRecord('bob', '15') + + cy.contains('bob').should('have.text', 'bob') + }) + + it('updates a column on the table', () => { + cy.addRecord('bob', '15') + + cy.contains('bob').should('have.text', 'bob') + }) + + it('edits a record', () => { + cy.addRecord('bob', '15') + + cy.contains('bob').should('have.text', 'bob') + }) + + it('deletes a record', () => { + cy.addRecord('bob', '15') + + cy.contains('bob').should('have.text', 'bob') + }) + +}) diff --git a/packages/builder/package.json b/packages/builder/package.json index 26af308a29..ca1a6082e9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -66,6 +66,7 @@ "codemirror": "^5.51.0", "date-fns": "^1.29.0", "deepmerge": "^4.2.2", + "fast-sort": "^2.2.0", "feather-icons": "^4.21.0", "flatpickr": "^4.5.7", "lodash": "^4.17.13", diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 5708c98a98..3063c71a82 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -63,7 +63,7 @@ export const getBackendUiStore = () => { state.selectedView = `all_${model._id}` return state }), - save: async ({ model }) => { + save: async model => { const updatedModel = cloneDeep(model) // update any renamed schema keys to reflect their names @@ -97,14 +97,14 @@ export const getBackendUiStore = () => { ...state.draftModel.schema, [field.name]: cloneDeep(field), } - store.actions.models.save({ model: state.draftModel }) + store.actions.models.save(state.draftModel) return state }) }, deleteField: field => { store.update(state => { delete state.draftModel.schema[field.name] - store.actions.models.save({ model: state.draftModel }) + store.actions.models.save(state.draftModel) return state }) } diff --git a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte index becef0e117..7476e7454e 100644 --- a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte @@ -1,5 +1,6 @@
Before you can view your table, you need to set it up.
-Blocks are pre-made fields and help you build your table quicker.
-Blocks are pre-made fields and help you build your table quicker.
-