Add user type column selector

This commit is contained in:
Adria Navarro 2023-09-14 10:45:27 +02:00
parent 29358cec5f
commit eb748db3be
2 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,7 @@
import { TableNames, UNEDITABLE_USER_FIELDS } from "constants"
import {
FIELDS,
DEV_FIELDS,
RelationshipType,
ALLOWABLE_STRING_OPTIONS,
ALLOWABLE_NUMBER_OPTIONS,
@ -34,6 +35,7 @@
import { getBindings } from "components/backend/DataTable/formula"
import JSONSchemaModal from "./JSONSchemaModal.svelte"
import { ValidColumnNameRegex } from "@budibase/shared-core"
import { admin } from "stores/portal"
const AUTO_TYPE = "auto"
const FORMULA_TYPE = FIELDS.FORMULA.type
@ -70,6 +72,10 @@
fieldName: $tables.selected.name,
}
if ($admin.isDev) {
fieldDefinitions = { ...fieldDefinitions, ...cloneDeep(DEV_FIELDS) }
}
$: if (primaryDisplay) {
editableColumn.constraints.presence = { allowEmpty: false }
}

View File

@ -122,6 +122,15 @@ export const FIELDS = {
},
}
export const DEV_FIELDS = {
USER: {
name: "User",
type: "internal",
subtype: "user",
icon: "User",
},
}
export const AUTO_COLUMN_SUB_TYPES = {
AUTO_ID: "autoID",
CREATED_BY: "createdBy",