Move module setup to Project Settings (#8012)

* Move module bar setup to project settings

* Add system modules interface to dnd configure module bar

* Cleanup order

* Crucially important typo

* Add ability to add custom links

* Show correct initial value marker
This commit is contained in:
Rijk van Zanten
2021-09-14 18:07:46 -04:00
committed by GitHub
parent 1f94542c2c
commit d750c7ebc4
19 changed files with 560 additions and 220 deletions

View File

@@ -0,0 +1,55 @@
import { Knex } from 'knex';
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('directus_roles', (table) => {
table.dropColumn('module_list');
});
await knex.schema.alterTable('directus_settings', (table) => {
table.json('module_bar').defaultTo(
JSON.stringify([
{
type: 'module',
id: 'collections',
enabled: true,
},
{
type: 'module',
id: 'users',
enabled: true,
},
{
type: 'module',
id: 'files',
enabled: true,
},
{
type: 'module',
id: 'insights',
enabled: false,
},
{
type: 'module',
id: 'docs',
enabled: true,
},
{
type: 'module',
id: 'settings',
enabled: true,
locked: true,
},
])
);
});
}
export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable('directus_roles', (table) => {
table.json('module_list');
});
await knex.schema.alterTable('directus_settings', (table) => {
table.dropColumn('module_bar');
});
}

View File

@@ -54,39 +54,6 @@ fields:
- last_name
width: full
- field: module_list
interface: list
options:
template: '{{ name }}'
addLabel: Add New Module...
fields:
- name: $t:field_options.directus_roles.fields.icon_name
field: icon
type: string
meta:
interface: select-icon
width: half
- name: $t:field_options.directus_roles.fields.name_name
field: name
type: string
meta:
interface: input
width: half
options:
iconRight: title
placeholder:
- name: $t:field_options.directus_roles.fields.link_name
field: link
type: string
meta:
interface: input
width: full
options:
iconRight: link
placeholder: $t:field_options.directus_roles.fields.link_placeholder
special: json
width: full
- field: collection_list
interface: list
options:

View File

@@ -332,3 +332,7 @@ fields:
type:
_neq: 'raster'
hidden: true
- field: module_bar
interface: system-modules
special: json