Merge remote-tracking branch 'origin/master' into fix/export-row-data

This commit is contained in:
Dean 2023-11-07 15:21:47 +00:00
commit 61106bf8d5
30 changed files with 206 additions and 19 deletions

View File

@ -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:

View File

@ -1,5 +1,5 @@
{
"version": "2.13.1",
"version": "2.13.2",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -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
>
<input
checked={value}
@ -68,4 +70,7 @@
.spectrum-Checkbox-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View File

@ -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
>
<label
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
@ -66,4 +68,7 @@
.spectrum-Checkbox-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View File

@ -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 @@
>
<div
id={flatpickrId}
class:is-disabled={disabled}
class:is-disabled={disabled || readonly}
class:is-invalid={!!error}
class="flatpickr spectrum-InputGroup spectrum-Datepicker"
class:is-focused={open}
@ -211,6 +212,7 @@
{/if}
<input
{disabled}
{readonly}
data-input
type="text"
class="spectrum-Textfield-input spectrum-InputGroup-input"

View File

@ -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
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
>
<input
on:change={onChange}
@ -62,4 +64,7 @@
.spectrum-Radio-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View File

@ -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
/>
</div>

View File

@ -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}

View File

@ -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 @@
<DatePicker
{error}
{disabled}
{readonly}
{value}
{placeholder}
{enableTime}

View File

@ -8,6 +8,7 @@
export let id = null
export let fullScreenOffset = 0
export let disabled = false
export let readonly = false
export let easyMDEOptions
const dispatch = createEventDispatcher()
@ -19,6 +20,9 @@
// control
$: checkValue(value)
$: mde?.codemirror.on("change", debouncedUpdate)
$: if (readonly || disabled) {
mde?.togglePreview()
}
const checkValue = val => {
if (mde && val !== latestValue) {
@ -54,6 +58,7 @@
easyMDEOptions={{
initialValue: value,
placeholder,
toolbar: disabled || readonly ? false : undefined,
...easyMDEOptions,
}}
/>

View File

@ -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,

View File

@ -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,
})

View File

@ -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
}
]
},

View File

@ -137,7 +137,8 @@
actionType: actionType === "Create" ? "Create" : "Update",
dataSource,
size,
disabled: disabled || actionType === "View",
disabled,
readonly: !disabled && actionType === "View",
}}
styles={{
normal: {

View File

@ -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}
<CoreDropzone
value={fieldState.value}
disabled={fieldState.disabled}
disabled={fieldState.disabled || fieldState.readonly}
error={fieldState.error}
on:change={handleChange}
{processFiles}

View File

@ -6,6 +6,7 @@
export let label
export let text
export let disabled = false
export let readonly = false
export let size
export let validation
export let defaultValue
@ -39,6 +40,7 @@
{label}
{field}
{disabled}
{readonly}
{validation}
defaultValue={isTruthy(defaultValue)}
type="boolean"
@ -49,6 +51,7 @@
<CoreCheckbox
value={fieldState.value}
disabled={fieldState.disabled}
readonly={fieldState.readonly}
error={fieldState.error}
id={fieldState.fieldId}
{size}

View File

@ -6,6 +6,7 @@
export let label
export let type = "barcodeqr"
export let disabled = false
export let readonly = false
export let validation
export let defaultValue = ""
export let onChange
@ -33,6 +34,7 @@
{label}
{field}
{disabled}
{readonly}
{validation}
{defaultValue}
{type}
@ -43,7 +45,7 @@
<CodeScanner
value={fieldState.value}
on:change={handleUpdate}
disabled={fieldState.disabled}
disabled={fieldState.disabled || fieldState.readonly}
{allowManualEntry}
scanButtonText={scanText}
{beepOnScan}

View File

@ -6,6 +6,7 @@
export let label
export let placeholder
export let disabled = false
export let readonly = false
export let enableTime = true
export let timeOnly = false
export let time24hr = false
@ -30,6 +31,7 @@
{label}
{field}
{disabled}
{readonly}
{validation}
{defaultValue}
{span}
@ -42,6 +44,7 @@
value={fieldState.value}
on:change={handleChange}
disabled={fieldState.disabled}
readonly={fieldState.readonly}
error={fieldState.error}
id={fieldState.fieldId}
appendTo={document.getElementById("flatpickr-root")}

View File

@ -10,6 +10,7 @@
export let defaultValue
export let type
export let disabled = false
export let readonly = false
export let validation
export let span = 6
@ -29,6 +30,7 @@
type,
defaultValue,
disabled,
readonly,
validation,
formStep
)
@ -76,6 +78,7 @@
contenteditable={$component.editing}
on:blur={$component.editing ? updateLabel : null}
class:hidden={!label}
class:readonly
for={fieldState?.fieldId}
class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${labelClass}`}
>
@ -136,4 +139,7 @@
.spectrum-FieldLabel--left {
padding-right: var(--spectrum-global-dimension-size-200);
}
.readonly {
pointer-events: none;
}
</style>

View File

@ -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}

View File

@ -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(),

View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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

View File

@ -102,6 +102,7 @@ export interface BBReferenceFieldMetadata
extends Omit<BaseFieldSchema, "subtype"> {
type: FieldType.BB_REFERENCE
subtype: FieldSubtype.USER | FieldSubtype.USERS
relationshipType?: RelationshipType
}
export interface FieldConstraints {

View File

@ -1,7 +1,7 @@
## Description
_Describe the problem or feature in addition to a link to the relevant github issues._
### Addresses:
## Addresses
- `<Enter the Link to the issue(s) this PR addresses>`
- ...more if required