diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 78c07a037c..13d59d1019 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -45,8 +45,8 @@ jobs: BUMP_TYPE=${BUMP_TYPE_INPUT:-"patch"} ./versionCommit.sh $BUMP_TYPE - - new_version=$(./getCurrentVersion.sh) + cd .. + new_version=$(./scripts/getCurrentVersion.sh) echo "version=$new_version" >> $GITHUB_OUTPUT trigger-release: diff --git a/lerna.json b/lerna.json index 2126adac29..bfcac5633c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.13.1", + "version": "2.13.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index 3efc737bfb..e24f5669eb 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -8,6 +8,7 @@ export let id = null export let text = null export let disabled = false + export let readonly = false export let size export let indeterminate = false @@ -24,6 +25,7 @@ class:is-invalid={!!error} class:checked={value} class:is-indeterminate={indeterminate} + class:readonly > diff --git a/packages/bbui/src/Form/Core/CheckboxGroup.svelte b/packages/bbui/src/Form/Core/CheckboxGroup.svelte index 2b8a1e438a..66ac55561b 100644 --- a/packages/bbui/src/Form/Core/CheckboxGroup.svelte +++ b/packages/bbui/src/Form/Core/CheckboxGroup.svelte @@ -8,6 +8,7 @@ export let options = [] export let error = null export let disabled = false + export let readonly = false export let getOptionLabel = option => option export let getOptionValue = option => option @@ -34,6 +35,7 @@ title={getOptionLabel(option)} class="spectrum-Checkbox spectrum-FieldGroup-item" class:is-invalid={!!error} + class:readonly > diff --git a/packages/bbui/src/Form/Core/DatePicker.svelte b/packages/bbui/src/Form/Core/DatePicker.svelte index 7ce15292be..786aee40b6 100644 --- a/packages/bbui/src/Form/Core/DatePicker.svelte +++ b/packages/bbui/src/Form/Core/DatePicker.svelte @@ -9,6 +9,7 @@ export let id = null export let disabled = false + export let readonly = false export let error = null export let enableTime = true export let value = null @@ -186,7 +187,7 @@ > option export let getOptionValue = option => option export let getOptionTitle = option => option @@ -40,6 +41,7 @@ title={getOptionTitle(option)} class="spectrum-Radio spectrum-FieldGroup-item spectrum-Radio--emphasized" class:is-invalid={!!error} + class:readonly > diff --git a/packages/bbui/src/Form/Core/RichTextField.svelte b/packages/bbui/src/Form/Core/RichTextField.svelte index f964405f0d..3e0b0caf4d 100644 --- a/packages/bbui/src/Form/Core/RichTextField.svelte +++ b/packages/bbui/src/Form/Core/RichTextField.svelte @@ -4,6 +4,7 @@ export let value = "" export let placeholder = null export let disabled = false + export let readonly = false export let error = null export let height = null export let id = null @@ -20,6 +21,7 @@ {fullScreenOffset} {disabled} {easyMDEOptions} + {readonly} on:change /> diff --git a/packages/bbui/src/Form/Core/TextArea.svelte b/packages/bbui/src/Form/Core/TextArea.svelte index 465212cd44..be7eed466d 100644 --- a/packages/bbui/src/Form/Core/TextArea.svelte +++ b/packages/bbui/src/Form/Core/TextArea.svelte @@ -5,6 +5,7 @@ export let value = "" export let placeholder = null export let disabled = false + export let readonly = false export let error = null export let id = null export let height = null @@ -61,6 +62,7 @@ class="spectrum-Textfield-input" style={align ? `text-align: ${align}` : ""} {disabled} + {readonly} {id} on:focus={() => (focus = true)} on:blur={onChange} diff --git a/packages/bbui/src/Form/DatePicker.svelte b/packages/bbui/src/Form/DatePicker.svelte index 04ce8b5467..f17871a576 100644 --- a/packages/bbui/src/Form/DatePicker.svelte +++ b/packages/bbui/src/Form/DatePicker.svelte @@ -7,6 +7,7 @@ export let label = null export let labelPosition = "above" export let disabled = false + export let readonly = false export let error = null export let enableTime = true export let timeOnly = false @@ -33,6 +34,7 @@ { if (mde && val !== latestValue) { @@ -54,6 +58,7 @@ easyMDEOptions={{ initialValue: value, placeholder, + toolbar: disabled || readonly ? false : undefined, ...easyMDEOptions, }} /> diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index d5a9aba488..4eb1f962f0 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -44,6 +44,8 @@ const NUMBER_TYPE = FIELDS.NUMBER.type const JSON_TYPE = FIELDS.JSON.type const DATE_TYPE = FIELDS.DATETIME.type + const USER_TYPE = FIELDS.USER.subtype + const USERS_TYPE = FIELDS.USERS.subtype const dispatch = createEventDispatcher() const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] @@ -287,6 +289,14 @@ if (saveColumn.type !== LINK_TYPE) { delete saveColumn.fieldName } + if (isUsersColumn(saveColumn)) { + if (saveColumn.subtype === USER_TYPE) { + saveColumn.relationshipType = RelationshipType.ONE_TO_MANY + } else if (saveColumn.subtype === USERS_TYPE) { + saveColumn.relationshipType = RelationshipType.MANY_TO_MANY + } + } + try { await tables.saveField({ originalName, diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index f9a40b09a6..a67c2d3c61 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -112,9 +112,9 @@ } await usersFetch.update({ query: { - appId: query || !filterByAppAccess ? null : prodAppId, - email: query, + string: { email: query }, }, + appId: query || !filterByAppAccess ? null : prodAppId, limit: 50, paginate: query || !filterByAppAccess ? null : false, }) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index eeb8366af8..417f6b7fad 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2589,6 +2589,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "text", "label": "Initial form step", @@ -2738,6 +2749,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "validation/string", "label": "Validation", @@ -2858,6 +2880,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "validation/number", "label": "Validation", @@ -3165,6 +3198,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "select", "label": "Options source", @@ -3319,6 +3363,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "select", "label": "Type", @@ -3522,6 +3577,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "validation/boolean", "label": "Validation", @@ -3630,6 +3696,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "validation/string", "label": "Validation", @@ -3740,6 +3817,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "validation/datetime", "label": "Validation", @@ -4087,7 +4175,7 @@ }, { "type": "boolean", - "label": "Disabled", + "label": "Read only", "key": "disabled", "defaultValue": false }, @@ -4193,6 +4281,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "select", "label": "Layout", @@ -4274,6 +4373,17 @@ "key": "disabled", "defaultValue": false }, + { + "type": "boolean", + "label": "Read only", + "key": "readonly", + "defaultValue": false, + "dependsOn": { + "setting": "disabled", + "value": true, + "invert": true + } + }, { "type": "select", "label": "Layout", @@ -5923,12 +6033,7 @@ "type": "boolean", "label": "Disabled", "key": "disabled", - "defaultValue": false, - "dependsOn": { - "setting": "actionType", - "value": "View", - "invert": true - } + "defaultValue": false } ] }, diff --git a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte index e78cbd89c7..52ef3ac80c 100644 --- a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte +++ b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte @@ -137,7 +137,8 @@ actionType: actionType === "Create" ? "Create" : "Update", dataSource, size, - disabled: disabled || actionType === "View", + disabled, + readonly: !disabled && actionType === "View", }} styles={{ normal: { diff --git a/packages/client/src/components/app/forms/AttachmentField.svelte b/packages/client/src/components/app/forms/AttachmentField.svelte index f28d4801d4..cc0f7aaac6 100644 --- a/packages/client/src/components/app/forms/AttachmentField.svelte +++ b/packages/client/src/components/app/forms/AttachmentField.svelte @@ -6,6 +6,7 @@ export let field export let label export let disabled = false + export let readonly = false export let compact = false export let validation export let extensions @@ -72,6 +73,7 @@ {label} {field} {disabled} + {readonly} {validation} {span} type="attachment" @@ -82,7 +84,7 @@ {#if fieldState} @@ -136,4 +139,7 @@ .spectrum-FieldLabel--left { padding-right: var(--spectrum-global-dimension-size-200); } + .readonly { + pointer-events: none; + } diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index 87883fe4b6..1a740585f3 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -8,6 +8,7 @@ export let theme export let size export let disabled = false + export let readonly = false export let actionType = "Create" export let initialFormStep = 1 @@ -39,7 +40,7 @@ $: schemaKey = generateSchemaKey(schema) $: initialValues = getInitialValues(actionType, dataSource, $context) $: resetKey = Helpers.hashString( - schemaKey + JSON.stringify(initialValues) + disabled + schemaKey + JSON.stringify(initialValues) + disabled + readonly ) // Returns the closes data context which isn't a built in context @@ -97,6 +98,7 @@ {theme} {size} {disabled} + {readonly} {actionType} {schema} {table} diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 4dacf36244..6ebe9de7ec 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -6,6 +6,7 @@ export let dataSource export let disabled = false + export let readonly = false export let initialValues export let size export let schema @@ -148,6 +149,7 @@ type, defaultValue = null, fieldDisabled = false, + fieldReadOnly = false, validationRules, step = 1 ) => { @@ -205,6 +207,7 @@ error: initialError, disabled: disabled || fieldDisabled || (isAutoColumn && !editAutoColumns), + readonly: readonly || fieldReadOnly, defaultValue, validator, lastUpdate: Date.now(), diff --git a/packages/client/src/components/app/forms/JSONField.svelte b/packages/client/src/components/app/forms/JSONField.svelte index c80060d3d6..cf96f54a23 100644 --- a/packages/client/src/components/app/forms/JSONField.svelte +++ b/packages/client/src/components/app/forms/JSONField.svelte @@ -7,6 +7,7 @@ export let label export let placeholder export let disabled = false + export let readonly = false export let defaultValue = "" export let onChange @@ -48,6 +49,7 @@ {label} {field} {disabled} + {readonly} {validation} {defaultValue} type="json" @@ -60,6 +62,7 @@ value={serialiseValue(fieldState.value)} on:change={handleChange} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} id={fieldState.fieldId} {placeholder} diff --git a/packages/client/src/components/app/forms/LongFormField.svelte b/packages/client/src/components/app/forms/LongFormField.svelte index 8d94f83319..a9087a0a9c 100644 --- a/packages/client/src/components/app/forms/LongFormField.svelte +++ b/packages/client/src/components/app/forms/LongFormField.svelte @@ -8,6 +8,7 @@ export let label export let placeholder export let disabled = false + export let readonly = false export let validation export let defaultValue = "" export let format = "auto" @@ -58,6 +59,7 @@ {label} {field} {disabled} + {readonly} {validation} {defaultValue} type="longform" @@ -71,6 +73,7 @@ value={fieldState.value} on:change={handleChange} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} id={fieldState.fieldId} {placeholder} @@ -88,6 +91,7 @@ value={fieldState.value} on:change={handleChange} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} id={fieldState.fieldId} {placeholder} diff --git a/packages/client/src/components/app/forms/MultiFieldSelect.svelte b/packages/client/src/components/app/forms/MultiFieldSelect.svelte index f3983a2284..519bef4659 100644 --- a/packages/client/src/components/app/forms/MultiFieldSelect.svelte +++ b/packages/client/src/components/app/forms/MultiFieldSelect.svelte @@ -6,6 +6,7 @@ export let label export let placeholder export let disabled = false + export let readonly = false export let validation export let defaultValue export let optionsSource = "schema" @@ -56,6 +57,7 @@ {field} {label} {disabled} + {readonly} {validation} {span} defaultValue={expandedDefaultValue} @@ -73,6 +75,7 @@ getOptionValue={flatOptions ? x => x : x => x.value} id={fieldState.fieldId} disabled={fieldState.disabled} + readonly={fieldState.readonly} on:change={handleChange} {placeholder} {options} @@ -83,6 +86,7 @@ value={fieldState.value || []} id={fieldState.fieldId} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} {options} {direction} diff --git a/packages/client/src/components/app/forms/OptionsField.svelte b/packages/client/src/components/app/forms/OptionsField.svelte index bd8dc862ca..f8080419a3 100644 --- a/packages/client/src/components/app/forms/OptionsField.svelte +++ b/packages/client/src/components/app/forms/OptionsField.svelte @@ -6,6 +6,7 @@ export let label export let placeholder export let disabled = false + export let readonly = false export let optionsType = "select" export let validation export let defaultValue @@ -46,6 +47,7 @@ {field} {label} {disabled} + {readonly} {validation} {defaultValue} {span} @@ -60,6 +62,7 @@ value={fieldState.value} id={fieldState.fieldId} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} {options} {placeholder} @@ -74,6 +77,7 @@ value={fieldState.value} id={fieldState.fieldId} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} {options} {direction} diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index a9a98f0db7..99906fe831 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -11,6 +11,7 @@ export let label export let placeholder export let disabled = false + export let readonly = false export let validation export let autocomplete = true export let defaultValue @@ -186,6 +187,7 @@ {label} {field} {disabled} + {readonly} {validation} defaultValue={expandedDefaultValue} {type} @@ -204,6 +206,7 @@ on:loadMore={loadMore} id={fieldState.fieldId} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} getOptionLabel={getDisplayName} getOptionValue={option => option._id} diff --git a/packages/client/src/components/app/forms/StringField.svelte b/packages/client/src/components/app/forms/StringField.svelte index 073353d500..a8dec6649e 100644 --- a/packages/client/src/components/app/forms/StringField.svelte +++ b/packages/client/src/components/app/forms/StringField.svelte @@ -7,6 +7,7 @@ export let placeholder export let type = "text" export let disabled = false + export let readonly = false export let validation export let defaultValue = "" export let align @@ -28,6 +29,7 @@ {label} {field} {disabled} + {readonly} {validation} {defaultValue} {span} @@ -41,6 +43,7 @@ value={fieldState.value} on:change={handleChange} disabled={fieldState.disabled} + readonly={fieldState.readonly} error={fieldState.error} id={fieldState.fieldId} {placeholder} diff --git a/packages/frontend-core/src/fetch/UserFetch.js b/packages/frontend-core/src/fetch/UserFetch.js index b1478c3a6d..65bfe36058 100644 --- a/packages/frontend-core/src/fetch/UserFetch.js +++ b/packages/frontend-core/src/fetch/UserFetch.js @@ -33,7 +33,7 @@ export default class UserFetch extends DataFetch { let finalQuery // convert old format to new one - we now allow use of the lucene format const { appId, paginated, ...rest } = query - if (!LuceneUtils.hasFilters(query) && rest.email) { + if (!LuceneUtils.hasFilters(query) && rest.email != null) { finalQuery = { string: { email: rest.email } } } else { finalQuery = rest diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts index 755ccf61e7..19a7303072 100644 --- a/packages/types/src/documents/app/table/schema.ts +++ b/packages/types/src/documents/app/table/schema.ts @@ -102,6 +102,7 @@ export interface BBReferenceFieldMetadata extends Omit { type: FieldType.BB_REFERENCE subtype: FieldSubtype.USER | FieldSubtype.USERS + relationshipType?: RelationshipType } export interface FieldConstraints {