From 3a106c937cf4ac7f298bfe0a61883f77fc625aa5 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 15 Feb 2021 19:59:49 +0000 Subject: [PATCH] Formating. --- .../DataTable/modals/CreateEditColumn.svelte | 29 ++++++++++++------- .../popovers/ManageAccessPopover.svelte | 4 ++- .../modals/CreateTableModal.svelte | 27 ++++------------- .../builder/src/constants/backend/index.js | 8 +++-- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 0045d2261c..86a321865d 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -10,7 +10,12 @@ import { cloneDeep } from "lodash/fp" import { backendUiStore } from "builderStore" import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" - import { FIELDS, getAutoColumnInformation, buildAutoColumn, AUTO_COLUMN_SUB_TYPES } from "constants/backend" + import { + FIELDS, + getAutoColumnInformation, + buildAutoColumn, + AUTO_COLUMN_SUB_TYPES, + } from "constants/backend" import { notifier } from "builderStore/store/notifications" import ValuesList from "components/common/ValuesList.svelte" import DatePicker from "components/common/DatePicker.svelte" @@ -45,15 +50,21 @@ UNEDITABLE_USER_FIELDS.includes(field.name) // used to select what different options can be displayed for column type - $: canBeSearched = field.type !== 'link' && - field.subtype !== AUTO_COLUMN_SUB_TYPES.CREATED_BY && - field.subtype !== AUTO_COLUMN_SUB_TYPES.UPDATED_BY - $: canBeDisplay = field.type !== 'link' && field.type !== AUTO_COL - $: canBeRequired = field.type !== 'link' && !uneditable && field.type !== AUTO_COL + $: canBeSearched = + field.type !== "link" && + field.subtype !== AUTO_COLUMN_SUB_TYPES.CREATED_BY && + field.subtype !== AUTO_COLUMN_SUB_TYPES.UPDATED_BY + $: canBeDisplay = field.type !== "link" && field.type !== AUTO_COL + $: canBeRequired = + field.type !== "link" && !uneditable && field.type !== AUTO_COL async function saveColumn() { if (field.type === AUTO_COL) { - field = buildAutoColumn($backendUiStore.draftTable.name, field.name, field.subtype) + field = buildAutoColumn( + $backendUiStore.draftTable.name, + field.name, + field.subtype + ) } backendUiStore.update(state => { backendUiStore.actions.tables.saveField({ @@ -78,9 +89,7 @@ } function handleFieldConstraints(event) { - const definition = fieldDefinitions[ - event.target.value.toUpperCase() - ] + const definition = fieldDefinitions[event.target.value.toUpperCase()] if (!definition) { return } diff --git a/packages/builder/src/components/backend/DataTable/popovers/ManageAccessPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/ManageAccessPopover.svelte index e8f6f6df0b..ee8162c8d4 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/ManageAccessPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/ManageAccessPopover.svelte @@ -30,7 +30,9 @@
Who Can Access This Data?
- +
diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index bcf7edbed0..7365f3e64e 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -2,12 +2,7 @@ import { goto } from "@sveltech/routify" import { backendUiStore, store } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { - Input, - Label, - ModalContent, - Toggle, - } from "@budibase/bbui" + import { Input, Label, ModalContent, Toggle } from "@budibase/bbui" import TableDataImport from "../TableDataImport.svelte" import analytics from "analytics" import screenTemplates from "builderStore/store/screenTemplates" @@ -109,23 +104,13 @@
- - - + + +
- - + +
diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index ba4ad09d9f..37eb0f82f7 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -79,7 +79,7 @@ export const FIELDS = { type: "array", presence: false, }, - } + }, } export const AUTO_COLUMN_SUB_TYPES = { @@ -120,14 +120,16 @@ export const Roles = { export const USER_TABLE_ID = "ta_users" export function isAutoColumnUserRelationship(subtype) { - return subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY || + return ( + subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY || subtype === AUTO_COLUMN_SUB_TYPES.UPDATED_BY + ) } export function getAutoColumnInformation(enabled = true) { let info = {} for (let [key, subtype] of Object.entries(AUTO_COLUMN_SUB_TYPES)) { - info[subtype] = {enabled, name: AUTO_COLUMN_DISPLAY_NAMES[key]} + info[subtype] = { enabled, name: AUTO_COLUMN_DISPLAY_NAMES[key] } } return info }