mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Finalize interface names (#5521)
* Rename button-links->presentation-links * Rename checkboxes->select-multiple-checkbox * Rename code->input-code * Rename checkboxes files * Rename color->select-color * Rename divider->presentation-divider * Rename dropdown-multiselect->select-multiple-dropdown * Rename hash->input-hash * Rename icon->select-icon * Rename image->file-image * Rename m2a-builder->list-m2a * Rename many-to-many->list-m2m * Rename many-to-one->select-dropdown-m2o * Rename markdown->input-rich-text-md * Rename notice->presentation-notice * Rename one-to-many->list-o2m * Rename radio-buttons->select-radio * Rename repeater->list * Rename text-input->input * Rename textarea->input-multiline * Rename toggle->boolean * Rename tree-view->list-o2m-tree-view * Rename wysiwyg->input-rich-text-html * Use correct interfaces in system defaults * Rename collection->system-collection * Rename collections->system-collections * Rename display-template->system-display-template * Rename field->system-field * Rename interface->system-interface * Rename interface-options->system-interface-options * Rename scope->interface-scope * Rename tfa-setup->system-mfa-setup * Fix oversights * Remove old todo * Some more tweaks * Add migration, fix dropdown name in system use * Merge numeric + input * Replace dropdown->select-dropdown in app use * Merge slug->input, user->select-dropdown-m2o * Fix type issue * Fix seeder field name
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
<div class="field full">
|
||||
<div class="label type-label">{{ $t('field_name_translations') }}</div>
|
||||
<interface-repeater
|
||||
<interface-list
|
||||
v-model="fieldData.meta.translations"
|
||||
:template="'[{{ language }}] {{ translation }}'"
|
||||
:fields="[
|
||||
@@ -44,7 +44,7 @@
|
||||
type: 'string',
|
||||
name: $t('translation'),
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
width: 'half',
|
||||
options: {
|
||||
placeholder: 'Enter a translation...',
|
||||
|
||||
@@ -60,19 +60,19 @@ export default defineComponent({
|
||||
const type: string = state.fieldData?.type || 'alias';
|
||||
|
||||
const recommendedInterfacesPerType: { [type: string]: string[] } = {
|
||||
string: ['text-input', 'dropdown'],
|
||||
text: ['wysiwyg'],
|
||||
string: ['input', 'select-dropdown'],
|
||||
text: ['input-rich-text-html'],
|
||||
boolean: ['toggle'],
|
||||
integer: ['numeric'],
|
||||
bigInteger: ['numeric'],
|
||||
float: ['numeric'],
|
||||
decimal: ['numeric'],
|
||||
integer: ['input'],
|
||||
bigInteger: ['input'],
|
||||
float: ['input'],
|
||||
decimal: ['input'],
|
||||
timestamp: ['datetime'],
|
||||
datetime: ['datetime'],
|
||||
date: ['datetime'],
|
||||
time: ['datetime'],
|
||||
json: ['checkboxes', 'tags'],
|
||||
uuid: ['text-input'],
|
||||
json: ['select-multiple-checkbox', 'tags'],
|
||||
uuid: ['input'],
|
||||
csv: ['tags'],
|
||||
};
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ export default defineComponent({
|
||||
type: 'alias',
|
||||
meta: {
|
||||
special: 'm2m',
|
||||
interface: 'many-to-many',
|
||||
interface: 'list-m2m',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -196,7 +196,7 @@ export default defineComponent({
|
||||
collection: state.relations[0].one_collection,
|
||||
meta: {
|
||||
special: 'o2m',
|
||||
interface: 'one-to-many',
|
||||
interface: 'list-o2m',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -307,7 +307,7 @@ export default defineComponent({
|
||||
collection: state.relations[0].one_collection,
|
||||
field: state.relations[0].many_field,
|
||||
meta: {
|
||||
interface: 'many-to-one',
|
||||
interface: 'select-dropdown-m2o',
|
||||
special: 'm2o',
|
||||
},
|
||||
},
|
||||
@@ -335,7 +335,7 @@ export default defineComponent({
|
||||
collection: state.relations[0].one_collection,
|
||||
field: state.relations[0].many_field,
|
||||
meta: {
|
||||
interface: 'many-to-one',
|
||||
interface: 'select-dropdown-m2o',
|
||||
special: 'm2o',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -463,7 +463,7 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
|
||||
is_primary_key: true,
|
||||
},
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
options: {
|
||||
iconLeft: 'vpn_key',
|
||||
},
|
||||
@@ -475,7 +475,7 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
|
||||
type: 'string',
|
||||
schema: {},
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
options: {
|
||||
iconLeft: 'translate',
|
||||
},
|
||||
|
||||
@@ -253,7 +253,7 @@ export default defineComponent({
|
||||
meta: {
|
||||
hidden: true,
|
||||
readonly: true,
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
special: ['uuid'],
|
||||
},
|
||||
schema: {
|
||||
@@ -267,7 +267,7 @@ export default defineComponent({
|
||||
field: primaryKeyFieldName.value,
|
||||
type: 'string',
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
readonly: false,
|
||||
hidden: false,
|
||||
},
|
||||
@@ -283,7 +283,7 @@ export default defineComponent({
|
||||
type: 'integer',
|
||||
meta: {
|
||||
hidden: true,
|
||||
interface: 'numeric',
|
||||
interface: 'input',
|
||||
readonly: true,
|
||||
},
|
||||
schema: {
|
||||
@@ -320,7 +320,7 @@ export default defineComponent({
|
||||
},
|
||||
],
|
||||
},
|
||||
interface: 'dropdown',
|
||||
interface: 'select-dropdown',
|
||||
display: 'labels',
|
||||
display_options: {
|
||||
showAsDot: true,
|
||||
@@ -357,7 +357,7 @@ export default defineComponent({
|
||||
field: systemFields.sort.name,
|
||||
type: 'integer',
|
||||
meta: {
|
||||
interface: 'numeric',
|
||||
interface: 'input',
|
||||
hidden: true,
|
||||
},
|
||||
schema: {},
|
||||
@@ -372,9 +372,9 @@ export default defineComponent({
|
||||
type: 'uuid',
|
||||
meta: {
|
||||
special: ['user-created'],
|
||||
interface: 'user',
|
||||
interface: 'select-dropdown-m2o',
|
||||
options: {
|
||||
display: 'both',
|
||||
template: '{{avatar.$thumbnail}} {{first_name}} {{last_name}}',
|
||||
},
|
||||
display: 'user',
|
||||
readonly: true,
|
||||
@@ -410,9 +410,9 @@ export default defineComponent({
|
||||
type: 'uuid',
|
||||
meta: {
|
||||
special: ['user-updated'],
|
||||
interface: 'user',
|
||||
interface: 'select-dropdown-m2o',
|
||||
options: {
|
||||
display: 'both',
|
||||
template: '{{avatar.$thumbnail}} {{first_name}} {{last_name}}',
|
||||
},
|
||||
display: 'user',
|
||||
readonly: true,
|
||||
|
||||
@@ -395,7 +395,7 @@ export default defineComponent({
|
||||
name: i18n.t('collection'),
|
||||
type: 'string',
|
||||
meta: {
|
||||
interface: 'dropdown',
|
||||
interface: 'select-dropdown',
|
||||
options: {
|
||||
choices: collectionsStore.state.collections
|
||||
.map((collection) => ({
|
||||
@@ -416,7 +416,7 @@ export default defineComponent({
|
||||
name: i18n.t('scope'),
|
||||
type: 'string',
|
||||
meta: {
|
||||
interface: 'scope',
|
||||
interface: 'system-scope',
|
||||
width: 'half',
|
||||
},
|
||||
},
|
||||
@@ -425,7 +425,7 @@ export default defineComponent({
|
||||
name: i18n.t('layout'),
|
||||
type: 'string',
|
||||
meta: {
|
||||
interface: 'dropdown',
|
||||
interface: 'select-dropdown',
|
||||
options: {
|
||||
choices: layouts.value.map((layout) => ({
|
||||
text: layout.name,
|
||||
@@ -440,7 +440,7 @@ export default defineComponent({
|
||||
name: i18n.t('name'),
|
||||
type: 'string',
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
interface: 'input',
|
||||
width: 'half',
|
||||
options: {
|
||||
placeholder: i18n.t('preset_name_placeholder'),
|
||||
@@ -452,7 +452,7 @@ export default defineComponent({
|
||||
name: i18n.t('divider'),
|
||||
type: 'alias',
|
||||
meta: {
|
||||
interface: 'divider',
|
||||
interface: 'presentation-divider',
|
||||
width: 'fill',
|
||||
options: {
|
||||
title: i18n.t('layout_preview'),
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</v-notice>
|
||||
|
||||
<p class="type-label">{{ $tc('field', 0) }}</p>
|
||||
<interface-checkboxes v-model="fields" type="json" :choices="fieldsInCollection" />
|
||||
<interface-select-multiple-checkbox v-model="fields" type="json" :choices="fieldsInCollection" />
|
||||
|
||||
<div v-if="appMinimal" class="app-minimal">
|
||||
<v-divider />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}}
|
||||
</v-notice>
|
||||
|
||||
<interface-code v-model="permissions" language="json" type="json" />
|
||||
<interface-input-code v-model="permissions" language="json" type="json" />
|
||||
|
||||
<div v-if="appMinimal" class="app-minimal">
|
||||
<v-divider />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
})
|
||||
}}
|
||||
</v-notice>
|
||||
<interface-code v-model="presets" language="json" type="json" />
|
||||
<interface-input-code v-model="presets" language="json" type="json" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}}
|
||||
</v-notice>
|
||||
|
||||
<interface-code v-model="validation" language="json" type="json" />
|
||||
<interface-input-code v-model="validation" language="json" type="json" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user