diff --git a/api/src/database/migrations/20210506A-rename-interfaces.ts b/api/src/database/migrations/20210506A-rename-interfaces.ts new file mode 100644 index 0000000000..b83fe151d5 --- /dev/null +++ b/api/src/database/migrations/20210506A-rename-interfaces.ts @@ -0,0 +1,76 @@ +import { Knex } from 'knex'; + +// [before, after, after-option additions] +const changes: [string, string, Record?][] = [ + ['button-links', 'presentation-links'], + ['checkboxes', 'select-multiple-checkbox'], + ['code', 'input-code'], + ['color', 'select-color'], + ['datetime', 'datetime'], + ['divider', 'presentation-divider'], + ['dropdown', 'select-dropdown'], + ['dropdown-multiselect', 'select-multiple-dropdown'], + ['file', 'file'], + ['hash', 'input-hash'], + ['icon', 'select-icon'], + ['image', 'file-image'], + ['m2a-builder', 'list-m2a'], + ['many-to-many', 'list-m2m'], + ['many-to-one', 'select-dropdown-m2o'], + ['markdown', 'input-rich-text-md'], + ['notice', 'presentation-notice'], + ['numeric', 'input'], + ['one-to-many', 'list-o2m'], + ['radio-buttons', 'select-radio'], + ['repeater', 'list'], + ['slider', 'slider'], + ['slug', 'input', { slug: true }], + ['tags', 'tags'], + ['text-input', 'input'], + ['textarea', 'input-multiline'], + ['toggle', 'boolean'], + ['translations', 'translations'], + ['tree-view', 'list-o2m-tree-view'], + ['user', 'select-dropdown-m2o', { template: '{{avatar.$thumbnail}} {{first_name}} {{last_name}}' }], + ['wysiwyg', 'input-rich-text-html'], + + // System: + ['collection', 'system-collection'], + ['collections', 'system-collection-multiple'], + ['display-template', 'system-display-template'], + ['field', 'system-field'], + ['interface', 'system-interface'], + ['interface-options', 'system-interface-options'], + ['scope', 'system-scope'], + ['system-language', 'system-language'], + ['tfa-setup', 'system-mfa-setup'], +]; + +export async function up(knex: Knex): Promise { + for (const [before, after, options] of changes) { + // If any options need to be added, update the fields one by one in order to update the pre-existing field options + if (options) { + const fields = await knex + .select<{ id: number; options: Record }[]>('id', 'options') + .from('directus_fields') + .where({ interface: before }); + + for (const { id, options: existingOptions } of fields) { + const newOptions = { + ...(existingOptions || {}), + ...options, + }; + + await knex('directus_fields').update({ interface: after, options: newOptions }).where({ id }); + } + } else { + await knex('directus_fields').update({ interface: after }).where({ interface: before }); + } + } +} + +export async function down(knex: Knex): Promise { + for (const [before, after] of changes) { + await knex('directus_fields').update({ interface: before }).where({ interface: after }); + } +} diff --git a/api/src/database/system-data/fields/activity.yaml b/api/src/database/system-data/fields/activity.yaml index 44e6450fef..3e759a6ac5 100644 --- a/api/src/database/system-data/fields/activity.yaml +++ b/api/src/database/system-data/fields/activity.yaml @@ -66,7 +66,7 @@ fields: width: half - field: revisions - interface: one-to-many + interface: list-o2m special: o2m options: fields: diff --git a/api/src/database/system-data/fields/collections.yaml b/api/src/database/system-data/fields/collections.yaml index 637ac47a54..8c8c5a3fb9 100644 --- a/api/src/database/system-data/fields/collections.yaml +++ b/api/src/database/system-data/fields/collections.yaml @@ -5,53 +5,53 @@ fields: special: - alias - no-data - interface: divider + interface: presentation-divider options: icon: box title: Collection Setup width: full - field: collection - interface: text-input + interface: input options: font: monospace readonly: true width: half - field: icon - interface: icon + interface: select-icon options: width: half - field: note - interface: text-input + interface: input options: placeholder: A description of this collection... width: full - field: display_template - interface: display-template + interface: system-display-template options: collectionField: collection width: full - field: hidden special: boolean - interface: toggle + interface: boolean options: label: Hide within the App width: half - field: singleton special: boolean - interface: toggle + interface: boolean options: label: Treat as single object width: half - field: translations special: json - interface: repeater + interface: list options: template: '{{ translation }} ({{ language }})' fields: @@ -67,7 +67,7 @@ fields: name: Collection Name type: string meta: - interface: text-input + interface: input width: half options: placeholder: Enter a translation... @@ -75,7 +75,7 @@ fields: name: Singular Unit type: string meta: - interface: text-input + interface: input width: half options: placeholder: Enter a translation... @@ -83,7 +83,7 @@ fields: name: Plural Unit type: string meta: - interface: text-input + interface: input width: half options: placeholder: Enter a translation... @@ -93,14 +93,14 @@ fields: special: - alias - no-data - interface: divider + interface: presentation-divider options: icon: archive title: Archive width: full - field: archive_field - interface: field + interface: system-field options: collectionField: collection allowNone: true @@ -108,14 +108,14 @@ fields: width: half - field: archive_app_filter - interface: toggle + interface: boolean special: boolean options: label: Enable App Archive Filter width: half - field: archive_value - interface: text-input + interface: input options: font: monospace iconRight: archive @@ -123,7 +123,7 @@ fields: width: half - field: unarchive_value - interface: text-input + interface: input options: font: monospace iconRight: unarchive @@ -134,14 +134,14 @@ fields: special: - alias - no-data - interface: divider + interface: presentation-divider options: icon: sort title: Sort width: full - field: sort_field - interface: field + interface: system-field options: collectionField: collection placeholder: Choose a field... @@ -156,14 +156,14 @@ fields: special: - alias - no-data - interface: divider + interface: presentation-divider options: icon: admin_panel_settings title: Accountability width: full - field: accountability - interface: dropdown + interface: select-dropdown options: choices: - text: '$t:field_options.directus_collections.track_activity_revisions' diff --git a/api/src/database/system-data/fields/files.yaml b/api/src/database/system-data/fields/files.yaml index 2244ec7893..b0733daaea 100644 --- a/api/src/database/system-data/fields/files.yaml +++ b/api/src/database/system-data/fields/files.yaml @@ -3,18 +3,18 @@ table: directus_files fields: - field: id hidden: true - interface: text-input + interface: input special: uuid - field: title - interface: text-input + interface: input options: iconRight: title placeholder: A unique title... width: full - field: description - interface: textarea + interface: input-multiline width: full options: placeholder: An optional description... @@ -32,21 +32,21 @@ fields: format: false - field: location - interface: text-input + interface: input options: iconRight: place placeholder: An optional location... width: half - field: storage - interface: text-input + interface: input options: iconRight: storage width: half readonly: true - field: storage_divider - interface: divider + interface: presentation-divider options: icon: insert_drive_file title: File Naming @@ -56,7 +56,7 @@ fields: width: full - field: filename_disk - interface: text-input + interface: input options: iconRight: publish placeholder: Name on disk storage... @@ -64,7 +64,7 @@ fields: width: half - field: filename_download - interface: text-input + interface: input options: iconRight: get_app placeholder: Name when downloading... @@ -83,11 +83,13 @@ fields: readonly: true - field: modified_by - interface: user + interface: select-dropdown-m2o special: user-updated width: half display: user readonly: true + options: + template: '{{avatar.$thumbnail}} {{first_name}} {{last_name}}' - field: modified_on interface: datetime diff --git a/api/src/database/system-data/fields/folders.yaml b/api/src/database/system-data/fields/folders.yaml index 15ac834515..ae2a9806c2 100644 --- a/api/src/database/system-data/fields/folders.yaml +++ b/api/src/database/system-data/fields/folders.yaml @@ -2,7 +2,7 @@ table: directus_folders fields: - field: id - interface: text-input + interface: input special: uuid width: half @@ -11,4 +11,3 @@ fields: - field: name width: full - diff --git a/api/src/database/system-data/fields/roles.yaml b/api/src/database/system-data/fields/roles.yaml index 164efe152e..8cb3296965 100644 --- a/api/src/database/system-data/fields/roles.yaml +++ b/api/src/database/system-data/fields/roles.yaml @@ -3,33 +3,33 @@ table: directus_roles fields: - field: id hidden: true - interface: text-input + interface: input special: uuid - field: name - interface: text-input + interface: input options: placeholder: The unique name for this role... width: half - field: icon - interface: icon + interface: select-icon display: icon width: half - field: description - interface: text-input + interface: input options: placeholder: A description of this role... width: full - field: app_access - interface: toggle + interface: boolean special: boolean width: half - field: admin_access - interface: toggle + interface: boolean special: boolean width: half @@ -41,12 +41,12 @@ fields: width: full - field: enforce_tfa - interface: toggle + interface: boolean special: boolean width: half - field: users - interface: one-to-many + interface: list-o2m special: o2m options: fields: @@ -55,7 +55,7 @@ fields: width: full - field: module_list - interface: repeater + interface: list options: template: '{{ name }}' addLabel: Add New Module... @@ -64,13 +64,13 @@ fields: field: icon type: string meta: - interface: icon + interface: select-icon width: half - name: Name field: name type: string meta: - interface: text-input + interface: input width: half options: iconRight: title @@ -79,7 +79,7 @@ fields: field: link type: string meta: - interface: text-input + interface: input width: full options: iconRight: link @@ -88,7 +88,7 @@ fields: width: full - field: collection_list - interface: repeater + interface: list options: template: '{{ group_name }}' addLabel: Add New Group... @@ -98,7 +98,7 @@ fields: type: string meta: width: half - interface: text-input + interface: input options: iconRight: title placeholder: Label this group... @@ -111,7 +111,7 @@ fields: default_value: always_open meta: width: half - interface: dropdown + interface: select-dropdown options: choices: - value: always_open @@ -124,7 +124,7 @@ fields: field: collections type: JSON meta: - interface: repeater + interface: list options: addLabel: Add New Collection... template: '{{ collection }}' diff --git a/api/src/database/system-data/fields/settings.yaml b/api/src/database/system-data/fields/settings.yaml index 4613b7e99f..12f5f99944 100644 --- a/api/src/database/system-data/fields/settings.yaml +++ b/api/src/database/system-data/fields/settings.yaml @@ -5,7 +5,7 @@ fields: hidden: true - field: project_name - interface: text-input + interface: input options: iconRight: title placeholder: My project... @@ -15,7 +15,7 @@ fields: width: half - field: project_url - interface: text-input + interface: input options: iconRight: link placeholder: https://example.com @@ -25,7 +25,7 @@ fields: width: half - field: project_color - interface: color + interface: select-color note: Login & Logo Background translations: language: en-US @@ -41,7 +41,7 @@ fields: width: half - field: public_divider - interface: divider + interface: presentation-divider options: icon: public title: Public Pages @@ -65,13 +65,13 @@ fields: width: half - field: public_note - interface: textarea + interface: input-multiline options: placeholder: A short, public message that supports markdown formatting... width: full - field: security_divider - interface: divider + interface: presentation-divider options: icon: security title: Security @@ -81,7 +81,7 @@ fields: width: full - field: auth_password_policy - interface: dropdown + interface: select-dropdown options: choices: - value: null @@ -94,14 +94,14 @@ fields: width: half - field: auth_login_attempts - interface: numeric + interface: input options: iconRight: lock placeholder: $t:unlimited width: half - field: files_divider - interface: divider + interface: presentation-divider options: icon: storage title: Files & Thumbnails @@ -111,7 +111,7 @@ fields: width: full - field: storage_asset_presets - interface: repeater + interface: list options: fields: - field: key @@ -120,8 +120,9 @@ fields: schema: is_nullable: false meta: - interface: slug + interface: input options: + slug: true onlyOnCreate: false width: half - field: fit @@ -130,7 +131,7 @@ fields: schema: is_nullable: false meta: - interface: dropdown + interface: select-dropdown options: choices: - value: contain @@ -148,7 +149,7 @@ fields: schema: is_nullable: false meta: - interface: numeric + interface: input width: half - field: height name: Height @@ -156,7 +157,7 @@ fields: schema: is_nullable: false meta: - interface: numeric + interface: input width: half - field: quality type: integer @@ -176,7 +177,7 @@ fields: schema: default_value: false meta: - interface: toggle + interface: boolean width: half options: label: Don't upscale images @@ -185,7 +186,7 @@ fields: width: full - field: storage_asset_transform - interface: dropdown + interface: select-dropdown options: choices: - value: all @@ -197,7 +198,7 @@ fields: width: half - field: overrides_divider - interface: divider + interface: presentation-divider options: icon: brush title: App Overrides @@ -207,7 +208,7 @@ fields: width: full - field: custom_css - interface: code + interface: input-code options: language: css lineNumber: true diff --git a/api/src/database/system-data/fields/users.yaml b/api/src/database/system-data/fields/users.yaml index c1d15122c0..cc7be1ec9b 100644 --- a/api/src/database/system-data/fields/users.yaml +++ b/api/src/database/system-data/fields/users.yaml @@ -2,26 +2,26 @@ table: directus_users fields: - field: first_name - interface: text-input + interface: input options: iconRight: account_circle width: half - field: last_name - interface: text-input + interface: input options: iconRight: account_circle width: half - field: email - interface: text-input + interface: input options: iconRight: email width: half - field: password special: hash,conceal - interface: hash + interface: input-hash options: iconRight: lock masked: true @@ -33,19 +33,19 @@ fields: display: image - field: location - interface: text-input + interface: input options: iconRight: place width: half - field: title - interface: text-input + interface: input options: iconRight: work width: half - field: description - interface: textarea + interface: input-multiline width: full - field: tags @@ -61,7 +61,7 @@ fields: format: false - field: preferences_divider - interface: divider + interface: presentation-divider options: icon: face title: User Preferences @@ -75,7 +75,7 @@ fields: width: half - field: theme - interface: dropdown + interface: select-dropdown options: choices: - value: auto @@ -87,12 +87,12 @@ fields: width: half - field: tfa_secret - interface: tfa-setup + interface: mfa-setup special: conceal width: half - field: admin_divider - interface: divider + interface: presentation-divider options: icon: verified_user title: Admin Options @@ -103,7 +103,7 @@ fields: width: full - field: status - interface: dropdown + interface: select-dropdown options: choices: - text: Draft @@ -119,7 +119,7 @@ fields: width: half - field: role - interface: many-to-one + interface: select-dropdown-m2o options: template: '{{ name }}' special: m2o @@ -137,7 +137,7 @@ fields: - field: id special: uuid - interface: text-input + interface: input options: iconRight: vpn_key width: full diff --git a/api/src/database/system-data/fields/webhooks.yaml b/api/src/database/system-data/fields/webhooks.yaml index 99d0be0887..82ae7c3f27 100644 --- a/api/src/database/system-data/fields/webhooks.yaml +++ b/api/src/database/system-data/fields/webhooks.yaml @@ -5,13 +5,13 @@ fields: hidden: true - field: name - interface: text-input + interface: input options: iconRight: title width: full - field: method - interface: dropdown + interface: select-dropdown display: labels display_options: defaultForeground: 'var(--foreground-normal)' @@ -25,13 +25,13 @@ fields: width: half - field: url - interface: text-input + interface: input options: iconRight: link width: half - field: status - interface: dropdown + interface: select-dropdown display: labels display_options: defaultForeground: 'var(--foreground-normal)' @@ -55,7 +55,7 @@ fields: width: half - field: data - interface: toggle + interface: boolean options: label: Send Event Data special: boolean @@ -63,7 +63,7 @@ fields: display: boolean - field: triggers_divider - interface: divider + interface: presentation-divider options: icon: api title: Triggers @@ -73,7 +73,7 @@ fields: width: full - field: actions - interface: checkboxes + interface: select-multiple-checkbox options: choices: - text: Create @@ -107,7 +107,7 @@ fields: background: 'var(--purple-25)' - field: collections - interface: collections + interface: system-collections special: csv width: full display: labels diff --git a/api/src/services/collections.ts b/api/src/services/collections.ts index 86b31a8228..5cda70bbd2 100644 --- a/api/src/services/collections.ts +++ b/api/src/services/collections.ts @@ -425,11 +425,9 @@ export class CollectionsService { /** * @deprecated Use `createOne` or `createMany` instead */ - create(data: (Partial & { collection: string })[]): Promise; - create(data: Partial & { collection: string }): Promise; - async create( - data: (Partial & { collection: string }) | (Partial & { collection: string })[] - ): Promise { + create(data: RawCollection[]): Promise; + create(data: RawCollection): Promise; + async create(data: RawCollection | RawCollection[]): Promise { logger.warn( 'CollectionsService.create is deprecated and will be removed before v9.0.0. Use createOne or createMany instead.' ); diff --git a/app/src/components/v-form/form-field-interface.vue b/app/src/components/v-form/form-field-interface.vue index 26d1a83bfe..6be2a2dc55 100644 --- a/app/src/components/v-form/form-field-interface.vue +++ b/app/src/components/v-form/form-field-interface.vue @@ -80,9 +80,7 @@ export default defineComponent({ const { interfaces } = getInterfaces(); const interfaceExists = computed(() => { - return !!interfaces.value.find( - (inter: InterfaceConfig) => inter.id === props.field?.meta?.interface || 'text-input' - ); + return !!interfaces.value.find((inter: InterfaceConfig) => inter.id === props.field?.meta?.interface || 'input'); }); return { interfaceExists, getDefaultInterfaceForType }; diff --git a/app/src/displays/boolean/index.ts b/app/src/displays/boolean/index.ts index 7b2abc5dcf..621cb04f29 100644 --- a/app/src/displays/boolean/index.ts +++ b/app/src/displays/boolean/index.ts @@ -14,7 +14,7 @@ export default defineDisplay({ name: '$t:displays.boolean.label_on', type: 'string', meta: { - interface: 'text-input', + interface: 'input', width: 'half', options: { placeholder: '$t:displays.boolean.label_on_placeholder', @@ -26,7 +26,7 @@ export default defineDisplay({ name: '$t:displays.boolean.label_off', type: 'string', meta: { - interface: 'text-input', + interface: 'input', width: 'half', options: { placeholder: '$t:displays.boolean.label_off_placeholder', @@ -38,7 +38,7 @@ export default defineDisplay({ name: '$t:displays.boolean.icon_on', type: 'string', meta: { - interface: 'icon', + interface: 'select-icon', width: 'half', }, schema: { @@ -50,7 +50,7 @@ export default defineDisplay({ name: '$t:displays.boolean.icon_off', type: 'string', meta: { - interface: 'icon', + interface: 'select-icon', width: 'half', }, schema: { @@ -62,7 +62,7 @@ export default defineDisplay({ name: '$t:displays.boolean.color_on', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, schema: { @@ -74,7 +74,7 @@ export default defineDisplay({ name: '$t:displays.boolean.color_off', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, schema: { diff --git a/app/src/displays/collection/index.ts b/app/src/displays/collection/index.ts index ea0e90614b..a314a2d96e 100644 --- a/app/src/displays/collection/index.ts +++ b/app/src/displays/collection/index.ts @@ -14,7 +14,7 @@ export default defineDisplay({ name: '$t:icon', type: 'boolean', meta: { - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.collection.icon_label', }, diff --git a/app/src/displays/color/index.ts b/app/src/displays/color/index.ts index 83c847f120..14bd3b6b38 100644 --- a/app/src/displays/color/index.ts +++ b/app/src/displays/color/index.ts @@ -14,7 +14,7 @@ export default defineDisplay({ name: '$t:displays.color.default_color', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, schema: { diff --git a/app/src/displays/datetime/index.ts b/app/src/displays/datetime/index.ts index 6e162503db..c13af8f460 100644 --- a/app/src/displays/datetime/index.ts +++ b/app/src/displays/datetime/index.ts @@ -13,7 +13,7 @@ export default defineDisplay({ name: '$t:displays.datetime.format', type: 'string', meta: { - interface: 'dropdown', + interface: 'select-dropdown', width: 'half', options: { choices: [ @@ -34,7 +34,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.datetime.relative_label', }, diff --git a/app/src/displays/formatted-json-value/index.ts b/app/src/displays/formatted-json-value/index.ts index 31cc8488bb..248c59eeb5 100644 --- a/app/src/displays/formatted-json-value/index.ts +++ b/app/src/displays/formatted-json-value/index.ts @@ -15,7 +15,7 @@ export default defineDisplay({ type: 'string', meta: { width: 'full', - interface: 'text-input', + interface: 'input', options: { placeholder: '{{ field }}', }, diff --git a/app/src/displays/formatted-value/index.ts b/app/src/displays/formatted-value/index.ts index 6081c281d7..49c21aa5bd 100644 --- a/app/src/displays/formatted-value/index.ts +++ b/app/src/displays/formatted-value/index.ts @@ -15,7 +15,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.formatted-value.format_title_label', }, @@ -30,7 +30,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.formatted-value.bold_label', }, @@ -44,7 +44,7 @@ export default defineDisplay({ name: '$t:color', meta: { width: 'half', - interface: 'color', + interface: 'select-color', }, }, { @@ -52,7 +52,7 @@ export default defineDisplay({ name: '$t:font', meta: { width: 'half', - interface: 'dropdown', + interface: 'select-dropdown', options: { choices: [ { text: '$t:sans_serif', value: 'sans-serif' }, diff --git a/app/src/displays/icon/index.ts b/app/src/displays/icon/index.ts index 73ee88d70b..9abf06e30d 100644 --- a/app/src/displays/icon/index.ts +++ b/app/src/displays/icon/index.ts @@ -13,7 +13,7 @@ export default defineDisplay({ name: '$t:displays.icon.filled', type: 'boolean', meta: { - interface: 'toggle', + interface: 'boolean', width: 'half', options: { label: '$t:displays.icon.filled_label', @@ -28,7 +28,7 @@ export default defineDisplay({ name: '$t:color', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, }, diff --git a/app/src/displays/image/image.vue b/app/src/displays/image/image.vue index 08d4d71729..87d275e061 100644 --- a/app/src/displays/image/image.vue +++ b/app/src/displays/image/image.vue @@ -31,7 +31,6 @@ export default defineComponent({ const src = computed(() => { if (props.value === null) return null; const url = getRootPath() + `assets/${props.value.id}?key=system-small-cover`; - return addTokenToURL(url); }); diff --git a/app/src/displays/image/index.ts b/app/src/displays/image/index.ts index 38a3af5129..32c6764d46 100644 --- a/app/src/displays/image/index.ts +++ b/app/src/displays/image/index.ts @@ -15,7 +15,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.image.circle_label', }, diff --git a/app/src/displays/labels/index.ts b/app/src/displays/labels/index.ts index a04442cfb6..905b88645c 100644 --- a/app/src/displays/labels/index.ts +++ b/app/src/displays/labels/index.ts @@ -14,7 +14,7 @@ export default defineDisplay({ name: '$t:displays.labels.default_foreground', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, schema: { @@ -26,7 +26,7 @@ export default defineDisplay({ name: '$t:displays.labels.default_background', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, schema: { @@ -39,7 +39,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.labels.format_label', }, @@ -54,7 +54,7 @@ export default defineDisplay({ type: 'boolean', meta: { width: 'half', - interface: 'toggle', + interface: 'boolean', }, schema: { default_value: false, @@ -65,7 +65,7 @@ export default defineDisplay({ name: '$t:choices', type: 'json', meta: { - interface: 'repeater', + interface: 'list', options: { template: '{{text}}', fields: [ @@ -74,7 +74,7 @@ export default defineDisplay({ name: '$t:text', type: 'string', meta: { - interface: 'text-input', + interface: 'input', width: 'half', options: { placeholder: '$t:displays.labels.choices_text_placeholder', @@ -86,7 +86,7 @@ export default defineDisplay({ name: '$t:value', type: 'string', meta: { - interface: 'text-input', + interface: 'input', options: { font: 'monospace', placeholder: '$t:displays.labels.choices_value_placeholder', @@ -99,7 +99,7 @@ export default defineDisplay({ name: '$t:foreground_color', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, }, @@ -108,7 +108,7 @@ export default defineDisplay({ name: '$t:background_color', type: 'string', meta: { - interface: 'color', + interface: 'select-color', width: 'half', }, }, diff --git a/app/src/displays/mime-type/index.ts b/app/src/displays/mime-type/index.ts index 4f476a5526..45b66b3643 100644 --- a/app/src/displays/mime-type/index.ts +++ b/app/src/displays/mime-type/index.ts @@ -13,7 +13,7 @@ export default defineDisplay({ name: '$t:displays.mime-type.extension_only', type: 'boolean', meta: { - interface: 'toggle', + interface: 'boolean', options: { label: '$t:displays.mime-type.extension_only_label', }, diff --git a/app/src/displays/rating/index.ts b/app/src/displays/rating/index.ts index 11fd20da65..ebb7c83c3d 100644 --- a/app/src/displays/rating/index.ts +++ b/app/src/displays/rating/index.ts @@ -13,7 +13,7 @@ export default defineDisplay({ name: '$t:displays.rating.simple', type: 'boolean', meta: { - interface: 'toggle', + interface: 'boolean', width: 'half', options: { label: '$t:displays.rating.simple_label', diff --git a/app/src/displays/related-values/options.vue b/app/src/displays/related-values/options.vue index 8c005bfa84..095afd10b2 100644 --- a/app/src/displays/related-values/options.vue +++ b/app/src/displays/related-values/options.vue @@ -1,6 +1,6 @@ diff --git a/app/src/interfaces/input/options.vue b/app/src/interfaces/input/options.vue new file mode 100644 index 0000000000..d7183c032d --- /dev/null +++ b/app/src/interfaces/input/options.vue @@ -0,0 +1,234 @@ + + + diff --git a/app/src/interfaces/m2a-builder/index.ts b/app/src/interfaces/list-m2a/index.ts similarity index 57% rename from app/src/interfaces/m2a-builder/index.ts rename to app/src/interfaces/list-m2a/index.ts index cecb13ce99..41a6f2e107 100644 --- a/app/src/interfaces/m2a-builder/index.ts +++ b/app/src/interfaces/list-m2a/index.ts @@ -1,11 +1,11 @@ import { defineInterface } from '../define'; -import InterfaceManyToAny from './m2a-builder.vue'; +import InterfaceListM2A from './list-m2a.vue'; export default defineInterface({ - id: 'm2a-builder', - name: '$t:m2a_builder', + id: 'list-m2a', + name: '$t:list-m2a', icon: 'note_add', - component: InterfaceManyToAny, + component: InterfaceListM2A, relational: true, types: ['alias'], groups: ['m2a'], diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/list-m2a/list-m2a.vue similarity index 100% rename from app/src/interfaces/m2a-builder/m2a-builder.vue rename to app/src/interfaces/list-m2a/list-m2a.vue diff --git a/app/src/interfaces/many-to-many/index.ts b/app/src/interfaces/list-m2m/index.ts similarity index 55% rename from app/src/interfaces/many-to-many/index.ts rename to app/src/interfaces/list-m2m/index.ts index d166337214..0d38c8e5f1 100644 --- a/app/src/interfaces/many-to-many/index.ts +++ b/app/src/interfaces/list-m2m/index.ts @@ -1,13 +1,13 @@ import { defineInterface } from '../define'; -import InterfaceManyToMany from './many-to-many.vue'; +import InterfaceListM2M from './list-m2m.vue'; import Options from './options.vue'; export default defineInterface({ - id: 'many-to-many', - name: '$t:interfaces.many-to-many.many-to-many', - description: '$t:interfaces.many-to-many.description', + id: 'list-m2m', + name: '$t:interfaces.list-m2m.many-to-many', + description: '$t:interfaces.list-m2m.description', icon: 'note_add', - component: InterfaceManyToMany, + component: InterfaceListM2M, relational: true, types: ['alias'], groups: ['m2m', 'files'], diff --git a/app/src/interfaces/many-to-many/many-to-many.vue b/app/src/interfaces/list-m2m/list-m2m.vue similarity index 100% rename from app/src/interfaces/many-to-many/many-to-many.vue rename to app/src/interfaces/list-m2m/list-m2m.vue diff --git a/app/src/interfaces/many-to-many/options.vue b/app/src/interfaces/list-m2m/options.vue similarity index 98% rename from app/src/interfaces/many-to-many/options.vue rename to app/src/interfaces/list-m2m/options.vue index 671ef0d922..6be3432486 100644 --- a/app/src/interfaces/many-to-many/options.vue +++ b/app/src/interfaces/list-m2m/options.vue @@ -1,6 +1,6 @@