diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 544c24c003..eb9e9a0b73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -145,7 +145,7 @@ The HTML and CSS for your apps runtime pages, as well as the budibase client lib #### Backend -The backend schema, tables and records are stored using PouchDB when developing locally, and in [CouchDB](https://pouchdb.com/) when running in production. +/he backend schema, tables and rows are stored using PouchDB when developing locally, and in [CouchDB](https://pouchdb.com/) when running in production. ### Publishing Budibase to NPM diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index 26af4fac71..67132c736b 100644 --- a/packages/builder/cypress/integration/createAutomation.spec.js +++ b/packages/builder/cypress/integration/createAutomation.spec.js @@ -16,7 +16,7 @@ context("Create a automation", () => { cy.contains("automate").click() cy.contains("Create New Automation").click() cy.get(".modal").within(() => { - cy.get("input").type("Add Record") + cy.get("input").type("Add Row") cy.get(".buttons") .contains("Create") .click() @@ -24,7 +24,7 @@ context("Create a automation", () => { // Add trigger cy.get("[data-cy=add-automation-component]").click() - cy.get("[data-cy=RECORD_SAVED]").click() + cy.get("[data-cy=ROW_SAVED]").click() cy.get("[data-cy=automation-block-setup]").within(() => { cy.get("select") .first() @@ -32,7 +32,7 @@ context("Create a automation", () => { }) // Create action - cy.get("[data-cy=CREATE_RECORD]").click() + cy.get("[data-cy=CREATE_ROW]").click() cy.get("[data-cy=automation-block-setup]").within(() => { cy.get("select") .first() @@ -53,9 +53,9 @@ context("Create a automation", () => { cy.get(".stop-button.highlighted").should("be.visible") }) - it("should add record when a new record is added", () => { + it("should add row when a new row is added", () => { cy.contains("backend").click() - cy.addRecord(["Rover", 15]) + cy.addRow(["Rover", 15]) cy.reload() cy.contains("goodboy").should("have.text", "goodboy") }) diff --git a/packages/builder/cypress/integration/createComponents.spec.js b/packages/builder/cypress/integration/createComponents.spec.js index 2e247f7110..f2035bf16b 100644 --- a/packages/builder/cypress/integration/createComponents.spec.js +++ b/packages/builder/cypress/integration/createComponents.spec.js @@ -6,7 +6,7 @@ xcontext('Create Components', () => { // https://on.cypress.io/type cy.createApp('Model App', 'Model App Description') cy.createTable('dog', 'name', 'age') - cy.addRecord('bob', '15') + cy.addRow('bob', '15') }) // https://on.cypress.io/interacting-with-elements diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js index d7ae805b27..36aed6e058 100644 --- a/packages/builder/cypress/integration/createTable.spec.js +++ b/packages/builder/cypress/integration/createTable.spec.js @@ -16,8 +16,8 @@ context("Create a Table", () => { cy.contains("name").should("be.visible") }) - it("creates a record in the table", () => { - cy.addRecord(["Rover"]) + it("creates a row in the table", () => { + cy.addRow(["Rover"]) cy.contains("Rover").should("be.visible") }) @@ -32,7 +32,7 @@ context("Create a Table", () => { cy.contains("nameupdated").should("have.text", "nameupdated") }) - it("edits a record", () => { + it("edits a row", () => { cy.get("tbody .ri-more-line").click() cy.get("[data-cy=edit-row]").click() cy.get(".modal input").type("Updated") @@ -40,7 +40,7 @@ context("Create a Table", () => { cy.contains("RoverUpdated").should("have.text", "RoverUpdated") }) - it("deletes a record", () => { + it("deletes a row", () => { cy.get("tbody .ri-more-line").click() cy.get("[data-cy=delete-row]").click() cy.contains("Delete Row").click() diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index c224b8af42..e35688c813 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -7,13 +7,13 @@ context("Create a View", () => { cy.addColumn("data", "age", "Number") cy.addColumn("data", "rating", "Number") - // 6 Records - cy.addRecord(["Students", 25, 1]) - cy.addRecord(["Students", 20, 3]) - cy.addRecord(["Students", 18, 6]) - cy.addRecord(["Students", 25, 2]) - cy.addRecord(["Teachers", 49, 5]) - cy.addRecord(["Teachers", 36, 3]) + // 6 Rows + cy.addRow(["Students", 25, 1]) + cy.addRow(["Students", 20, 3]) + cy.addRow(["Students", 18, 6]) + cy.addRow(["Students", 25, 2]) + cy.addRow(["Teachers", 49, 5]) + cy.addRow(["Teachers", 36, 3]) }) it("creates a view", () => { diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index bcc82a0396..cf47051d38 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -92,7 +92,7 @@ Cypress.Commands.add("addColumn", (tableName, columnName, type) => { }) }) -Cypress.Commands.add("addRecord", values => { +Cypress.Commands.add("addRow", values => { cy.contains("Create New Row").click() cy.get(".modal").within(() => { diff --git a/packages/builder/src/builderStore/store/automation/tests/testAutomation.js b/packages/builder/src/builderStore/store/automation/tests/testAutomation.js index 8f714bdead..3fafbaf1d0 100644 --- a/packages/builder/src/builderStore/store/automation/tests/testAutomation.js +++ b/packages/builder/src/builderStore/store/automation/tests/testAutomation.js @@ -26,11 +26,11 @@ export default { ], trigger: { id: "iRzYMOqND", - name: "Record Saved", - event: "record:save", + name: "Row Saved", + event: "row:save", icon: "ri-save-line", - tagline: "Record is added to {{table.name}}", - description: "Fired when a record is saved to your database.", + tagline: "Row is added to {{table.name}}", + description: "Fired when a row is saved to your database.", params: { table: "table" }, type: "TRIGGER", args: { @@ -65,7 +65,7 @@ export default { _rev: "7-b8aa1ce0b53e88928bb88fc11bdc0aff", }, }, - stepId: "RECORD_SAVED", + stepId: "ROW_SAVED", }, }, type: "automation", diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index a5d7afcbb5..d89796f9cc 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -27,7 +27,7 @@ export const getBackendUiStore = () => { }) }, }, - records: { + rows: { save: () => store.update(state => { state.selectedView = state.selectedView @@ -38,9 +38,9 @@ export const getBackendUiStore = () => { state.selectedView = state.selectedView return state }), - select: record => + select: row => store.update(state => { - state.selectedRecord = record + state.selectedRow = row return state }), }, diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte b/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte index b0a588314f..aca1e7f90d 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte @@ -13,7 +13,7 @@ function enrichInputs(inputs) { let enrichedInputs = { ...inputs, enriched: {} } - const tableId = inputs.tableId || inputs.record?.tableId + const tableId = inputs.tableId || inputs.row?.tableId if (tableId) { enrichedInputs.enriched.table = $backendUiStore.tables.find( table => table._id === tableId diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index a43126afbb..896652dbb7 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -1,6 +1,6 @@ -{#if record && record._id === recordId} +{#if row && row._id === rowId} {/if} diff --git a/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte similarity index 87% rename from packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte rename to packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index 50d13557fd..f974e521c4 100644 --- a/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -2,7 +2,7 @@ import { Input, Select, Label, DatePicker, Toggle } from "@budibase/bbui" import Dropzone from "components/common/Dropzone.svelte" import { capitalise } from "../../../helpers" - import LinkedRecordSelector from "components/common/LinkedRecordSelector.svelte" + import LinkedRowSelector from "components/common/LinkedRowSelector.svelte" export let meta export let value = meta.type === "boolean" ? false : "" @@ -28,7 +28,7 @@ {:else if type === 'boolean'} {:else if type === 'link'} - + {:else} {/if} diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 9c387ca6b2..dde114a76c 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -10,7 +10,7 @@ import ActionButton from "components/common/ActionButton.svelte" import AttachmentList from "./AttachmentList.svelte" import TablePagination from "./TablePagination.svelte" - import CreateEditRecordModal from "./modals/CreateEditRecordModal.svelte" + import CreateEditRowModal from "./modals/CreateEditRowModal.svelte" import RowPopover from "./buttons/CreateRowButton.svelte" import ColumnPopover from "./buttons/CreateColumnButton.svelte" import ViewPopover from "./buttons/CreateViewButton.svelte" @@ -41,12 +41,12 @@ : [] $: tableId = data?.length ? data[0].tableId : null - function selectRelationship(record, fieldName) { - if (!record?.[fieldName]?.length) { + function selectRelationship(row, fieldName) { + if (!row?.[fieldName]?.length) { return } $goto( - `/${$params.application}/backend/table/${tableId}/relationship/${record._id}/${fieldName}` + `/${$params.application}/backend/table/${tableId}/relationship/${row._id}/${fieldName}` ) } diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index ec94ae2aa6..d3c82e4f7c 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -12,7 +12,7 @@ $: name = view.name - // Fetch records for specified view + // Fetch rows for specified view $: { if (!name.startsWith("all_")) { fetchViewData(name, view.field, view.groupBy) diff --git a/packages/builder/src/components/backend/DataTable/api.js b/packages/builder/src/components/backend/DataTable/api.js index b14a7fc613..496db35b3f 100644 --- a/packages/builder/src/components/backend/DataTable/api.js +++ b/packages/builder/src/components/backend/DataTable/api.js @@ -6,22 +6,22 @@ export async function createUser(user) { return await response.json() } -export async function saveRecord(record, tableId) { - const SAVE_RECORDS_URL = `/api/${tableId}/records` - const response = await api.post(SAVE_RECORDS_URL, record) +export async function saveRow(row, tableId) { + const SAVE_ROWS_URL = `/api/${tableId}/rows` + const response = await api.post(SAVE_ROWS_URL, row) return await response.json() } -export async function deleteRecord(record) { - const DELETE_RECORDS_URL = `/api/${record.tableId}/records/${record._id}/${record._rev}` - const response = await api.delete(DELETE_RECORDS_URL) +export async function deleteRow(row) { + const DELETE_ROWS_URL = `/api/${row.tableId}/rows/${row._id}/${row._rev}` + const response = await api.delete(DELETE_ROWS_URL) return response } export async function fetchDataForView(view) { - const FETCH_RECORDS_URL = `/api/views/${view.name}` + const FETCH_ROWS_URL = `/api/views/${view.name}` - const response = await api.get(FETCH_RECORDS_URL) + const response = await api.get(FETCH_ROWS_URL) return await response.json() } diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte index 1ef0333398..3c0444881f 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte @@ -1,6 +1,6 @@ @@ -12,5 +12,5 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditRowModal.svelte similarity index 50% rename from packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte rename to packages/builder/src/components/backend/DataTable/modals/CreateEditRowModal.svelte index 08aaae1880..2cc0113f55 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditRowModal.svelte @@ -1,46 +1,46 @@ + onConfirm={saveRow}> {#each tableSchema as [key, meta]}
- +
{/each}
diff --git a/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte index 4caa3e3d40..a03c3def9b 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte @@ -19,7 +19,7 @@ import Checkbox from "components/common/Checkbox.svelte" import ActionButton from "components/common/ActionButton.svelte" import DatePicker from "components/common/DatePicker.svelte" - import LinkedRecordSelector from "components/common/LinkedRecordSelector.svelte" + import LinkedRowSelector from "components/common/LinkedRowSelector.svelte" import * as api from "../api" let fieldDefinitions = cloneDeep(FIELDS) diff --git a/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte index 040fc34fab..786c062245 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte @@ -1,7 +1,7 @@ @@ -52,7 +52,7 @@ onOk={deleteRow} title="Confirm Delete" /> - +