From 6405e79f15b919f399a71917ee55472cc77ac9ac Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 11 Aug 2020 11:23:07 +0100 Subject: [PATCH] tidy up + lint --- packages/builder/cypress/support/commands.js | 4 +- .../builder/src/builderStore/store/backend.js | 8 +- .../ModelDataTable/ModelDataTable.svelte | 1 - .../modals/CreateDatabase.svelte | 40 --- .../modals/CreateEditColumn.svelte | 6 +- .../modals/CreateEditRecord.svelte | 2 +- .../modals/RecordFieldControl.svelte | 4 +- .../database/ModelDataTable/modals/index.js | 1 - .../ModelDataTable/popovers/Column.svelte | 7 +- .../popovers/ColumnHeader.svelte | 7 +- .../ModelDataTable/popovers/EditRow.svelte | 13 +- .../ModelDataTable/popovers/Row.svelte | 9 +- .../nav/ModelNavigator/CreateTable.svelte | 8 +- .../nav/ModelNavigator/EditTable.svelte | 22 +- .../builder/src/constants/backend/index.js | 2 +- .../[application]/backend/model/index.svelte | 4 +- packages/builder/yarn.lock | 231 +----------------- 17 files changed, 61 insertions(+), 308 deletions(-) delete mode 100644 packages/builder/src/components/database/ModelDataTable/modals/CreateDatabase.svelte diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index b01d0797b3..40ffb0f489 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -84,7 +84,9 @@ Cypress.Commands.add("addRecord", values => { cy.contains("Create New Row").click() for (let i = 0; i < values.length; i++) { - cy.get("input").eq(i).type(values[i]) + cy.get("input") + .eq(i) + .type(values[i]) } // Save diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index f95360000e..28272d9893 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -87,8 +87,10 @@ export const getBackendUiStore = () => { delete: async model => { await api.delete(`/api/models/${model._id}/${model._rev}`) store.update(state => { - state.models = state.models.filter(existing => existing._id !== model._id) - state.selectedModel = state.models[0] || {} + state.models = state.models.filter( + existing => existing._id !== model._id + ) + state.selectedModel = state.models[0] || {} return state }) }, @@ -111,7 +113,7 @@ export const getBackendUiStore = () => { store.actions.models.save(state.draftModel) return state }) - } + }, }, views: { select: view => diff --git a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte index 8bebccd07d..c7efd29253 100644 --- a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte @@ -24,7 +24,6 @@ let views = [] let currentPage = 0 let search - let dropdownLeft $: { if ($backendUiStore.selectedView) { diff --git a/packages/builder/src/components/database/ModelDataTable/modals/CreateDatabase.svelte b/packages/builder/src/components/database/ModelDataTable/modals/CreateDatabase.svelte deleted file mode 100644 index d50adc2d10..0000000000 --- a/packages/builder/src/components/database/ModelDataTable/modals/CreateDatabase.svelte +++ /dev/null @@ -1,40 +0,0 @@ - - -
-
- Database Name - -
-
- Cancel - - Save - -
-
- - diff --git a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditColumn.svelte index 833c49a7ce..77a6db9d39 100644 --- a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditColumn.svelte @@ -30,12 +30,10 @@ } async function saveColumn() { - // if existing - // update the name and type backendUiStore.update(state => { backendUiStore.actions.models.saveField({ originalName, - field + field, }) return state @@ -110,7 +108,7 @@ diff --git a/packages/builder/src/components/database/ModelDataTable/popovers/ColumnHeader.svelte b/packages/builder/src/components/database/ModelDataTable/popovers/ColumnHeader.svelte index 0aae87f299..35e72427e2 100644 --- a/packages/builder/src/components/database/ModelDataTable/popovers/ColumnHeader.svelte +++ b/packages/builder/src/components/database/ModelDataTable/popovers/ColumnHeader.svelte @@ -44,7 +44,7 @@ {#if editing} -

Edit Column

+
Edit Column
{:else}
    @@ -73,9 +73,10 @@ diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte index 8f1d27d0ca..6125b0851b 100644 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte +++ b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte @@ -26,7 +26,7 @@
    -

    Create Table

    +
    Create Table