From a92d54f9a7ef44545f281b7ee171ec2447944a7e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 24 Nov 2020 14:04:14 +0000 Subject: [PATCH] user table and relationships complete --- .../DataTable/modals/CreateEditColumn.svelte | 13 ++++++-- .../TableNavigator/TableNavigator.svelte | 3 +- .../components/settings/SettingsModal.svelte | 5 +++ packages/builder/src/constants/index.js | 7 ++++ .../src/pages/[application]/_reset.svelte | 7 +--- .../data/table/users/index.svelte | 1 + .../server/src/api/controllers/application.js | 33 +++++++++++++++++++ packages/server/src/api/controllers/user.js | 3 +- packages/server/src/db/client.js | 2 +- packages/server/src/db/utils.js | 14 ++++---- packages/server/src/electron.js | 3 +- 11 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 packages/builder/src/pages/[application]/data/table/users/index.svelte diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 866e574bca..9c8e985ffd 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -2,6 +2,7 @@ import { Input, Button, TextButton, Select, Toggle } from "@budibase/bbui" import { cloneDeep } from "lodash/fp" import { backendUiStore } from "builderStore" + import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { FIELDS } from "constants/backend" import { notifier } from "builderStore/store/notifications" import ValuesList from "components/common/ValuesList.svelte" @@ -30,6 +31,12 @@ table => table._id !== $backendUiStore.draftTable._id ) $: required = !!field?.constraints?.presence || primaryDisplay + $: uneditable = $backendUiStore.selectedTable?._id === TableNames.USERS && UNEDITABLE_USER_FIELDS.includes(field.name) + $: { + console.log($backendUiStore.selectedTable) + console.log(field.name) + console.log(uneditable) + } async function saveColumn() { backendUiStore.update(state => { @@ -87,7 +94,7 @@
- +