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:
Rijk van Zanten
2021-05-06 16:49:32 -04:00
committed by GitHub
parent c6927bb4e2
commit c4ae4b66cc
181 changed files with 2191 additions and 2328 deletions

View File

@@ -0,0 +1,76 @@
import { defineInterface } from '@/interfaces/define';
import CodeMirror from 'codemirror';
import 'codemirror/mode/meta';
import InterfaceCode from './input-code.vue';
const choicesMap = CodeMirror.modeInfo.reduce((acc: Record<string, string>, choice) => {
if (['JSON', 'JSON-LD'].includes(choice.name)) {
acc['JSON'] = 'JSON';
return acc;
}
if (choice.mode == null || choice.mode == 'null') {
choice.mode = 'plaintext';
}
if (choice.mode in acc) {
acc[choice.mode] += ' / ' + choice.name;
} else {
acc[choice.mode] = choice.name;
}
return acc;
}, {});
const choices = Object.entries(choicesMap).map(([key, value]) => ({
text: value,
value: key,
}));
export default defineInterface({
id: 'input-code',
name: '$t:interfaces.input-code.code',
description: '$t:interfaces.input-code.description',
icon: 'code',
component: InterfaceCode,
types: ['string', 'json', 'text'],
options: [
{
field: 'language',
name: '$t:language',
type: 'string',
meta: {
width: 'half',
interface: 'select-dropdown',
options: { choices },
},
},
{
field: 'lineNumber',
name: '$t:interfaces.input-code.line_number',
type: 'boolean',
meta: {
width: 'half',
interface: 'boolean',
},
schema: {
default_value: false,
},
},
{
field: 'template',
name: '$t:template',
type: 'text',
meta: {
width: 'full',
interface: 'input-code',
options: {
placeholder: '$t:interfaces.input-code.placeholder',
},
},
schema: {
default_value: null,
},
},
],
});