Files
directus/app/src/interfaces
Rijk van Zanten 9335372400 Foreign Key Constraints (#5615)
* Bump knex-schema-inspector

* Fix cli role name attr

* Update relation type

* Restructure relations

* Restructure relations table

* Update api type for relation record

* Fetch relations in new structure

* Update schema-inspector

* Use new relations schema structure in api

* Update relations GETters

* Add default value to one deselect

* Add create relationship on existing field

* Add updating existing relationship

* Add delete relations

* Add relations query resolver

* Add graphql mutations for relations

* Fix reading from wrong name

* Fix wrong method name

* No idea why this flip flops every install

* Update relation type

* Accept null in use-collection composable

* Use new relations structure in translations

* Use new relations structure in new-collection

* Start updating field detail store

* Renames for new relations structure

* Silently ignore passed collection/field in relation update

* Fix setting pk field in m2o relational setup

* Small tweaks in o2m setup

* Fix m2m setup

* Tweak m2o setup

* Fix m2a setup

* Allow null for related collection (m2a)

* Fix languages code name

* Fix migration default value

* Fix relational cleanup in collections/fields

* Fix transaction problem in field delete

* Fix inserting relational o2m items

* Don't execute updateByQuery on empty item set

Fixes #5710, fixes #5070

* Show referential action input on m2o

* Finish language for m2o

* Show triggers config on o2m

* Delete items on one_deselect_item delete

* Fix naming, show relational trigger config on m2m

* Tweak language, add setup to m2a

* Fix linter warnings

* Add trigger setup for translations

* fix Edit non-schema relationship issue

* Sync existing on_delete triggers in o2m setup

* Add migration to setup foreign key constraints

* Update illegal FK values before setting constraint

* Fix MySQL unsigned vs not-unsigned in FK creation

* Use pretty names for labels in relational triggers

* Prefix auto-junction when system table

Fixes #5493

* Add system foreign key triggers

Fixes #5749

* Update docs
2021-05-19 12:29:16 -04:00
..
2021-05-06 16:49:32 -04:00
2021-05-06 16:49:32 -04:00
2021-05-07 08:54:12 -04:00
2021-05-07 13:19:54 -04:00
2021-05-06 16:49:32 -04:00
2021-05-19 12:29:16 -04:00
2021-05-19 12:29:16 -04:00
2021-05-19 12:29:16 -04:00
2021-05-06 16:49:32 -04:00
2021-05-06 16:49:32 -04:00
2021-05-19 12:29:16 -04:00
2021-04-29 15:55:12 -04:00
2021-04-29 12:11:43 -04:00
2021-05-06 16:49:32 -04:00
2021-04-29 15:55:12 -04:00
2021-04-29 15:55:12 -04:00

Interfaces

Interfaces are the individual blocks that allow editing and viewing individual pieces of data. They can be seen as the individual fields in a form, where the field is a single column in a table.

Defining interfaces

Interfaces need to be defined through the defineInterface function. This allows the interface to register things like it's name and options.

export default defineInterface({
	id: 'input',
	register: ({ i18n }) => ({
		name: i18n.t('input'),
		icon: 'box',
		component: InterfaceTextInput,
	}),
});

id

Unique ID for the interface within the platform. This is not shown to the end user, but is used internally to build up forms and layouts.

register

Callback function that allows the interface to register it's options and other user-facing parameters.

The one parameter that the register function gets is context. Context holds the following properties:

Property Description
i18n The internal vue-i18n instance. Can be used to return a translated name or translated interface options

name

The user-facing name of the interface. By using the i18n handler from context, you can make this localized.

icon

The icon that's shown when refering to this interface. It's most prominent usage is in the field-setup wizard.

component

The Vue component that makes up the input of the interface. This is the component that will be rendered in the edit form.