From d9a87b1805a3ec08d49bfb1106a9a36c09670566 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 16 Nov 2020 14:34:50 -0500 Subject: [PATCH 001/357] Fix name of trim option in text input interface --- app/src/lang/en-US/index.json | 2 +- app/src/lang/en-US/interfaces.json | 2 +- docs/concepts/relationships.md | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/src/lang/en-US/index.json b/app/src/lang/en-US/index.json index e3a6811e7e..08592acdbb 100644 --- a/app/src/lang/en-US/index.json +++ b/app/src/lang/en-US/index.json @@ -711,7 +711,7 @@ "step_interval": "Step Interval", "icon_left": "Icon Left", "icon_right": "Icon Right", - "trimed": "Trimed", + "trim": "Trim", "font_family": "Font Family", "font": "Font", "numeric": "Numeric", diff --git a/app/src/lang/en-US/interfaces.json b/app/src/lang/en-US/interfaces.json index c1a76d4424..98fb99d776 100644 --- a/app/src/lang/en-US/interfaces.json +++ b/app/src/lang/en-US/interfaces.json @@ -176,7 +176,7 @@ "text-input": { "text-input": "Text Input", "description": "Enter a single line text", - "trim": "Trimed", + "trim": "Trim", "trim_label": "Trim the start and end", "mask": "Masked", "mask_label": "Hide the real value" diff --git a/docs/concepts/relationships.md b/docs/concepts/relationships.md index c4c0bef7a7..eaeb5094d5 100644 --- a/docs/concepts/relationships.md +++ b/docs/concepts/relationships.md @@ -106,3 +106,20 @@ An example of a O2O is: a _person_ only has one unique set of _fingerprints_, an Sometimes called a "matrix field" or "replicator", the Many-to-Any (M2X) relationship is essentially the same as a M2M, but with one crucial difference: the junction table also stores the _parent collection name of the FK_. This "compound key" combines the collection name and FK to provide a unique reference to _any_ other item within the project. You can then artificially limit which collections are valid through an "allow list". An example of a M2X is a "page layout builder". These typically will have modular components across several different collections (eg: "Heading", "Text Block", "Media Asset", etc), and a _Pages_ collections where you can piece them together. Therefore, the junction table will link a specific page with specific components, allowing the creation of relational page layouts. + +@TODO + +``` +[ ] o2o +[x] m2o (dropdown) +[x] o2m (table, repeater) + +[x] m2m [o2m-m2o] (table, repeater) + +[ ] o2a (builder) +[x] a2o + +[x] m2a [o2m-a2o] (builder) +[ ] a2m [o2a-m2o] +[ ] a2a [o2a-a2o] (dynamic builder) +``` From 749de0bd1850b1ae300909c43c2a0b15b945322a Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 16 Nov 2020 14:36:32 -0500 Subject: [PATCH 002/357] Set default formatting to false --- app/src/displays/formatted-value/formatted-value.vue | 2 +- app/src/displays/formatted-value/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/displays/formatted-value/formatted-value.vue b/app/src/displays/formatted-value/formatted-value.vue index 8d1da01878..7fdcb7cc9d 100644 --- a/app/src/displays/formatted-value/formatted-value.vue +++ b/app/src/displays/formatted-value/formatted-value.vue @@ -18,7 +18,7 @@ export default defineComponent({ }, formatTitle: { type: Boolean, - default: true, + default: false, }, bold: { type: Boolean, diff --git a/app/src/displays/formatted-value/index.ts b/app/src/displays/formatted-value/index.ts index ab0bfb4399..e4f247f8b1 100644 --- a/app/src/displays/formatted-value/index.ts +++ b/app/src/displays/formatted-value/index.ts @@ -21,7 +21,7 @@ export default defineDisplay(({ i18n }) => ({ }, }, schema: { - default_value: true, + default_value: false, }, }, { From a17c3ce6db982843bf9f6e1e7f00e1b696900684 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 16 Nov 2020 15:38:59 -0500 Subject: [PATCH 003/357] Start on m2a-builder interface --- api/src/services/fields.ts | 2 +- app/src/interfaces/m2a-builder/index.ts | 13 +++ .../interfaces/m2a-builder/m2a-builder.vue | 84 +++++++++++++++++++ app/src/interfaces/types.ts | 2 +- app/src/lang/en-US/index.json | 3 + app/src/stores/relations.ts | 2 +- app/src/types/fields.ts | 12 ++- 7 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 app/src/interfaces/m2a-builder/index.ts create mode 100644 app/src/interfaces/m2a-builder/m2a-builder.vue diff --git a/api/src/services/fields.ts b/api/src/services/fields.ts index 194e0f1adf..561cc15d2b 100644 --- a/api/src/services/fields.ts +++ b/api/src/services/fields.ts @@ -104,7 +104,7 @@ export class FieldsService { aliasFields.push(...systemFieldRows); } - const aliasTypes = ['alias', 'o2m', 'm2m', 'files', 'files', 'translations']; + const aliasTypes = ['alias', 'o2m', 'm2m', 'm2a', 'files', 'files', 'translations']; aliasFields = aliasFields.filter((field) => { const specials = toArray(field.special); diff --git a/app/src/interfaces/m2a-builder/index.ts b/app/src/interfaces/m2a-builder/index.ts new file mode 100644 index 0000000000..1531786895 --- /dev/null +++ b/app/src/interfaces/m2a-builder/index.ts @@ -0,0 +1,13 @@ +import { defineInterface } from '../define'; +import InterfaceManyToAny from './m2a-builder.vue'; + +export default defineInterface(({ i18n }) => ({ + id: 'm2a-builder', + name: i18n.t('m2a_builder'), + icon: 'note_add', + component: InterfaceManyToAny, + relationship: 'm2a', + types: ['alias'], + localTypes: ['m2a'], + options: [], +})); diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/m2a-builder/m2a-builder.vue new file mode 100644 index 0000000000..048f6a5af6 --- /dev/null +++ b/app/src/interfaces/m2a-builder/m2a-builder.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/app/src/interfaces/types.ts b/app/src/interfaces/types.ts index c9c2d51ee3..b591fe02cb 100644 --- a/app/src/interfaces/types.ts +++ b/app/src/interfaces/types.ts @@ -11,7 +11,7 @@ export type InterfaceConfig = { options: DeepPartial[] | Component; types: typeof types[number][]; localTypes?: readonly typeof localTypes[number][]; - relationship?: null | 'm2o' | 'o2m' | 'm2m' | 'translations'; + relationship?: null | 'm2o' | 'o2m' | 'm2m' | 'm2a' | 'translations'; hideLabel?: boolean; hideLoader?: boolean; system?: boolean; diff --git a/app/src/lang/en-US/index.json b/app/src/lang/en-US/index.json index 08592acdbb..37c3aef072 100644 --- a/app/src/lang/en-US/index.json +++ b/app/src/lang/en-US/index.json @@ -517,6 +517,8 @@ "display_not_found": "Display \"{display}\" not found.", "reset_display": "Reset Display", + "m2a_builder": "Builder (M2A)", + "item_count": "No Items | One Item | {count} Items", "no_items_copy": "There are no items in this collection yet.", @@ -973,6 +975,7 @@ "activity_feed": "Activity Feed", "add_field_filter": "Add a field filter", "add_new": "Add New", + "from_collection": "From “{collection}” Collection", "create_new": "Create New", "additional_info": "Additional Info", "admin_email": "Admin Email", diff --git a/app/src/stores/relations.ts b/app/src/stores/relations.ts index c253e8d746..06584327e7 100644 --- a/app/src/stores/relations.ts +++ b/app/src/stores/relations.ts @@ -22,7 +22,7 @@ export const useRelationsStore = createStore({ return relation.many_collection === collection || relation.one_collection === collection; }); }, - getRelationsForField(collection: string, field: string) { + getRelationsForField(collection: string, field: string): Relation[] { const fieldsStore = useFieldsStore(); const fieldInfo = fieldsStore.getField(collection, field); diff --git a/app/src/types/fields.ts b/app/src/types/fields.ts index a900e132ac..fd08915dec 100644 --- a/app/src/types/fields.ts +++ b/app/src/types/fields.ts @@ -27,7 +27,17 @@ export const types = [ 'unknown', ] as const; -export const localTypes = ['standard', 'file', 'files', 'm2o', 'o2m', 'm2m', 'presentation', 'translations'] as const; +export const localTypes = [ + 'standard', + 'file', + 'files', + 'm2o', + 'o2m', + 'm2m', + 'm2a', + 'presentation', + 'translations', +] as const; export type FieldSchema = { /** @todo import this from @directus/schema when that's launched */ From 637310ecaea1b59cc03eabad61fb58d4239ac139 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 16 Nov 2020 16:17:08 -0500 Subject: [PATCH 004/357] Add select existing --- .../interfaces/m2a-builder/m2a-builder.vue | 55 +++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/m2a-builder/m2a-builder.vue index 048f6a5af6..d8178426f5 100644 --- a/app/src/interfaces/m2a-builder/m2a-builder.vue +++ b/app/src/interfaces/m2a-builder/m2a-builder.vue @@ -1,5 +1,7 @@ From 9d384c9cd7d3441dbbeacbf0d72fd6bf53c26039 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 16 Nov 2020 16:26:25 -0500 Subject: [PATCH 005/357] Fetch values for selected rows --- .../interfaces/m2a-builder/m2a-builder.vue | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/m2a-builder/m2a-builder.vue index d8178426f5..b0275f1be2 100644 --- a/app/src/interfaces/m2a-builder/m2a-builder.vue +++ b/app/src/interfaces/m2a-builder/m2a-builder.vue @@ -35,10 +35,12 @@ From 44a101c49e96fa704400af676529380d1794556c Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Tue, 17 Nov 2020 16:02:08 -0300 Subject: [PATCH 010/357] Stack color-inputs on 'half' width --- app/src/interfaces/color/color.vue | 52 +++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/app/src/interfaces/color/color.vue b/app/src/interfaces/color/color.vue index 67ef32b7e9..4aeccc692b 100644 --- a/app/src/interfaces/color/color.vue +++ b/app/src/interfaces/color/color.vue @@ -30,7 +30,7 @@ -
+
@@ -136,6 +136,10 @@ export default defineComponent({ }, ], }, + width: { + type: String, + required: true, + }, }, setup(props, { emit }) { const htmlColorInput = ref(null); @@ -151,13 +155,13 @@ export default defineComponent({ const isValidColor = computed(() => rgb.value !== null && props.value !== null); const lowContrast = computed(() => { - if (color.value === null) return true + if (color.value === null) return true; const pageColorString = getComputedStyle(document.body).getPropertyValue('--background-page').trim(); const pageColor = Color(pageColorString); - return color.value.contrast(pageColor) < 2 - }) + return color.value.contrast(pageColor) < 2; + }); const { hsl, rgb, hex, color } = useColor(); @@ -175,7 +179,7 @@ export default defineComponent({ menuActive, Color, setValue, - lowContrast + lowContrast, }; function setValue(type: 'rgb' | 'hsl', i: number, val: number) { @@ -236,7 +240,7 @@ export default defineComponent({ return color.value !== null ? color.value.hex() : null; }, set(newHex) { - if(newHex === '') color.value = null; + if (newHex === '') color.value = null; if (newHex === null || isHex(newHex) === false) return; color.value = Color(newHex); }, @@ -326,11 +330,6 @@ export default defineComponent({ margin-left: calc(-1 * var(--border-width)); } - /* stylelint-disable indentation */ - &:not(:last-child)::v-deep .input:not(.active):not(:focus-within):not(:hover):not(:active):not(:focus) { - border-right-color: transparent; - } - &:first-child { --border-radius: 4px 0px 0px 4px; } @@ -339,5 +338,36 @@ export default defineComponent({ --border-radius: 0px 4px 4px 0px; } } + + &.stacked { + grid-template-columns: repeat(3, 1fr); + + .color-type { + grid-column: 1 / span 3; + } + + .color-data-input { + &:not(:first-child)::v-deep .input { + margin-top: calc(-2 * var(--border-width)); + margin-left: initial; + } + + &:not(:first-child):not(:nth-child(2))::v-deep .input { + margin-left: calc(-1 * var(--border-width)); + } + + &:first-child { + --border-radius: 4px 4px 0px 0px; + } + + &:nth-child(2) { + --border-radius: 0px 0px 0px 4px; + } + + &:last-child { + --border-radius: 0px 0px 4px 0px; + } + } + } } From ececff6e14c18767761142983ad1c22cf60d5f1b Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 17 Nov 2020 14:23:39 -0500 Subject: [PATCH 011/357] Add todo --- .../interfaces/m2a-builder/m2a-builder.vue | 96 ++++++++++++++++++- .../components/drawer-item/drawer-item.vue | 31 +++--- 2 files changed, 108 insertions(+), 19 deletions(-) diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/m2a-builder/m2a-builder.vue index ea9f0b70a4..411f155aa2 100644 --- a/app/src/interfaces/m2a-builder/m2a-builder.vue +++ b/app/src/interfaces/m2a-builder/m2a-builder.vue @@ -1,6 +1,6 @@ From 6ac2180ab4726afc17a5e23e9bac1e5d59abc171 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 18:33:34 -0500 Subject: [PATCH 066/357] Add displays to new collection date fields Closes #3226 --- .../modules/settings/routes/data-model/new-collection.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/modules/settings/routes/data-model/new-collection.vue b/app/src/modules/settings/routes/data-model/new-collection.vue index dd0ad49baa..fab90254dc 100644 --- a/app/src/modules/settings/routes/data-model/new-collection.vue +++ b/app/src/modules/settings/routes/data-model/new-collection.vue @@ -389,6 +389,10 @@ export default defineComponent({ readonly: true, hidden: true, width: 'half', + display: 'datetime', + display_options: { + relative: true, + }, }, schema: {}, }); @@ -423,6 +427,10 @@ export default defineComponent({ readonly: true, hidden: true, width: 'half', + display: 'datetime', + display_options: { + relative: true, + }, }, schema: {}, }); From 08c248f4a0607582b1dc88e24cbdb4141261ef38 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 18:42:25 -0500 Subject: [PATCH 067/357] Don't treat leading zero values as numbers Fixes #3216 --- api/src/env.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/env.ts b/api/src/env.ts index c23a1dfb23..1271103d2a 100644 --- a/api/src/env.ts +++ b/api/src/env.ts @@ -62,7 +62,8 @@ function processValues(env: Record) { if (value === 'true') env[key] = true; if (value === 'false') env[key] = false; if (value === 'null') env[key] = null; - if (isNaN(value) === false && value.length > 0) env[key] = Number(value); + if (String(value).startsWith('0') === false && isNaN(value) === false && value.length > 0) + env[key] = Number(value); } return env; From 0dbaefcb4cdf151d277a685472e92523bc603641 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 19:16:44 -0500 Subject: [PATCH 068/357] Add default nested limit --- api/src/database/run-ast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/database/run-ast.ts b/api/src/database/run-ast.ts index 48e01423c0..02952351a2 100644 --- a/api/src/database/run-ast.ts +++ b/api/src/database/run-ast.ts @@ -94,7 +94,7 @@ export default async function runAST( // to the "standard" item limit. Instead of _n_ nested items per parent item, it would mean // that there's _n_ items, which are then divided on the parent items. (no good) if (nestedNode.type === 'o2m') { - tempLimit = nestedNode.query.limit; + tempLimit = nestedNode.query.limit || 100; nestedNode.query.limit = -1; } From a9ffc4097959d5f5399ba38adc22b7624546d4ed Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 19:31:25 -0500 Subject: [PATCH 069/357] Fix schema not handling uppercases in PG Fixes #3213 --- api/src/controllers/items.ts | 2 ++ packages/schema/src/dialects/postgres.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/controllers/items.ts b/api/src/controllers/items.ts index 53f979c79f..d70fb97c75 100644 --- a/api/src/controllers/items.ts +++ b/api/src/controllers/items.ts @@ -52,6 +52,7 @@ router.get( accountability: req.accountability, schema: req.schema, }); + const metaService = new MetaService({ accountability: req.accountability, schema: req.schema, @@ -67,6 +68,7 @@ router.get( meta: meta, data: records || null, }; + return next(); }), respond diff --git a/packages/schema/src/dialects/postgres.ts b/packages/schema/src/dialects/postgres.ts index f25b2bbb9b..42cf64ab48 100644 --- a/packages/schema/src/dialects/postgres.ts +++ b/packages/schema/src/dialects/postgres.ts @@ -281,7 +281,7 @@ export default class Postgres implements Schema { knex.raw('pg_attribute.attnum = any(pg_index.indkey)') ); }) - .whereRaw('pg_index.indrelid = c.table_name::regclass') + .whereRaw('pg_index.indrelid = quote_ident(c.table_name)::regclass') .andWhere(knex.raw('pg_attribute.attname = c.column_name')) .andWhere(knex.raw('pg_index.indisprimary')) .as('is_primary'), @@ -299,7 +299,9 @@ export default class Postgres implements Schema { .andWhere({ 'pg_catalog.pg_class.relname': 'c.table_name' }) .as('column_comment'), - knex.raw('pg_get_serial_sequence(c.table_name, c.column_name) as serial'), + knex.raw( + 'pg_get_serial_sequence(quote_ident(c.table_name), c.column_name) as serial' + ), 'ffk.referenced_table_schema', 'ffk.referenced_table_name', From 100937c2dd4161094ecc86b666e03c03f5b832d2 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 19:44:53 -0500 Subject: [PATCH 070/357] Fix `*.*.*` fields using wrong default fields Fixes #3219 --- api/package.json | 2 +- api/src/utils/get-ast-from-query.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/package.json b/api/package.json index cc6b5cd34f..41321d36e2 100644 --- a/api/package.json +++ b/api/package.json @@ -53,7 +53,7 @@ "scripts": { "start": "npx directus start", "build": "rm -rf dist && tsc --build && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist", - "dev": "cross-env NODE_ENV=development LOG_LEVEL=trace ts-node-dev --files src/start.ts --respawn --watch \"src/**/*.ts\" --watch \".env\" --transpile-only", + "dev": "cross-env NODE_ENV=development ts-node-dev --files src/start.ts --respawn --watch \"src/**/*.ts\" --watch \".env\" --transpile-only", "cli": "cross-env NODE_ENV=development ts-node --script-mode --transpile-only src/cli/index.ts", "prepublishOnly": "npm run build" }, diff --git a/api/src/utils/get-ast-from-query.ts b/api/src/utils/get-ast-from-query.ts index 32fbf970cc..8420eff016 100644 --- a/api/src/utils/get-ast-from-query.ts +++ b/api/src/utils/get-ast-from-query.ts @@ -239,6 +239,7 @@ export default async function getASTFromQuery( if (fieldKey.includes('*') === false) continue; if (fieldKey === '*') { + console.log(allowedFields); // Set to all fields in collection if (allowedFields.includes('*')) { fields.splice(index, 1, ...fieldsInCollection); @@ -265,7 +266,7 @@ export default async function getASTFromQuery( }) : allowedFields.filter((fieldKey) => !!getRelation(parentCollection, fieldKey)); - const nonRelationalFields = fieldsInCollection.filter( + const nonRelationalFields = allowedFields.filter( (fieldKey) => relationalFields.includes(fieldKey) === false ); From bf45a08c379b8786cefaf61131ac7ac7f8e53003 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 19:49:52 -0500 Subject: [PATCH 071/357] Reset current page to 1 on collection switch Ref #3176 --- app/src/layouts/tabular/tabular.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/layouts/tabular/tabular.vue b/app/src/layouts/tabular/tabular.vue index bf143bbc35..4ac587d8e8 100644 --- a/app/src/layouts/tabular/tabular.vue +++ b/app/src/layouts/tabular/tabular.vue @@ -326,6 +326,12 @@ export default defineComponent({ function useItemOptions() { const page = ref(1); + watch( + () => props.collection, + () => (page.value = 1), + { immediate: true } + ); + const sort = computed({ get() { return _layoutQuery.value?.sort || primaryKeyField.value?.field; From cc2b18d711a0665aef3fd91841db24d00a99d467 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 20:53:51 -0500 Subject: [PATCH 072/357] Cas't string default value NULL to null Fixes #2924 --- api/src/utils/get-default-value.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/utils/get-default-value.ts b/api/src/utils/get-default-value.ts index 459183d822..bd3ab24280 100644 --- a/api/src/utils/get-default-value.ts +++ b/api/src/utils/get-default-value.ts @@ -9,12 +9,14 @@ export default function getDefaultValue( let defaultValue = column.default_value || null; if (defaultValue === null) return null; + if (defaultValue === 'null') return null; + if (defaultValue === 'NULL') return null; // Check if the default is wrapped in an extra pair of quotes, this happens in SQLite if ( typeof defaultValue === 'string' && - defaultValue.startsWith(`'`) && - defaultValue.endsWith(`'`) + ((defaultValue.startsWith(`'`) && defaultValue.endsWith(`'`)) || + (defaultValue.startsWith(`"`) && defaultValue.endsWith(`"`))) ) { defaultValue = defaultValue.slice(1, -1); } From e8c2a612778ad13c265b6eb6c82036155ef1ce85 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 20:58:10 -0500 Subject: [PATCH 073/357] Fix wrong import --- api/src/services/payload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/services/payload.ts b/api/src/services/payload.ts index 2b7e796d1c..9e2d13b5c6 100644 --- a/api/src/services/payload.ts +++ b/api/src/services/payload.ts @@ -26,7 +26,7 @@ import { toArray } from '../utils/to-array'; import { FieldMeta } from '../types'; import { systemFieldRows } from '../database/system-data/fields'; import { systemRelationRows } from '../database/system-data/relations'; -import { InvalidPayloadException } from '../../dist/exceptions'; +import { InvalidPayloadException } from '../exceptions'; import { isPlainObject } from 'lodash'; type Action = 'create' | 'read' | 'update'; From eb306e91b1eb5234dc70d9244a5b7b774094efec Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 20:58:25 -0500 Subject: [PATCH 074/357] Ignore dist in tsconfig --- api/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/tsconfig.json b/api/tsconfig.json index 53f4a560a0..bc28a37ea8 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -14,6 +14,7 @@ "declaration": true }, "exclude": [ - "node_modules" + "node_modules", + "dist" ] } From d7b74e34734899650ce973aa2866a10e1826ab01 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 27 Nov 2020 21:01:35 -0500 Subject: [PATCH 075/357] v9.0.0-rc.19 --- api/package.json | 2 +- app/package.json | 2 +- docs/package-lock.json | 2 +- docs/package.json | 2 +- lerna.json | 2 +- packages/create-directus-project/package.json | 2 +- packages/format-title/package.json | 2 +- packages/schema/package.json | 2 +- packages/sdk-js/package.json | 2 +- packages/specs/package-lock.json | 2 +- packages/specs/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/package.json b/api/package.json index 41321d36e2..0c8e0af828 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "directus", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "license": "GPL-3.0-only", "homepage": "https://github.com/directus/directus#readme", "description": "Directus is a real-time API and App dashboard for managing SQL database content.", diff --git a/app/package.json b/app/package.json index 26c09e1d93..3f589ce14a 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@directus/app", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "private": false, "description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases", "author": "Rijk van Zanten ", diff --git a/docs/package-lock.json b/docs/package-lock.json index f9695d08c0..bf42a84f09 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,6 +1,6 @@ { "name": "@directus/docs", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/docs/package.json b/docs/package.json index 97dc6aa993..cb144d9f43 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "description": "", "main": "index.js", "scripts": { diff --git a/lerna.json b/lerna.json index 96173406ce..2fa73a493d 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,7 @@ "docs", "packages/*" ], - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "command": { "bootstrap": { "npmClientArgs": [ diff --git a/packages/create-directus-project/package.json b/packages/create-directus-project/package.json index 0f77282b59..8bf9d05518 100644 --- a/packages/create-directus-project/package.json +++ b/packages/create-directus-project/package.json @@ -1,6 +1,6 @@ { "name": "create-directus-project", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "description": "A small installer util that will create a directory, add boilerplate folders, and install Directus through npm.", "main": "lib/index.js", "bin": "./lib/index.js", diff --git a/packages/format-title/package.json b/packages/format-title/package.json index 05e1e427c1..d04db4824a 100644 --- a/packages/format-title/package.json +++ b/packages/format-title/package.json @@ -1,6 +1,6 @@ { "name": "@directus/format-title", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "description": "Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)", "keywords": [ "title-case", diff --git a/packages/schema/package.json b/packages/schema/package.json index b2846379e2..3753fe661c 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@directus/schema", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "description": "Utility for extracting information about existing DB schema", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk-js/package.json b/packages/sdk-js/package.json index 102b659947..c52ff27086 100644 --- a/packages/sdk-js/package.json +++ b/packages/sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "@directus/sdk-js", - "version": "9.0.0-rc.18-1", + "version": "9.0.0-rc.19", "description": "The official Directus SDK for use in JavaScript!", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/specs/package-lock.json b/packages/specs/package-lock.json index c63203d17f..705b1e2398 100644 --- a/packages/specs/package-lock.json +++ b/packages/specs/package-lock.json @@ -1,6 +1,6 @@ { "name": "@directus/specs", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/specs/package.json b/packages/specs/package.json index 81dec1c7da..a0a65df12f 100644 --- a/packages/specs/package.json +++ b/packages/specs/package.json @@ -1,6 +1,6 @@ { "name": "@directus/specs", - "version": "9.0.0-rc.18", + "version": "9.0.0-rc.19", "description": "OpenAPI Specification of the Directus API", "main": "index.js", "scripts": { From e6066fb653641b5865ada844d7268afe9f48f59a Mon Sep 17 00:00:00 2001 From: e01 Date: Sun, 29 Nov 2020 15:53:58 +0200 Subject: [PATCH 076/357] Add formatted-json-value display --- .../formatted-json-value.vue | 37 +++++++++++++++++++ .../displays/formatted-json-value/index.ts | 25 +++++++++++++ app/src/lang/en-US/displays.json | 4 ++ 3 files changed, 66 insertions(+) create mode 100644 app/src/displays/formatted-json-value/formatted-json-value.vue create mode 100644 app/src/displays/formatted-json-value/index.ts diff --git a/app/src/displays/formatted-json-value/formatted-json-value.vue b/app/src/displays/formatted-json-value/formatted-json-value.vue new file mode 100644 index 0000000000..a24c6dc0d3 --- /dev/null +++ b/app/src/displays/formatted-json-value/formatted-json-value.vue @@ -0,0 +1,37 @@ + + + diff --git a/app/src/displays/formatted-json-value/index.ts b/app/src/displays/formatted-json-value/index.ts new file mode 100644 index 0000000000..6cff4e7280 --- /dev/null +++ b/app/src/displays/formatted-json-value/index.ts @@ -0,0 +1,25 @@ +import { defineDisplay } from '@/displays/define'; +import DisplayJsonValue from './formatted-json-value.vue'; + +export default defineDisplay(({ i18n }) => ({ + id: 'formatted-json-value', + name: i18n.t('displays.formatted-json-value.formatted-json-value'), + description: i18n.t('displays.formatted-json-value.description'), + types: ['json'], + icon: 'settings_ethernet', + handler: DisplayJsonValue, + options: [ + { + field: 'format', + name: i18n.t('display_template'), + type: 'string', + meta: { + width: 'full', + interface: 'text-input', + options: { + placeholder: '{{ field }}', + }, + }, + }, + ], +})); diff --git a/app/src/lang/en-US/displays.json b/app/src/lang/en-US/displays.json index a875737be1..fd8d52ac2e 100644 --- a/app/src/lang/en-US/displays.json +++ b/app/src/lang/en-US/displays.json @@ -48,6 +48,10 @@ "format_title_label": "Auto-format casing", "bold_label": "Use bold style" }, + "formatted-json-value": { + "formatted-json-value": "Formatted JSON value", + "description": "Display a formatted version of the object" + }, "icon": { "icon": "Icon", "description": "Display an icon", From 198b9d46a7232e2de709e28bde58a3545b66935b Mon Sep 17 00:00:00 2001 From: e01 Date: Sun, 29 Nov 2020 18:57:42 +0200 Subject: [PATCH 077/357] Make duplicate field db-safe --- .../routes/data-model/fields/components/field-select.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/modules/settings/routes/data-model/fields/components/field-select.vue b/app/src/modules/settings/routes/data-model/fields/components/field-select.vue index 47bc90563b..da8111961a 100644 --- a/app/src/modules/settings/routes/data-model/fields/components/field-select.vue +++ b/app/src/modules/settings/routes/data-model/fields/components/field-select.vue @@ -184,7 +184,7 @@
{{ $tc('field', 0) }} - +
From ba4605752b60681dd105b9d677265c393ab91322 Mon Sep 17 00:00:00 2001 From: Samuli Asmala Date: Mon, 30 Nov 2020 11:50:18 +0200 Subject: [PATCH 078/357] Only select columns from BASE TABLEs to exclude views Postgres views cannot have primary keys so presence of any views prevented the use of application. Fixes #3229. --- packages/schema/src/dialects/postgres.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/schema/src/dialects/postgres.ts b/packages/schema/src/dialects/postgres.ts index 42cf64ab48..048acc331c 100644 --- a/packages/schema/src/dialects/postgres.ts +++ b/packages/schema/src/dialects/postgres.ts @@ -90,18 +90,23 @@ export default class Postgres implements Schema { // =============================================================================================== async overview() { const [columnsResult, primaryKeysResult] = await Promise.all([ + // Only select columns from BASE TABLEs to exclude views (Postgres views + // cannot have primary keys so they cannot be used) this.knex.raw( ` SELECT - table_name, - column_name, - column_default as default_value, - is_nullable, - data_type + c.table_name, + c.column_name, + c.column_default as default_value, + c.is_nullable, + c.data_type FROM - information_schema.columns + information_schema.columns c + LEFT JOIN information_schema.tables t + ON c.table_name = t.table_name WHERE - table_schema IN (?); + t.table_type = 'BASE TABLE' + AND c.table_schema IN (?); `, [this.explodedSchema.join(',')] ), From 59671e4c49e7909fc5fdd19082b72d9c054d95a9 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 30 Nov 2020 10:04:20 -0500 Subject: [PATCH 079/357] Update readme.md Fixes #3244 --- app/src/components/v-card/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/components/v-card/readme.md b/app/src/components/v-card/readme.md index f6cbc9f64c..1c081f28af 100644 --- a/app/src/components/v-card/readme.md +++ b/app/src/components/v-card/readme.md @@ -8,10 +8,10 @@ Renders a card. A card is nothing but a v-sheet with predefined building blocks Hello, world! This is a card - Consectetur enim ullamco sint sit deserunt proident consectetur. + Consectetur enim ullamco sint sit deserunt proident consectetur. Save - + ``` From 58fc7af2ae21de73ce0fdacd5d7857ed22d6dde7 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 30 Nov 2020 11:07:15 -0500 Subject: [PATCH 080/357] Update special-case.ts --- packages/format-title/src/special-case.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/format-title/src/special-case.ts b/packages/format-title/src/special-case.ts index 51d1cdce6b..45edcd15b6 100644 --- a/packages/format-title/src/special-case.ts +++ b/packages/format-title/src/special-case.ts @@ -23,4 +23,5 @@ export default [ 'YouTube', 'UUID', 'SEO', + 'CTA' ]; From 4428aebe92ed46c602dfc4ea5ad4c7d331b6618b Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 1 Dec 2020 00:06:05 +0100 Subject: [PATCH 081/357] Fix default value of SQLite schema overview Fixes #3186 --- packages/schema/src/dialects/sqlite.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/schema/src/dialects/sqlite.ts b/packages/schema/src/dialects/sqlite.ts index e655c566a8..2313efa376 100644 --- a/packages/schema/src/dialects/sqlite.ts +++ b/packages/schema/src/dialects/sqlite.ts @@ -25,6 +25,13 @@ export default class SQLite implements Schema { // Overview // =============================================================================================== async overview() { + const tablesWithAutoIncrementPrimaryKeys = ( + await this.knex + .select('name') + .from('sqlite_master') + .whereRaw(`sql LIKE "%AUTOINCREMENT%"`) + ).map(({ name }) => name); + const tables = await this.tables(); const overview: SchemaOverview = {}; @@ -42,7 +49,10 @@ export default class SQLite implements Schema { overview[table].columns[column.name] = { table_name: table, column_name: column.name, - default_value: column.dflt_value, + default_value: + column.pk === 1 && tablesWithAutoIncrementPrimaryKeys.includes(table) + ? 'AUTO_INCREMENT' + : column.dflt_value, is_nullable: column.notnull == 0, data_type: column.type, numeric_precision: null, From 41ea26b143281a94bc34390b54e3a94e66027c00 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 1 Dec 2020 00:18:57 +0100 Subject: [PATCH 082/357] Fix nullable property of Postgres schema overview --- packages/schema/src/dialects/postgres.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/schema/src/dialects/postgres.ts b/packages/schema/src/dialects/postgres.ts index 048acc331c..f459976930 100644 --- a/packages/schema/src/dialects/postgres.ts +++ b/packages/schema/src/dialects/postgres.ts @@ -148,10 +148,11 @@ export default class Postgres implements Schema { columns: {}, }; - overview[column.table_name].columns[column.column_name] = column; - overview[column.table_name].columns[ - column.column_name - ].default_value = this.parseDefaultValue(column.default_value); + overview[column.table_name].columns[column.column_name] = { + ...column, + default_value: this.parseDefaultValue(column.default_value), + is_nullable: column.is_nullable === 'YES', + }; } return overview; From d3b038289e3f6572eb15cbab1b12ce0cfb923840 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 11:55:39 -0500 Subject: [PATCH 083/357] Fix typing in formatted-json-value display --- .../displays/formatted-json-value/formatted-json-value.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/displays/formatted-json-value/formatted-json-value.vue b/app/src/displays/formatted-json-value/formatted-json-value.vue index a24c6dc0d3..226b13332f 100644 --- a/app/src/displays/formatted-json-value/formatted-json-value.vue +++ b/app/src/displays/formatted-json-value/formatted-json-value.vue @@ -18,14 +18,14 @@ export default defineComponent({ }, format: { type: String, - default: false, + default: null, }, }, setup(props) { const displayValue = computed(() => { if (!props.value) return null; try { - return render(props.format, props.value); + return render(props.format || '', props.value); } catch (error) { return null; } From 9ce3f264b61ebc0b38f13717cc401331453229a9 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 12:45:09 -0500 Subject: [PATCH 084/357] Bad log, no log --- api/src/utils/get-ast-from-query.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/src/utils/get-ast-from-query.ts b/api/src/utils/get-ast-from-query.ts index 8420eff016..9193da0366 100644 --- a/api/src/utils/get-ast-from-query.ts +++ b/api/src/utils/get-ast-from-query.ts @@ -239,7 +239,6 @@ export default async function getASTFromQuery( if (fieldKey.includes('*') === false) continue; if (fieldKey === '*') { - console.log(allowedFields); // Set to all fields in collection if (allowedFields.includes('*')) { fields.splice(index, 1, ...fieldsInCollection); From 47b06dc99fd017c223b5d30d8a9aac265a7d1691 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 1 Dec 2020 18:48:26 +0100 Subject: [PATCH 085/357] Fix a typo in cache.ts --- api/src/cache.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/cache.ts b/api/src/cache.ts index ccde84b26a..52977ff95f 100644 --- a/api/src/cache.ts +++ b/api/src/cache.ts @@ -9,13 +9,13 @@ let cache: Keyv | null = null; if (env.CACHE_ENABLED === true) { validateEnv(['CACHE_NAMESPACE', 'CACHE_TTL', 'CACHE_STORE']); - cache = getKevyInstance(); + cache = getKeyvInstance(); cache.on('error', (err) => logger.error(err)); } export default cache; -function getKevyInstance() { +function getKeyvInstance() { switch (env.CACHE_STORE) { case 'redis': return new Keyv(getConfig('redis')); From 7a36dd3d0ac77e4805405dfa134c2580d67da095 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 1 Dec 2020 18:51:27 +0100 Subject: [PATCH 086/357] Remove unused required properties --- api/src/database/system-data/fields/settings.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/src/database/system-data/fields/settings.yaml b/api/src/database/system-data/fields/settings.yaml index 3d780cd4e9..82a5dbaba7 100644 --- a/api/src/database/system-data/fields/settings.yaml +++ b/api/src/database/system-data/fields/settings.yaml @@ -136,7 +136,6 @@ fields: text: Fit inside - value: outside text: Fit outside - required: true width: half - field: width name: Width @@ -166,7 +165,6 @@ fields: max: 100 min: 0 step: 1 - required: true width: half - field: withoutEnlargement type: boolean From db355faa3719bce3f79449ea81ea9b7769f4ac96 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 13:33:30 -0500 Subject: [PATCH 087/357] Setup structure for query param detail pages --- docs/getting-started/installation.md | 4 ++-- docs/nav-web.yaml | 6 ++++++ docs/reference/api/query/fields.md | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 docs/reference/api/query/fields.md diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 76536d603e..7d70dcb0be 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -6,8 +6,8 @@ Directus can be installed in many different ways, on several different stacks. C * [Docker](/guides/installation/docker.md) * [Manually](/guides/installation/manual.md) -::: Development Environment -Developers looking to work on the project's source code should follow our [Contributing Guide](#). +::: tip Development Environment +Developers looking to work on the project's source code should follow our [Contributing Guide](/getting-started/contributing). ::: ## Deployment Guides diff --git a/docs/nav-web.yaml b/docs/nav-web.yaml index 39185fec14..13c32f56f9 100644 --- a/docs/nav-web.yaml +++ b/docs/nav-web.yaml @@ -114,6 +114,12 @@ - type: page path: /reference/api/introduction title: Introduction + - type: group + title: Query Parameters + children: + - type: page + path: /reference/api/query/fields + title: Fields - type: page path: /reference/api/items title: Items diff --git a/docs/reference/api/query/fields.md b/docs/reference/api/query/fields.md new file mode 100644 index 0000000000..cb06804d37 --- /dev/null +++ b/docs/reference/api/query/fields.md @@ -0,0 +1 @@ +# Fields From 3a6e209f97b260336baa6b7814c2aaaaac22531f Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 15:51:52 -0500 Subject: [PATCH 088/357] Update docs --- docs/getting-started/contributing.md | 4 ++-- docs/getting-started/introduction.md | 16 +++++++--------- docs/getting-started/support.md | 8 ++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/getting-started/contributing.md b/docs/getting-started/contributing.md index 96d7643d60..0cb3e2ba66 100644 --- a/docs/getting-started/contributing.md +++ b/docs/getting-started/contributing.md @@ -8,7 +8,7 @@ Our Node.js repository is located at `directus/directus` and houses the Admin Ap To contribute to the project, please follow the instructions located within our GitHub repoitory's [contributing.md file](#). -::: PHP API Port +::: info PHP API Port While the Node.js version of Directus defines the official specification and is our team's primary focus, we also support a community-lead PHP API port in Laravel. This secondary codebase is located in a separate git repository at [`directus/php`](#). ::: @@ -16,7 +16,7 @@ While the Node.js version of Directus defines the official specification and is Feature requests are a great way to let our team know what should be prioritized next. You can [submit a feature request](https://github.com/directus/directus/discussions/category_choices) or upvote [existing submissions](https://github.com/directus/directus/discussions) all via our GitHub Discussions board. -:::warning The 80/20 Rule +::: warning The 80/20 Rule To keep the Directus codebase as clean and simple as possible, we will only consider approving features that we feel at least 80% of our user-base will find valuable. If your feature request falls within the 20% range, it is considered an edge-case and should be implemented as an extension. ::: diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 06c4a4f9d7..fe81b26061 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -6,7 +6,7 @@ **Directus is an open-source platform that provides a real-time API and intuitive Admin App for your custom database.** Built on node.js and vue.js 3, it allows both administrators and non-technical users to view and manage the content/data stored within pure SQL databases. It can be used as a headless CMS for managing project content, a database client for modeling and viewing raw data, or as a standalone customizable WebApp. -::: What's in a name? +::: details What's in a name? Directus ([duh REKT iss](http://audio.pronouncekiwi.com/Salli/Directus)) is latin for: _laid straight, arranged in lines_. The broadest goal of Directus is to present data in a simple, orderly, and intuitive way. ::: @@ -41,18 +41,18 @@ Dedicated hardware, custom limits, full white-labeling, uptime SLAs, and more ar ### Documentation -[Our online documentation](#) describes the most version of our platform. They are written in publicly managed markdown files so the community can help keep them clean and up-to-date! +[Our online documentation](https://docs.directus.io) describes the most version of our platform. They are written in publicly managed markdown files so the community can help keep them clean and up-to-date! * Getting Started: Novice Oriented. For a platform intro and installation. * Concepts: Learning Oriented. For understanding the platfom. * Guides: Problem Oriented. Follow along with steps while working. * Reference: Information Oriented. Look up info and specs while working. -::: Versioned Docs +::: tip Versioned Docs Docs for specific versions of Directus 9+ are available within the individual Project's App Documentation module. ::: -### Online Demo + + ### Marketing Website Our [marketing site](https://directus.io) provides general information, resources, and team info for the project. -### Blog - -Long-form updates, major release details, and strategic organization information. - ### Social For the latest product info and sneak-peeks into upcoming releases, be sure to follow us on [Twitter](https://twitter.com/directus). ### Community -Join our growing community of 2,600+ developers on [Discord](https://discord.gg/directus) and [Slack](https://directus.chat). From community support to seeing where the platform is heading next, it's a great way to get more involved. +Join our growing community of 2,600+ developers on [Discord](https://directus.chat). From community support to seeing where the platform is heading next, it's a great way to get more involved. ### Languages diff --git a/docs/getting-started/support.md b/docs/getting-started/support.md index dc31d787f0..62a385239f 100644 --- a/docs/getting-started/support.md +++ b/docs/getting-started/support.md @@ -4,9 +4,9 @@ ## Community Support -[Github Discussions](#) is great first place to reach out for help. Our community and core developers often check this platform and answer posts. It has the added benefit of being an archival resource for others developers with similar questions. +[Github Discussions](https://github.com/directus/directus/discussions) is great first place to reach out for help. Our community and core developers often check this platform and answer posts. It has the added benefit of being an archival resource for others developers with similar questions. -Our [Discord](https://discord.gg/directus) community is another great way to get assisstance. Please keep all questions on the `#help` channel, be considerate, and remember that you are getting free help for a free product. +Our [Discord](https://directus.chat) community is another great way to get assisstance. Please keep all questions on the `#help` channel, be considerate, and remember that you are getting free help for a free product. ## Premium Support @@ -16,7 +16,7 @@ Premium support is included with our Enterprise Cloud service. On-Demand Cloud c ### Commissioned Features -If you need a specific feature added to Directus faster than the normal development timeline, [reach out to us](#) for a quote. Our parent agency will often help subsidize the cost of developing new features if they pass our [80/20 Rule](#) and can be merged into the core codebase. Other custom/proprietary development will be built bespoke within our robust extension system. +If you need a specific feature added to Directus faster than the normal development timeline, [reach out to us](https://directus.io/contact/) for a quote. Our parent agency will often help subsidize the cost of developing new features if they pass our [80/20 Rule](/getting-started/contributing) and can be merged into the core codebase. Other custom/proprietary development will be built bespoke within our robust extension system. ### Expedited Fixes @@ -38,7 +38,7 @@ Not currently. Directus has been built specifically for wrapping _relational_ da Directus is primarily a free and open-source project, maintained by a small core team and community contributors who donate their time and resources. -Our platform is feature-rich, however we strictly adhere to our [80/20 Rule](#) to avoid a messy/bloated codebase. Directus is also quite stable, however new issues still arise, some of which may be triaged with a lower prioritization. +Our platform is feature-rich, however we strictly adhere to our [80/20 Rule](/getting-started/contributing) to avoid a messy/bloated codebase. Directus is also quite stable, however new issues still arise, some of which may be triaged with a lower prioritization. If you require more expeditious updates, you can contact us regarding [sponsoring expedited fixes](#) or [commissioning new features](#). You can also [submit a pull request](#) — after all, it is open-source! From 550927e04b211478eb8a06dc39f84486cb066d70 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 1 Dec 2020 22:21:35 +0100 Subject: [PATCH 089/357] Update readme of filters-to-query util --- app/src/utils/filters-to-query/readme.md | 37 ++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/app/src/utils/filters-to-query/readme.md b/app/src/utils/filters-to-query/readme.md index 41f63fa46f..df13fadd1d 100644 --- a/app/src/utils/filters-to-query/readme.md +++ b/app/src/utils/filters-to-query/readme.md @@ -1,11 +1,11 @@ # Filters to Query -Converts an array of filter objects to an Axios compatible object of query params. +Converts an array of filter objects to an object of query params. ## Usage ```ts -const filters: Filter[] = [ +const multipleFilters: Filter[] = [ { field: 'title', operator: 'contains', @@ -18,10 +18,37 @@ const filters: Filter[] = [ }, ]; -filtersToQuery(filters); +filtersToQuery(multipleFilters); // { -// 'filter[title][contains]': 'directus', -// 'filter[author][eq]: 1 +// _and: [ +// { +// title: { +// _contains: 'directus' +// } +// }, +// { +// author: { +// _eq: 1 +// } +// } +// ] +// } + + +const singleFilter: Filter[] = [ + { + field: 'title', + operator: 'contains', + value: 'directus', + } +]; + +filtersToQuery(singleFilter); + +// { +// title: { +// _contains: 'directus' +// } // } ``` From 30b44630575d5ca6848a7d1d1ed13ab63a706f96 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 16:46:15 -0500 Subject: [PATCH 090/357] Update docs --- docs/concepts/activity-and-versions.md | 37 +++-- docs/concepts/api-extensions.md | 3 + docs/concepts/app-extensions.md | 81 +++++----- docs/concepts/app-overview.md | 195 ++++++++++++------------- docs/concepts/data-model.md | 3 + docs/concepts/files-and-thumbnails.md | 20 +-- docs/concepts/internationalization.md | 6 +- docs/concepts/platform-overview.md | 110 +++++++------- docs/concepts/relationships.md | 2 +- docs/getting-started/contributing.md | 36 ++--- docs/guides/field-types/single-file.md | 3 + docs/guides/fields.md | 32 ++-- docs/guides/files.md | 47 +++--- docs/guides/items.md | 39 ++++- docs/reference/api/activity.md | 15 ++ docs/reference/api/assets.md | 14 ++ docs/reference/api/authentication.md | 14 ++ docs/reference/api/collections.md | 15 ++ docs/reference/api/extensions.md | 14 ++ docs/reference/api/fields.md | 15 ++ docs/reference/api/files.md | 15 ++ docs/reference/api/folders.md | 15 ++ docs/reference/api/items.md | 14 ++ docs/reference/api/permissions.md | 15 ++ docs/reference/api/presets.md | 15 ++ docs/reference/api/relations.md | 15 ++ docs/reference/api/revisions.md | 15 ++ docs/reference/api/roles.md | 15 ++ docs/reference/api/server.md | 14 ++ docs/reference/api/settings.md | 15 ++ docs/reference/api/users.md | 15 ++ docs/reference/api/utilities.md | 14 ++ docs/reference/api/webhooks.md | 10 ++ docs/reference/field-types.md | 3 + package.json | 2 +- 35 files changed, 607 insertions(+), 286 deletions(-) create mode 100644 docs/concepts/api-extensions.md create mode 100644 docs/concepts/data-model.md create mode 100644 docs/guides/field-types/single-file.md create mode 100644 docs/reference/api/activity.md create mode 100644 docs/reference/api/assets.md create mode 100644 docs/reference/api/authentication.md create mode 100644 docs/reference/api/collections.md create mode 100644 docs/reference/api/extensions.md create mode 100644 docs/reference/api/fields.md create mode 100644 docs/reference/api/files.md create mode 100644 docs/reference/api/folders.md create mode 100644 docs/reference/api/items.md create mode 100644 docs/reference/api/permissions.md create mode 100644 docs/reference/api/presets.md create mode 100644 docs/reference/api/relations.md create mode 100644 docs/reference/api/revisions.md create mode 100644 docs/reference/api/roles.md create mode 100644 docs/reference/api/server.md create mode 100644 docs/reference/api/settings.md create mode 100644 docs/reference/api/users.md create mode 100644 docs/reference/api/utilities.md create mode 100644 docs/reference/api/webhooks.md create mode 100644 docs/reference/field-types.md diff --git a/docs/concepts/activity-and-versions.md b/docs/concepts/activity-and-versions.md index c269f40300..15c8fb1084 100644 --- a/docs/concepts/activity-and-versions.md +++ b/docs/concepts/activity-and-versions.md @@ -4,22 +4,22 @@ ## Activity -This is a log of all events that have occured within the project. Activity can be accessed in two ways, via the main [Activity Module](#), or within the sidebar of individual [Item Detail](#) pages. The following information is stored for each event's activity item: +This is a log of all events that have occured within the project. Activity can be accessed in two ways, via the main [Activity Module](/concepts/app-overview#actvity-history), or within the sidebar of individual [Item Detail](/concepts/app-overview#item-detail) pages. The following information is stored for each event's activity item: -* Action -* User -* Datetime -* IP Address -* User Agent -* Collection -* Item -* Comment (when applicable) +- Action +- User +- Datetime +- IP Address +- User Agent +- Collection +- Item +- Comment (when applicable) -::: Readonly +::: tip Readonly For proper accountability, activity records are readonly. Administrators should avoid changing, deleting, or truncating this data. ::: -:::warning External Events +::: warning External Events Directus can only track events that pass through the platform's middleware. Changes made directly to the database, or by other external means, are not included in the activity log. ::: @@ -27,19 +27,18 @@ Directus can only track events that pass through the platform's middleware. Chan Every change made to items in Directus are also stored as a versioned snapshot. This additional data is also linked to the specific Activity event which created it. Below are the two key pieces of information stored for each version: -* Data — A full snapshot of the item _after_ the event -* Delta — The specific field data changed by this event +- Data — A full snapshot of the item _after_ the event +- Delta — The specific field data changed by this event -::: Customizing Version Data -Since versions store a full data snapshot and delta, the `directus_revisions` collection can quickly grow quite large, increasing database size and potentially decreasing performance. To remedy this, Directus allows [configuring version scope](#) per collection to set the exact field data saved. +::: tip Customizing Version Data +Since versions store a full data snapshot and delta, the `directus_revisions` collection can quickly grow quite large, increasing database size and potentially decreasing performance. To remedy this, Directus allows [configuring version scope](/concepts/app-overview) per collection to set the exact field data saved. ::: -::: Creating Detached Versions +::: tip Creating Detached Versions You can also create a new version for an item without saving the data to the parent item itself. This allows you to "stage" changes to an item that may already be live/published. ::: ### Relevant Guides -* [Reverting an Item](#) -* [Changing an Item's Version](#) -* [Creating Detached Versions](#) +- [Reverting an Item](/guides/items#reverting-an-item) +- [Changing an Item's Version](/guides/items) diff --git a/docs/concepts/api-extensions.md b/docs/concepts/api-extensions.md new file mode 100644 index 0000000000..aa211af1e0 --- /dev/null +++ b/docs/concepts/api-extensions.md @@ -0,0 +1,3 @@ +# API Extensions + +@TODO diff --git a/docs/concepts/app-extensions.md b/docs/concepts/app-extensions.md index 65b8dd9442..9f98edca26 100644 --- a/docs/concepts/app-extensions.md +++ b/docs/concepts/app-extensions.md @@ -6,18 +6,17 @@ Modules are the highest and broadest level of organization within the App. All core functionality within the App (other than authentication and activity) can be bucketed into one of the following five modules: -* Collections — The primary way to view and interact with database content -* User Directory — A dedicated section for the platform's system Users -* File Library — An aggregate of all files uploaded and managed within the platform -* Documentation — A tailored, in-app portal for the platform's concepts, guides, and reference -* Settings — An Admin-Only section for configuring the project and system settings +- Collections — The primary way to view and interact with database content +- User Directory — A dedicated section for the platform's system Users +- File Library — An aggregate of all files uploaded and managed within the platform +- Documentation — A tailored, in-app portal for the platform's concepts, guides, and reference +- Settings — An Admin-Only section for configuring the project and system settings In addition to these core modules, custom modules offer a _blank canvas_ for creating altogether new/different experiences within the App, such as proprietary dashboards, compound datasets, or third-party integrations (eg: a Stripe Payments Console). ### Relevant Guides -* [Creating a Custom Module](#) -* [Customizing the Module Navigation](#) +- [Creating a Custom Module](/guides/extensions/modules) ## Layouts @@ -27,72 +26,72 @@ Layouts provide different ways for presenting, browsing, visualizing, or even ma This tabular layout supports all forms of data, and is therefore the default within the Collections module. It includes the following features/options: -* Toggle & Reorder Field Columns (Option) -* Row Spacing (Option) -* Manual Ordering -* Column Sort -* Column Resizing -* Select All +- Toggle & Reorder Field Columns (Option) +- Row Spacing (Option) +- Manual Ordering +- Column Sort +- Column Resizing +- Select All ### Cards -This tiled layout is ideal for collections that prioritize an image. It is the default for both the [User Directory](#) (shows the avatar) and [File Library](#) (shows asset thumbnail). It includes the following features/options: +This tiled layout is ideal for collections that prioritize an image. It is the default for both the [User Directory](/guides/users) (shows the avatar) and [File Library](/guides/files) (shows asset thumbnail). It includes the following features/options: -* Image Source (Option) -* Title (Option) -* Subtitle (Option) -* Image Fit (Option) -* Fallback Icon (Option) -* Card Size -* Sort Field & Direction -* Select All +- Image Source (Option) +- Title (Option) +- Subtitle (Option) +- Image Fit (Option) +- Fallback Icon (Option) +- Card Size +- Sort Field & Direction +- Select All -### Calendar + ### Relevant Guides -* [Creating a Custom Layout](#) +- [Creating a Custom Layout](/guides/extensions/layouts) ## Interfaces -Interfaces provide a multitude of ways to view or interact with field data on [Item Detail](#) page forms. Every interface supports a specific subset of field [types](#) (eg: String), which determines how the data will be stored. For example, the _Text Input_ interface can manage most types of data, but might not be ideal for dates, where a _Calendar_ interface excels. Directus includes many Interfaces out-of-the-box: +Interfaces provide a multitude of ways to view or interact with field data on [Item Detail](/concepts/app-overview#item-detail) page forms. Every interface supports a specific subset of field [types](/reference/field-types) (eg: String), which determines how the data will be stored. For example, the _Text Input_ interface can manage most types of data, but might not be ideal for dates, where a _Calendar_ interface excels. Directus includes many Interfaces out-of-the-box: -* Text Input -* @TODO List all core interfaces, or link to a exhaustive reference? +- Text Input +- @TODO List all core interfaces, or link to a exhaustive reference? -In addition to these core interfaces, custom interfaces allow for creating more tailored or propreitary ways to view or manage field data, such as bespoke layout builders, skeuomorphic knobs, or relational views for third-party data (eg: Stripe Credit Card UI). +In addition to these core interfaces, custom interfaces allow for creating more tailored or proprietary ways to view or manage field data, such as bespoke layout builders, skeuomorphic knobs, or relational views for third-party data (eg: Stripe Credit Card UI). ### Relevant Guides -* [Creating a Custom Interface](#) +- [Creating a Custom Interface](#) ## Displays -Displays are the smaller, read-only counterpart to Interfaces, defining how a field's data will be displayed inline on [Item Detail](#) pages, Modals, and even within Interfaces themselves. For example, you may have a "Status" field that uses a _Dropdown_ Interface on the Item Detail page, and a _Color Dot_ Display when the field is referenced throughout the rest of the App. Directus includes many Displays out-of-the-box: +Displays are the smaller, read-only counterpart to Interfaces, defining how a field's data will be displayed inline on [Item Detail](/concepts/app-overview#item-detail) pages, Modals, and even within Interfaces themselves. For example, you may have a "Status" field that uses a _Dropdown_ Interface on the Item Detail page, and a _Color Dot_ Display when the field is referenced throughout the rest of the App. Directus includes many Displays out-of-the-box: -* Raw -* Formatted Value -* @TODO List all core interfaces, or link to a exhaustive reference? +- Raw +- Formatted Value +- @TODO List all core interfaces, or link to a exhaustive reference? In addition to these core displays, custom displays allow for creating customized ways to view or represent field data, such as progress indicators, relational data tooltips, or specific formatting options. ### Relevant Guides -* [Creating a Custom Display](#) +- [Creating a Custom Display](/guides/extensions/displays) ## Title Formatter -Directus uses [Database Mirroring](#) to create its underlying data model based on your custom schema. Therefore the App needs a reliable way of converting any raw table name, field name, or other technical value into a prettified format that is human-readable. At its core, the Title Formatter converts any string into title-case with proper whitespace. It also covers acronyms, initialisms, common proper nouns, so each is output properly. Some example conversion include: +Directus uses [Database Mirroring](/concepts/platform-overview) to create its underlying data model based on your custom schema. Therefore the App needs a reliable way of converting any raw table name, field name, or other technical value into a prettified format that is human-readable. At its core, the Title Formatter converts any string into title-case with proper whitespace. It also covers acronyms, initialisms, common proper nouns, so each is output properly. Some example conversion include: -| Original String | Formatted Title | -|-----------------|-----------------| +| Original String | Formatted Title | +| ---------------------------- | --------------------------------- | | `snowWhiteAndTheSevenDwarfs` | `Snow White and the Seven Dwarfs` | -| `NewcastleUponTyne` | `Newcastle upon Tyne` | -| `brighton_by_the_sea` | `Brighton by the Sea` | -| `new_ipad_ftp_app` | `New iPad FTP App` | +| `NewcastleUponTyne` | `Newcastle upon Tyne` | +| `brighton_by_the_sea` | `Brighton by the Sea` | +| `new_ipad_ftp_app` | `New iPad FTP App` | diff --git a/docs/concepts/app-overview.md b/docs/concepts/app-overview.md index af836c8b13..76cb859ec3 100644 --- a/docs/concepts/app-overview.md +++ b/docs/concepts/app-overview.md @@ -9,34 +9,34 @@ ### 1. Module Bar -* **Project Logo** — Displays your configured project logo and project color (defaults to the Directus logo and color). If [configured](#), clicking this component will navigate to the Project URL. During platform activity, an indeterminate progress indicator will also be shown here. -* **Modules** — Any available [modules](#) are listed below the project logo. These may be turned off or reordered based on your [role's configuration](#), but by default this includes: - * [Collections](#) - * [User Directory](#) - * [File Library](#) - * [Documentation](#) - * [Settings](#) — Admin only - * [Custom Modules](#) — If configured -* **Current User Menu** — This component displays the authenticated user's name and avatar. Hovering over this menu exposes the Log Out button. +- **Project Logo** — Displays your configured project logo and project color (defaults to the Directus logo and color). If configured, clicking this component will navigate to the Project URL. During platform activity, an indeterminate progress indicator will also be shown here. +- **Modules** — Any available modules are listed below the project logo. These may be turned off or reordered based on your [role's configuration](/concepts/users-roles-and-permissions), but by default this includes: + - [Collections](/concepts/app-overview) + - [User Directory](/concepts/app-overview) + - [File Library](/concepts/app-overview) + - [Documentation](/concepts/app-overview) + - [Settings](/concepts/app-overview) — Admin only + - [Custom Modules](/guides/extensions/modules) — If configured +- **Current User Menu** — This component displays the authenticated user's name and avatar. Hovering over this menu exposes the Log Out button. ### 2. Navigation Bar -* **Project Name** — Shows the name of your current project (see [Project Settings](#)), as well as the quality of your project's API connection. -* **Navigation** — This is a dynamic navigation based on your current module. Some modules also support [Presets and/or Bookmarks](#), which are ways to link to more specific data-sets. +- **Project Name** — Shows the name of your current project (see [Project Settings](/guides/white-labeling)), as well as the quality of your project's API connection. +- **Navigation** — This is a dynamic navigation based on your current module. Some modules also support [Presets and/or Bookmarks](/guides/roles-and-permissions), which are ways to link to more specific data-sets. ### 3. Page -* **Header** — A fixed section at the top of each page, the header includes: - * Page Icon — Clicking this navigates back to the previous page - * Module Title — Clicking this navigates to the parent module/section - * Page Title — Displays the current page's title - * Action Buttons — On the right-side of the header are contextual buttons for specific page actions. Please note that some primary action buttons have a "..." icon beside them that provides additional options when clicked. -* **Page Content** — This displays the content of the page you navigated to. +- **Header** — A fixed section at the top of each page, the header includes: + - Page Icon — Clicking this navigates back to the previous page + - Module Title — Clicking this navigates to the parent module/section + - Page Title — Displays the current page's title + - Action Buttons — On the right-side of the header are contextual buttons for specific page actions. Please note that some primary action buttons have a "..." icon beside them that provides additional options when clicked. +- **Page Content** — This displays the content of the page you navigated to. ### 4. Page Sidebar -* **Page Components** — Lists any contextual page components available. The "Info" component is available on every page, explaining the page's general purpose and relevant details. Clicking any sidebar component will accordion it open. If the App window is large enough, the sidebar will automatically open, and can be closed by clicking the "X" in the top-right. -* **Notifications Tray** — Fixed to the bottom of the page sidebar, this button opens a tray of recent user notifications, and provides a link to the [Activity History](#) page. +- **Page Components** — Lists any contextual page components available. The "Info" component is available on every page, explaining the page's general purpose and relevant details. Clicking any sidebar component will accordion it open. If the App window is large enough, the sidebar will automatically open, and can be closed by clicking the "X" in the top-right. +- **Notifications Tray** — Fixed to the bottom of the page sidebar, this button opens a tray of recent user notifications, and provides a link to the [Activity History](/concepts/app-overview) page. ## Collections @@ -50,127 +50,126 @@ A page that lists the collections available to the current user. This is the lan Provides a configurable layout to browse or visualize items within a given collection. Like other browse pages, there are many available features, including: -* [Creating Items](#) -* [Browsing Items](#) - * [Searching](#) - * [Layouts](#) - * [Advanced Filter](#) - * [Bookmarking](#) -* [Updating Items](#) - * Batch -* [Deleting Items](#) - * Batch -* [Export Data](#) +- [Creating Items](/guides/items#creating-items) +- [Browsing Items](/guides/items#browsing-items) + - [Searching](/guides/items#searching) + - [Layouts](/guides/items#layouts) + - [Advanced Filter](/guides/items#advanced-filter) + - [Bookmarking](/guides/items#bookmark) +- [Updating Items](/guides/items#updating-items) +- [Deleting Items](/guides/items#deleting-items) +- [Export Data](/guides/items#export-data) ### Item Detail -Most layouts on the browse page support navigating to individual item detail pages, where you a presented with a [customizable form](#) for viewing/editing the item's content. Like other detail pages, there are many available features, including: +Most layouts on the browse page support navigating to individual item detail pages, where you a presented with a [customizable form](/guides/fields#adjusting-fields-layout) for viewing/editing the item's content. Like other detail pages, there are many available features, including: -* [Updating an Item](#) -* [Reverting an Item](#) -* [Revisions](#) -* [Comments](#) +- [Updating an Item](/guides/items#updating-item) +- [Reverting an Item](/guides/items#reverting-item) +- [Revisions](/guides/items#revisions) +- [Comments](/guides/items#comments) ## User Directory -A module includes a comprehensive listing of all system users within your project. This page has the same features and configuration as [Collection Detail](#). +A module includes a comprehensive listing of all system users within your project. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). ### User Detail -Similar to other [Item Detail](#) pages, this page provides a custom form for viewing system users. This is also used for editing the "Profile Page" of the current user, which is accessible from the [User Menu](#). Directus ships with a full-featured user system, with the following fields: +Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for viewing system users. This is also used for editing the "Profile Page" of the current user, which is accessible from the [User Menu](/concepts/app-overview). Directus ships with a full-featured user system, with the following fields: -* **First Name** — The user's given name -* **Last Name** — The user's family name -* **Email** — The user's email address used for login/authenticating and email updates -* **Password** — The private string used for login/authenticating (stored as a secure hash) -* **Avatar** — An image displayed throughout the App that represents the user -* **Location** — Can be used for the user's city, country, office name, etc -* **Title** — The name of the position the user holds at their company or organization -* **Description** — A description or bio of the user -* **Tags** — A set of keywords useful when searching within the User Directory -* **Timezone** — (User Preference) The timezone of the user -* **Language** — (User Preference) The language to use for this user's App language -* **Theme** — (User Preference) Light, Dark, or Auto (based on the user's OS preferences) -* **Two-Factor Auth** — (User Preference) Enables authenticating with 2FA -* **Status** — (Admin Only) Determines if the user is active within the App/API -* **Role** — (Admin Only) The user's role determines their permissions and access -* **Token** — (Admin Only) A static string used for authenticating within the API +- **First Name** — The user's given name +- **Last Name** — The user's family name +- **Email** — The user's email address used for login/authenticating and email updates +- **Password** — The private string used for login/authenticating (stored as a secure hash) +- **Avatar** — An image displayed throughout the App that represents the user +- **Location** — Can be used for the user's city, country, office name, etc +- **Title** — The name of the position the user holds at their company or organization +- **Description** — A description or bio of the user +- **Tags** — A set of keywords useful when searching within the User Directory +- **Timezone** — (User Preference) The timezone of the user +- **Language** — (User Preference) The language to use for this user's App language +- **Theme** — (User Preference) Light, Dark, or Auto (based on the user's OS preferences) +- **Two-Factor Auth** — (User Preference) Enables authenticating with 2FA +- **Status** — (Admin Only) Determines if the user is active within the App/API +- **Role** — (Admin Only) The user's role determines their permissions and access +- **Token** — (Admin Only) A static string used for authenticating within the API The sidebar's info component also includes the following readonly details: -* **User Key** — The primary key of the user -* **Last Access** — The timestamp of the user's last App or API action -* **Last Page** — The last App page accessed by the user +- **User Key** — The primary key of the user +- **Last Access** — The timestamp of the user's last App or API action +- **Last Page** — The last App page accessed by the user -::: Extending Users -While the fields included out-of-the-box are locked from schema changes, you can extend Directus Users to include additional proprietary fields within [Settings > Data Model](#). +::: tip Extending Users +While the fields included out-of-the-box are locked from schema changes, you can extend Directus Users to include +additional proprietary fields within [Settings > Data Model](/concepts/data-model). ::: ## File Library -This module aggregates all files within the project into one consolidated library. This page has the same features and configuration as [Collection Detail](#). +This module aggregates all files within the project into one consolidated library. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). ### File Detail -Similar to other [Item Detail](#) pages, this page provides a custom form for viewing assets and embeds. Directus ships with a full-featured system for digital asset management, with the following fields: +Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for viewing assets and embeds. Directus ships with a full-featured system for digital asset management, with the following fields: -* **Title** — Pulled from the file metadata if available, falls back to a formatted version of the filename -* **Description** — Pulled from the file metadata if available -* **Tags** — Pulled from the file metadata if available -* **Location** — Pulled from the file metadata if available -* **Storage** — The storage adapter where the asset is saved (readonly) -* **Filename Disk** — The actual name of the file within the storage adapter -* **Filename Download** — The name used when downloading the file via _Content-Disposition_ +- **Title** — Pulled from the file metadata if available, falls back to a formatted version of the filename +- **Description** — Pulled from the file metadata if available +- **Tags** — Pulled from the file metadata if available +- **Location** — Pulled from the file metadata if available +- **Storage** — The storage adapter where the asset is saved (readonly) +- **Filename Disk** — The actual name of the file within the storage adapter +- **Filename Download** — The name used when downloading the file via _Content-Disposition_ The sidebar's info component also includes the following readonly details: -* **Type** — The MIME type of the file, displayed in the App as a formatted media type -* **Dimensions** — (Images Only) The width and height of the image in pixels -* **Size** — The file-size the asset takes up within the storage adapter -* **Created** — The timestamp of when the file was uploaded to the project -* **Owner** — The Directus user that uploaded the file to the project -* **Folder** — The current parent folder that contains the file -* **Metadata** — [Metadata](#) JSON dump of the file's EXIF, IPTC, and ICC information +- **Type** — The MIME type of the file, displayed in the App as a formatted media type +- **Dimensions** — (Images Only) The width and height of the image in pixels +- **Size** — The file-size the asset takes up within the storage adapter +- **Created** — The timestamp of when the file was uploaded to the project +- **Owner** — The Directus user that uploaded the file to the project +- **Folder** — The current parent folder that contains the file +- **Metadata** — Metadata JSON dump of the file's EXIF, IPTC, and ICC information -::: Extending Files -While the fields included out-of-the-box are locked from schema changes, you can extend Directus Files to include additional proprietary fields within [Settings > Data Model](#). +::: tip Extending Files +While the fields included out-of-the-box are locked from schema changes, you can extend Directus Files to include additional proprietary fields within [Settings > Data Model](/concepts/data-model). ::: ## Documentation -This module is an internal set of guides, concepts, and reference docs for your project's specific version of Directus. It also includes a dynamic [API Reference](#) that is dynamically tailored to your custom schema. The docs are organized into four distinct sections: +This module is an internal set of guides, concepts, and reference docs for your project's specific version of Directus. It also includes a dynamic [API Reference](/reference/api/introduction) that is dynamically tailored to your custom schema. The docs are organized into four distinct sections: -* [Getting Started](#)** — Novice Oriented. For a platform intro and installation. -* [Concepts](#)** — Learning Oriented. For understanding the platfom. -* [Guides](#)** — Problem Oriented. Follow along with steps while working. -* [Reference](#)** — Information Oriented. Look up info and specs while working. +- [Getting Started](/getting-started/introduction)\*\* — Novice Oriented. For a platform intro and installation. +- [Concepts](/concepts/app-overview)\*\* — Learning Oriented. For understanding the platform. +- [Guides](/concepts/roles-and-permissions)\*\* — Problem Oriented. Follow along with steps while working. +- [Reference](/reference/api/introduction)\*\* — Information Oriented. Look up info and specs while working. -::: Updating the Docs -Our docs are written in markdown (with some additional VuePress styling like this hint box), and available for editing/fixing via [GitHub](*). +::: tip Updating the Docs +Our docs are written in markdown (with some additional VuePress styling like this hint box), and available for editing/fixing via [GitHub](https://github.com/directus/directus). ::: -## Actvity History +## Activity History -This module provides a collective timeline of all actions taken within the project. This is a great way to audit user activity or enforce accountability. This is the only system module that is not in the module bar by default — instead being located within the notifications tray of the page sidebar. This page has the same features and configuration as [Collection Detail](#). +This module provides a collective timeline of all actions taken within the project. This is a great way to audit user activity or enforce accountability. This is the only system module that is not in the module bar by default — instead being located within the notifications tray of the page sidebar. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). ### Activity Detail Unlike other item detail pages, activity items are **readonly** (for proper accountability) and open in a modal window with the following fields: -* **User** — The Directus user that performed the action -* **Action** — The specific action taken, eg: Create, Update, Delete, Authenticate, etc -* **Date** — The timestamp of when the action was performed -* **IP Address** — The IP address of the device from which the action was performed -* **User Agent** — The description of the browser that was used to perform the action -* **Collection** — The collection affected by the action -* **Item** — The item (within the above Collection) affected by the action +- **User** — The Directus user that performed the action +- **Action** — The specific action taken, eg: Create, Update, Delete, Authenticate, etc +- **Date** — The timestamp of when the action was performed +- **IP Address** — The IP address of the device from which the action was performed +- **User Agent** — The description of the browser that was used to perform the action +- **Collection** — The collection affected by the action +- **Item** — The item (within the above Collection) affected by the action # Settings -This module is only available to users within [admin roles](#). This is where your project is configured, and the first place to go after installation. It includes the following sections: +This module is only available to users within [admin roles](/concepts/users-roles-and-permissions#administrators-role). This is where your project is configured, and the first place to go after installation. It includes the following sections: -* [Project Settings](#) -* [Data Model](#) -* [Roles & Permissions](#) -* [Presets & Bookmarks](#) -* [Webhooks](#) +- [Project Settings](/concepts/platform-overview) +- [Data Model](/concepts/data-model) +- [Roles & Permissions](/concepts/users-roles-and-permissions) +- [Presets & Bookmarks](/concepts/presets-and-bookmarks) +- [Webhooks](/guides/webhooks) diff --git a/docs/concepts/data-model.md b/docs/concepts/data-model.md new file mode 100644 index 0000000000..4afed956c7 --- /dev/null +++ b/docs/concepts/data-model.md @@ -0,0 +1,3 @@ +# Data Model + +@TODO diff --git a/docs/concepts/files-and-thumbnails.md b/docs/concepts/files-and-thumbnails.md index a844bccd7a..c6e96afb66 100644 --- a/docs/concepts/files-and-thumbnails.md +++ b/docs/concepts/files-and-thumbnails.md @@ -6,21 +6,18 @@ Storage adapters allow project files to be stored in different locations or services. By default, Directus includes the following adapters: -* **Local Filesystem** — The default, any filesystem location or network-attached storage -* **S3 or Equivalent** — Including AWS S3, DigitalOcean Spaces, Alibaba OSS, and others -* **Google Cloud Storage** — A RESTful web service on the Google Cloud Platform +- **Local Filesystem** — The default, any filesystem location or network-attached storage +- **S3 or Equivalent** — Including AWS S3, DigitalOcean Spaces, Alibaba OSS, and others +- **Google Cloud Storage** — A RESTful web service on the Google Cloud Platform ## Files -Directus allows you to manage all your files in one place, including documents, images, videos, and more. Files can be uploaded to the [File Library](#) in general, or directly to an item via a [Single File](#) or [Multiple Files](#) field. - -@TODO private files +Directus allows you to manage all your files in one place, including documents, images, videos, and more. Files can be uploaded to the [File Library](/concepts/app-overview#file-library) in general, or directly to an item via a [Single File](/guides/field-types/single-file) or [Multiple Files](/guides/field-types/multiple-files) field. ### Relevant Guides -* [Uploading a File](#) -* [Requesting an Original File](#) -* [Requesting a Private File](#) +- [Uploading a File](/guides/files#uploading-a-file) +- [Requesting an Original File](/guides/files#accessing-an-original-file) ## Embedded Assets @@ -30,9 +27,8 @@ Directus also supports ingesting third-party embedded assets, such as YouTube or Our file middleware also allows for cropping and transforming image assets on the fly. This means you can simply request an image, include any desired transformation parameters, and you'll be served the new asset as a response. This is very useful for automatically generating many different thumbnails/versions of an original file. -To impede malicious users from consuming your storage by requesting a multitude of random sizes, Directus includes a [Thumbnail Allow-List](#) to limit what transformations are possible. +To impede malicious users from consuming your storage by requesting a multitude of random sizes, Directus includes a [Asset Allow-List](/guides/files#creating-thumbnail-presets) to limit what transformations are possible. ### Relevant Guides -* [Requesting a Thumbnail](#) -* [Allow-Listing Thumbnails](#) +- [Requesting a Thumbnail](/guides/files#requesting-a-thumbnail) diff --git a/docs/concepts/internationalization.md b/docs/concepts/internationalization.md index 492b0af315..c60ea13c7d 100644 --- a/docs/concepts/internationalization.md +++ b/docs/concepts/internationalization.md @@ -10,7 +10,7 @@ Directus supports internationalization across its entire Admin App. Many languag Directus uses [database mirroring](#) to dynamically pull in your schema's tables and columns, however this only covers one language. Therefore our platform supports schema translations for these names, allowing you to properly support different languages for your Collection and Field names. -::: Overriding Technical Names +::: tip Overriding Technical Names If your project requires more _technical_ table/column names (eg: `cust` or `f_name`), you can also use schema translations to override those defaults (eg: `Customers` or `First Name`) in the primary language. ::: @@ -18,6 +18,6 @@ If your project requires more _technical_ table/column names (eg: `cust` or `f_n One of the most important features in Directus is the ability to author and manage multilingual content. While you can accomplish this by creating _standard_ fields in the parent collection for each language, it is more extensible to use our relational translation fields to dynamically manage content in as many languages as is required. Mixing standard and translated fields also allows language-agnostic data (such as dates or toggles) to remain within the parent collection. -::: Custom Interfaces -For more advanced use-cases, such as connecting to a third-party translation service, you can read our extension guide on [creating a custom interface](#). +::: tip Custom Interfaces +For more advanced use-cases, such as connecting to a third-party translation service, you can read our extension guide on [creating a custom interface](/guides/extensions/interfaces). ::: diff --git a/docs/concepts/platform-overview.md b/docs/concepts/platform-overview.md index 330dc37e23..730f8557e4 100644 --- a/docs/concepts/platform-overview.md +++ b/docs/concepts/platform-overview.md @@ -4,113 +4,115 @@ ## Database Mirroring -Instead of using a predefined "one-size-fits-all" data model to store your content, Directus "mirrors" your actual SQL database in real-time. The principle is akin to a database client (eg: _phpMyAdmin_), but includes far mor advanced tools, and is safe and intutive enough for non-technical users. This approach has many unique advantages: +Instead of using a predefined "one-size-fits-all" data model to store your content, Directus "mirrors" your actual SQL database in real-time. The principle is akin to a database client (eg: _phpMyAdmin_), but includes far mor advanced tools, and is safe and intuitive enough for non-technical users. This approach has many unique advantages: -* A custom SQL database schema, tailored to your exact requirements -* Significant performance improvements through optimizations and indexing -* Complete transparency, portability, and security for your data -* Direct database access and the full power of raw/complex SQL queries -* Allows importing existing databases, unaltered and without any migrations +- A custom SQL database schema, tailored to your exact requirements +- Significant performance improvements through optimizations and indexing +- Complete transparency, portability, and security for your data +- Direct database access and the full power of raw/complex SQL queries +- Allows importing existing databases, unaltered and without any migrations ## Directus API -The Directus API uses _Database Mirroring_ to dynamically generate REST endpoints and a GraphQL schema based on the connected database's architecture. It is written in [Node.js](#) and uses database abstraction to support most [SQL database vendors](#). +The Directus API uses _Database Mirroring_ to dynamically generate REST endpoints and a GraphQL schema based on the connected database's architecture. It is written in [Node.js](https://nodejs.org) and uses database abstraction to support most [SQL database vendors](/guides/installation#databases). ### Relevant Docs -* [API Reference](#) -* [API Extensions](#) +- [API Reference](/reference/api/introduction) +- [API Custom Endpoints](/concepts/api-extensions) ## Directus App -The Directus App is decoupled from, and powered by, the Directus API. It provides a way for both technical admins and non-technical users to view and manage content of the connected database. It is written in [Vue.js](#) v3, is completely modular, and is highly customizable. +The Directus App is decoupled from, and powered by, the Directus API. It provides a way for both technical admins and non-technical users to view and manage content of the connected database. It is written in [Vue.js](https://vuejs.org) v3, is completely modular, and is highly customizable. ### Relevant Docs -* [App Overview](#) -* [App Extensions](#) +- [App Overview](/concepts/app-overview) +- [App Extensions](/concepts/app-extensions) ## Projects & Environments A Project is a complete instance of Directus. Each project primarily represents a database, but also includes a configuration file and any related asset storage. This modular approach means you can also create different environments (eg: Dev, Staging, Prod) by simply creating additional project instances. -::: Migrating Environments + ## Collections -A Collection is a grouping of similar Items. Each collection represents a table in your database. Directus automatically uses a built-in [title formatter](#) to display your database table names prettified, and you can use [translations](#) to completely rename them if needed. +A Collection is a grouping of similar Items. Each collection represents a table in your database. Directus automatically uses a built-in [title formatter](/concepts/app-extensions) to display your database table names prettified, and you can use [translations](/concepts/data-model) to completely rename them if needed. -::: Usage +::: tip Usage Collections can be organized in any way that is appropriate for your project. You can architect them platform-specific (eg: _pages_ of a website), or in a more platform-agnostic way (eg: raw _customers_ of your business). While there's no right or wrong way to structure your data-model, we recommend keeping your data as agnostic as possible so it is easier to repurpose in the future. In short, **learn to see your data as its own asset — not only through the lens of your immediate project needs**. ::: ### Relevant Guides -* [Creating a Collection](#) -* [Deleting a Collection](#) +- [Creating a Collection](/guides/collections#creating-a-collection) +- [Deleting a Collection](/guides/collections#deleting-a-collection) ## Presets -Presets store the exact state of a [collection detail](#) page. These are used to set layout defaults for a user, or to define bookmarks that can be used to quickly recall specific datasets. +Presets store the exact state of a [collection detail](/concepts/app-overview) page. These are used to set layout defaults for a user, or to define bookmarks that can be used to quickly recall specific datasets. ### Relevant Guides -* [Creating a Preset](#) -* [Deleting a Preset](#) +- [Creating a Preset](/guides/presets#creating-a-preset) +- [Deleting a Preset](/guides/presets#deleting-a-preset) ## Fields -A Field is a specific type of value within a Collection. Each field represents a database column. Directus automatically uses a built-in [title formatter](#) to display your database column names prettified, and you can use [translations](#) to completely rename them if needed. +A Field is a specific type of value within a Collection. Each field represents a database column. Directus automatically uses a built-in [title formatter](/concepts/app-extensions#title-formatter) to display your database column names prettified, and you can use [translations](/guides/fields) to completely rename them if needed. Each field also mirrors other characteristics from the column, including its `type`, `default`, `length`, `allow_null`, etc. -::: Usage +::: tip Usage You might have `title`, `body`, `author`, and `date_published` fields within an `articles` collection. ::: -::: Aliases +::: tip Aliases Not all fields in Directus map directly to an actual database column within their table. Some relational fields, like One-to-Many (O2M) and Many-to-Many (M2M), represent data that is stored in different tables. Other fields are only for presentation and don't save data at all, such as a divider. These are called "alias" fields. ::: -::: Relational Fields -Fields that reference other items (in the same collection or different) are called relational fields. Linking or connecting data relationally is an immensly powerful feature of relational databases and SQL queries. +::: tip Relational Fields +Fields that reference other items (in the same collection or different) are called relational fields. Linking or connecting data relationally is an immensely powerful feature of relational databases and SQL queries. ::: ### Relevant Guides -* [Creating a Standard Field](#) -* [Creating a Presentation Field](#) -* [Creating a Many-to-One Field](#) -* [Creating a One-to-Many Field](#) -* [Creating a Many-to-Many Field](#) -* [Creating a Many-to-Any Field](#) -* [Creating Translated Fields](#) -* [Duplicating Fields](#) -* [Adjusting Field Layout](#) -* [Deleting Fields](#) +- [Creating a Standard Field](/guides/field-types/standard-field) +- [Creating a Presentation Field](/guides/field-types/presentation-field) +- [Creating a Many-to-One Field](/guides/field-types/many-to-one-field) +- [Creating a One-to-Many Field](/guides/field-types/one-to-many-field) +- [Creating a Many-to-Many Field](/guides/field-types/many-to-many-field) +- [Creating a Many-to-Any Field](/guides/field-types/many-to-any-field) +- [Creating Translated Fields](/guides/field-types/translated-fields) +- [Duplicating Fields](/guides/fields#duplicating-a-field) +- [Adjusting Field Layout](/guides/fields#adjusting-field-layout) +- [Deleting Fields](/guides/fields#deleting-a-field) ## Types Directus has built-in database abstraction for managing all SQL database vendors. However, each of those vendors has a different list of supported column datatypes. To standardize all of these differences, Directus has a single superset of types that each map to the more specific vendor ones. -* String -* Text -* Boolean -* Integer -* Big Integer -* Float -* Decimal -* Timestamp -* DateTime -* Date -* Time -* JSON -* CSV -* UUID +- String +- Text +- Boolean +- Integer +- Big Integer +- Float +- Decimal +- Timestamp +- DateTime +- Date +- Time +- JSON +- CSV +- UUID + +@TODO confirm ## Items @@ -118,7 +120,7 @@ An Item is an object containing the field values within a Collection. Each item ### Relevant Guides -* [Creating an Item](#) -* [Archiving an Item](#) -* [Reordering Items](#) -* [Deleting an Item](#) +- [Creating an Item](/guides/items#creating-an-item) +- [Archiving an Item](/guides/items#archiving-an-item) +- [Reordering Items](/guides/items#reordering-items) +- [Deleting an Item](/guides/items#deleting-an-item) diff --git a/docs/concepts/relationships.md b/docs/concepts/relationships.md index 3ef12bc319..05dfbaaefa 100644 --- a/docs/concepts/relationships.md +++ b/docs/concepts/relationships.md @@ -4,7 +4,7 @@ ## Understanding Relationships -While it may seem complex at first, relational data is actually quite straightforward once you understand what's happeneing behind the confusing terminology. Before diving into the details of each type, let's first cover a few basics that will help you better visualize each in your mind's eye. +While it may seem complex at first, relational data is actually quite straightforward once you understand what's happening behind the confusing terminology. Before diving into the details of each type, let's first cover a few basics that will help you better visualize each in your mind's eye. ### PKs vs FKs diff --git a/docs/getting-started/contributing.md b/docs/getting-started/contributing.md index 0cb3e2ba66..c378581236 100644 --- a/docs/getting-started/contributing.md +++ b/docs/getting-started/contributing.md @@ -8,7 +8,7 @@ Our Node.js repository is located at `directus/directus` and houses the Admin Ap To contribute to the project, please follow the instructions located within our GitHub repoitory's [contributing.md file](#). -::: info PHP API Port +::: tip PHP API Port While the Node.js version of Directus defines the official specification and is our team's primary focus, we also support a community-lead PHP API port in Laravel. This secondary codebase is located in a separate git repository at [`directus/php`](#). ::: @@ -22,22 +22,22 @@ To keep the Directus codebase as clean and simple as possible, we will only cons ## RFCs -Some Directus features/fixes may require additional design, strategy, and/or discussion before beginning work. For these notable pull-requests, you should first submit an RFC (Request For Comments) to our core team via [Discord](https://discord.gg/directus). This process is relatively informal, but ensures proper alignment, and helps avoid squandered development time by contributors. +Some Directus features/fixes may require additional design, strategy, and/or discussion before beginning work. For these notable pull-requests, you should first submit an RFC (Request For Comments) to our core team via [Discord](https://directus.chat). This process is relatively informal, but ensures proper alignment, and helps avoid squandered development time by contributors. ## Bug Reporting Reporting any bugs you come across is an invaluable part of helping keep Directus stable. After confirming a similar issue doesn't already exist, you can [submit a bug report](https://github.com/directus/directus/issues/new) via GitHub Issues. Please ensure the following for all submissions: -* You are experiencing an actual bug, not a configuration issue -* You are not asking a question or requesting a new feature -* You have checked that no similar issue already exists -* You have entered a clear and concise title -* You have followed the issue template, with stack details and steps to reproduce -* You have already tried the following troubleshooting steps: - * You are on the latest version of Directus - * You have stopped (`CTRL+C`) and restarted the server - * You have confirmed the issue is not related to your own custom code - * Dev Only: You have cleared and reinstalled all dependencies +- You are experiencing an actual bug, not a configuration issue +- You are not asking a question or requesting a new feature +- You have checked that no similar issue already exists +- You have entered a clear and concise title +- You have followed the issue template, with stack details and steps to reproduce +- You have already tried the following troubleshooting steps: + - You are on the latest version of Directus + - You have stopped (`CTRL+C`) and restarted the server + - You have confirmed the issue is not related to your own custom code + - Dev Only: You have cleared and reinstalled all dependencies ## Reporting Security Vulnerabilities @@ -45,8 +45,8 @@ If you believe you have discovered a security issue within a Directus product or We value the members of the independent security research community who find security vulnerabilities and work with our team so that proper fixes can be issued to users. Our policy is to credit all researchers in the fix's release notes. In order to receive credit, security researchers must follow responsible disclosure practices, including: -* They do not publish the vulnerability prior to the Directus team releasing a fix for it -* They do not divulge exact details of the issue, for example, through exploits or proof-of-concepts +- They do not publish the vulnerability prior to the Directus team releasing a fix for it +- They do not divulge exact details of the issue, for example, through exploits or proof-of-concepts ## Code of Conduct @@ -54,7 +54,7 @@ The Directus [Code of Conduct](https://github.com/directus/directus/blob/main/co ## Development Workflow -Before getting started, ensure you your local environment meets our [minimum requirements](#) and you are familiar with Git. +Before getting started, ensure you your local environment meets our [minimum requirements](/guides/installation/cli) and you are familiar with Git. ### 1. Fork the Directus repository @@ -80,10 +80,10 @@ npm install ### 5. Setup the Database & Env File -For this step, you'll need to already have a SQL database up-and-running, otherwise you can only use the SQLite driver, which will create the database for you. Run the following command from within the `/api` directory. +For this step, you'll need to already have a SQL database up-and-running, otherwise you can only use the SQLite driver, which will create the database for you. Run the following command from within root of the project: ```bash -./cli.js init +npm run cli -- init ``` ### 6. Start the development server @@ -128,7 +128,7 @@ Contains the Directus API (REST+GraphQL), written in node.js. ### `/app` -Contains the Directus Admin App, written in vue.js 3. +Contains the Directus Admin App, written in Vue.js 3. ### `/docs` diff --git a/docs/guides/field-types/single-file.md b/docs/guides/field-types/single-file.md new file mode 100644 index 0000000000..06b94206ea --- /dev/null +++ b/docs/guides/field-types/single-file.md @@ -0,0 +1,3 @@ +# Single File + +@TODO diff --git a/docs/guides/fields.md b/docs/guides/fields.md index 743cd2f669..2ab388dd94 100644 --- a/docs/guides/fields.md +++ b/docs/guides/fields.md @@ -8,15 +8,15 @@ 2. Under Fields & Layout, click the **Create Field** button 3. **Choose the field type**, and follow its specific setup guide... -* [Standard Field](#) -* [Presentation Field](#) -* [Many-to-One Field](#) -* [One-to-Many Field](#) -* [Many-to-Many Field](#) -* [Many-to-Any Field](#) -* [Translated Fields](#) +- [Standard Field](#) +- [Presentation Field](#) +- [Many-to-One Field](#) +- [One-to-Many Field](#) +- [Many-to-Many Field](#) +- [Many-to-Any Field](#) +- [Translated Fields](#) -::: Database Fields +::: tip Database Fields Keep in mind that Directus Fields are just a database columns. Therefore you can import or create a column directly in the database, and it will automatically appear within Directus. The first time you manage that column, a `directus_fields` record will be created with default values. ::: @@ -34,13 +34,13 @@ It is not currently possible to duplicate relational fields or a collection's pr The layout of the collection's form is determined by the following field options. -* **Field Visibility** — If the field is "Visible" or "Hidden" -* **Field Width** — How wide the field is shown relative to the form/page - * Half — The field is shown at half the form width - * Full — (Default) The field is shown at the full form width - * Fill — The field is shown filling the page width -* **Field Sort** — The order of fields within the form -* **Field Group** — If the field is a "group" type +- **Field Visibility** — If the field is "Visible" or "Hidden" +- **Field Width** — How wide the field is shown relative to the form/page + - Half — The field is shown at half the form width + - Full — (Default) The field is shown at the full form width + - Fill — The field is shown filling the page width +- **Field Sort** — The order of fields within the form +- **Field Group** — If the field is a "group" type 1. Create any desired groupings by **[Creating a Field Group](#)** 2. Click the **More Options** icon for any fields/groups to adjust visibility @@ -54,6 +54,6 @@ The layout of the collection's form is determined by the following field options 3. Click the **Delete Field** option 4. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change +::: danger Irreversible Change This action is permanent and can not be undone. Please proceed with caution. ::: diff --git a/docs/guides/files.md b/docs/guides/files.md index 336c270e0c..911b736cb1 100644 --- a/docs/guides/files.md +++ b/docs/guides/files.md @@ -2,6 +2,10 @@ > Directus offers a full-featured Digital Asset Management (DAM) system, multiple storage adapters, private file permissions, and on-demand image thumbnail generation. +## Uploading a File + +@TODO + ## Accessing an Original File The location of your actual file originals is based on the project's configuration, but you can consistently access them via the API using the following URL. @@ -14,7 +18,7 @@ example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4 ![Original File](../assets/original.jpg) _Original File Used Below — 602KB and 1800x1200_ -:::warning Direct File Access +::: warning Direct File Access While you may _technically_ be able to access your original files within their actual filesystem directory (eg: `/uploads/` for the default local storage configuration), it is recommended that you always use the Directus API. This is the only way that you can take advantage of file permissions and other built-in features. ::: @@ -27,29 +31,28 @@ While you may _technically_ be able to access your original files within their a 5. Enter the **Fit**, **Width**, **Height**, and **Quality** for the preset 6. Click the **Save** action button in the header -::: Storage Asset Transform +::: tip Storage Asset Transform The **Storage Asset Transform** can be used in conjunction with the presets to force an allow-list or completely disable the thumbnailing system. The options for this are: -* **All** — Any valid thumbnail request will be returned -* **None** — No thumbnails will be returned, not even presets -* **Presets Only** — Only valid Storage Asset Presets will be returned - -::: +- **All** — Any valid thumbnail request will be returned +- **None** — No thumbnails will be returned, not even presets +- **Presets Only** — Only valid Storage Asset Presets will be returned + ::: ## Requesting a Thumbnail Fetching thumbnails is as easy as adding query parameters to the original file's URL. If a requested thumbnail doesn't yet exist, it is dynamically generated and immediately returned. When requesting a thumbnail, the following parameters are all required. -* **`fit`** — The **fit** of the thumbnail while always preserving the aspect ratio, can be any of the following options: - * `cover` — Covers both width/height by cropping/clipping to fit - * `contain` — Contain within both width/height using "letterboxing" as needed - * `inside` — Resize to be as large as possible, ensuring dimensions are less than or equal to the requested width and height - * `outside` — Resize to be as small as possible, ensuring dimensions are greater than or equal to the requested width and height -* **`width`** — The **width** of the thumbnail in pixels -* **`height`** — The **height** of the thumbnail in pixels -* **`quality`** — The **quality** of the thumbnail (`0` to `100`) -* **`withoutEnlargement`** — Disable image up-scaling -* **`download`** — Add `Content-Disposition` header and force browser to download file +- **`fit`** — The **fit** of the thumbnail while always preserving the aspect ratio, can be any of the following options: + - `cover` — Covers both width/height by cropping/clipping to fit + - `contain` — Contain within both width/height using "letterboxing" as needed + - `inside` — Resize to be as large as possible, ensuring dimensions are less than or equal to the requested width and height + - `outside` — Resize to be as small as possible, ensuring dimensions are greater than or equal to the requested width and height +- **`width`** — The **width** of the thumbnail in pixels +- **`height`** — The **height** of the thumbnail in pixels +- **`quality`** — The **quality** of the thumbnail (`0` to `100`) +- **`withoutEnlargement`** — Disable image up-scaling +- **`download`** — Add `Content-Disposition` header and force browser to download file ``` example.com/assets/?fit=&width=&height=&quality= @@ -58,7 +61,7 @@ example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4?fit=cover&width=200&heig Alternatively, you can reference a specific thumbnail by its preset key. -* **`key`** — This **key** of the [Storage Asset Preset](#), a shortcut for the above parameters +- **`key`** — This **key** of the [Storage Asset Preset](/guides/files#creating-thumbnail-presets), a shortcut for the above parameters ``` example.com/assets/?key= @@ -69,8 +72,8 @@ example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4?key=card For easier comparison, both of the examples below were requested at `200` width, `200` height, and `75` quality. The `cover` thumbnail forces the dimensions, trimming the outside edges as needed. The `contain` thumbnail always maintains its aspect ratio, shrinking the image to fit _within_ the dimensions and adding "letterboxing" as needed. -| Cover | Contain | -|------|------| +| Cover | Contain | +| ----------------------------------------------------------- | --------------------------------------------------------------- | | ![Cover](../assets/200-200-cover-75.jpg)
_8KB • 200x200_ | ![Contain](../assets/200-200-contain-75.jpg)
_6KB • 200x133_ | ::: Aspect Ratio @@ -81,6 +84,6 @@ Images are never stretched or distorted even when changing the aspect ratio. The quality parameter can be any integer from `0-100`. Qualities closer to `0` have lower filesizes, but also poor image quality due to compression artifacts. Values closer to `100` have larger filesizes, but better image quality. Below are four possible qualities (200x200 cover) to visually compare the balance between compression and filesize. -| 25% | 50% | 75% | 100% | -|------|------|--------|------| +| 25% | 50% | 75% | 100% | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -------------------------------------------------- | | ![25%](../assets/200-200-cover-25.jpg)
_4KB_ | ![50%](../assets/200-200-cover-50.jpg)
_6KB_ | ![75%](../assets/200-200-cover-75.jpg)
_8KB_ | ![100%](../assets/200-200-cover-100.jpg)
_38KB_ | diff --git a/docs/guides/items.md b/docs/guides/items.md index eab438e8bd..44d45a9593 100644 --- a/docs/guides/items.md +++ b/docs/guides/items.md @@ -1,4 +1,41 @@ # Items -> TK +Browse: +## Creating Items + +## Browsing Items + +### Searching + +### Layouts + +### Advanced Filter + +### Bookmark + +## Reordering Items + +## Updating Items + +## Deleting Items + +## Export Data + +--- + +Detail: + +## Creating an Item + +## Archiving an Item + +## Updating Item + +## Reverting Item + +## Deleting an Item + +## Revisions + +## Comments diff --git a/docs/reference/api/activity.md b/docs/reference/api/activity.md new file mode 100644 index 0000000000..a226a749c6 --- /dev/null +++ b/docs/reference/api/activity.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Activity', + 'description': 'All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.', + 'x-collection': 'directus_activity', + }, +} +--- + +# Activity + +All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens. diff --git a/docs/reference/api/assets.md b/docs/reference/api/assets.md new file mode 100644 index 0000000000..b4034697b0 --- /dev/null +++ b/docs/reference/api/assets.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Assets', + 'description': 'Image typed files can be dynamically resized and transformed to fit any need.', + }, +} +--- + +# Assets + +Image typed files can be dynamically resized and transformed to fit any need. diff --git a/docs/reference/api/authentication.md b/docs/reference/api/authentication.md new file mode 100644 index 0000000000..2ed0a73cba --- /dev/null +++ b/docs/reference/api/authentication.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Authentication', + 'description': 'All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.', + }, +} +--- + +# Authentication + +All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens. diff --git a/docs/reference/api/collections.md b/docs/reference/api/collections.md new file mode 100644 index 0000000000..76b72f88a7 --- /dev/null +++ b/docs/reference/api/collections.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Collections', + 'description': 'Collections are the individual collections of items, similar to tables in a database. Changes to collections will alter the schema of the database.', + 'x-collection': 'directus_collections', + }, +} +--- + +# Collections + +Collections are the individual collections of items, similar to tables in a database. Changes to collections will alter the schema of the database. diff --git a/docs/reference/api/extensions.md b/docs/reference/api/extensions.md new file mode 100644 index 0000000000..73cf959063 --- /dev/null +++ b/docs/reference/api/extensions.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Extensions', + 'description': 'Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules.', + }, +} +--- + +# Extensions + +Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules. diff --git a/docs/reference/api/fields.md b/docs/reference/api/fields.md new file mode 100644 index 0000000000..403a867ab3 --- /dev/null +++ b/docs/reference/api/fields.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Fields', + 'description': 'Fields are individual pieces of content within an item. They are mapped to columns in the database.', + 'x-collection': 'directus_fields', + }, +} +--- + +# Fields + +Fields are individual pieces of content within an item. They are mapped to columns in the database. diff --git a/docs/reference/api/files.md b/docs/reference/api/files.md new file mode 100644 index 0000000000..6ddbbacc43 --- /dev/null +++ b/docs/reference/api/files.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Files', + 'description': 'Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly.', + 'x-collection': 'directus_files', + }, +} +--- + +# Files + +Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly. diff --git a/docs/reference/api/folders.md b/docs/reference/api/folders.md new file mode 100644 index 0000000000..a80f8e3258 --- /dev/null +++ b/docs/reference/api/folders.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Folders', + 'description': 'Group files by virtual folders.', + 'x-collection': 'directus_folders', + }, +} +--- + +# Folders + +Group files by virtual folders. diff --git a/docs/reference/api/items.md b/docs/reference/api/items.md new file mode 100644 index 0000000000..e9d0731382 --- /dev/null +++ b/docs/reference/api/items.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Items', + 'description': 'Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks.', + }, +} +--- + +# Items + +Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks. diff --git a/docs/reference/api/permissions.md b/docs/reference/api/permissions.md new file mode 100644 index 0000000000..afc13a16b1 --- /dev/null +++ b/docs/reference/api/permissions.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Permissions', + 'description': 'Permissions control who has access to what and when.', + 'x-collection': 'directus_permissions', + }, +} +--- + +# Permissions + +Permissions control who has access to what and when. diff --git a/docs/reference/api/presets.md b/docs/reference/api/presets.md new file mode 100644 index 0000000000..5b98b1ad11 --- /dev/null +++ b/docs/reference/api/presets.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Presets', + 'description': 'Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app.', + 'x-collection': 'directus_presets', + }, +} +--- + +# Presets + +Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app. diff --git a/docs/reference/api/relations.md b/docs/reference/api/relations.md new file mode 100644 index 0000000000..bdc284b2d1 --- /dev/null +++ b/docs/reference/api/relations.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Relations', + 'description': 'What data is linked to what other data. Allows you to assign authors to articles, products to sales, and whatever other structures you can think of.', + 'x-collection': 'directus_relations', + }, +} +--- + +# Relations + +What data is linked to what other data. Allows you to assign authors to articles, products to sales, and whatever other structures you can think of. diff --git a/docs/reference/api/revisions.md b/docs/reference/api/revisions.md new file mode 100644 index 0000000000..97380a8ffc --- /dev/null +++ b/docs/reference/api/revisions.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Revisions', + 'description': "Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will.", + 'x-collection': 'directus_revisions', + }, +} +--- + +# Revisions + +Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will. diff --git a/docs/reference/api/roles.md b/docs/reference/api/roles.md new file mode 100644 index 0000000000..b5e1ae49d3 --- /dev/null +++ b/docs/reference/api/roles.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Roles', + 'description': 'Roles are groups of users that share permissions.', + 'x-collection': 'directus_roles', + }, +} +--- + +# Roles + +Roles are groups of users that share permissions. diff --git a/docs/reference/api/server.md b/docs/reference/api/server.md new file mode 100644 index 0000000000..6427410be3 --- /dev/null +++ b/docs/reference/api/server.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Server', + 'description': "Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with.", + }, +} +--- + +# Server + +Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with. diff --git a/docs/reference/api/settings.md b/docs/reference/api/settings.md new file mode 100644 index 0000000000..3f8e6828cd --- /dev/null +++ b/docs/reference/api/settings.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Settings', + 'description': 'Settings control the way the platform works and acts.', + 'x-collection': 'directus_settings', + }, +} +--- + +# Settings + +Settings control the way the platform works and acts. diff --git a/docs/reference/api/users.md b/docs/reference/api/users.md new file mode 100644 index 0000000000..ec4f94dba5 --- /dev/null +++ b/docs/reference/api/users.md @@ -0,0 +1,15 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Users', + 'description': 'Users are what gives you access to the data.', + 'x-collection': 'directus_users', + }, +} +--- + +# Users + +Users are what gives you access to the data. diff --git a/docs/reference/api/utilities.md b/docs/reference/api/utilities.md new file mode 100644 index 0000000000..05f041f8c2 --- /dev/null +++ b/docs/reference/api/utilities.md @@ -0,0 +1,14 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': + { + 'name': 'Utilities', + 'description': 'Directus comes with various utility endpoints you can use to simplify your development flow.', + }, +} +--- + +# Utilities + +Directus comes with various utility endpoints you can use to simplify your development flow. diff --git a/docs/reference/api/webhooks.md b/docs/reference/api/webhooks.md new file mode 100644 index 0000000000..dae02f5a0a --- /dev/null +++ b/docs/reference/api/webhooks.md @@ -0,0 +1,10 @@ +--- +{ + 'layout': 'APIReferenceLayout', + 'tag': { 'name': 'Webhooks', 'description': 'Webhooks.', 'x-collection': 'directus_webhooks' }, +} +--- + +# Webhooks + +Webhooks. diff --git a/docs/reference/field-types.md b/docs/reference/field-types.md new file mode 100644 index 0000000000..b0d58c5b33 --- /dev/null +++ b/docs/reference/field-types.md @@ -0,0 +1,3 @@ +# Field Types + +@TODO diff --git a/package.json b/package.json index 1d1ce642df..d3313e2044 100644 --- a/package.json +++ b/package.json @@ -197,7 +197,7 @@ } }, "lint-staged": { - "**/*.{js,ts}": [ + "**/*.{js,ts,md}": [ "prettier --write" ], "**/*.{css,scss}": [ From 41a3ffcd002f3cc05feb2d737e5901bf56c3cb8a Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 16:52:51 -0500 Subject: [PATCH 091/357] Format md --- .prettierrc | 3 +- docs/concepts/activity-and-versions.md | 38 +++-- docs/concepts/app-extensions.md | 52 ++++-- docs/concepts/app-overview.md | 111 +++++++++---- docs/concepts/files-and-thumbnails.md | 25 ++- docs/concepts/internationalization.md | 29 ++-- docs/concepts/platform-overview.md | 73 +++++--- docs/concepts/relationships.md | 90 ++++++---- docs/concepts/users-roles-and-permissions.md | 49 +++--- docs/getting-started/backing-directus.md | 50 ++++-- docs/getting-started/contributing.md | 77 ++++++--- docs/getting-started/installation.md | 33 ++-- docs/getting-started/introduction.md | 92 ++++++---- docs/getting-started/quickstart.md | 3 +- docs/getting-started/support.md | 55 ++++-- docs/guides/collections.md | 111 +++++++------ docs/guides/extensions/api-endpoints.md | 36 ++-- docs/guides/extensions/api-hooks.md | 97 ++++++----- docs/guides/extensions/displays.md | 103 ++++++------ docs/guides/extensions/email-templates.md | 3 +- docs/guides/extensions/interfaces.md | 90 +++++----- docs/guides/extensions/layouts.md | 77 ++++----- docs/guides/extensions/modules.md | 68 ++++---- docs/guides/field-types/many-to-any-field.md | 2 +- docs/guides/field-types/translated-fields.md | 2 +- docs/guides/fields.md | 21 +-- docs/guides/files.md | 55 +++--- docs/guides/installation/cli.md | 18 +- .../installation/digitalocean-one-click.md | 15 +- docs/guides/installation/docker.md | 6 +- docs/guides/installation/heroku.md | 2 +- docs/guides/installation/manual.md | 3 +- docs/guides/presets.md | 44 ++--- docs/guides/projects.md | 34 ++-- docs/guides/roles-and-permissions.md | 126 ++++++++------ docs/guides/users.md | 51 +++--- docs/guides/webhooks.md | 24 +-- docs/guides/white-labeling.md | 80 +++++---- docs/readme.md | 50 +++--- docs/reference/api/activity.md | 7 +- docs/reference/api/assets.md | 3 +- docs/reference/api/authentication.md | 7 +- docs/reference/api/collections.md | 7 +- docs/reference/api/extensions.md | 7 +- docs/reference/api/fields.md | 4 +- docs/reference/api/files.md | 7 +- docs/reference/api/introduction.md | 7 +- docs/reference/api/items.md | 7 +- docs/reference/api/presets.md | 7 +- docs/reference/api/relations.md | 7 +- docs/reference/api/revisions.md | 7 +- docs/reference/api/server.md | 7 +- docs/reference/api/utilities.md | 4 +- docs/reference/environment-variables.md | 157 +++++++++--------- docs/reference/error-codes.md | 7 +- docs/reference/filter-rules.md | 134 +++++++-------- docs/reference/item-objects.md | 15 +- docs/reference/sdk-js.md | 97 +++++------ 58 files changed, 1416 insertions(+), 980 deletions(-) diff --git a/.prettierrc b/.prettierrc index f8d45edb52..8d0df3d705 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "printWidth": 100, "singleQuote": true, - "useTabs": true + "useTabs": true, + "proseWrap": "always" } diff --git a/docs/concepts/activity-and-versions.md b/docs/concepts/activity-and-versions.md index 15c8fb1084..fc6741df7a 100644 --- a/docs/concepts/activity-and-versions.md +++ b/docs/concepts/activity-and-versions.md @@ -1,10 +1,15 @@ # Activity & Versions -> Directus stores detailed records of all changes made to data through the App and API. This gives a comprehensive accountability log of who did what, and when. This also powers the Directus versioning system, which allows storing alternate versions/revisions of items. +> Directus stores detailed records of all changes made to data through the App and API. This gives a +> comprehensive accountability log of who did what, and when. This also powers the Directus +> versioning system, which allows storing alternate versions/revisions of items. ## Activity -This is a log of all events that have occured within the project. Activity can be accessed in two ways, via the main [Activity Module](/concepts/app-overview#actvity-history), or within the sidebar of individual [Item Detail](/concepts/app-overview#item-detail) pages. The following information is stored for each event's activity item: +This is a log of all events that have occured within the project. Activity can be accessed in two +ways, via the main [Activity Module](/concepts/app-overview#actvity-history), or within the sidebar +of individual [Item Detail](/concepts/app-overview#item-detail) pages. The following information is +stored for each event's activity item: - Action - User @@ -15,28 +20,31 @@ This is a log of all events that have occured within the project. Activity can b - Item - Comment (when applicable) -::: tip Readonly -For proper accountability, activity records are readonly. Administrators should avoid changing, deleting, or truncating this data. -::: +::: tip Readonly For proper accountability, activity records are readonly. Administrators should +avoid changing, deleting, or truncating this data. ::: -::: warning External Events -Directus can only track events that pass through the platform's middleware. Changes made directly to the database, or by other external means, are not included in the activity log. -::: +::: warning External Events Directus can only track events that pass through the platform's +middleware. Changes made directly to the database, or by other external means, are not included in +the activity log. ::: ## Versions -Every change made to items in Directus are also stored as a versioned snapshot. This additional data is also linked to the specific Activity event which created it. Below are the two key pieces of information stored for each version: +Every change made to items in Directus are also stored as a versioned snapshot. This additional data +is also linked to the specific Activity event which created it. Below are the two key pieces of +information stored for each version: - Data — A full snapshot of the item _after_ the event - Delta — The specific field data changed by this event -::: tip Customizing Version Data -Since versions store a full data snapshot and delta, the `directus_revisions` collection can quickly grow quite large, increasing database size and potentially decreasing performance. To remedy this, Directus allows [configuring version scope](/concepts/app-overview) per collection to set the exact field data saved. -::: +::: tip Customizing Version Data Since versions store a full data snapshot and delta, the +`directus_revisions` collection can quickly grow quite large, increasing database size and +potentially decreasing performance. To remedy this, Directus allows +[configuring version scope](/concepts/app-overview) per collection to set the exact field data +saved. ::: -::: tip Creating Detached Versions -You can also create a new version for an item without saving the data to the parent item itself. This allows you to "stage" changes to an item that may already be live/published. -::: +::: tip Creating Detached Versions You can also create a new version for an item without saving the +data to the parent item itself. This allows you to "stage" changes to an item that may already be +live/published. ::: ### Relevant Guides diff --git a/docs/concepts/app-extensions.md b/docs/concepts/app-extensions.md index 9f98edca26..407508acbe 100644 --- a/docs/concepts/app-extensions.md +++ b/docs/concepts/app-extensions.md @@ -1,10 +1,14 @@ # App Components -> Directus has been architected as completely modular and extensible. There are four keystone component types within the App. Out-of-the-box components are configurable, or altogether new components can be created as extensions. +> Directus has been architected as completely modular and extensible. There are four keystone +> component types within the App. Out-of-the-box components are configurable, or altogether new +> components can be created as extensions. ## Modules -Modules are the highest and broadest level of organization within the App. All core functionality within the App (other than authentication and activity) can be bucketed into one of the following five modules: +Modules are the highest and broadest level of organization within the App. All core functionality +within the App (other than authentication and activity) can be bucketed into one of the following +five modules: - Collections — The primary way to view and interact with database content - User Directory — A dedicated section for the platform's system Users @@ -12,7 +16,9 @@ Modules are the highest and broadest level of organization within the App. All c - Documentation — A tailored, in-app portal for the platform's concepts, guides, and reference - Settings — An Admin-Only section for configuring the project and system settings -In addition to these core modules, custom modules offer a _blank canvas_ for creating altogether new/different experiences within the App, such as proprietary dashboards, compound datasets, or third-party integrations (eg: a Stripe Payments Console). +In addition to these core modules, custom modules offer a _blank canvas_ for creating altogether +new/different experiences within the App, such as proprietary dashboards, compound datasets, or +third-party integrations (eg: a Stripe Payments Console). ### Relevant Guides @@ -20,11 +26,15 @@ In addition to these core modules, custom modules offer a _blank canvas_ for cre ## Layouts -Layouts provide different ways for presenting, browsing, visualizing, or even managing sets of data. Most commonly shown on Collection Detail pages and contextual modals for item selection. Directus includes several Layout options out-of-the-box, each with different features and configuration options. +Layouts provide different ways for presenting, browsing, visualizing, or even managing sets of data. +Most commonly shown on Collection Detail pages and contextual modals for item selection. Directus +includes several Layout options out-of-the-box, each with different features and configuration +options. ### Table -This tabular layout supports all forms of data, and is therefore the default within the Collections module. It includes the following features/options: +This tabular layout supports all forms of data, and is therefore the default within the Collections +module. It includes the following features/options: - Toggle & Reorder Field Columns (Option) - Row Spacing (Option) @@ -35,7 +45,9 @@ This tabular layout supports all forms of data, and is therefore the default wit ### Cards -This tiled layout is ideal for collections that prioritize an image. It is the default for both the [User Directory](/guides/users) (shows the avatar) and [File Library](/guides/files) (shows asset thumbnail). It includes the following features/options: +This tiled layout is ideal for collections that prioritize an image. It is the default for both the +[User Directory](/guides/users) (shows the avatar) and [File Library](/guides/files) (shows asset +thumbnail). It includes the following features/options: - Image Source (Option) - Title (Option) @@ -60,12 +72,19 @@ In addition to these core layouts, custom layouts allow for creating more tailor ## Interfaces -Interfaces provide a multitude of ways to view or interact with field data on [Item Detail](/concepts/app-overview#item-detail) page forms. Every interface supports a specific subset of field [types](/reference/field-types) (eg: String), which determines how the data will be stored. For example, the _Text Input_ interface can manage most types of data, but might not be ideal for dates, where a _Calendar_ interface excels. Directus includes many Interfaces out-of-the-box: +Interfaces provide a multitude of ways to view or interact with field data on +[Item Detail](/concepts/app-overview#item-detail) page forms. Every interface supports a specific +subset of field [types](/reference/field-types) (eg: String), which determines how the data will be +stored. For example, the _Text Input_ interface can manage most types of data, but might not be +ideal for dates, where a _Calendar_ interface excels. Directus includes many Interfaces +out-of-the-box: - Text Input - @TODO List all core interfaces, or link to a exhaustive reference? -In addition to these core interfaces, custom interfaces allow for creating more tailored or proprietary ways to view or manage field data, such as bespoke layout builders, skeuomorphic knobs, or relational views for third-party data (eg: Stripe Credit Card UI). +In addition to these core interfaces, custom interfaces allow for creating more tailored or +proprietary ways to view or manage field data, such as bespoke layout builders, skeuomorphic knobs, +or relational views for third-party data (eg: Stripe Credit Card UI). ### Relevant Guides @@ -73,13 +92,19 @@ In addition to these core interfaces, custom interfaces allow for creating more ## Displays -Displays are the smaller, read-only counterpart to Interfaces, defining how a field's data will be displayed inline on [Item Detail](/concepts/app-overview#item-detail) pages, Modals, and even within Interfaces themselves. For example, you may have a "Status" field that uses a _Dropdown_ Interface on the Item Detail page, and a _Color Dot_ Display when the field is referenced throughout the rest of the App. Directus includes many Displays out-of-the-box: +Displays are the smaller, read-only counterpart to Interfaces, defining how a field's data will be +displayed inline on [Item Detail](/concepts/app-overview#item-detail) pages, Modals, and even within +Interfaces themselves. For example, you may have a "Status" field that uses a _Dropdown_ Interface +on the Item Detail page, and a _Color Dot_ Display when the field is referenced throughout the rest +of the App. Directus includes many Displays out-of-the-box: - Raw - Formatted Value - @TODO List all core interfaces, or link to a exhaustive reference? -In addition to these core displays, custom displays allow for creating customized ways to view or represent field data, such as progress indicators, relational data tooltips, or specific formatting options. +In addition to these core displays, custom displays allow for creating customized ways to view or +represent field data, such as progress indicators, relational data tooltips, or specific formatting +options. ### Relevant Guides @@ -87,7 +112,12 @@ In addition to these core displays, custom displays allow for creating customize ## Title Formatter -Directus uses [Database Mirroring](/concepts/platform-overview) to create its underlying data model based on your custom schema. Therefore the App needs a reliable way of converting any raw table name, field name, or other technical value into a prettified format that is human-readable. At its core, the Title Formatter converts any string into title-case with proper whitespace. It also covers acronyms, initialisms, common proper nouns, so each is output properly. Some example conversion include: +Directus uses [Database Mirroring](/concepts/platform-overview) to create its underlying data model +based on your custom schema. Therefore the App needs a reliable way of converting any raw table +name, field name, or other technical value into a prettified format that is human-readable. At its +core, the Title Formatter converts any string into title-case with proper whitespace. It also covers +acronyms, initialisms, common proper nouns, so each is output properly. Some example conversion +include: | Original String | Formatted Title | | ---------------------------- | --------------------------------- | diff --git a/docs/concepts/app-overview.md b/docs/concepts/app-overview.md index 76cb859ec3..a96419109c 100644 --- a/docs/concepts/app-overview.md +++ b/docs/concepts/app-overview.md @@ -1,6 +1,8 @@ # App Overview -> The Directus App is the presentation layer for your data, content, and assets. It uses a left-to-right visual hierarchy for organization and navigation. Below we cover the App's global elements and individual pages. +> The Directus App is the presentation layer for your data, content, and assets. It uses a +> left-to-right visual hierarchy for organization and navigation. Below we cover the App's global +> elements and individual pages. ## Global Elements @@ -9,20 +11,29 @@ ### 1. Module Bar -- **Project Logo** — Displays your configured project logo and project color (defaults to the Directus logo and color). If configured, clicking this component will navigate to the Project URL. During platform activity, an indeterminate progress indicator will also be shown here. -- **Modules** — Any available modules are listed below the project logo. These may be turned off or reordered based on your [role's configuration](/concepts/users-roles-and-permissions), but by default this includes: +- **Project Logo** — Displays your configured project logo and project color (defaults to the + Directus logo and color). If configured, clicking this component will navigate to the Project + URL. During platform activity, an indeterminate progress indicator will also be shown here. +- **Modules** — Any available modules are listed below the project logo. These may be turned off + or reordered based on your [role's configuration](/concepts/users-roles-and-permissions), but by + default this includes: - [Collections](/concepts/app-overview) - [User Directory](/concepts/app-overview) - [File Library](/concepts/app-overview) - [Documentation](/concepts/app-overview) - [Settings](/concepts/app-overview) — Admin only - [Custom Modules](/guides/extensions/modules) — If configured -- **Current User Menu** — This component displays the authenticated user's name and avatar. Hovering over this menu exposes the Log Out button. +- **Current User Menu** — This component displays the authenticated user's name and avatar. + Hovering over this menu exposes the Log Out button. ### 2. Navigation Bar -- **Project Name** — Shows the name of your current project (see [Project Settings](/guides/white-labeling)), as well as the quality of your project's API connection. -- **Navigation** — This is a dynamic navigation based on your current module. Some modules also support [Presets and/or Bookmarks](/guides/roles-and-permissions), which are ways to link to more specific data-sets. +- **Project Name** — Shows the name of your current project (see + [Project Settings](/guides/white-labeling)), as well as the quality of your project's API + connection. +- **Navigation** — This is a dynamic navigation based on your current module. Some modules also + support [Presets and/or Bookmarks](/guides/roles-and-permissions), which are ways to link to + more specific data-sets. ### 3. Page @@ -30,25 +41,35 @@ - Page Icon — Clicking this navigates back to the previous page - Module Title — Clicking this navigates to the parent module/section - Page Title — Displays the current page's title - - Action Buttons — On the right-side of the header are contextual buttons for specific page actions. Please note that some primary action buttons have a "..." icon beside them that provides additional options when clicked. + - Action Buttons — On the right-side of the header are contextual buttons for specific page + actions. Please note that some primary action buttons have a "..." icon beside them that + provides additional options when clicked. - **Page Content** — This displays the content of the page you navigated to. ### 4. Page Sidebar -- **Page Components** — Lists any contextual page components available. The "Info" component is available on every page, explaining the page's general purpose and relevant details. Clicking any sidebar component will accordion it open. If the App window is large enough, the sidebar will automatically open, and can be closed by clicking the "X" in the top-right. -- **Notifications Tray** — Fixed to the bottom of the page sidebar, this button opens a tray of recent user notifications, and provides a link to the [Activity History](/concepts/app-overview) page. +- **Page Components** — Lists any contextual page components available. The "Info" component is + available on every page, explaining the page's general purpose and relevant details. Clicking + any sidebar component will accordion it open. If the App window is large enough, the sidebar + will automatically open, and can be closed by clicking the "X" in the top-right. +- **Notifications Tray** — Fixed to the bottom of the page sidebar, this button opens a tray of + recent user notifications, and provides a link to the [Activity History](/concepts/app-overview) + page. ## Collections -This module is the primary way for interacting with your database content. Here you can access your collections, browse their items, and navigate to individual item forms. +This module is the primary way for interacting with your database content. Here you can access your +collections, browse their items, and navigate to individual item forms. ### Collection Listing -A page that lists the collections available to the current user. This is the landing page of the module, and effectively the same as its navigation listing. +A page that lists the collections available to the current user. This is the landing page of the +module, and effectively the same as its navigation listing. ### Collection Detail -Provides a configurable layout to browse or visualize items within a given collection. Like other browse pages, there are many available features, including: +Provides a configurable layout to browse or visualize items within a given collection. Like other +browse pages, there are many available features, including: - [Creating Items](/guides/items#creating-items) - [Browsing Items](/guides/items#browsing-items) @@ -62,7 +83,9 @@ Provides a configurable layout to browse or visualize items within a given colle ### Item Detail -Most layouts on the browse page support navigating to individual item detail pages, where you a presented with a [customizable form](/guides/fields#adjusting-fields-layout) for viewing/editing the item's content. Like other detail pages, there are many available features, including: +Most layouts on the browse page support navigating to individual item detail pages, where you a +presented with a [customizable form](/guides/fields#adjusting-fields-layout) for viewing/editing the +item's content. Like other detail pages, there are many available features, including: - [Updating an Item](/guides/items#updating-item) - [Reverting an Item](/guides/items#reverting-item) @@ -71,11 +94,15 @@ Most layouts on the browse page support navigating to individual item detail pag ## User Directory -A module includes a comprehensive listing of all system users within your project. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). +A module includes a comprehensive listing of all system users within your project. This page has the +same features and configuration as [Collection Detail](/concepts/app-overview). ### User Detail -Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for viewing system users. This is also used for editing the "Profile Page" of the current user, which is accessible from the [User Menu](/concepts/app-overview). Directus ships with a full-featured user system, with the following fields: +Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for +viewing system users. This is also used for editing the "Profile Page" of the current user, which is +accessible from the [User Menu](/concepts/app-overview). Directus ships with a full-featured user +system, with the following fields: - **First Name** — The user's given name - **Last Name** — The user's family name @@ -100,20 +127,23 @@ The sidebar's info component also includes the following readonly details: - **Last Access** — The timestamp of the user's last App or API action - **Last Page** — The last App page accessed by the user -::: tip Extending Users -While the fields included out-of-the-box are locked from schema changes, you can extend Directus Users to include -additional proprietary fields within [Settings > Data Model](/concepts/data-model). -::: +::: tip Extending Users While the fields included out-of-the-box are locked from schema changes, you +can extend Directus Users to include additional proprietary fields within +[Settings > Data Model](/concepts/data-model). ::: ## File Library -This module aggregates all files within the project into one consolidated library. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). +This module aggregates all files within the project into one consolidated library. This page has the +same features and configuration as [Collection Detail](/concepts/app-overview). ### File Detail -Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for viewing assets and embeds. Directus ships with a full-featured system for digital asset management, with the following fields: +Similar to other [Item Detail](/concepts/app-overview) pages, this page provides a custom form for +viewing assets and embeds. Directus ships with a full-featured system for digital asset management, +with the following fields: -- **Title** — Pulled from the file metadata if available, falls back to a formatted version of the filename +- **Title** — Pulled from the file metadata if available, falls back to a formatted version of the + filename - **Description** — Pulled from the file metadata if available - **Tags** — Pulled from the file metadata if available - **Location** — Pulled from the file metadata if available @@ -131,30 +161,39 @@ The sidebar's info component also includes the following readonly details: - **Folder** — The current parent folder that contains the file - **Metadata** — Metadata JSON dump of the file's EXIF, IPTC, and ICC information -::: tip Extending Files -While the fields included out-of-the-box are locked from schema changes, you can extend Directus Files to include additional proprietary fields within [Settings > Data Model](/concepts/data-model). -::: +::: tip Extending Files While the fields included out-of-the-box are locked from schema changes, you +can extend Directus Files to include additional proprietary fields within +[Settings > Data Model](/concepts/data-model). ::: ## Documentation -This module is an internal set of guides, concepts, and reference docs for your project's specific version of Directus. It also includes a dynamic [API Reference](/reference/api/introduction) that is dynamically tailored to your custom schema. The docs are organized into four distinct sections: +This module is an internal set of guides, concepts, and reference docs for your project's specific +version of Directus. It also includes a dynamic [API Reference](/reference/api/introduction) that is +dynamically tailored to your custom schema. The docs are organized into four distinct sections: -- [Getting Started](/getting-started/introduction)\*\* — Novice Oriented. For a platform intro and installation. +- [Getting Started](/getting-started/introduction)\*\* — Novice Oriented. For a platform intro and + installation. - [Concepts](/concepts/app-overview)\*\* — Learning Oriented. For understanding the platform. -- [Guides](/concepts/roles-and-permissions)\*\* — Problem Oriented. Follow along with steps while working. -- [Reference](/reference/api/introduction)\*\* — Information Oriented. Look up info and specs while working. +- [Guides](/concepts/roles-and-permissions)\*\* — Problem Oriented. Follow along with steps while + working. +- [Reference](/reference/api/introduction)\*\* — Information Oriented. Look up info and specs + while working. -::: tip Updating the Docs -Our docs are written in markdown (with some additional VuePress styling like this hint box), and available for editing/fixing via [GitHub](https://github.com/directus/directus). -::: +::: tip Updating the Docs Our docs are written in markdown (with some additional VuePress styling +like this hint box), and available for editing/fixing via +[GitHub](https://github.com/directus/directus). ::: ## Activity History -This module provides a collective timeline of all actions taken within the project. This is a great way to audit user activity or enforce accountability. This is the only system module that is not in the module bar by default — instead being located within the notifications tray of the page sidebar. This page has the same features and configuration as [Collection Detail](/concepts/app-overview). +This module provides a collective timeline of all actions taken within the project. This is a great +way to audit user activity or enforce accountability. This is the only system module that is not in +the module bar by default — instead being located within the notifications tray of the page sidebar. +This page has the same features and configuration as [Collection Detail](/concepts/app-overview). ### Activity Detail -Unlike other item detail pages, activity items are **readonly** (for proper accountability) and open in a modal window with the following fields: +Unlike other item detail pages, activity items are **readonly** (for proper accountability) and open +in a modal window with the following fields: - **User** — The Directus user that performed the action - **Action** — The specific action taken, eg: Create, Update, Delete, Authenticate, etc @@ -166,7 +205,9 @@ Unlike other item detail pages, activity items are **readonly** (for proper acco # Settings -This module is only available to users within [admin roles](/concepts/users-roles-and-permissions#administrators-role). This is where your project is configured, and the first place to go after installation. It includes the following sections: +This module is only available to users within +[admin roles](/concepts/users-roles-and-permissions#administrators-role). This is where your project +is configured, and the first place to go after installation. It includes the following sections: - [Project Settings](/concepts/platform-overview) - [Data Model](/concepts/data-model) diff --git a/docs/concepts/files-and-thumbnails.md b/docs/concepts/files-and-thumbnails.md index c6e96afb66..f81dbd0333 100644 --- a/docs/concepts/files-and-thumbnails.md +++ b/docs/concepts/files-and-thumbnails.md @@ -1,10 +1,13 @@ # Files & Thumbnails -> Directus offers a full Digital Asset Management (DAM) system. This includes multiple storage adapters, nested folder organization, private file access, image editing, and on-demand thumbnail generation. +> Directus offers a full Digital Asset Management (DAM) system. This includes multiple storage +> adapters, nested folder organization, private file access, image editing, and on-demand thumbnail +> generation. ## Storage Adapters -Storage adapters allow project files to be stored in different locations or services. By default, Directus includes the following adapters: +Storage adapters allow project files to be stored in different locations or services. By default, +Directus includes the following adapters: - **Local Filesystem** — The default, any filesystem location or network-attached storage - **S3 or Equivalent** — Including AWS S3, DigitalOcean Spaces, Alibaba OSS, and others @@ -12,7 +15,10 @@ Storage adapters allow project files to be stored in different locations or serv ## Files -Directus allows you to manage all your files in one place, including documents, images, videos, and more. Files can be uploaded to the [File Library](/concepts/app-overview#file-library) in general, or directly to an item via a [Single File](/guides/field-types/single-file) or [Multiple Files](/guides/field-types/multiple-files) field. +Directus allows you to manage all your files in one place, including documents, images, videos, and +more. Files can be uploaded to the [File Library](/concepts/app-overview#file-library) in general, +or directly to an item via a [Single File](/guides/field-types/single-file) or +[Multiple Files](/guides/field-types/multiple-files) field. ### Relevant Guides @@ -21,13 +27,20 @@ Directus allows you to manage all your files in one place, including documents, ## Embedded Assets -Directus also supports ingesting third-party embedded assets, such as YouTube or Vimeo videos. These are managed the same as normal files, however the resource itself is stored on the external service, and referenced via its proprietary UID. +Directus also supports ingesting third-party embedded assets, such as YouTube or Vimeo videos. These +are managed the same as normal files, however the resource itself is stored on the external service, +and referenced via its proprietary UID. ## Crop & Transform Images -Our file middleware also allows for cropping and transforming image assets on the fly. This means you can simply request an image, include any desired transformation parameters, and you'll be served the new asset as a response. This is very useful for automatically generating many different thumbnails/versions of an original file. +Our file middleware also allows for cropping and transforming image assets on the fly. This means +you can simply request an image, include any desired transformation parameters, and you'll be served +the new asset as a response. This is very useful for automatically generating many different +thumbnails/versions of an original file. -To impede malicious users from consuming your storage by requesting a multitude of random sizes, Directus includes a [Asset Allow-List](/guides/files#creating-thumbnail-presets) to limit what transformations are possible. +To impede malicious users from consuming your storage by requesting a multitude of random sizes, +Directus includes a [Asset Allow-List](/guides/files#creating-thumbnail-presets) to limit what +transformations are possible. ### Relevant Guides diff --git a/docs/concepts/internationalization.md b/docs/concepts/internationalization.md index c60ea13c7d..6e09f0d68a 100644 --- a/docs/concepts/internationalization.md +++ b/docs/concepts/internationalization.md @@ -1,23 +1,32 @@ # Internationalization -> Directus is maintained by people all over the world. Not only does Directus allow you to author and manage multilingual content, the App itself also supports multiple languages and locales. +> Directus is maintained by people all over the world. Not only does Directus allow you to author +> and manage multilingual content, the App itself also supports multiple languages and locales. ## App Translations -Directus supports internationalization across its entire Admin App. Many languages are currently supported, with more are being added all the time. Help the communtiy by adding or refining your language through our [CrowdIn](https://locales.directus.io/) integration. +Directus supports internationalization across its entire Admin App. Many languages are currently +supported, with more are being added all the time. Help the communtiy by adding or refining your +language through our [CrowdIn](https://locales.directus.io/) integration. ## Schema Translations -Directus uses [database mirroring](#) to dynamically pull in your schema's tables and columns, however this only covers one language. Therefore our platform supports schema translations for these names, allowing you to properly support different languages for your Collection and Field names. +Directus uses [database mirroring](#) to dynamically pull in your schema's tables and columns, +however this only covers one language. Therefore our platform supports schema translations for these +names, allowing you to properly support different languages for your Collection and Field names. -::: tip Overriding Technical Names -If your project requires more _technical_ table/column names (eg: `cust` or `f_name`), you can also use schema translations to override those defaults (eg: `Customers` or `First Name`) in the primary language. -::: +::: tip Overriding Technical Names If your project requires more _technical_ table/column names (eg: +`cust` or `f_name`), you can also use schema translations to override those defaults (eg: +`Customers` or `First Name`) in the primary language. ::: ## Content Translations -One of the most important features in Directus is the ability to author and manage multilingual content. While you can accomplish this by creating _standard_ fields in the parent collection for each language, it is more extensible to use our relational translation fields to dynamically manage content in as many languages as is required. Mixing standard and translated fields also allows language-agnostic data (such as dates or toggles) to remain within the parent collection. +One of the most important features in Directus is the ability to author and manage multilingual +content. While you can accomplish this by creating _standard_ fields in the parent collection for +each language, it is more extensible to use our relational translation fields to dynamically manage +content in as many languages as is required. Mixing standard and translated fields also allows +language-agnostic data (such as dates or toggles) to remain within the parent collection. -::: tip Custom Interfaces -For more advanced use-cases, such as connecting to a third-party translation service, you can read our extension guide on [creating a custom interface](/guides/extensions/interfaces). -::: +::: tip Custom Interfaces For more advanced use-cases, such as connecting to a third-party +translation service, you can read our extension guide on +[creating a custom interface](/guides/extensions/interfaces). ::: diff --git a/docs/concepts/platform-overview.md b/docs/concepts/platform-overview.md index 730f8557e4..9f46293a94 100644 --- a/docs/concepts/platform-overview.md +++ b/docs/concepts/platform-overview.md @@ -1,10 +1,14 @@ # Platform Overview -> The Directus platform is primarily comprised of an API and App, working in concert to manage the content of your SQL database. +> The Directus platform is primarily comprised of an API and App, working in concert to manage the +> content of your SQL database. ## Database Mirroring -Instead of using a predefined "one-size-fits-all" data model to store your content, Directus "mirrors" your actual SQL database in real-time. The principle is akin to a database client (eg: _phpMyAdmin_), but includes far mor advanced tools, and is safe and intuitive enough for non-technical users. This approach has many unique advantages: +Instead of using a predefined "one-size-fits-all" data model to store your content, Directus +"mirrors" your actual SQL database in real-time. The principle is akin to a database client (eg: +_phpMyAdmin_), but includes far mor advanced tools, and is safe and intuitive enough for +non-technical users. This approach has many unique advantages: - A custom SQL database schema, tailored to your exact requirements - Significant performance improvements through optimizations and indexing @@ -14,7 +18,10 @@ Instead of using a predefined "one-size-fits-all" data model to store your conte ## Directus API -The Directus API uses _Database Mirroring_ to dynamically generate REST endpoints and a GraphQL schema based on the connected database's architecture. It is written in [Node.js](https://nodejs.org) and uses database abstraction to support most [SQL database vendors](/guides/installation#databases). +The Directus API uses _Database Mirroring_ to dynamically generate REST endpoints and a GraphQL +schema based on the connected database's architecture. It is written in +[Node.js](https://nodejs.org) and uses database abstraction to support most +[SQL database vendors](/guides/installation#databases). ### Relevant Docs @@ -23,7 +30,9 @@ The Directus API uses _Database Mirroring_ to dynamically generate REST endpoint ## Directus App -The Directus App is decoupled from, and powered by, the Directus API. It provides a way for both technical admins and non-technical users to view and manage content of the connected database. It is written in [Vue.js](https://vuejs.org) v3, is completely modular, and is highly customizable. +The Directus App is decoupled from, and powered by, the Directus API. It provides a way for both +technical admins and non-technical users to view and manage content of the connected database. It is +written in [Vue.js](https://vuejs.org) v3, is completely modular, and is highly customizable. ### Relevant Docs @@ -32,7 +41,10 @@ The Directus App is decoupled from, and powered by, the Directus API. It provide ## Projects & Environments -A Project is a complete instance of Directus. Each project primarily represents a database, but also includes a configuration file and any related asset storage. This modular approach means you can also create different environments (eg: Dev, Staging, Prod) by simply creating additional project instances. +A Project is a complete instance of Directus. Each project primarily represents a database, but also +includes a configuration file and any related asset storage. This modular approach means you can +also create different environments (eg: Dev, Staging, Prod) by simply creating additional project +instances. + ## Backing-up a Project @@ -45,6 +47,6 @@ All project configuration is handled by the `.env` file within the `/api` direct 4. **Delete the project's root directory** from the server 5. **Delete all Directus system tables** (`directus_*`) from the database -::: Pure SQL -After completing this process, you will be left with a pure SQL database, with no trace that Directus was ever installed. Any external services connecting to your database's project tables directly (eg: SQL queries) should continue working normally. -::: +::: Pure SQL After completing this process, you will be left with a pure SQL database, with no trace +that Directus was ever installed. Any external services connecting to your database's project tables +directly (eg: SQL queries) should continue working normally. ::: diff --git a/docs/guides/roles-and-permissions.md b/docs/guides/roles-and-permissions.md index 625e0fd603..ef298662bb 100644 --- a/docs/guides/roles-and-permissions.md +++ b/docs/guides/roles-and-permissions.md @@ -1,6 +1,7 @@ # Roles & Permissions -> During installation, Directus automatically includes an initial "Admin" role with complete project access. After that, you are free to extend and customize these as much as is needed. +> During installation, Directus automatically includes an initial "Admin" role with complete project +> access. After that, you are free to extend and customize these as much as is needed. ## Creating a Role @@ -12,21 +13,26 @@ ## Configuring a Role -* **Permissions** — Defines the role's access permissions, see [Configuring Role Permissions](#) and [Configuring System Permissions](#) -* **Role Name** — This is the name of the role -* **Role Icon** — The icon used throughout the App when referencing this role -* **Description** — A helpful note that explains the role's purpose -* **App Access** — Allows logging in to the App -* **Admin Access** — Gives full permission to project data and Settings -* **IP Access** — An allow-list of IP addresses from which the platform can be accessed, empty allows all -* **Require 2FA** — Forces all users within this role to use two-factor authentication -* **Users in Role** — A list of all users within this role -* **Module Navigation** — Overrides the visible modules, see [Customizing the Module Navigation](#) -* **Collection Navigation** — Overrides the collection module's navigation, see [Customizing the Collection Navigation](#) +- **Permissions** — Defines the role's access permissions, see [Configuring Role Permissions](#) + and [Configuring System Permissions](#) +- **Role Name** — This is the name of the role +- **Role Icon** — The icon used throughout the App when referencing this role +- **Description** — A helpful note that explains the role's purpose +- **App Access** — Allows logging in to the App +- **Admin Access** — Gives full permission to project data and Settings +- **IP Access** — An allow-list of IP addresses from which the platform can be accessed, empty + allows all +- **Require 2FA** — Forces all users within this role to use two-factor authentication +- **Users in Role** — A list of all users within this role +- **Module Navigation** — Overrides the visible modules, see + [Customizing the Module Navigation](#) +- **Collection Navigation** — Overrides the collection module's navigation, see + [Customizing the Collection Navigation](#) ### Customizing the Module Navigation -The options in the [Module Bar](#) can be overridden with custom options per role. When this setting is empty, the default modules are used. +The options in the [Module Bar](#) can be overridden with custom options per role. When this setting +is empty, the default modules are used. 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Module Navigation** field @@ -36,7 +42,8 @@ The options in the [Module Bar](#) can be overridden with custom options per rol 6. Enter a relative (App) or absolute (external) **link** for the module 7. Use the drag handles to **drag-and-drop** the modules into the desired order -If you are looking to replicate the default modules, paste the following configuration into the Module Navigation field using the [Raw Value](#) field label option. +If you are looking to replicate the default modules, paste the following configuration into the +Module Navigation field using the [Raw Value](#) field label option. ```json [ @@ -63,78 +70,93 @@ If you are looking to replicate the default modules, paste the following configu ] ``` -:::warning Settings Module -The settings module is not controlled by this configuration. It is always added to the end of the list for any user's with Admin Access. -::: +:::warning Settings Module The settings module is not controlled by this configuration. It is always +added to the end of the list for any user's with Admin Access. ::: -::: Customizing Existing Modules -You can enter the link to an existing module to customize its name or icon. For example, you can use `/collections` to override the Collections module. -::: +::: Customizing Existing Modules You can enter the link to an existing module to customize its name +or icon. For example, you can use `/collections` to override the Collections module. ::: ### Customizing the Collection Navigation -The collections in the [Navigation Bar](#) can be overridden with custom options per role. When this setting is empty, all collections that the user has permission to see are shown alphabetically in a single, unlabeled group. +The collections in the [Navigation Bar](#) can be overridden with custom options per role. When this +setting is empty, all collections that the user has permission to see are shown alphabetically in a +single, unlabeled group. 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Collection Navigation** field 3. Click the **Add New Group** button to add a Grouping 4. Enter a **Group Name**, or leave it empty to simply show a divider 5. Choose if the group's **Accordion** will be... - * Always Open (Default) - * Start Open - * Start Collapsed + - Always Open (Default) + - Start Open + - Start Collapsed 6. Click the **Add New Collection** button to add a Collection 7. Choose a **Collection** from the dropdown 8. Use the drag handles to **drag-and-drop** the groups/collections into the desired order ## Configuring Role Permissions -Directus possesses an extremely granular, yet easy to configure, permissions system. When creating a new role, permissions are disabled for all project collections by default — allowing you to give explicit access to only what is required. Individual permissions are applied to the role, and each is scoped to a specific collection and CRUD action (create, read, update, delete). +Directus possesses an extremely granular, yet easy to configure, permissions system. When creating a +new role, permissions are disabled for all project collections by default — allowing you to give +explicit access to only what is required. Individual permissions are applied to the role, and each +is scoped to a specific collection and CRUD action (create, read, update, delete). -:::warning Saves Automatically -Every change made to the permissions of a role is saved automatically and instantly. -::: +:::warning Saves Automatically Every change made to the permissions of a role is saved automatically +and instantly. ::: -:::warning Admin Roles -If a role is set to **Admin Access** then it is granted complete access to the platoform, and therefore the permission configuration field is disabled. -::: +:::warning Admin Roles If a role is set to **Admin Access** then it is granted complete access to +the platoform, and therefore the permission configuration field is disabled. ::: 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Permissions** section 3. **Click the icon** for the collection (row) and action (column) you want to set 4. Choose the desired permission level: **All Access**, **No Access**, or **Use Custom** -If you selected _All Access_ or _No Access_ then setup is complete. If you chose to customize the permissions, then a modal will open with additional configuration options. Continue with the appropriate guide below based on the _action_ of the permission. +If you selected _All Access_ or _No Access_ then setup is complete. If you chose to customize the +permissions, then a modal will open with additional configuration options. Continue with the +appropriate guide below based on the _action_ of the permission. #### Create (Custom) -5. **Field Permissions** control which fields accept a value on create. Fields are individually toggled. -6. **Field Validation** define the rules for field values on create, as defined by the [Filter Rules](#) entered. -7. **Field Presets** control the field defaults when creating an item, as defined by the [Item Object](#) entered. +5. **Field Permissions** control which fields accept a value on create. Fields are individually + toggled. +6. **Field Validation** define the rules for field values on create, as defined by the + [Filter Rules](#) entered. +7. **Field Presets** control the field defaults when creating an item, as defined by the + [Item Object](#) entered. #### Read (Custom) -5. **Item Permissions** control which items can be read, as defined by the [Filter Rules](#) entered. +5. **Item Permissions** control which items can be read, as defined by the [Filter Rules](#) + entered. 6. **Field Permissions** control which fields can be read. Fields are individually toggled. #### Update (Custom) -5. **Item Permissions** control which items can be updated, as defined by the [Filter Rules](#) entered. +5. **Item Permissions** control which items can be updated, as defined by the [Filter Rules](#) + entered. 6. **Field Permissions** control which fields can be updated. Fields are individually toggled. -7. **Field Validation** define the rules for field values on update, as defined by the [Filter Rules](#) entered. -8. **Field Presets** control the field defaults when updating an item, as defined by the [Item Object](#) entered. +7. **Field Validation** define the rules for field values on update, as defined by the + [Filter Rules](#) entered. +8. **Field Presets** control the field defaults when updating an item, as defined by the + [Item Object](#) entered. #### Delete (Custom) -5. **Item Permissions** control which items can be deleted, as defined by the [Filter Rules](#) entered. +5. **Item Permissions** control which items can be deleted, as defined by the [Filter Rules](#) + entered. ## Configuring System Permissions -In addition to setting permissions for your project's collections, you can also tailor the permissions for system collections. It is important to note that when [App Access](#) is enabled for a role, Directus will automatically add permission for the neccesary system collections. To edit system permissions, simply click the "System Collections" toggle, and then edit permissions using the same steps as with project collections. +In addition to setting permissions for your project's collections, you can also tailor the +permissions for system collections. It is important to note that when [App Access](#) is enabled for +a role, Directus will automatically add permission for the neccesary system collections. To edit +system permissions, simply click the "System Collections" toggle, and then edit permissions using +the same steps as with project collections. -::: Resetting System Permissions -To reset the role's system permissions for proper App access, expand the system collections and then click "Reset System Permissions" at the bottom of the listing. -::: +::: Resetting System Permissions To reset the role's system permissions for proper App access, +expand the system collections and then click "Reset System Permissions" at the bottom of the +listing. ::: ## Deleting a Role @@ -142,14 +164,12 @@ To reset the role's system permissions for proper App access, expand the system 2. Click the red **Delete Role** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::warning Users in a Deleted Role -If you delete a role that still has users in it, those users will be given a `NULL` role, which denies their App access and limits them to the [Public](#) permissions. They can then be reassigned to a new role by an admin. -::: +:::warning Users in a Deleted Role If you delete a role that still has users in it, those users will +be given a `NULL` role, which denies their App access and limits them to the [Public](#) +permissions. They can then be reassigned to a new role by an admin. ::: -:::warning Last Admin -You must maintain at least one role/user with Admin Access so that you can still properly manage the project. -::: +:::warning Last Admin You must maintain at least one role/user with Admin Access so that you can +still properly manage the project. ::: -:::warning Public Role -You can not delete the Public role, as it is part of the core platform. To disable it completely, simply turn off all Public access permissions. -::: +:::warning Public Role You can not delete the Public role, as it is part of the core platform. To +disable it completely, simply turn off all Public access permissions. ::: diff --git a/docs/guides/users.md b/docs/guides/users.md index f0d2f63d35..f60cc9fb3a 100644 --- a/docs/guides/users.md +++ b/docs/guides/users.md @@ -1,6 +1,8 @@ # Users -> You are prompted to enter the details of your first admin user during the installation process. After that, you are free to create as many users as you'd like. There is no limit to the number of users in a project. +> You are prompted to enter the details of your first admin user during the installation process. +> After that, you are free to create as many users as you'd like. There is no limit to the number of +> users in a project. ## Creating a User @@ -17,7 +19,8 @@ 4. Enter **one or more email addresses**, separated by commas, in the modal 5. Click **Invite** -At this point the invited user(s) will recieve an email with a link to the App where they set a password and enable their account. +At this point the invited user(s) will recieve an email with a link to the App where they set a +password and enable their account. ## Configuring a User @@ -25,37 +28,33 @@ At this point the invited user(s) will recieve an email with a link to the App w 2. Click on the user you wish to manage 3. Complete any of the [User Fields](/concepts/app-overview.md#user-detail) -::: User Preferences -This section of the User Detail is only visible/editable by the current user, and admins. -::: +::: User Preferences This section of the User Detail is only visible/editable by the current user, +and admins. ::: ### Status -* **Draft** — An incomplete user; no App/API access -* **Invited** — Has a pending invite to the project; no App/API access until accepted -* **Active** — The only status that has proper access to the App and API -* **Suspended** — A user that has been temporarily disabled; no App/API access -* **Archived** — A soft-deleted user; no App/API access +- **Draft** — An incomplete user; no App/API access +- **Invited** — Has a pending invite to the project; no App/API access until accepted +- **Active** — The only status that has proper access to the App and API +- **Suspended** — A user that has been temporarily disabled; no App/API access +- **Archived** — A soft-deleted user; no App/API access -:::warning Admin Only -Only admins can adjust this field's value. -::: +:::warning Admin Only Only admins can adjust this field's value. ::: ### Role -Setting the user's role determines their access, permissions, and App presentation. You can adjust a user's role from the User Detail page, or from the _Users in Role_ field within **Settings > Roles & Permissions > [Role Name]**. +Setting the user's role determines their access, permissions, and App presentation. You can adjust a +user's role from the User Detail page, or from the _Users in Role_ field within **Settings > Roles & +Permissions > [Role Name]**. -:::warning Admin Only -Only admins can adjust this field's value. -::: +:::warning Admin Only Only admins can adjust this field's value. ::: ### Token -A user's token is an alternate way to [authenticate into the API](#) using a static string. When NULL, the token is disabled. When enabled, ensure that a secure string is used. +A user's token is an alternate way to [authenticate into the API](#) using a static string. When +NULL, the token is disabled. When enabled, ensure that a secure string is used. -:::warning Admin Only -Only admins can adjust this field's value. -::: +:::warning Admin Only Only admins can adjust this field's value. ::: ## Archiving a User @@ -64,9 +63,8 @@ Only admins can adjust this field's value. 3. Click the orange **Archive User** action button in the header 4. Confirm this decision by clicking **Archive** in the dialog -:::warning Disables Access -Archiving uses _soft-delete_, therefore archived users are unable to access the App or API. -::: +:::warning Disables Access Archiving uses _soft-delete_, therefore archived users are unable to +access the App or API. ::: ## Deleting a User @@ -75,6 +73,5 @@ Archiving uses _soft-delete_, therefore archived users are unable to access the 3. Click the red **Delete User** action button in the header 4. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change -Unlike the soft-delete of archiving, this process is a hard-delete. Therefore, this action is permanent and can not be undone. Please proceed with caution. -::: +:::danger Irreversible Change Unlike the soft-delete of archiving, this process is a hard-delete. +Therefore, this action is permanent and can not be undone. Please proceed with caution. ::: diff --git a/docs/guides/webhooks.md b/docs/guides/webhooks.md index e9aa1ffc08..bd15d1b234 100644 --- a/docs/guides/webhooks.md +++ b/docs/guides/webhooks.md @@ -1,6 +1,8 @@ # Webhooks -> In addition to writing custom code for more complex [event hooks](#), Directus provides a way to quickly configure webhooks through the App. These send HTTP requests when a specific event is triggered within the project. +> In addition to writing custom code for more complex [event hooks](#), Directus provides a way to +> quickly configure webhooks through the App. These send HTTP requests when a specific event is +> triggered within the project. ## Creating Webhooks @@ -8,13 +10,14 @@ 2. Click the **Create Webhook** action button in the header 3. Complete the **other webhook form fields** outlined below -* **Name** — A name to help remember this webhooks purpose -* **Method** — Send as either a HTTP `GET` or `POST` request -* **URL** — The URL to send the request to -* **Status** — Whether the webhook is active (enabled) or inactive (disabled) -* **Data** — Whether the event's data should be sent along with the request -* **Trigger Actions** — The specific actions that will trigger the event -* **Trigger Collections** — The specific collections for which the above actions will trigger the event +- **Name** — A name to help remember this webhooks purpose +- **Method** — Send as either a HTTP `GET` or `POST` request +- **URL** — The URL to send the request to +- **Status** — Whether the webhook is active (enabled) or inactive (disabled) +- **Data** — Whether the event's data should be sent along with the request +- **Trigger Actions** — The specific actions that will trigger the event +- **Trigger Collections** — The specific collections for which the above actions will trigger the + event ## Disabling Webhooks @@ -27,6 +30,5 @@ 2. Click the red **Delete Webhook** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change -This action is permanent and can not be undone. Please proceed with caution. -::: +:::danger Irreversible Change This action is permanent and can not be undone. Please proceed with +caution. ::: diff --git a/docs/guides/white-labeling.md b/docs/guides/white-labeling.md index 3297222b28..fdae264e07 100644 --- a/docs/guides/white-labeling.md +++ b/docs/guides/white-labeling.md @@ -1,65 +1,85 @@ # White-Labeling a Project -> The Directus App UX/UI is meant to be _transparent_, and uses "form follows function" as the guiding design principle. This allows the platform to be completely tailored to your branding, end-to-end. +> The Directus App UX/UI is meant to be _transparent_, and uses "form follows function" as the +> guiding design principle. This allows the platform to be completely tailored to your branding, +> end-to-end. ## Project Settings 1. Navigate to **Settings > Project Settings** 2. Configure any of the following **branding fields** -* **Project Name** — The name used at the top of the [Navigation Bar](#) and on the login/public pages -* **Project URL** — The URL when clicking the logo at the top of the [Module Bar](#) -* **Project Color** — The color used behind the logo at the top of the [Module Bar](#), on the login/public pages, and for the browser's FavIcon -* **Project Logo** — A 40x40 pixel logo at the top of the [Module Bar](#) and on the login/public pages +- **Project Name** — The name used at the top of the [Navigation Bar](#) and on the login/public + pages +- **Project URL** — The URL when clicking the logo at the top of the [Module Bar](#) +- **Project Color** — The color used behind the logo at the top of the [Module Bar](#), on the + login/public pages, and for the browser's FavIcon +- **Project Logo** — A 40x40 pixel logo at the top of the [Module Bar](#) and on the login/public + pages -::: Recommended Logo Styling -The 40x40 pixel Project Logo is inset within the 64x64 pixel Project Color square. To avoid a "boxy" look, we recommend using a SVG or PNG logo with transparency. -::: +::: Recommended Logo Styling The 40x40 pixel Project Logo is inset within the 64x64 pixel Project +Color square. To avoid a "boxy" look, we recommend using a SVG or PNG logo with transparency. ::: -::: Browser FavIcon & Title -The project color and logo are also used to set the dynamic favicon, and the project title is used in the browser's title. This furthers the bespoke appearance of your platform and makes it easier to differentiate between different Directus projects. -::: +::: Browser FavIcon & Title The project color and logo are also used to set the dynamic favicon, and +the project title is used in the browser's title. This furthers the bespoke appearance of your +platform and makes it easier to differentiate between different Directus projects. ::: ### Public Page Styling -In addition to the above options, you can also apply the following additional styling to your prject's [public pages](#). +In addition to the above options, you can also apply the following additional styling to your +prject's [public pages](#). -* **Public Foreground** — An image shown on the right-side pane of public pages; max 400px width -* **Public Background** — An image displayed behind the above foreground image, shown full-bleed within the right-side pane of public pages -* **Public Note** — A helpful note displayed at the bottom of the right-side pane of public pages; supports markdown for rich-text formatting +- **Public Foreground** — An image shown on the right-side pane of public pages; max 400px width +- **Public Background** — An image displayed behind the above foreground image, shown full-bleed + within the right-side pane of public pages +- **Public Note** — A helpful note displayed at the bottom of the right-side pane of public pages; + supports markdown for rich-text formatting -::: Default Background Color -When a Public Background image is not set, the right-side pane of public pages uses the Project Color instead. -::: +::: Default Background Color When a Public Background image is not set, the right-side pane of +public pages uses the Project Color instead. ::: ## Themes & Custom CSS -The Directus App has been developed with customization and extensibility in mind. Colors and styles referenced within the codebase all use CSS variables, and therefore it is easy to make comprehensive changes to the App styling. +The Directus App has been developed with customization and extensibility in mind. Colors and styles +referenced within the codebase all use CSS variables, and therefore it is easy to make comprehensive +changes to the App styling. -* **Themes** — See the [Light Theme](https://github.com/directus/directus/blob/main/app/src/styles/themes/_light.scss) or [Dark Theme](https://github.com/directus/directus/blob/main/app/src/styles/themes/_dark.scss) -* **Typography** — See the [Fonts](https://github.com/directus/directus/blob/main/app/src/styles/_type-styles.scss) and [Type Styles](https://github.com/directus/directus/blob/main/app/src/styles/mixins/type-styles.scss) -* **Variables** — See the [Global Variables](https://github.com/directus/directus/blob/main/app/src/styles/_variables.scss) +- **Themes** — See the + [Light Theme](https://github.com/directus/directus/blob/main/app/src/styles/themes/_light.scss) + or [Dark Theme](https://github.com/directus/directus/blob/main/app/src/styles/themes/_dark.scss) +- **Typography** — See the + [Fonts](https://github.com/directus/directus/blob/main/app/src/styles/_type-styles.scss) and + [Type Styles](https://github.com/directus/directus/blob/main/app/src/styles/mixins/type-styles.scss) +- **Variables** — See the + [Global Variables](https://github.com/directus/directus/blob/main/app/src/styles/_variables.scss) -You can override any core CSS, including the above variables, directly within the App through project Settings. +You can override any core CSS, including the above variables, directly within the App through +project Settings. 1. Navigate to **Settings > Project Settings** 2. Scroll to the **CSS Overrides** field 3. Enter any **valid CSS** 4. Click the **Save** action button in the header -::: Action Styling -The `--primary` variable (and its shades) control call-to-actions and all other "Directus blue" elements within the App. While it may be tempting to override this variable with your brand's color, please first review the following warnings: +::: Action Styling The `--primary` variable (and its shades) control call-to-actions and all other +"Directus blue" elements within the App. While it may be tempting to override this variable with +your brand's color, please first review the following warnings: -* Avoid using yellow, orange, or red hues that give a sense of "danger" -* Avoid low-contrast colors like yellows, grays, etc, that might not be easily visible -* Avoid low-saturation colors like black, which might not properly highlight CTAs +- Avoid using yellow, orange, or red hues that give a sense of "danger" +- Avoid low-contrast colors like yellows, grays, etc, that might not be easily visible +- Avoid low-saturation colors like black, which might not properly highlight CTAs ::: ## API Reference -In addition to the static core docs, Directus also includes a [Dynamic API Reference](#) based on your project's schema. This includes tailored endpoint info for each collection within your data model, customizing the documentation to your specific project. +In addition to the static core docs, Directus also includes a [Dynamic API Reference](#) based on +your project's schema. This includes tailored endpoint info for each collection within your data +model, customizing the documentation to your specific project. ## System Table Prefix -Most white-labeling takes place in the presentation layer of the platform's App, but in some cases even the API and/or database needs to be a bit more agnostic. For that reason, Directus allows changing the prefix used by system tables. By default this is set to use `directus_*` to avoid any potential conflicts, but you can override this within the [Environment Variables](#). +Most white-labeling takes place in the presentation layer of the platform's App, but in some cases +even the API and/or database needs to be a bit more agnostic. For that reason, Directus allows +changing the prefix used by system tables. By default this is set to use `directus_*` to avoid any +potential conflicts, but you can override this within the [Environment Variables](#). diff --git a/docs/readme.md b/docs/readme.md index a0310ed221..b43e4632e0 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -6,43 +6,43 @@ Welcome to the Directus documentation. Novice Oriented. For a platform intro and installation. -* [Introduction](#) -* [Support](#) -* [Contributing](#) -* [Backing Directus](#) +- [Introduction](#) +- [Support](#) +- [Contributing](#) +- [Backing Directus](#) ## Concepts Learning Oriented. For understanding the platfom. -* [Platform Overview](#) -* [App Overview](#) -* [App Extensions](#) -* [Activity & Versions](#) -* [Files & Thumbnails](#) -* [Internationalization](#) -* [Relationships](#) -* [Users, Roles & Permissions](#) +- [Platform Overview](#) +- [App Overview](#) +- [App Extensions](#) +- [Activity & Versions](#) +- [Files & Thumbnails](#) +- [Internationalization](#) +- [Relationships](#) +- [Users, Roles & Permissions](#) ## Guides Problem Oriented. Follow along with steps while working. -* [Collections](#) -* [Fields](#) -* [Presets](#) -* [Projects](#) -* [Roles & Permissions](#) -* [Users](#) -* [Webhooks](#) -* [White-Labeling](#) +- [Collections](#) +- [Fields](#) +- [Presets](#) +- [Projects](#) +- [Roles & Permissions](#) +- [Users](#) +- [Webhooks](#) +- [White-Labeling](#) ## Reference Information Oriented. Look up info and specs while working. -* [Command Line Interface](#) -* [Environment Variables](#) -* [Error Codes](#) -* [Filter Rules](#) -* [Item Objects](#) +- [Command Line Interface](#) +- [Environment Variables](#) +- [Error Codes](#) +- [Filter Rules](#) +- [Item Objects](#) diff --git a/docs/reference/api/activity.md b/docs/reference/api/activity.md index a226a749c6..c2babc5ec7 100644 --- a/docs/reference/api/activity.md +++ b/docs/reference/api/activity.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Activity', - 'description': 'All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.', + 'description': + 'All events that happen within Directus are tracked and stored in the activities + collection. This gives you full accountability over everything that happens.', 'x-collection': 'directus_activity', }, } @@ -12,4 +14,5 @@ # Activity -All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens. +All events that happen within Directus are tracked and stored in the activities collection. This +gives you full accountability over everything that happens. diff --git a/docs/reference/api/assets.md b/docs/reference/api/assets.md index b4034697b0..9a08c94ee4 100644 --- a/docs/reference/api/assets.md +++ b/docs/reference/api/assets.md @@ -4,7 +4,8 @@ 'tag': { 'name': 'Assets', - 'description': 'Image typed files can be dynamically resized and transformed to fit any need.', + 'description': + 'Image typed files can be dynamically resized and transformed to fit any need.', }, } --- diff --git a/docs/reference/api/authentication.md b/docs/reference/api/authentication.md index 2ed0a73cba..1fe861eabe 100644 --- a/docs/reference/api/authentication.md +++ b/docs/reference/api/authentication.md @@ -4,11 +4,14 @@ 'tag': { 'name': 'Authentication', - 'description': 'All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.', + 'description': + 'All events that happen within Directus are tracked and stored in the activities + collection. This gives you full accountability over everything that happens.', }, } --- # Authentication -All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens. +All events that happen within Directus are tracked and stored in the activities collection. This +gives you full accountability over everything that happens. diff --git a/docs/reference/api/collections.md b/docs/reference/api/collections.md index 76b72f88a7..1f50c9afca 100644 --- a/docs/reference/api/collections.md +++ b/docs/reference/api/collections.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Collections', - 'description': 'Collections are the individual collections of items, similar to tables in a database. Changes to collections will alter the schema of the database.', + 'description': + 'Collections are the individual collections of items, similar to tables in a + database. Changes to collections will alter the schema of the database.', 'x-collection': 'directus_collections', }, } @@ -12,4 +14,5 @@ # Collections -Collections are the individual collections of items, similar to tables in a database. Changes to collections will alter the schema of the database. +Collections are the individual collections of items, similar to tables in a database. Changes to +collections will alter the schema of the database. diff --git a/docs/reference/api/extensions.md b/docs/reference/api/extensions.md index 73cf959063..aed686070d 100644 --- a/docs/reference/api/extensions.md +++ b/docs/reference/api/extensions.md @@ -4,11 +4,14 @@ 'tag': { 'name': 'Extensions', - 'description': 'Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules.', + 'description': + 'Directus can easily be extended through the addition of several types of + extensions, including layouts, interfaces, and modules.', }, } --- # Extensions -Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules. +Directus can easily be extended through the addition of several types of extensions, including +layouts, interfaces, and modules. diff --git a/docs/reference/api/fields.md b/docs/reference/api/fields.md index 403a867ab3..30b1b290cb 100644 --- a/docs/reference/api/fields.md +++ b/docs/reference/api/fields.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Fields', - 'description': 'Fields are individual pieces of content within an item. They are mapped to columns in the database.', + 'description': + 'Fields are individual pieces of content within an item. They are mapped to columns + in the database.', 'x-collection': 'directus_fields', }, } diff --git a/docs/reference/api/files.md b/docs/reference/api/files.md index 6ddbbacc43..9ca482124d 100644 --- a/docs/reference/api/files.md +++ b/docs/reference/api/files.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Files', - 'description': 'Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly.', + 'description': + 'Files can be saved in any given location. Directus has a powerful assets endpoint + that can be used to generate thumbnails for images on the fly.', 'x-collection': 'directus_files', }, } @@ -12,4 +14,5 @@ # Files -Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly. +Files can be saved in any given location. Directus has a powerful assets endpoint that can be used +to generate thumbnails for images on the fly. diff --git a/docs/reference/api/introduction.md b/docs/reference/api/introduction.md index 05a445fcdf..c2b0c84219 100644 --- a/docs/reference/api/introduction.md +++ b/docs/reference/api/introduction.md @@ -1,5 +1,8 @@ # API Reference -Directus offers both a RESTful and GraphQL API to manage the data in the database. The API has predictable resource-oriented URLs, relies on standard HTTP status codes, and uses JSON for input and output. +Directus offers both a RESTful and GraphQL API to manage the data in the database. The API has +predictable resource-oriented URLs, relies on standard HTTP status codes, and uses JSON for input +and output. -The input/output of the API differs greatly for individual installs, as most of the endpoints will return data that's based on your specific schema. +The input/output of the API differs greatly for individual installs, as most of the endpoints will +return data that's based on your specific schema. diff --git a/docs/reference/api/items.md b/docs/reference/api/items.md index e9d0731382..f1e25c203c 100644 --- a/docs/reference/api/items.md +++ b/docs/reference/api/items.md @@ -4,11 +4,14 @@ 'tag': { 'name': 'Items', - 'description': 'Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks.', + 'description': + 'Items are individual pieces of data in your database. They can be anything, from + articles, to IoT status checks.', }, } --- # Items -Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks. +Items are individual pieces of data in your database. They can be anything, from articles, to IoT +status checks. diff --git a/docs/reference/api/presets.md b/docs/reference/api/presets.md index 5b98b1ad11..a19ea123b3 100644 --- a/docs/reference/api/presets.md +++ b/docs/reference/api/presets.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Presets', - 'description': 'Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app.', + 'description': + 'Presets hold the preferences of individual users of the platform. This allows + Directus to show and maintain custom item listings for users of the app.', 'x-collection': 'directus_presets', }, } @@ -12,4 +14,5 @@ # Presets -Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings for users of the app. +Presets hold the preferences of individual users of the platform. This allows Directus to show and +maintain custom item listings for users of the app. diff --git a/docs/reference/api/relations.md b/docs/reference/api/relations.md index bdc284b2d1..ae649fbb89 100644 --- a/docs/reference/api/relations.md +++ b/docs/reference/api/relations.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Relations', - 'description': 'What data is linked to what other data. Allows you to assign authors to articles, products to sales, and whatever other structures you can think of.', + 'description': + 'What data is linked to what other data. Allows you to assign authors to articles, + products to sales, and whatever other structures you can think of.', 'x-collection': 'directus_relations', }, } @@ -12,4 +14,5 @@ # Relations -What data is linked to what other data. Allows you to assign authors to articles, products to sales, and whatever other structures you can think of. +What data is linked to what other data. Allows you to assign authors to articles, products to sales, +and whatever other structures you can think of. diff --git a/docs/reference/api/revisions.md b/docs/reference/api/revisions.md index 97380a8ffc..fbb3a79a7c 100644 --- a/docs/reference/api/revisions.md +++ b/docs/reference/api/revisions.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Revisions', - 'description': "Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will.", + 'description': + "Revisions are individual changes to items made. Directus keeps track of changes + made, so you're able to revert to a previous state at will.", 'x-collection': 'directus_revisions', }, } @@ -12,4 +14,5 @@ # Revisions -Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will. +Revisions are individual changes to items made. Directus keeps track of changes made, so you're able +to revert to a previous state at will. diff --git a/docs/reference/api/server.md b/docs/reference/api/server.md index 6427410be3..2f37347bc7 100644 --- a/docs/reference/api/server.md +++ b/docs/reference/api/server.md @@ -4,11 +4,14 @@ 'tag': { 'name': 'Server', - 'description': "Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with.", + 'description': + "Access to where Directus runs. Allows you to make sure your server has everything + needed to run the platform, and check what kind of latency we're dealing with.", }, } --- # Server -Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with. +Access to where Directus runs. Allows you to make sure your server has everything needed to run the +platform, and check what kind of latency we're dealing with. diff --git a/docs/reference/api/utilities.md b/docs/reference/api/utilities.md index 05f041f8c2..efe7cab9c3 100644 --- a/docs/reference/api/utilities.md +++ b/docs/reference/api/utilities.md @@ -4,7 +4,9 @@ 'tag': { 'name': 'Utilities', - 'description': 'Directus comes with various utility endpoints you can use to simplify your development flow.', + 'description': + 'Directus comes with various utility endpoints you can use to simplify your + development flow.', }, } --- diff --git a/docs/reference/environment-variables.md b/docs/reference/environment-variables.md index 16a21eca0b..8c72ac713c 100644 --- a/docs/reference/environment-variables.md +++ b/docs/reference/environment-variables.md @@ -1,7 +1,8 @@ # Environment Variables -> Each Directus project supports a number of environment variables for configuration. These variables are added to the `/api/.env` file, with an example file at `/api/example.env` for easier boilerplate setup. - +> Each Directus project supports a number of environment variables for configuration. These +> variables are added to the `/api/.env` file, with an example file at `/api/example.env` for easier +> boilerplate setup. ## General @@ -15,18 +16,20 @@ URL where your API can be reached on the web.
**Default: `/`** ### `LOG_LEVEL` -What level of detail to log. One of `fatal`, `error`, `warn`, `info`, `debug`, `trace` or `silent`.
**Default: `info`** +What level of detail to log. One of `fatal`, `error`, `warn`, `info`, `debug`, `trace` or +`silent`.
**Default: `info`** ### `LOG_STYLE` Render the logs human readable (pretty) or as JSON. One of `pretty`, `raw`.
**Default: `pretty`** - ## Database ### `DB_CLIENT` -What database client to use. One of `pg` or `postgres`, `mysql`, `mysql2`, `oracledb`, `mssql`, or `sqlite3`. For all database clients except SQLite, you will also need to configure the following variables: +What database client to use. One of `pg` or `postgres`, `mysql`, `mysql2`, `oracledb`, `mssql`, or +`sqlite3`. For all database clients except SQLite, you will also need to configure the following +variables: ### `DB_HOST` @@ -52,12 +55,11 @@ Database user's password. Required when using `pg`, `mysql`, `mysql2`, `oracledb Where to read/write the SQLite database. Required when using `sqlite3`. -::: Additional Database Variables -All `DB_*` environment variables are passed to the `connection` configuration of a [`Knex` instance](http://knexjs.org). -Based on your project's needs, you can extend the `DB_*` environment variables with any config you need to pass to the database instance. +::: Additional Database Variables All `DB_*` environment variables are passed to the `connection` +configuration of a [`Knex` instance](http://knexjs.org). Based on your project's needs, you can +extend the `DB_*` environment variables with any config you need to pass to the database instance. ::: - ## Security ### `KEY` @@ -74,7 +76,8 @@ The duration that the access token is valid.
**Default: `15m`** ### `REFRESH_TOKEN_TTL` -The duration that the refresh token is valid, and also how long users stay logged-in to the App.
**Default: `7d`** +The duration that the refresh token is valid, and also how long users stay logged-in to the +App.
**Default: `7d`** ### `REFRESH_TOKEN_COOKIE_SECURE` @@ -84,7 +87,6 @@ Whether or not to use a secure cookie for the refresh token in cookie mode.
* Value for `sameSite` in the refresh token cookie when in cookie mode.
**Default: `lax`** - ## CORS ### `CORS_ENABLED` @@ -111,7 +113,6 @@ Whether or not to send the `Access-Control-Allow-Credentials` header.
**Defau Value for the `Access-Control-Max-Age` header.
**Default: `18000`** - ## Rate Limiting ### `RATE_LIMITER_ENABLED` @@ -128,27 +129,28 @@ The time window in seconds in which the points are counted.
**Default: `1`** ### `RATE_LIMITER_STORE` -Where to store the rate limiter counts. Either `memory`, `redis`, or `memcache`. Based on the rate limiter used, you must also provide the following configurations.
**Default: `memory`** +Where to store the rate limiter counts. Either `memory`, `redis`, or `memcache`. Based on the rate +limiter used, you must also provide the following configurations.
**Default: `memory`** -* **Memory** - * No additional configuration required -* **Redis** - * **`RATE_LIMITER_REDIS`** — Redis connection string - * eg: `redis://:authpassword@127.0.0.1:6380/4` - * Alternatively, you can enter individual connection parameters: - * **`RATE_LIMITER_REDIS_HOST`** - * **`RATE_LIMITER_REDIS_PORT`** - * **`RATE_LIMITER_REDIS_PASSWORD`** - * **`RATE_LIMITER_REDIS_DB`** -* **Memcache** - * **`RATE_LIMITER_MEMCACHE`** — Location of your memcache instance +- **Memory** + - No additional configuration required +- **Redis** + - **`RATE_LIMITER_REDIS`** — Redis connection string + - eg: `redis://:authpassword@127.0.0.1:6380/4` + - Alternatively, you can enter individual connection parameters: + - **`RATE_LIMITER_REDIS_HOST`** + - **`RATE_LIMITER_REDIS_PORT`** + - **`RATE_LIMITER_REDIS_PASSWORD`** + - **`RATE_LIMITER_REDIS_DB`** +- **Memcache** + - **`RATE_LIMITER_MEMCACHE`** — Location of your memcache instance -::: Additional Rate Limiter Variables -All `RATE_LIMITER_*` variables are passed directly to a `rate-limiter-flexible` instance. Depending on your -project's needs, you can extend the above environment variables to configure any of [the `rate-limiter-flexible` options](https://github.com/animir/node-rate-limiter-flexible/wiki/Options). +::: Additional Rate Limiter Variables All `RATE_LIMITER_*` variables are passed directly to a +`rate-limiter-flexible` instance. Depending on your project's needs, you can extend the above +environment variables to configure any of +[the `rate-limiter-flexible` options](https://github.com/animir/node-rate-limiter-flexible/wiki/Options). ::: - ## Cache ### `CACHE_ENABLED` @@ -159,9 +161,8 @@ Whether or not caching is enabled.
**Default: `false`** How long the cache is persisted.
**Default: `30m`** -:::warning Forced Flush -Regardless of TTL, the cache is always flushed for every create, update, and delete action. -::: +:::warning Forced Flush Regardless of TTL, the cache is always flushed for every create, update, and +delete action. ::: ### `CACHE_NAMESPACE` @@ -169,57 +170,58 @@ How to scope the cache data.
**Default: `directus-cache`** ### `CACHE_STORE` -Where to store the cache data. Either `memory`, `redis`, or `memcache`. Based on the cache used, you must also provide the following configurations.
**Default: `memory`** - -* **Memory** - * No additional configuration required -* **Redis** - * **`CACHE_REDIS`** — Redis connection string - * eg: `redis://:authpassword@127.0.0.1:6380/4` - * Alternatively, you can enter individual connection parameters: - * **`CACHE_REDIS_HOST`** - * **`CACHE_REDIS_PORT`** - * **`CACHE_REDIS_PASSWORD`** - * **`CACHE_REDIS_DB`** -* **Memcache** - * **`CACHE_MEMCACHE`** — Location of your memcache instance +Where to store the cache data. Either `memory`, `redis`, or `memcache`. Based on the cache used, you +must also provide the following configurations.
**Default: `memory`** +- **Memory** + - No additional configuration required +- **Redis** + - **`CACHE_REDIS`** — Redis connection string + - eg: `redis://:authpassword@127.0.0.1:6380/4` + - Alternatively, you can enter individual connection parameters: + - **`CACHE_REDIS_HOST`** + - **`CACHE_REDIS_PORT`** + - **`CACHE_REDIS_PASSWORD`** + - **`CACHE_REDIS_DB`** +- **Memcache** + - **`CACHE_MEMCACHE`** — Location of your memcache instance ## File Storage ### `STORAGE_LOCATIONS` -A CSV of storage locations (eg: `local,digitalocean,amazon`) to use. You can use any names you'd like for these keys, but each must have a matching `` configuration.
**Default: `local`** +A CSV of storage locations (eg: `local,digitalocean,amazon`) to use. You can use any names you'd +like for these keys, but each must have a matching `` configuration.
**Default: +`local`** For each of the storage locations listed, you must provide the following configuration: -* **`STORAGE__PUBLIC_URL`** — Location on the internet where the files are accessible -* **`STORAGE__DRIVER`** — Which driver to use, either `local`, `s3`, or `gcl` +- **`STORAGE__PUBLIC_URL`** — Location on the internet where the files are accessible +- **`STORAGE__DRIVER`** — Which driver to use, either `local`, `s3`, or `gcl` Based on your configured driver, you must also provide the following configurations. -* **Local** - * `STORAGE__ROOT` — Where to store the files on disk -* **S3** - * **`STORAGE__KEY`** — User key - * **`STORAGE__SECRET`** — User secret - * **`STORAGE__ENDPOINT`** — S3 Endpoint - * **`STORAGE__BUCKET`** — S3 Bucket - * **`STORAGE__REGION`** — S3 Region -* **Google Cloud** - * **`STORAGE__KEY_FILENAME`** — Path to key file on disk - * **`STORAGE__BUCKET`** — Google Cloud Storage bucket - +- **Local** + - `STORAGE__ROOT` — Where to store the files on disk +- **S3** + - **`STORAGE__KEY`** — User key + - **`STORAGE__SECRET`** — User secret + - **`STORAGE__ENDPOINT`** — S3 Endpoint + - **`STORAGE__BUCKET`** — S3 Bucket + - **`STORAGE__REGION`** — S3 Region +- **Google Cloud** + - **`STORAGE__KEY_FILENAME`** — Path to key file on disk + - **`STORAGE__BUCKET`** — Google Cloud Storage bucket ## oAuth ### `OAUTH_PROVIDERS` -CSV of oAuth providers you want to use. For each of the oAuth providers you list, you must also provide the following configurations. - -* **`OAUTH__KEY`** — oAuth key for the external service -* **`OAUTH__SECRET`** — oAuth secret for the external service. +CSV of oAuth providers you want to use. For each of the oAuth providers you list, you must also +provide the following configurations. +- **`OAUTH__KEY`** — oAuth key for the external service +- **`OAUTH__SECRET`** — oAuth secret for the external service. ## Extensions @@ -227,7 +229,6 @@ CSV of oAuth providers you want to use. For each of the oAuth providers you list Path to your local extensions folder.
**Default: `./extensions`** - ## Email ### `EMAIL_FROM` @@ -236,15 +237,17 @@ Email address from which emails are sent.
**Default: `no-reply@directus.io`** ### `EMAIL_TRANSPORT` -What to use to send emails. One of `sendmail`, `smtp`. Based on the transport used, you must also provide the following configurations.
**Default: `sendmail`** +What to use to send emails. One of `sendmail`, `smtp`. Based on the transport used, you must also +provide the following configurations.
**Default: `sendmail`** -* **Sendmail** (`sendmail`) - * **`EMAIL_SENDMAIL_NEW_LINE`** — What new line style to use in sendmail. **Default: `unix`** - * **`EMAIL_SENDMAIL_PATH`** — Path to your sendmail executable. **Default: `/usr/sbin/sendmail`** -* **SMTP** (`smtp`) - * **`EMAIL_SMTP_HOST`** — SMTP Host - * **`EMAIL_SMTP_PORT`** — SMTP Port - * **`EMAIL_SMTP_USER`** — SMTP User - * **`EMAIL_SMTP_PASSWORD`** — SMTP Password - * **`EMAIL_SMTP_POOL`** — Use SMTP pooling - * **`EMAIL_SMTP_SECURE`** — Enable TLS +- **Sendmail** (`sendmail`) + - **`EMAIL_SENDMAIL_NEW_LINE`** — What new line style to use in sendmail. **Default: `unix`** + - **`EMAIL_SENDMAIL_PATH`** — Path to your sendmail executable. **Default: + `/usr/sbin/sendmail`** +- **SMTP** (`smtp`) + - **`EMAIL_SMTP_HOST`** — SMTP Host + - **`EMAIL_SMTP_PORT`** — SMTP Port + - **`EMAIL_SMTP_USER`** — SMTP User + - **`EMAIL_SMTP_PASSWORD`** — SMTP Password + - **`EMAIL_SMTP_POOL`** — Use SMTP pooling + - **`EMAIL_SMTP_SECURE`** — Enable TLS diff --git a/docs/reference/error-codes.md b/docs/reference/error-codes.md index 6f6d1ea233..2b22ef7812 100644 --- a/docs/reference/error-codes.md +++ b/docs/reference/error-codes.md @@ -1,7 +1,7 @@ # Error Codes | Error Code | Description | -|-----------------------|------------------------------------------------| +| --------------------- | ---------------------------------------------- | | `FAILED_VALIDATION` | Validation for this particular item failed | | `FORBIDDEN` | You are not allowed to do the current action | | `INVALID_CREDENTIALS` | Username / password or access token is wrong | @@ -12,6 +12,5 @@ | `ROUTE_NOT_FOUND` | Endpoint does not exist | | `SERVICE_UNAVAILABLE` | Could not use external service | -:::warning Security -To prevent leaking which items exist, all actions for non-existing items will return a `FORBIDDEN` error. -::: +:::warning Security To prevent leaking which items exist, all actions for non-existing items will +return a `FORBIDDEN` error. ::: diff --git a/docs/reference/filter-rules.md b/docs/reference/filter-rules.md index 151f135eb2..23a1827793 100644 --- a/docs/reference/filter-rules.md +++ b/docs/reference/filter-rules.md @@ -1,12 +1,14 @@ # Filter Rules -> Permissions, validation, and the API's `filter` parameter all rely on a specific JSON structure to define their rules. This page describes the syntax for creating flat, relational, or complex filter rules. +> Permissions, validation, and the API's `filter` parameter all rely on a specific JSON structure to +> define their rules. This page describes the syntax for creating flat, relational, or complex +> filter rules. ## Syntax -* **Field** — Any valid root field, [relational field](#), or [logical operator](#) -* **Operator** — Any valid [API operator](#) prefaced with an underscore -* **Value** — Any valid static value, or [dynamic variable](#) +- **Field** — Any valid root field, [relational field](#), or [logical operator](#) +- **Operator** — Any valid [API operator](#) prefaced with an underscore +- **Value** — Any valid static value, or [dynamic variable](#) ``` { @@ -44,33 +46,34 @@ ## Supported Operators -| Operator | Description | -| -------------------- | -------------------------------------- | -| `eq` | Equal to | -| `neq` | Not equal to | -| `lt` | Less than | -| `lte` | Less than or equal to | -| `gt` | Greater than | -| `gte` | Greater than or equal to | -| `in` | Exists in one of the values | -| `nin` | Not in one of the values | -| `null` | It is null | -| `nnull` | It is not null | -| `contains`, `like` | Contains the substring | -| `ncontains`, `nlike` | Doesn't contain the substring | -| `rlike` | Contains a substring using a wildcard | +| Operator | Description | +| -------------------- | ----------------------------------------- | +| `eq` | Equal to | +| `neq` | Not equal to | +| `lt` | Less than | +| `lte` | Less than or equal to | +| `gt` | Greater than | +| `gte` | Greater than or equal to | +| `in` | Exists in one of the values | +| `nin` | Not in one of the values | +| `null` | It is null | +| `nnull` | It is not null | +| `contains`, `like` | Contains the substring | +| `ncontains`, `nlike` | Doesn't contain the substring | +| `rlike` | Contains a substring using a wildcard | | `nrlike` | Not contains a substring using a wildcard | -| `between` | The value is between two values | -| `nbetween` | The value is not between two values | -| `empty` | The value is empty (null or falsy) | -| `nempty` | The value is not empty (null or falsy) | -| `all` | Contains all given related item's IDs | -| `has` | Has one or more related items's IDs | +| `between` | The value is between two values | +| `nbetween` | The value is not between two values | +| `empty` | The value is empty (null or falsy) | +| `nempty` | The value is not empty (null or falsy) | +| `all` | Contains all given related item's IDs | +| `has` | Has one or more related items's IDs | ## Relational -You can target related values by nesting field names. For example, if you have a relational [Many-to-One](#) -`author` field, you can set a rule for the `author.name` field using the following syntax. +You can target related values by nesting field names. For example, if you have a relational +[Many-to-One](#) `author` field, you can set a rule for the `author.name` field using the following +syntax. ```json { @@ -84,52 +87,49 @@ You can target related values by nesting field names. For example, if you have a ## Logical Operators -You can nest or group multiple rules using the `_and` or `_or` logical operators. Each operator holds an array of rules, allowing for more complex filtering. +You can nest or group multiple rules using the `_and` or `_or` logical operators. Each operator +holds an array of rules, allowing for more complex filtering. ```json { - "_or": [ - { - "_and": [ - { - "owner": { - "_eq": "$CURRENT_USER" - } - }, - { - "status": { - "_in": [ - "published", - "draft" - ] - } - } - ] - }, - { - "_and": [ - { - "owner": { - "_neq": "$CURRENT_USER" - } - }, - { - "status": { - "_in": [ - "published" - ] - } - } - ] - } - ] + "_or": [ + { + "_and": [ + { + "owner": { + "_eq": "$CURRENT_USER" + } + }, + { + "status": { + "_in": ["published", "draft"] + } + } + ] + }, + { + "_and": [ + { + "owner": { + "_neq": "$CURRENT_USER" + } + }, + { + "status": { + "_in": ["published"] + } + } + ] + } + ] } ``` ## Dynamic Variables -In addition to static values, you can also filter against _dynamic_ values using the following variables. +In addition to static values, you can also filter against _dynamic_ values using the following +variables. -* `$CURRENT_USER` — The primary key of the currently authenticated user -* `$CURRENT_ROLE` — The primary key of the role for the currently authenticated user -* `$NOW` — The current timestamp +- `$CURRENT_USER` — The primary key of the currently authenticated user +- `$CURRENT_ROLE` — The primary key of the role for the currently authenticated user +- `$NOW` — The current timestamp diff --git a/docs/reference/item-objects.md b/docs/reference/item-objects.md index 02e8c0c473..35aff08cb6 100644 --- a/docs/reference/item-objects.md +++ b/docs/reference/item-objects.md @@ -4,8 +4,8 @@ ## Syntax -* **Field** — Any valid root field or [relational field](#) -* **Value** — Any valid static value, or [dynamic variable](#) +- **Field** — Any valid root field or [relational field](#) +- **Value** — Any valid static value, or [dynamic variable](#) ``` { @@ -23,8 +23,9 @@ ## Relational -You can set related values by nesting field names. For example, if you have a relational [Many-to-One](#) -`author` field, you can set a rule for the `author.name` field using the following syntax. +You can set related values by nesting field names. For example, if you have a relational +[Many-to-One](#) `author` field, you can set a rule for the `author.name` field using the following +syntax. ```json { @@ -38,6 +39,6 @@ You can set related values by nesting field names. For example, if you have a re In addition to static values, you can also set _dynamic_ values using the following variables. -* `$CURRENT_USER` — The primary key of the currently authenticated user -* `$CURRENT_ROLE` — The primary key of the role for the currently authenticated user -* `$NOW` — The current timestamp +- `$CURRENT_USER` — The primary key of the currently authenticated user +- `$CURRENT_ROLE` — The primary key of the role for the currently authenticated user +- `$NOW` — The current timestamp diff --git a/docs/reference/sdk-js.md b/docs/reference/sdk-js.md index e3660bce20..cf2ca4c983 100644 --- a/docs/reference/sdk-js.md +++ b/docs/reference/sdk-js.md @@ -1,6 +1,7 @@ # SDK JS -The JS SDK is a small wrapper around [Axios](https://npmjs.com/axios) that makes it a little easier to use the Directus API from a JavaScript powered project. +The JS SDK is a small wrapper around [Axios](https://npmjs.com/axios) that makes it a little easier +to use the Directus API from a JavaScript powered project. ## Installation @@ -56,7 +57,7 @@ const directus = new DirectusSDK('https://api.example.com/', { storage: new MemoryStore(), // Storage adapter where refresh tokens are stored in JSON mode mode: 'json', // What login mode to use. One of `json`, `cookie` autoRefresh: true, // Whether or not to automatically refresh the access token on login - } + }, }); ``` @@ -85,18 +86,19 @@ You can tap into the Axios instance used directly through `directus.axios`. ```js directus.items('articles').create({ - title: 'My New Article' + title: 'My New Article', }); ``` ##### Multiple Items + ```js directus.items('articles').create([ { - title: 'My First Article' + title: 'My First Article', }, { - title: 'My Second Article' + title: 'My Second Article', }, ]); ``` @@ -116,9 +118,9 @@ directus.items('articles').read({ search: 'Directus', filter: { date_published: { - _gte: '$NOW' - } - } + _gte: '$NOW', + }, + }, }); ``` @@ -149,29 +151,21 @@ directus.items('articles').read([15, 42], { fields: ['title'] }); ```js // One directus.items('articles').update(15, { - title: 'An Updated title' + title: 'An Updated title', }); // Multiple directus.items('articles').update([15, 42], { - title: 'An Updated title' + title: 'An Updated title', }); ``` Supports optional query: ```js -directus.items('articles').update( - 15, - { title: 'An Updated title' }, - { fields: ['title'] } -); +directus.items('articles').update(15, { title: 'An Updated title' }, { fields: ['title'] }); -directus.items('articles').update( - [15, 42], - { title: 'An Updated title' }, - { fields: ['title'] } -); +directus.items('articles').update([15, 42], { title: 'An Updated title' }, { fields: ['title'] }); ``` ##### Multiple Items, Multiple Values @@ -192,16 +186,19 @@ directus.items('articles').update([ Supports optional query: ```js -directus.items('articles').update([ - { - id: 15, - title: 'Article 15', - }, - { - id: 42, - title: 'Article 42', - }, -], { fields: ['title'] }); +directus.items('articles').update( + [ + { + id: 15, + title: 'Article 15', + }, + { + id: 42, + title: 'Article 42', + }, + ], + { fields: ['title'] } +); ``` ##### Multiple Items by Query, Single Value @@ -209,14 +206,14 @@ directus.items('articles').update([ ```js directus.items('articles').update( { - archived: true + archived: true, }, { filter: { publish_date: { - _gte: '$NOW' - } - } + _gte: '$NOW', + }, + }, } ); ``` @@ -249,9 +246,9 @@ directus.activity.read(); directus.activity.read({ filter: { action: { - _eq: 'create' - } - } + _eq: 'create', + }, + }, }); ``` @@ -281,7 +278,7 @@ directus.activity.read([15, 42], { fields: ['action'] }); directus.activity.comments.create({ collection: 'articles', item: 15, - comment: 'Hello, world!' + comment: 'Hello, world!', }); ``` @@ -311,13 +308,19 @@ Note: these configuration options are passed in the top level SDK constructor. ##### mode -`cookie` or `json`. When in cookie mode, the API will set the refresh token in a `httpOnly` secure cookie that can't be accessed from client side JS. This is the most secure way to connect to the API from a public front-end website. +`cookie` or `json`. When in cookie mode, the API will set the refresh token in a `httpOnly` secure +cookie that can't be accessed from client side JS. This is the most secure way to connect to the API +from a public front-end website. -When you can't rely on cookies, or need more control over handling the storage of the cookie, use `json` mode. This will return the refresh token like "regular" in the payload. You can use the `storage` option (see below) to control where the refresh token is stored / read from +When you can't rely on cookies, or need more control over handling the storage of the cookie, use +`json` mode. This will return the refresh token like "regular" in the payload. You can use the +`storage` option (see below) to control where the refresh token is stored / read from ##### storage -When using `json` for mode, the refresh token needs to be stored somewhere. The `storage` option allows you to plug in any object that has an async `setItem()` and `getItem()` method. This allows you to plugin things like [`localforage`](https://github.com/localForage/localForage) directly: +When using `json` for mode, the refresh token needs to be stored somewhere. The `storage` option +allows you to plug in any object that has an async `setItem()` and `getItem()` method. This allows +you to plugin things like [`localforage`](https://github.com/localForage/localForage) directly: ```js import localforage from 'localforage'; @@ -328,7 +331,8 @@ const directus = new DirectusSDK('https://api.example.com', { storage: localfora ##### autoRefresh -Whether or not to automatically call `refresh()` when the access token is about to expire. Defaults to `true` +Whether or not to automatically call `refresh()` when the access token is about to expire. Defaults +to `true` #### Get / Set Token @@ -473,7 +477,7 @@ directus.server.specs.oas(); #### Ping the Server ```js -directus.server.ping() +directus.server.ping(); ``` #### Get Server/Project Info @@ -540,7 +544,7 @@ Supports optional query: ```js directus.users.me.read({ - fields: ['last_access'] + fields: ['last_access'], }); ``` @@ -553,10 +557,7 @@ directus.users.me.update({ first_name: 'Admin' }); Supports optional query: ```js -directus.users.me.update( - { first_name: 'Admin' }, - { fields: ['last_access'] } -); +directus.users.me.update({ first_name: 'Admin' }, { fields: ['last_access'] }); ``` --- From f8977a885d0bc343f9af6cba6e1a81eb2644155c Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 18:01:00 -0500 Subject: [PATCH 092/357] Update docs once more --- docs/concepts/activity-and-versions.md | 32 ++++-- docs/concepts/app-overview.md | 24 +++- docs/concepts/internationalization.md | 16 ++- docs/concepts/platform-overview.md | 32 ++++-- docs/concepts/relationships.md | 78 ++++++++----- docs/concepts/users-roles-and-permissions.md | 41 ++++--- docs/getting-started/backing-directus.md | 35 +++--- docs/getting-started/contributing.md | 10 +- docs/getting-started/installation.md | 24 ++-- docs/getting-started/introduction.md | 13 ++- docs/getting-started/support.md | 16 ++- docs/guides/collections.md | 32 ++++-- docs/guides/extensions/interfaces.md | 8 +- docs/guides/extensions/layouts.md | 8 +- docs/guides/extensions/modules.md | 9 +- docs/guides/fields.md | 46 +++++--- docs/guides/files.md | 22 +++- docs/guides/installation/aws.md | 3 + docs/guides/installation/cli.md | 15 ++- .../installation/digitalocean-app-platform.md | 1 + .../installation/digitalocean-droplet.md | 3 + docs/guides/installation/google-app-engine.md | 3 + docs/guides/installation/microsoft-azure.md | 3 + docs/guides/items.md | 2 + docs/guides/presets.md | 38 +++++-- docs/guides/projects.md | 23 ++-- docs/guides/roles-and-permissions.md | 103 +++++++++++------- docs/guides/setup/caddy.md | 3 + docs/guides/setup/nginx.md | 3 + docs/guides/users.md | 51 ++++++--- docs/guides/webhooks.md | 13 ++- docs/guides/white-labeling.md | 63 ++++++----- docs/reference/api/activity.md | 18 --- docs/reference/api/assets.md | 15 --- docs/reference/api/authentication.md | 17 --- docs/reference/api/collections.md | 18 --- docs/reference/api/extensions.md | 17 --- docs/reference/api/fields.md | 17 --- docs/reference/api/files.md | 18 --- docs/reference/api/folders.md | 15 --- docs/reference/api/items.md | 17 --- docs/reference/api/permissions.md | 15 --- docs/reference/api/presets.md | 18 --- docs/reference/api/query/fields.md | 2 + docs/reference/api/relations.md | 18 --- docs/reference/api/revisions.md | 18 --- docs/reference/api/roles.md | 15 --- docs/reference/api/server.md | 17 --- docs/reference/api/settings.md | 15 --- docs/reference/api/users.md | 15 --- docs/reference/api/utilities.md | 16 --- docs/reference/api/webhooks.md | 10 -- docs/reference/environment-variables.md | 17 ++- docs/reference/error-codes.md | 10 +- docs/reference/filter-rules.md | 6 +- 55 files changed, 537 insertions(+), 580 deletions(-) create mode 100644 docs/guides/installation/aws.md create mode 100644 docs/guides/installation/digitalocean-app-platform.md create mode 100644 docs/guides/installation/digitalocean-droplet.md create mode 100644 docs/guides/installation/google-app-engine.md create mode 100644 docs/guides/installation/microsoft-azure.md create mode 100644 docs/guides/setup/caddy.md create mode 100644 docs/guides/setup/nginx.md delete mode 100644 docs/reference/api/activity.md delete mode 100644 docs/reference/api/assets.md delete mode 100644 docs/reference/api/authentication.md delete mode 100644 docs/reference/api/collections.md delete mode 100644 docs/reference/api/extensions.md delete mode 100644 docs/reference/api/fields.md delete mode 100644 docs/reference/api/files.md delete mode 100644 docs/reference/api/folders.md delete mode 100644 docs/reference/api/items.md delete mode 100644 docs/reference/api/permissions.md delete mode 100644 docs/reference/api/presets.md delete mode 100644 docs/reference/api/relations.md delete mode 100644 docs/reference/api/revisions.md delete mode 100644 docs/reference/api/roles.md delete mode 100644 docs/reference/api/server.md delete mode 100644 docs/reference/api/settings.md delete mode 100644 docs/reference/api/users.md delete mode 100644 docs/reference/api/utilities.md delete mode 100644 docs/reference/api/webhooks.md diff --git a/docs/concepts/activity-and-versions.md b/docs/concepts/activity-and-versions.md index fc6741df7a..44cf51525e 100644 --- a/docs/concepts/activity-and-versions.md +++ b/docs/concepts/activity-and-versions.md @@ -6,7 +6,7 @@ ## Activity -This is a log of all events that have occured within the project. Activity can be accessed in two +This is a log of all events that have occurred within the project. Activity can be accessed in two ways, via the main [Activity Module](/concepts/app-overview#actvity-history), or within the sidebar of individual [Item Detail](/concepts/app-overview#item-detail) pages. The following information is stored for each event's activity item: @@ -20,12 +20,20 @@ stored for each event's activity item: - Item - Comment (when applicable) -::: tip Readonly For proper accountability, activity records are readonly. Administrators should -avoid changing, deleting, or truncating this data. ::: + +::: tip Readonly +For proper accountability, activity records are readonly. Administrators should +avoid changing, deleting, or truncating this data. +::: + -::: warning External Events Directus can only track events that pass through the platform's + +::: warning External Events +Directus can only track events that pass through the platform's middleware. Changes made directly to the database, or by other external means, are not included in -the activity log. ::: +the activity log. +::: + ## Versions @@ -36,15 +44,21 @@ information stored for each version: - Data — A full snapshot of the item _after_ the event - Delta — The specific field data changed by this event -::: tip Customizing Version Data Since versions store a full data snapshot and delta, the + -::: tip Creating Detached Versions You can also create a new version for an item without saving the + +::: tip Creating Detached Versions +You can also create a new version for an item without saving the data to the parent item itself. This allows you to "stage" changes to an item that may already be -live/published. ::: +live/published. +::: + ### Relevant Guides diff --git a/docs/concepts/app-overview.md b/docs/concepts/app-overview.md index a96419109c..cddecad78b 100644 --- a/docs/concepts/app-overview.md +++ b/docs/concepts/app-overview.md @@ -127,9 +127,13 @@ The sidebar's info component also includes the following readonly details: - **Last Access** — The timestamp of the user's last App or API action - **Last Page** — The last App page accessed by the user -::: tip Extending Users While the fields included out-of-the-box are locked from schema changes, you + +::: tip Extending Users +While the fields included out-of-the-box are locked from schema changes, you can extend Directus Users to include additional proprietary fields within -[Settings > Data Model](/concepts/data-model). ::: +[Settings > Data Model](/concepts/data-model). +::: + ## File Library @@ -161,9 +165,13 @@ The sidebar's info component also includes the following readonly details: - **Folder** — The current parent folder that contains the file - **Metadata** — Metadata JSON dump of the file's EXIF, IPTC, and ICC information -::: tip Extending Files While the fields included out-of-the-box are locked from schema changes, you + +::: tip Extending Files +While the fields included out-of-the-box are locked from schema changes, you can extend Directus Files to include additional proprietary fields within -[Settings > Data Model](/concepts/data-model). ::: +[Settings > Data Model](/concepts/data-model). +::: + ## Documentation @@ -179,9 +187,13 @@ dynamically tailored to your custom schema. The docs are organized into four dis - [Reference](/reference/api/introduction)\*\* — Information Oriented. Look up info and specs while working. -::: tip Updating the Docs Our docs are written in markdown (with some additional VuePress styling + +::: tip Updating the Docs +Our docs are written in markdown (with some additional VuePress styling like this hint box), and available for editing/fixing via -[GitHub](https://github.com/directus/directus). ::: +[GitHub](https://github.com/directus/directus). +::: + ## Activity History diff --git a/docs/concepts/internationalization.md b/docs/concepts/internationalization.md index 6e09f0d68a..8e36eb256f 100644 --- a/docs/concepts/internationalization.md +++ b/docs/concepts/internationalization.md @@ -15,9 +15,13 @@ Directus uses [database mirroring](#) to dynamically pull in your schema's table however this only covers one language. Therefore our platform supports schema translations for these names, allowing you to properly support different languages for your Collection and Field names. -::: tip Overriding Technical Names If your project requires more _technical_ table/column names (eg: + +::: tip Overriding Technical +Names If your project requires more _technical_ table/column names (eg: `cust` or `f_name`), you can also use schema translations to override those defaults (eg: -`Customers` or `First Name`) in the primary language. ::: +`Customers` or `First Name`) in the primary language. +::: + ## Content Translations @@ -27,6 +31,10 @@ each language, it is more extensible to use our relational translation fields to content in as many languages as is required. Mixing standard and translated fields also allows language-agnostic data (such as dates or toggles) to remain within the parent collection. -::: tip Custom Interfaces For more advanced use-cases, such as connecting to a third-party + +::: tip Custom Interfaces +For more advanced use-cases, such as connecting to a third-party translation service, you can read our extension guide on -[creating a custom interface](/guides/extensions/interfaces). ::: +[creating a custom interface](/guides/extensions/interfaces). +::: + diff --git a/docs/concepts/platform-overview.md b/docs/concepts/platform-overview.md index 9f46293a94..8b454941f1 100644 --- a/docs/concepts/platform-overview.md +++ b/docs/concepts/platform-overview.md @@ -59,12 +59,16 @@ Directus automatically uses a built-in [title formatter](/concepts/app-extension database table names prettified, and you can use [translations](/concepts/data-model) to completely rename them if needed. -::: tip Usage Collections can be organized in any way that is appropriate for your project. You can + +::: tip Usage +Collections can be organized in any way that is appropriate for your project. You can architect them platform-specific (eg: _pages_ of a website), or in a more platform-agnostic way (eg: raw _customers_ of your business). While there's no right or wrong way to structure your data-model, we recommend keeping your data as agnostic as possible so it is easier to repurpose in the future. In short, **learn to see your data as its own asset — not only through the lens of your immediate -project needs**. ::: +project needs**. +::: + ### Relevant Guides @@ -92,17 +96,29 @@ completely rename them if needed. Each field also mirrors other characteristics from the column, including its `type`, `default`, `length`, `allow_null`, etc. -::: tip Usage You might have `title`, `body`, `author`, and `date_published` fields within an -`articles` collection. ::: + +::: tip Usage +You might have `title`, `body`, `author`, and `date_published` fields within an +`articles` collection. +::: + -::: tip Aliases Not all fields in Directus map directly to an actual database column within their + +::: tip Aliases +Not all fields in Directus map directly to an actual database column within their table. Some relational fields, like One-to-Many (O2M) and Many-to-Many (M2M), represent data that is stored in different tables. Other fields are only for presentation and don't save data at all, such -as a divider. These are called "alias" fields. ::: +as a divider. These are called "alias" fields. +::: + -::: tip Relational Fields Fields that reference other items (in the same collection or different) + +::: tip Relational Fields +Fields that reference other items (in the same collection or different) are called relational fields. Linking or connecting data relationally is an immensely powerful -feature of relational databases and SQL queries. ::: +feature of relational databases and SQL queries. +::: + ### Relevant Guides diff --git a/docs/concepts/relationships.md b/docs/concepts/relationships.md index d205279bf7..f3053409e8 100644 --- a/docs/concepts/relationships.md +++ b/docs/concepts/relationships.md @@ -12,18 +12,23 @@ type, let's first cover a few basics that will help you better visualize each in ### PKs vs FKs -Every [item](#) in a relational database has a unique "key" that identifies it within its -[collection](#). Because it's required, the key is the first [field](#) created within a collection, -typically storing an "auto-increment" number, an automatically generated unique hash, or a manually -entered value. They are often abbreviated to "PK" (Primary Key), "ID" (Identifier), "UID" (Unique -Identifier), or "UUID" (Universally Unique Identifier), depending on the type of value they store. -After it's created, the value of an item's PK should _never_ change. +Every [item](/concepts/platform-overview#items) in a relational database has a unique "key" that +identifies it within its [collection](/concepts/platform-overview#collections). Because it's +required, the key is the first [field](/concepts/platform-overview#fields) created within a +collection, typically storing an "auto-increment" number, an automatically generated unique hash, or +a manually entered value. They are often abbreviated to "PK" (Primary Key), "ID" (Identifier), "UID" +(Unique Identifier), or "UUID" (Universally Unique Identifier), depending on the type of value they +store. After it's created, the value of an item's PK should _never_ change. To link items together relationally, you simply save a reference of an item's PK in a different field. That _reference_ is called a Foreign Key (FK). -::: Compound Keys We've ignored compound keys in this explanation to help keep things as simple as -possible. ::: + +::: tip Compound Keys +We've ignored compound keys in this explanation to help keep things as simple as +possible. +::: + ### Perspective Matters @@ -50,9 +55,9 @@ country ("One" Collection) ## One-to-Many (O2M) -A One-to-Many (O2M) relationship uses an [alias](#) field to reference one or more FKs in a M2O. -This is the _exact same_ relationship as the M2O above, but looking at it from the opposite -perspective (see [Perspective Matters](#)). So the O2M data model is the same, but adds an alias +A One-to-Many (O2M) relationship uses an alias field to reference one or more FKs in a M2O. This is +the _exact same_ relationship as the M2O above, but looking at it from the opposite perspective (see +[Perspective Matters](#perspective-matters)). So the O2M data model is the same, but adds an alias "cities" field to the Country collection, like this: ``` @@ -67,12 +72,20 @@ cities ("Many" Collection) - country (stores the FK to a country) ``` -::: Manual Reordering To enable manual reordering for a O2M, simply add a field with the `sort` type -to the "many" side (`cities` in the above example). ::: + +::: tip +Manual Reordering To enable manual reordering for a O2M, simply add a field with the `sort` type +to the "many" side (`cities` in the above example). +::: + -::: Translations The Translations interface allows [creating multilingual content](#) relationally. -It is a standard O2M relatinship, but also includes an additional field on the "many" collection to -hold the language key ::: + +::: tip Translations +The Translations interface allows [creating multilingual content](/concepts/internationalization#content-translations) relationally. +It is a standard O2M relationship, but also includes an additional field on the "many" collection to +hold the language key +::: + ## Many-to-Many (M2M) @@ -101,15 +114,27 @@ recipe_ingredients (Junction Collection) Notice that the example above also has a `quantity` field on the junction table. You can add any contextual fields to the junction, and they will also be included in the App's relational edit form. -:::warning M2M == O2M x2 An M2M is technically two relationships viewed as one. Each side has a O2M -to the Junction Table that sits in the middle. In that sense, there really is no "M2M". ::: + +::: warning M2M == O2Mx2 +An M2M is technically two relationships viewed as one. Each side has a O2M +to the Junction Table that sits in the middle. In that sense, there really is no "M2M". +::: + -::: Manual Reordering To enable manual reordering for a M2M, simply add a numeric field to the -junction table and set it as the [Collection Sort](#). ::: + +::: tip +Manual Reordering To enable manual reordering for a M2M, simply add a numeric field to the +junction table and set it as the [Collection Sort](#). +::: + -::: Self-Referencing You can also have a M2M relationship that connects items within the _same_ + +::: tip +Self-Referencing You can also have a M2M relationship that connects items within the _same_ collection. A common example of this is "Related Articles", where each article might relate to many -other articles. ::: +other articles. +::: + ## One-to-One (O2O) @@ -117,20 +142,21 @@ Directus does not include a one-to-one (O2O) relationship type or interface. How essentially the same as a M2O (storing a foreign key). The only difference is that a O2O enforces the cardinality. In other words, selecting a relational item in a O2O means that item can not be selected elsewhere (it can only be used once). This functionality can be added by checking and -constraining uniqueness via a [custom event hook](#) or [custom interface](#). +constraining uniqueness via a [custom event hook](/concepts/api-extensions) or +[custom interface](/concepts/app-extensions). An example of a O2O is: a _person_ only has one unique set of _fingerprints_, and those _fingerprints_ only belong to one _person_. -## Many-to-Any (M2X) +## Many-to-Any (M2A) -Sometimes called a "matrix field" or "replicator", the Many-to-Any (M2X) relationship is essentially +Sometimes called a "matrix field" or "replicator", the Many-to-Any (M2A) relationship is essentially the same as a M2M, but with one crucial difference: the junction table also stores the _parent collection name of the FK_. This "compound key" combines the collection name and FK to provide a unique reference to _any_ other item within the project. You can then artificially limit which collections are valid through an "allow list". -An example of a M2X is a "page layout builder". These typically will have modular components across +An example of a M2A is a "page layout builder". These typically will have modular components across several different collections (eg: "Heading", "Text Block", "Media Asset", etc), and a _Pages_ collections where you can piece them together. Therefore, the junction table will link a specific page with specific components, allowing the creation of relational page layouts. diff --git a/docs/concepts/users-roles-and-permissions.md b/docs/concepts/users-roles-and-permissions.md index 178fa8853c..7af29293e2 100644 --- a/docs/concepts/users-roles-and-permissions.md +++ b/docs/concepts/users-roles-and-permissions.md @@ -8,26 +8,35 @@ To use the App or API, you'll need a valid Directus User. Each user is assigned to a role that determines what they have access to see and do. For instance, some users have access to the App, while others can only connect to the API. Directus ships with a number of profile fields that help -create a full-featured [User Directory](#), and setting fields that allow customizing your -experience. +create a full-featured [User Directory](/concepts/app-overview#user-directory), and setting fields +that allow customizing your experience. -All Directus users are aggregated and shown on the [User Directory](#) page of the App +All Directus users are aggregated and shown on the +[User Directory](/concepts/app-overview#user-directory) page of the App -::: Extending Directus Users While the included fields within Directus Users are required/locked, + +::: tip Extending Directus Users +While the included fields within Directus Users are required/locked, you can still _extend_ this collection with additional custom fields as needed. You can do this via -the normal [Create a new Field](#) process from within the system collection. ::: +the normal [Create a new Field](#) process from within the system collection. +::: + -::: System vs Custom Users If your project requires a users, members, customers, etc., we recommend + +::: tip +System vs Custom Users If your project requires a users, members, customers, etc., we recommend creating your own collection to manage these instead of trying to repurpose the Directus Users -system. ::: +system. +::: + ### Relevant Guides -- [Setting up your User Profile](#) -- [Inviting a User](#) -- [Creating a User](#) -- [Archiving a User](#) -- [Deleting a User](#) +- [Setting up your User Profile](/guides/users#setting-up-your-user-profile) +- [Inviting a User](/guides/users#inviting-a-user) +- [Creating a User](/guides/users#creating-a-user) +- [Archiving a User](/guides/users#archiving-a-user) +- [Deleting a User](/guides/users#deleting-a-user) ## Roles @@ -45,12 +54,12 @@ users. This role can not be deleted, and has no permissions by default. Upon installation, Directus automatically creates this initial role to grant access to the first admin user. It is just a normal role, and like any other it can be updated, renamed or deleted, -however your project must maintain at least one role with [Admin Access](#) at all times. +however your project must maintain at least one role with Admin Access at all times. ### Relevant Guides -- [Creating a Role](#) -- [Deleting a Role](#) +- [Creating a Role](/guides/roles-and-permissions#creating-a-role) +- [Deleting a Role](/guides/roles-and-permissions#deleting-a-role) ## Permissions @@ -58,4 +67,4 @@ Directus gives you granular, filter-based permissions for managing access-contro ### Relevant Guides -- [Managing Permissions](#) +- [Managing Permissions](/guides/roles-and-permissions) diff --git a/docs/getting-started/backing-directus.md b/docs/getting-started/backing-directus.md index 25821d9b56..1a40039876 100644 --- a/docs/getting-started/backing-directus.md +++ b/docs/getting-started/backing-directus.md @@ -7,15 +7,15 @@ ## Financial Support Talented full-time and part-time staff, infrastructure, and third-party services are just some of -our organization's expenses, and revenue from our Cloud services and donations from sponsors dosen't +our organization's expenses, and revenue from our Cloud services and donations from sponsors doesn't fully cover those costs. Below are a few ways to help us keep the lights on and move towards self-sufficiency. ### GitHub Sponsors -Monthly donations via [GitHub Sponsors](#) are the most reliable form of financial support, and -donations made directly to our core developers are currently **doubled** by GitHub's matching -program! +Monthly donations via [GitHub Sponsors](https://github.com/sponsors/directus) are the most reliable +form of financial support, and donations made directly to our core developers are currently +**doubled** by GitHub's matching program! - [rijkvanzanten](https://github.com/rijkvanzanten) — Technical Lead - [WoLfulus](https://github.com/WoLfulus) — DevOps @@ -23,14 +23,16 @@ program! ### Sponsored Work -[Commissioned Features](#) and [Expedited Fixes](#) are great ways to financially support the -development of Directus, and improve the codebase for the community. +[Commissioned Features](/getting-started/support#commissioned-features) and +[Expedited Fixes](/getting-started/support-expedited-features) are great ways to financially support +the development of Directus, and improve the codebase for the community. ### Merch Our merchandise is a great way to support Directus — you get some swag, and we get some financial -support and advertising. Simply make an appropriate financial donation through [GitHub Sponsors](#), -message us with sizing/shipping details, and we'll get it shipped! +support and advertising. Simply make an appropriate financial donation through +[GitHub Sponsors](https://github.com/sponsors/directus), message us with sizing/shipping details, +and we'll get it shipped! ## Other Contributions @@ -40,17 +42,19 @@ Below are several ways anyone can help improve our ecosystem. Squashing bugs, optimizing the codebase, increasing test coverage, and adding new features, are all extremely valuable. Not technical? We have plenty of documentation that can always use some extra -attention. Learn more in our [Contributors Guide](#). +attention. Learn more in our [Contributors Guide](/getting-started/contributing). ### Translations Every translation enables users in new languages to use our international platform. Our -[Crowdin integration](#) makes polishing existing translations or creating new ones a breeze. +[Crowdin integration](https://locales.directus.io) makes polishing existing translations or creating +new ones a breeze. ### Bug Reporting If you encounter an issue within Directus, no matter how small, we would love to hear about it. -Proper bug reporing helps our team assess the platform's stability. [Report a bug](#) +Proper bug reporting helps our team assess the platform's stability. +[Report a bug](https://github.com/directus/directus/issues/new) ### Brand Advocacy @@ -58,10 +62,11 @@ You can create _perfect_ software, but if no one knows about it, it's all for na advertising are expensive, but you can help us avoid these costs with the following quick options: - **GitHub Stars** — The primary metric by which we measure our success. It only takes five - seconds to head to [directus/directus](#) and click the star — enough in a short period of time - and Directus gets featured on GitHub's trending page! + seconds to head to [directus/directus](https://github.com/directus/directus) and click the star + — enough in a short period of time and Directus gets featured on GitHub's trending page! - **Social Posts** — A quick post mentioning [@directus](https://twitter.com/directus) goes a long - way, and we re-tweet the team's favorite shout-outs to our 30K+ followers. + way, and we re-tweet the team's favorite shout-outs to our 35K+ followers. - **Testimonials** — _One sentence._ Even that was a sentence, and it was only two words! If you're a fan of Directus, we'd love to hear why with a short endorsement. Shoot us an - [email](#), [Tweet](#), or [Discord](#) message with your name, title, and company. + [email](mailto:info@directus.io), [Tweet](https://twitter.com/directus), or + [Discord](https://directus.chat) message with your name, title, and company. diff --git a/docs/getting-started/contributing.md b/docs/getting-started/contributing.md index 714be83717..73f9d2c2bb 100644 --- a/docs/getting-started/contributing.md +++ b/docs/getting-started/contributing.md @@ -9,14 +9,16 @@ Our Node.js repository is located at `directus/directus` and houses the Admin App (vue.js 3), Node.js API, project documentation (markdown), and API Specification (OpenAPI). Directus follows a monorepo design similar to React or Babel — to learn more about our monorepo's design and structure, -see our [Codebase Overview](#) below. +see our [Codebase Overview](#codebase-overview) below. To contribute to the project, please follow the instructions located within our GitHub repoitory's -[contributing.md file](#). +[contributing.md file](https://github.com/directus/directus/blob/main/contributing.md). -::: tip PHP API Port While the Node.js version of Directus defines the official specification and is + ## Feature Requests diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 1582ea7d36..8b6909e24a 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -4,24 +4,24 @@ Directus can be installed in many different ways, on several different stacks. C recommended method, but there are many ways to get started with our platform depending on your needs. -- [Command Line Interface (CLI)](/guides/installation/cli.md) -- [Docker](/guides/installation/docker.md) -- [Manually](/guides/installation/manual.md) +- [Command Line Interface (CLI)](/guides/installation/cli) +- [Docker](/guides/installation/docker) +- [Manually](/guides/installation/manual) ::: tip Development Environment Developers looking to work on the project's source code should follow our [Contributing Guide](/getting-started/contributing). ::: ## Deployment Guides -- [Amazon AWS](#) -- [DigitalOcean Droplet](#) -- [DigitalOcean One-Click](/guides/installation/digitalocean-one-click.md) -- [Google App Engine](#) -- [Heroku](/guides/installation/heroku.md) -- [Microsoft Azure](#) +- [Amazon AWS](/guides/installation/aws) +- [DigitalOcean Droplet](/guides/installation/digitalocean-droplet) +- [DigitalOcean One-Click](/guides/installation/digitalocean-one-click) +- [DigitalOcean App Platform](/guides/installation/digitalocean-app-platform) +- [Google App Engine](/guides/installation/google-app-engine) +- [Heroku](/guides/installation/heroku) +- [Microsoft Azure](/guides/installation/microsoft-azure) ## Optional Setup Guides -- [Caddy](#) -- [Nginx](#) -- [HAProxy](#) +- [Caddy](/guides/setup/caddy) +- [Nginx](/guides/setup/nginx) diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 8da3f7fb34..d7516ad83a 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -11,10 +11,13 @@ users to view and manage the content/data stored within pure SQL databases. It c headless CMS for managing project content, a database client for modeling and viewing raw data, or as a standalone customizable WebApp. -::: details What's in a name? Directus -([duh REKT iss](http://audio.pronouncekiwi.com/Salli/Directus)) is latin for: _laid straight, + +::: details What's in a name? +Directus ([duh REKT iss](http://audio.pronouncekiwi.com/Salli/Directus)) is latin for: _laid straight, arranged in lines_. The broadest goal of Directus is to present data in a simple, orderly, and -intuitive way. ::: +intuitive way. +::: + ## What makes it unique? @@ -48,7 +51,7 @@ guided by the following core principles: ### Open-Source Engine -Completely free and open-source on the GPLv3 license, Directus is publically available within our +Completely free and open-source on the GPLv3 license, Directus is publicly available within our [npm package](https://www.npmjs.com/package/directus) and main [GitHub repository](https://github.com/directus/directus). It includes our dynamic API engine (node.js), the intuitive Admin App (vue.js 3), this documentation (markdown), and all dependencies. @@ -70,7 +73,7 @@ They are written in publicly managed markdown files so the community can help ke up-to-date! - Getting Started: Novice Oriented. For a platform intro and installation. -- Concepts: Learning Oriented. For understanding the platfom. +- Concepts: Learning Oriented. For understanding the platform. - Guides: Problem Oriented. Follow along with steps while working. - Reference: Information Oriented. Look up info and specs while working. diff --git a/docs/getting-started/support.md b/docs/getting-started/support.md index 5c40569607..bef9cc59ef 100644 --- a/docs/getting-started/support.md +++ b/docs/getting-started/support.md @@ -32,10 +32,12 @@ custom/proprietary development will be built bespoke within our robust extension ### Expedited Fixes We triage all reported bugs based on priority and how long the fix is estimated to take. If you need -a specific issue resolved sooner, [reach out to us](#) for a quote. +a specific issue resolved sooner, [reach out to us](https://directus.io/contact/) for a quote. ## Frequently Asked Questions + ### Does Directus support Mongo/NoSQL? @@ -63,16 +65,18 @@ quite stable, however new issues still arise, some of which may be triaged with prioritization. If you require more expeditious updates, you can contact us regarding -[sponsoring expedited fixes](#) or [commissioning new features](#). You can also -[submit a pull request](#) — after all, it is open-source! +[sponsoring expedited fixes](#expedited-fixes) or +[commissioning new features](#commisioned-features). You can also +[submit a pull request](https://github.com/directus/directus/pulls) — after all, it is open-source! ### Can you give an ETA for this feature/fix? -If it is [sponsored work](#), then yes, delivery dates are part of our statement of work agreements. +If it is sponsored work, then yes, delivery dates are part of our statement of work agreements. Otherwise, most likely not. This is open-source software, work is prioritized internally, and all timelines are subject to change. ### But this is an emergency, my very important project requires it now! We understand, and are here to help. If you need something prioritized, you can reach out to us to -discuss [premium support](#), [sponsoring expedited fixes](#) or [commissioning new features](#). +discuss [premium support](#premium-support), [sponsoring expedited fixes](#expedited-features) or +[commissioning new features](#commissioned-features). diff --git a/docs/guides/collections.md b/docs/guides/collections.md index cb800826ce..dc4be23ef8 100644 --- a/docs/guides/collections.md +++ b/docs/guides/collections.md @@ -70,12 +70,20 @@ easy recovery. - **Archive Value** — The value saved in the Archive Field when archived - **Unarchive Value** — The value saved in the Archive Field when unarchived -:::warning API Responses Items that have been archived are still returned normally via the API. It -is up to you to filter them out as needed. ::: + +::: warning API Responses +Items that have been archived are still returned normally via the API. It +is up to you to filter them out as needed. +::: + -::: Status Field When creating a new Collection, you have the option of creating an optional + +::: tip Status Field +When creating a new Collection, you have the option of creating an optional "Status" field. If you choose to include this field, the collection's archive settings will -automatically be configured for you. ::: +automatically be configured for you. +::: + ### Sort @@ -83,9 +91,13 @@ The sort feature enables manual drag-and-drop item reordering within the Directu typically shown on the [Collection Detail](#) page/modal, and can also be used for sorting items within a [Junction Table](#). -::: Sort Field When creating a new Collection, you have the option of creating an optional "Sort" + +::: tip Sort Field +When creating a new Collection, you have the option of creating an optional "Sort" field. If you choose to include this field, the collection's sort settings will automatically be -configured for you. ::: +configured for you. +::: + ## Deleting a Collection @@ -93,5 +105,9 @@ configured for you. ::: 2. Click the red **Delete Collection** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change This action is permanent and can not be undone. Please proceed with -caution. ::: + +::: danger Irreversible Change +This action is permanent and can not be undone. Please proceed with +caution. +::: + diff --git a/docs/guides/extensions/interfaces.md b/docs/guides/extensions/interfaces.md index 52ea872d4c..c2c4b5140c 100644 --- a/docs/guides/extensions/interfaces.md +++ b/docs/guides/extensions/interfaces.md @@ -37,9 +37,11 @@ export default { - `component` — A reference to your Vue component. - `types` — A CSV of supported [types](#). -::: See -[the TypeScript definition](https://github.com/directus/directus/blob/20355fee5eba514dd75565f60269311187010c66/app/src/interfaces/types.ts#L5-L18) -for more info on what can go into this object. ::: + +::: tip +See [the TypeScript definition](https://github.com/directus/directus/blob/20355fee5eba514dd75565f60269311187010c66/app/src/interfaces/types.ts#L5-L18) for more info on what can go into this object. +::: + ### src/interface.vue diff --git a/docs/guides/extensions/layouts.md b/docs/guides/extensions/layouts.md index 12eb4e441a..14206c78b8 100644 --- a/docs/guides/extensions/layouts.md +++ b/docs/guides/extensions/layouts.md @@ -31,9 +31,13 @@ export default { - `name` — The human-readable name for this layout. - `component` — A reference to your Vue component. -::: See + +::: tip +See [the TypeScript definition](https://github.com/directus/directus/blob/20355fee5eba514dd75565f60269311187010c66/app/src/layouts/types.ts#L4-L9) -for more info on what can go into this object. ::: +for more info on what can go into this object. +::: + ### src/layout.vue diff --git a/docs/guides/extensions/modules.md b/docs/guides/extensions/modules.md index a549ee7090..2c1718e46a 100644 --- a/docs/guides/extensions/modules.md +++ b/docs/guides/extensions/modules.md @@ -37,9 +37,12 @@ export default { - `icon` — An icon name from the material icon set, or the extended list of Directus custom icons. - `routes` — Details the routes in your module per the Vue router. -::: See -[the TypeScript definition](https://github.com/directus/directus/blob/20355fee5eba514dd75565f60269311187010c66/app/src/modules/types.ts#L6-L17) -for more info on what can go into this object. ::: + +::: tip +See [the TypeScript definition](https://github.com/directus/directus/blob/20355fee5eba514dd75565f60269311187010c66/app/src/modules/types.ts#L6-L17) +for more info on what can go into this object. +::: + ### src/module.vue diff --git a/docs/guides/fields.md b/docs/guides/fields.md index ccfb9b60a5..b848b5545a 100644 --- a/docs/guides/fields.md +++ b/docs/guides/fields.md @@ -1,8 +1,9 @@ # Fields > You can manage your fields within the Data Model section of the App's Settings, via the -> [API Fields Endpoint](#), or directly within the database. If you're unfamiliar with Directus -> Fields, please start by reading our [Understanding Fields](#) docs. +> [API Fields Endpoint](/reference/api/fields), or directly within the database. If you're +> unfamiliar with Directus Fields, please start by reading our +> [Understanding Fields](/concepts/data-model) docs. ## Creating a Field @@ -10,18 +11,22 @@ 2. Under Fields & Layout, click the **Create Field** button 3. **Choose the field type**, and follow its specific setup guide... -- [Standard Field](#) -- [Presentation Field](#) -- [Many-to-One Field](#) -- [One-to-Many Field](#) -- [Many-to-Many Field](#) -- [Many-to-Any Field](#) -- [Translated Fields](#) +- [Standard Field](/guides/field-types/standard-field) +- [Presentation Field](/guides/field-types/presentation-field) +- [Many-to-One Field](/guides/field-types/many-to-one-field) +- [One-to-Many Field](/guides/field-types/one-to-many-field) +- [Many-to-Many Field](/guides/field-types/many-to-many-field) +- [Many-to-Any Field](/guides/field-types/many-to-any-field) +- [Translated Fields](/guides/field-types/translated-fields) -::: tip Database Fields Keep in mind that Directus Fields are just a database columns. Therefore you + +::: tip Database Fields +Keep in mind that Directus Fields are just a database columns. Therefore you can import or create a column directly in the database, and it will automatically appear within Directus. The first time you manage that column, a `directus_fields` record will be created with -default values. ::: +default values. +::: + ## Duplicating a Field @@ -29,8 +34,12 @@ default values. ::: 2. Click the **More Options** icon for the field you want to delete 3. Click the **Duplicate Field** option -:::warning Relational and Primary Key Fields It is not currently possible to duplicate relational -fields or a collection's primary key. ::: + +::: warning Relational and Primary Key Fields +It is not currently possible to duplicate relational +fields or a collection's primary key. +::: + ## Adjusting Field Layout @@ -44,7 +53,8 @@ The layout of the collection's form is determined by the following field options - **Field Sort** — The order of fields within the form - **Field Group** — If the field is a "group" type -1. Create any desired groupings by **[Creating a Field Group](#)** + + 2. Click the **More Options** icon for any fields/groups to adjust visibility 3. Click the **More Options** icon for any fields to adjust width 4. **Rearrange fields and groups** with their drag-and-drop handles @@ -56,5 +66,9 @@ The layout of the collection's form is determined by the following field options 3. Click the **Delete Field** option 4. Confirm this decision by clicking **Delete** in the dialog -::: danger Irreversible Change This action is permanent and can not be undone. Please proceed with -caution. ::: + +::: danger Irreversible Change +This action is permanent and can not be undone. Please proceed with +caution. +::: + diff --git a/docs/guides/files.md b/docs/guides/files.md index bd9a504948..b1737981e9 100644 --- a/docs/guides/files.md +++ b/docs/guides/files.md @@ -19,10 +19,14 @@ example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4 ![Original File](../assets/original.jpg) _Original File Used Below — 602KB and 1800x1200_ -::: warning Direct File Access While you may _technically_ be able to access your original files + +::: warning Direct File Access +While you may _technically_ be able to access your original files within their actual filesystem directory (eg: `/uploads/` for the default local storage configuration), it is recommended that you always use the Directus API. This is the only way -that you can take advantage of file permissions and other built-in features. ::: +that you can take advantage of file permissions and other built-in features. +::: + ## Creating Thumbnail Presets @@ -33,13 +37,17 @@ that you can take advantage of file permissions and other built-in features. ::: 5. Enter the **Fit**, **Width**, **Height**, and **Quality** for the preset 6. Click the **Save** action button in the header -::: tip Storage Asset Transform The **Storage Asset Transform** can be used in conjunction with the + +::: tip Storage Asset Transform +The **Storage Asset Transform** can be used in conjunction with the presets to force an allow-list or completely disable the thumbnailing system. The options for this are: - **All** — Any valid thumbnail request will be returned - **None** — No thumbnails will be returned, not even presets -- **Presets Only** — Only valid Storage Asset Presets will be returned ::: +- **Presets Only** — Only valid Storage Asset Presets will be returned +::: + ## Requesting a Thumbnail @@ -88,7 +96,11 @@ dimensions and adding "letterboxing" as needed. | ----------------------------------------------------------- | --------------------------------------------------------------- | | ![Cover](../assets/200-200-cover-75.jpg)
_8KB • 200x200_ | ![Contain](../assets/200-200-contain-75.jpg)
_6KB • 200x133_ | -::: Aspect Ratio Images are never stretched or distorted even when changing the aspect ratio. ::: + +::: Aspect Ratio +Images are never stretched or distorted even when changing the aspect ratio. +::: + ### Quality vs Filesize diff --git a/docs/guides/installation/aws.md b/docs/guides/installation/aws.md new file mode 100644 index 0000000000..b3598eecb5 --- /dev/null +++ b/docs/guides/installation/aws.md @@ -0,0 +1,3 @@ +# AWS + +@TODO diff --git a/docs/guides/installation/cli.md b/docs/guides/installation/cli.md index c60ab49ef2..edffb9f4cd 100644 --- a/docs/guides/installation/cli.md +++ b/docs/guides/installation/cli.md @@ -21,8 +21,11 @@ vendor's official support/LTS. | OracleDB | TBD | | MariaDB | 10.1+ | -::: Variants In addition to the databases above, other variants are also supported, including **AWS -Aurora** (MySQL), and **AWS Redshift** (PostgreSQL). ::: + +::: tip +Variants In addition to the databases above, other variants are also supported, including **AWS Aurora** (MySQL), and **AWS Redshift** (PostgreSQL). +::: + ## 2. Create a Project @@ -32,8 +35,12 @@ Create a new Directus project by running the following npm command. npx create-directus-project my-project ``` -:::warning Except for SQLite, the database must already be running before creating your Directus -project. ::: + +::: warning +Except for SQLite, the database must already be running before creating your Directus +project. +::: + ## 3. Start your Project diff --git a/docs/guides/installation/digitalocean-app-platform.md b/docs/guides/installation/digitalocean-app-platform.md new file mode 100644 index 0000000000..e61c3150f5 --- /dev/null +++ b/docs/guides/installation/digitalocean-app-platform.md @@ -0,0 +1 @@ +# DigitalOcean App Platform diff --git a/docs/guides/installation/digitalocean-droplet.md b/docs/guides/installation/digitalocean-droplet.md new file mode 100644 index 0000000000..77a984bc33 --- /dev/null +++ b/docs/guides/installation/digitalocean-droplet.md @@ -0,0 +1,3 @@ +# DigitalOcean Droplet + +@TODO diff --git a/docs/guides/installation/google-app-engine.md b/docs/guides/installation/google-app-engine.md new file mode 100644 index 0000000000..699ef81093 --- /dev/null +++ b/docs/guides/installation/google-app-engine.md @@ -0,0 +1,3 @@ +# Google App Engine + +@TODO diff --git a/docs/guides/installation/microsoft-azure.md b/docs/guides/installation/microsoft-azure.md new file mode 100644 index 0000000000..998809b973 --- /dev/null +++ b/docs/guides/installation/microsoft-azure.md @@ -0,0 +1,3 @@ +# Microsoft Azure + +@TODO diff --git a/docs/guides/items.md b/docs/guides/items.md index 44d45a9593..4bf75bbcff 100644 --- a/docs/guides/items.md +++ b/docs/guides/items.md @@ -1,5 +1,7 @@ # Items +@TODO + Browse: ## Creating Items diff --git a/docs/guides/presets.md b/docs/guides/presets.md index 2aba33bbd1..291b6b1d1e 100644 --- a/docs/guides/presets.md +++ b/docs/guides/presets.md @@ -1,8 +1,8 @@ # Collection Presets -> Presets store the exact state of a [collection detail](#) page. These can be used to set layout -> defaults for a user, or to define bookmarks that can be used to recall windows into specific -> datasets. +> Presets store the exact state of a [collection detail](/concepts/app-overview) page. These can be +> used to set layout defaults for a user, or to define bookmarks that can be used to recall windows +> into specific datasets. ## Creating a Preset @@ -25,16 +25,28 @@ Each preset saves all of the information needed to recreate a view of the collec including: the full-text search query, any advanced filters added, sort field, sort direction, and all other specific layout options. -::: Defaults vs Bookmarks It's important to be aware of the difference between a collection's + +::: Defaults vs Bookmarks +It's important to be aware of the difference between a collection's _defaults_ and its _bookmarks_, both of which are configured by presets. A _default_ is how a user will initially view the collection detail without any further customization, while a _bookmark_ is a -named dataset that can be recalled at any point via the [collection navigation](#). ::: +named dataset that can be recalled at any point via the [collection navigation](/concepts/users-roles-and-permissions). +::: + -::: System Defaults You can also adjust the defaults and bookmarks for the Directus Activity, -Directus Files, and Directus Users collections. ::: + +::: System Defaults +You can also adjust the defaults and bookmarks for the Directus Activity, +Directus Files, and Directus Users collections. +::: + -::: Order of Defaults Multiple defaults can be configured for a user, either for different layouts -of even the same layout. In this case, the preset priority is: User, then Role, then Global. ::: + +::: Order of Defaults +Multiple defaults can be configured for a user, either for different layouts +of even the same layout. In this case, the preset priority is: User, then Role, then Global. +::: + ## Deleting a Preset @@ -42,5 +54,9 @@ of even the same layout. In this case, the preset priority is: User, then Role, 2. Click the red **Delete Preset** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change This action is permanent and can not be undone. Please proceed with -caution. ::: + +:::danger Irreversible Change +This action is permanent and can not be undone. Please proceed with +caution. +::: + diff --git a/docs/guides/projects.md b/docs/guides/projects.md index 562df6d84b..8ea4e25e6b 100644 --- a/docs/guides/projects.md +++ b/docs/guides/projects.md @@ -1,7 +1,7 @@ # Projects > Every installation of Directus creates a single project. If you're unfamiliar with Directus -> Projects, please start by reading our [Platform Overview](#). +> Projects, please start by reading our [Platform Overview](/concepts/platform-overview). ## Creating a Project @@ -11,27 +11,18 @@ To install Directus, choose one of the following methods. - [Docker](/guides/installation/docker.md) - [Manually](/guides/installation/manual.md) -### Deployment Guides - -- [Amazon AWS](#) -- [DigitalOcean Droplet](#) -- [DigitalOcean One-Click](/guides/installation/digitalocean-one-click.md) -- [Google App Engine](#) -- [Heroku](/guides/installation/heroku.md) -- [Microsoft Azure](#) - ## Configuring a Project All project configuration is handled by the `.env` file within the `/api` directory. This file accepts a number of environment variables, each is explained in the following reference: -- [Environment Variables](#) +- [Environment Variables](/reference/environment-variables) ## Upgrading a Project 1. Backup your project 2. Run `npm update` - +3. Run `directus database migrate:latest` to update the DB ## Backing-up a Project @@ -47,6 +38,10 @@ accepts a number of environment variables, each is explained in the following re 4. **Delete the project's root directory** from the server 5. **Delete all Directus system tables** (`directus_*`) from the database -::: Pure SQL After completing this process, you will be left with a pure SQL database, with no trace + +::: Pure SQL +After completing this process, you will be left with a pure SQL database, with no trace that Directus was ever installed. Any external services connecting to your database's project tables -directly (eg: SQL queries) should continue working normally. ::: +directly (eg: SQL queries) should continue working normally. +::: + diff --git a/docs/guides/roles-and-permissions.md b/docs/guides/roles-and-permissions.md index ef298662bb..a82ff6b80c 100644 --- a/docs/guides/roles-and-permissions.md +++ b/docs/guides/roles-and-permissions.md @@ -13,8 +13,7 @@ ## Configuring a Role -- **Permissions** — Defines the role's access permissions, see [Configuring Role Permissions](#) - and [Configuring System Permissions](#) +- **Permissions** — Defines the role's access permissions - **Role Name** — This is the name of the role - **Role Icon** — The icon used throughout the App when referencing this role - **Description** — A helpful note that explains the role's purpose @@ -24,15 +23,13 @@ allows all - **Require 2FA** — Forces all users within this role to use two-factor authentication - **Users in Role** — A list of all users within this role -- **Module Navigation** — Overrides the visible modules, see - [Customizing the Module Navigation](#) -- **Collection Navigation** — Overrides the collection module's navigation, see - [Customizing the Collection Navigation](#) +- **Module Navigation** — Overrides the visible modules +- **Collection Navigation** — Overrides the collection module's navigation ### Customizing the Module Navigation -The options in the [Module Bar](#) can be overridden with custom options per role. When this setting -is empty, the default modules are used. +The options in the [Module Bar](/concepts/app-overview) can be overridden with custom options per +role. When this setting is empty, the default modules are used. 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Module Navigation** field @@ -43,7 +40,7 @@ is empty, the default modules are used. 7. Use the drag handles to **drag-and-drop** the modules into the desired order If you are looking to replicate the default modules, paste the following configuration into the -Module Navigation field using the [Raw Value](#) field label option. +Module Navigation field using the Raw Value field label option. ```json [ @@ -78,9 +75,9 @@ or icon. For example, you can use `/collections` to override the Collections mod ### Customizing the Collection Navigation -The collections in the [Navigation Bar](#) can be overridden with custom options per role. When this -setting is empty, all collections that the user has permission to see are shown alphabetically in a -single, unlabeled group. +The collections in the [Navigation Bar](/concepts/app-overview) can be overridden with custom +options per role. When this setting is empty, all collections that the user has permission to see +are shown alphabetically in a single, unlabeled group. 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Collection Navigation** field @@ -101,11 +98,19 @@ new role, permissions are disabled for all project collections by default — al explicit access to only what is required. Individual permissions are applied to the role, and each is scoped to a specific collection and CRUD action (create, read, update, delete). -:::warning Saves Automatically Every change made to the permissions of a role is saved automatically -and instantly. ::: + +::: warning Saves Automatically +Every change made to the permissions of a role is saved automatically +and instantly. +::: + -:::warning Admin Roles If a role is set to **Admin Access** then it is granted complete access to -the platoform, and therefore the permission configuration field is disabled. ::: + +::: warning Admin Roles +If a role is set to **Admin Access** then it is granted complete access to +the platform, and therefore the permission configuration field is disabled. +::: + 1. Navigate to **Settings > Roles & Permissions > [Role Name]** 2. Scroll to the **Permissions** section @@ -120,43 +125,45 @@ appropriate guide below based on the _action_ of the permission. 5. **Field Permissions** control which fields accept a value on create. Fields are individually toggled. -6. **Field Validation** define the rules for field values on create, as defined by the - [Filter Rules](#) entered. -7. **Field Presets** control the field defaults when creating an item, as defined by the - [Item Object](#) entered. +6. **Field Validation** define the rules for field values on create +7. **Field Presets** control the field defaults when creating an item #### Read (Custom) -5. **Item Permissions** control which items can be read, as defined by the [Filter Rules](#) - entered. +5. **Item Permissions** control which items can be read, as defined by the + [Filter Rules](/reference/filter-rules) entered. 6. **Field Permissions** control which fields can be read. Fields are individually toggled. #### Update (Custom) -5. **Item Permissions** control which items can be updated, as defined by the [Filter Rules](#) - entered. +5. **Item Permissions** control which items can be updated, as defined by the + [Filter Rules](/reference/filter-rules)) entered. 6. **Field Permissions** control which fields can be updated. Fields are individually toggled. 7. **Field Validation** define the rules for field values on update, as defined by the - [Filter Rules](#) entered. -8. **Field Presets** control the field defaults when updating an item, as defined by the - [Item Object](#) entered. + [Filter Rules](/reference/filter-rules) entered. +8. **Field Presets** control the field defaults when updating an item #### Delete (Custom) -5. **Item Permissions** control which items can be deleted, as defined by the [Filter Rules](#) - entered. +5. **Item Permissions** control which items can be deleted, as defined by the + [Filter Rules](/reference/filter-rules)) entered. ## Configuring System Permissions In addition to setting permissions for your project's collections, you can also tailor the -permissions for system collections. It is important to note that when [App Access](#) is enabled for -a role, Directus will automatically add permission for the neccesary system collections. To edit -system permissions, simply click the "System Collections" toggle, and then edit permissions using -the same steps as with project collections. +permissions for system collections. It is important to note that when +[App Access](/concepts/users-roles-and-permissions) is enabled for a role, Directus will +automatically add permission for the necessary system collections. To edit system permissions, +simply click the "System Collections" toggle, and then edit permissions using the same steps as with +project collections. -::: Resetting System Permissions To reset the role's system permissions for proper App access, + +::: Resetting System Permissions +To reset the role's system permissions for proper App access, expand the system collections and then click "Reset System Permissions" at the bottom of the -listing. ::: +listing. +::: + ## Deleting a Role @@ -164,12 +171,24 @@ listing. ::: 2. Click the red **Delete Role** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::warning Users in a Deleted Role If you delete a role that still has users in it, those users will -be given a `NULL` role, which denies their App access and limits them to the [Public](#) -permissions. They can then be reassigned to a new role by an admin. ::: + +::: warning Users in a Deleted Role +If you delete a role that still has users in it, those users will +be given a `NULL` role, which denies their App access and limits them to the [Public](/concepts/users-roles-and-permissions) +permissions. They can then be reassigned to a new role by an admin. +::: + -:::warning Last Admin You must maintain at least one role/user with Admin Access so that you can -still properly manage the project. ::: + +:::warning Last Admin +You must maintain at least one role/user with Admin Access so that you can +still properly manage the project. +::: + -:::warning Public Role You can not delete the Public role, as it is part of the core platform. To -disable it completely, simply turn off all Public access permissions. ::: + +:::warning Public Role +You can not delete the Public role, as it is part of the core platform. To +disable it completely, simply turn off all Public access permissions. +::: + diff --git a/docs/guides/setup/caddy.md b/docs/guides/setup/caddy.md new file mode 100644 index 0000000000..ad7eb4a72b --- /dev/null +++ b/docs/guides/setup/caddy.md @@ -0,0 +1,3 @@ +# Caddy Setup Guide + +@TODO diff --git a/docs/guides/setup/nginx.md b/docs/guides/setup/nginx.md new file mode 100644 index 0000000000..d29d348ba0 --- /dev/null +++ b/docs/guides/setup/nginx.md @@ -0,0 +1,3 @@ +# Nginx Setup Guide + +@TODO diff --git a/docs/guides/users.md b/docs/guides/users.md index f60cc9fb3a..91e7718520 100644 --- a/docs/guides/users.md +++ b/docs/guides/users.md @@ -4,12 +4,16 @@ > After that, you are free to create as many users as you'd like. There is no limit to the number of > users in a project. +## Setting up your User Profile + +@TODO + ## Creating a User 1. Navigate to the **User Library** 2. Click the **Create User** action button in the header 3. Enter an **Email Address** -4. Optional: Complete the **other user form fields** (see [Configuring a User](#)) +4. Optional: Complete the **other user form fields** ## Inviting a User @@ -19,7 +23,7 @@ 4. Enter **one or more email addresses**, separated by commas, in the modal 5. Click **Invite** -At this point the invited user(s) will recieve an email with a link to the App where they set a +At this point the invited user(s) will receive an email with a link to the App where they set a password and enable their account. ## Configuring a User @@ -28,8 +32,12 @@ password and enable their account. 2. Click on the user you wish to manage 3. Complete any of the [User Fields](/concepts/app-overview.md#user-detail) -::: User Preferences This section of the User Detail is only visible/editable by the current user, -and admins. ::: + +::: User Preferences +This section of the User Detail is only visible/editable by the current user, +and admins. +::: + ### Status @@ -39,7 +47,11 @@ and admins. ::: - **Suspended** — A user that has been temporarily disabled; no App/API access - **Archived** — A soft-deleted user; no App/API access -:::warning Admin Only Only admins can adjust this field's value. ::: + +::: warning Admin Only +Only admins can adjust this field's value. +::: + ### Role @@ -47,14 +59,17 @@ Setting the user's role determines their access, permissions, and App presentati user's role from the User Detail page, or from the _Users in Role_ field within **Settings > Roles & Permissions > [Role Name]**. -:::warning Admin Only Only admins can adjust this field's value. ::: + +::: warning Admin Only +Only admins can adjust this field's value. +::: + ### Token -A user's token is an alternate way to [authenticate into the API](#) using a static string. When -NULL, the token is disabled. When enabled, ensure that a secure string is used. - -:::warning Admin Only Only admins can adjust this field's value. ::: +A user's token is an alternate way to [authenticate into the API](/reference/api/authentication) +using a static string. When NULL, the token is disabled. When enabled, ensure that a secure string +is used. ## Archiving a User @@ -63,8 +78,12 @@ NULL, the token is disabled. When enabled, ensure that a secure string is used. 3. Click the orange **Archive User** action button in the header 4. Confirm this decision by clicking **Archive** in the dialog -:::warning Disables Access Archiving uses _soft-delete_, therefore archived users are unable to -access the App or API. ::: + +::: warning Disables Access +Archiving uses _soft-delete_, therefore archived users are unable to +access the App or API. +::: + ## Deleting a User @@ -73,5 +92,9 @@ access the App or API. ::: 3. Click the red **Delete User** action button in the header 4. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change Unlike the soft-delete of archiving, this process is a hard-delete. -Therefore, this action is permanent and can not be undone. Please proceed with caution. ::: + +::: danger Irreversible Change +Unlike the soft-delete of archiving, this process is a hard-delete. +Therefore, this action is permanent and can not be undone. Please proceed with caution. +::: + diff --git a/docs/guides/webhooks.md b/docs/guides/webhooks.md index bd15d1b234..1c3536f624 100644 --- a/docs/guides/webhooks.md +++ b/docs/guides/webhooks.md @@ -1,8 +1,8 @@ # Webhooks -> In addition to writing custom code for more complex [event hooks](#), Directus provides a way to -> quickly configure webhooks through the App. These send HTTP requests when a specific event is -> triggered within the project. +> In addition to writing custom code for more complex [event hooks](/concepts/api-extensions), +> Directus provides a way to quickly configure webhooks through the App. These send HTTP requests +> when a specific event is triggered within the project. ## Creating Webhooks @@ -30,5 +30,8 @@ 2. Click the red **Delete Webhook** action button in the header 3. Confirm this decision by clicking **Delete** in the dialog -:::danger Irreversible Change This action is permanent and can not be undone. Please proceed with -caution. ::: + +::: danger Irreversible Change +This action is permanent and can not be undone. Please proceed with caution. +::: + diff --git a/docs/guides/white-labeling.md b/docs/guides/white-labeling.md index fdae264e07..39f18b21e0 100644 --- a/docs/guides/white-labeling.md +++ b/docs/guides/white-labeling.md @@ -9,25 +9,34 @@ 1. Navigate to **Settings > Project Settings** 2. Configure any of the following **branding fields** -- **Project Name** — The name used at the top of the [Navigation Bar](#) and on the login/public - pages -- **Project URL** — The URL when clicking the logo at the top of the [Module Bar](#) -- **Project Color** — The color used behind the logo at the top of the [Module Bar](#), on the - login/public pages, and for the browser's FavIcon -- **Project Logo** — A 40x40 pixel logo at the top of the [Module Bar](#) and on the login/public - pages +- **Project Name** — The name used at the top of the [Navigation Bar](/concepts/app-overview) and + on the login/public pages +- **Project URL** — The URL when clicking the logo at the top of the + [Module Bar](/concepts/app-overview) +- **Project Color** — The color used behind the logo at the top of the + [Module Bar](/concepts/app-overview), on the login/public pages, and for the browser's FavIcon +- **Project Logo** — A 40x40 pixel logo at the top of the [Module Bar](/concepts/app-overview) and + on the login/public pages -::: Recommended Logo Styling The 40x40 pixel Project Logo is inset within the 64x64 pixel Project -Color square. To avoid a "boxy" look, we recommend using a SVG or PNG logo with transparency. ::: + +::: tip Recommended Logo Styling +The 40x40 pixel Project Logo is inset within the 64x64 pixel Project +Color square. To avoid a "boxy" look, we recommend using a SVG or PNG logo with transparency. +::: + -::: Browser FavIcon & Title The project color and logo are also used to set the dynamic favicon, and + +::: tip Browser FavIcon & Title +The project color and logo are also used to set the dynamic favicon, and the project title is used in the browser's title. This furthers the bespoke appearance of your -platform and makes it easier to differentiate between different Directus projects. ::: +platform and makes it easier to differentiate between different Directus projects. +::: + ### Public Page Styling In addition to the above options, you can also apply the following additional styling to your -prject's [public pages](#). +project's [public pages](/concepts/app-overview). - **Public Foreground** — An image shown on the right-side pane of public pages; max 400px width - **Public Background** — An image displayed behind the above foreground image, shown full-bleed @@ -35,8 +44,11 @@ prject's [public pages](#). - **Public Note** — A helpful note displayed at the bottom of the right-side pane of public pages; supports markdown for rich-text formatting -::: Default Background Color When a Public Background image is not set, the right-side pane of -public pages uses the Project Color instead. ::: + +::: tip Default Background Color +When a Public Background image is not set, the right-side pane of public pages uses the Project Color instead. +::: + ## Themes & Custom CSS @@ -61,25 +73,26 @@ project Settings. 3. Enter any **valid CSS** 4. Click the **Save** action button in the header -::: Action Styling The `--primary` variable (and its shades) control call-to-actions and all other -"Directus blue" elements within the App. While it may be tempting to override this variable with -your brand's color, please first review the following warnings: + + +::: tip Action Styling The `--primary` variable (and its shades) control call-to-actions and all +other "Directus blue" elements within the App. While it may be tempting to override this variable +with your brand's color, please first review the following warnings: - Avoid using yellow, orange, or red hues that give a sense of "danger" - Avoid low-contrast colors like yellows, grays, etc, that might not be easily visible -- Avoid low-saturation colors like black, which might not properly highlight CTAs - -::: +- Avoid low-saturation colors like black, which might not properly highlight CTAs ::: + ## API Reference -In addition to the static core docs, Directus also includes a [Dynamic API Reference](#) based on -your project's schema. This includes tailored endpoint info for each collection within your data -model, customizing the documentation to your specific project. +In addition to the static core docs, Directus also includes a Dynamic API Reference based on your +project's schema. This includes tailored endpoint info for each collection within your data model, +customizing the documentation to your specific project. -## System Table Prefix + diff --git a/docs/reference/api/activity.md b/docs/reference/api/activity.md deleted file mode 100644 index c2babc5ec7..0000000000 --- a/docs/reference/api/activity.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Activity', - 'description': - 'All events that happen within Directus are tracked and stored in the activities - collection. This gives you full accountability over everything that happens.', - 'x-collection': 'directus_activity', - }, -} ---- - -# Activity - -All events that happen within Directus are tracked and stored in the activities collection. This -gives you full accountability over everything that happens. diff --git a/docs/reference/api/assets.md b/docs/reference/api/assets.md deleted file mode 100644 index 9a08c94ee4..0000000000 --- a/docs/reference/api/assets.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Assets', - 'description': - 'Image typed files can be dynamically resized and transformed to fit any need.', - }, -} ---- - -# Assets - -Image typed files can be dynamically resized and transformed to fit any need. diff --git a/docs/reference/api/authentication.md b/docs/reference/api/authentication.md deleted file mode 100644 index 1fe861eabe..0000000000 --- a/docs/reference/api/authentication.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Authentication', - 'description': - 'All events that happen within Directus are tracked and stored in the activities - collection. This gives you full accountability over everything that happens.', - }, -} ---- - -# Authentication - -All events that happen within Directus are tracked and stored in the activities collection. This -gives you full accountability over everything that happens. diff --git a/docs/reference/api/collections.md b/docs/reference/api/collections.md deleted file mode 100644 index 1f50c9afca..0000000000 --- a/docs/reference/api/collections.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Collections', - 'description': - 'Collections are the individual collections of items, similar to tables in a - database. Changes to collections will alter the schema of the database.', - 'x-collection': 'directus_collections', - }, -} ---- - -# Collections - -Collections are the individual collections of items, similar to tables in a database. Changes to -collections will alter the schema of the database. diff --git a/docs/reference/api/extensions.md b/docs/reference/api/extensions.md deleted file mode 100644 index aed686070d..0000000000 --- a/docs/reference/api/extensions.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Extensions', - 'description': - 'Directus can easily be extended through the addition of several types of - extensions, including layouts, interfaces, and modules.', - }, -} ---- - -# Extensions - -Directus can easily be extended through the addition of several types of extensions, including -layouts, interfaces, and modules. diff --git a/docs/reference/api/fields.md b/docs/reference/api/fields.md deleted file mode 100644 index 30b1b290cb..0000000000 --- a/docs/reference/api/fields.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Fields', - 'description': - 'Fields are individual pieces of content within an item. They are mapped to columns - in the database.', - 'x-collection': 'directus_fields', - }, -} ---- - -# Fields - -Fields are individual pieces of content within an item. They are mapped to columns in the database. diff --git a/docs/reference/api/files.md b/docs/reference/api/files.md deleted file mode 100644 index 9ca482124d..0000000000 --- a/docs/reference/api/files.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Files', - 'description': - 'Files can be saved in any given location. Directus has a powerful assets endpoint - that can be used to generate thumbnails for images on the fly.', - 'x-collection': 'directus_files', - }, -} ---- - -# Files - -Files can be saved in any given location. Directus has a powerful assets endpoint that can be used -to generate thumbnails for images on the fly. diff --git a/docs/reference/api/folders.md b/docs/reference/api/folders.md deleted file mode 100644 index a80f8e3258..0000000000 --- a/docs/reference/api/folders.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Folders', - 'description': 'Group files by virtual folders.', - 'x-collection': 'directus_folders', - }, -} ---- - -# Folders - -Group files by virtual folders. diff --git a/docs/reference/api/items.md b/docs/reference/api/items.md deleted file mode 100644 index f1e25c203c..0000000000 --- a/docs/reference/api/items.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Items', - 'description': - 'Items are individual pieces of data in your database. They can be anything, from - articles, to IoT status checks.', - }, -} ---- - -# Items - -Items are individual pieces of data in your database. They can be anything, from articles, to IoT -status checks. diff --git a/docs/reference/api/permissions.md b/docs/reference/api/permissions.md deleted file mode 100644 index afc13a16b1..0000000000 --- a/docs/reference/api/permissions.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Permissions', - 'description': 'Permissions control who has access to what and when.', - 'x-collection': 'directus_permissions', - }, -} ---- - -# Permissions - -Permissions control who has access to what and when. diff --git a/docs/reference/api/presets.md b/docs/reference/api/presets.md deleted file mode 100644 index a19ea123b3..0000000000 --- a/docs/reference/api/presets.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Presets', - 'description': - 'Presets hold the preferences of individual users of the platform. This allows - Directus to show and maintain custom item listings for users of the app.', - 'x-collection': 'directus_presets', - }, -} ---- - -# Presets - -Presets hold the preferences of individual users of the platform. This allows Directus to show and -maintain custom item listings for users of the app. diff --git a/docs/reference/api/query/fields.md b/docs/reference/api/query/fields.md index cb06804d37..e9b2b5eaa3 100644 --- a/docs/reference/api/query/fields.md +++ b/docs/reference/api/query/fields.md @@ -1 +1,3 @@ # Fields + +@TODO diff --git a/docs/reference/api/relations.md b/docs/reference/api/relations.md deleted file mode 100644 index ae649fbb89..0000000000 --- a/docs/reference/api/relations.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Relations', - 'description': - 'What data is linked to what other data. Allows you to assign authors to articles, - products to sales, and whatever other structures you can think of.', - 'x-collection': 'directus_relations', - }, -} ---- - -# Relations - -What data is linked to what other data. Allows you to assign authors to articles, products to sales, -and whatever other structures you can think of. diff --git a/docs/reference/api/revisions.md b/docs/reference/api/revisions.md deleted file mode 100644 index fbb3a79a7c..0000000000 --- a/docs/reference/api/revisions.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Revisions', - 'description': - "Revisions are individual changes to items made. Directus keeps track of changes - made, so you're able to revert to a previous state at will.", - 'x-collection': 'directus_revisions', - }, -} ---- - -# Revisions - -Revisions are individual changes to items made. Directus keeps track of changes made, so you're able -to revert to a previous state at will. diff --git a/docs/reference/api/roles.md b/docs/reference/api/roles.md deleted file mode 100644 index b5e1ae49d3..0000000000 --- a/docs/reference/api/roles.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Roles', - 'description': 'Roles are groups of users that share permissions.', - 'x-collection': 'directus_roles', - }, -} ---- - -# Roles - -Roles are groups of users that share permissions. diff --git a/docs/reference/api/server.md b/docs/reference/api/server.md deleted file mode 100644 index 2f37347bc7..0000000000 --- a/docs/reference/api/server.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Server', - 'description': - "Access to where Directus runs. Allows you to make sure your server has everything - needed to run the platform, and check what kind of latency we're dealing with.", - }, -} ---- - -# Server - -Access to where Directus runs. Allows you to make sure your server has everything needed to run the -platform, and check what kind of latency we're dealing with. diff --git a/docs/reference/api/settings.md b/docs/reference/api/settings.md deleted file mode 100644 index 3f8e6828cd..0000000000 --- a/docs/reference/api/settings.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Settings', - 'description': 'Settings control the way the platform works and acts.', - 'x-collection': 'directus_settings', - }, -} ---- - -# Settings - -Settings control the way the platform works and acts. diff --git a/docs/reference/api/users.md b/docs/reference/api/users.md deleted file mode 100644 index ec4f94dba5..0000000000 --- a/docs/reference/api/users.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Users', - 'description': 'Users are what gives you access to the data.', - 'x-collection': 'directus_users', - }, -} ---- - -# Users - -Users are what gives you access to the data. diff --git a/docs/reference/api/utilities.md b/docs/reference/api/utilities.md deleted file mode 100644 index efe7cab9c3..0000000000 --- a/docs/reference/api/utilities.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': - { - 'name': 'Utilities', - 'description': - 'Directus comes with various utility endpoints you can use to simplify your - development flow.', - }, -} ---- - -# Utilities - -Directus comes with various utility endpoints you can use to simplify your development flow. diff --git a/docs/reference/api/webhooks.md b/docs/reference/api/webhooks.md deleted file mode 100644 index dae02f5a0a..0000000000 --- a/docs/reference/api/webhooks.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -{ - 'layout': 'APIReferenceLayout', - 'tag': { 'name': 'Webhooks', 'description': 'Webhooks.', 'x-collection': 'directus_webhooks' }, -} ---- - -# Webhooks - -Webhooks. diff --git a/docs/reference/environment-variables.md b/docs/reference/environment-variables.md index 8c72ac713c..f67735e4d9 100644 --- a/docs/reference/environment-variables.md +++ b/docs/reference/environment-variables.md @@ -55,10 +55,13 @@ Database user's password. Required when using `pg`, `mysql`, `mysql2`, `oracledb Where to read/write the SQLite database. Required when using `sqlite3`. -::: Additional Database Variables All `DB_*` environment variables are passed to the `connection` + +::: tip Additional Database Variables +All `DB_*` environment variables are passed to the `connection` configuration of a [`Knex` instance](http://knexjs.org). Based on your project's needs, you can extend the `DB_*` environment variables with any config you need to pass to the database instance. ::: + ## Security @@ -145,11 +148,13 @@ limiter used, you must also provide the following configurations.
**Default: - **Memcache** - **`RATE_LIMITER_MEMCACHE`** — Location of your memcache instance -::: Additional Rate Limiter Variables All `RATE_LIMITER_*` variables are passed directly to a + +::: tip Additional Rate Limiter Variables All `RATE_LIMITER_*` variables are passed directly to a `rate-limiter-flexible` instance. Depending on your project's needs, you can extend the above environment variables to configure any of [the `rate-limiter-flexible` options](https://github.com/animir/node-rate-limiter-flexible/wiki/Options). ::: + ## Cache @@ -161,8 +166,12 @@ Whether or not caching is enabled.
**Default: `false`** How long the cache is persisted.
**Default: `30m`** -:::warning Forced Flush Regardless of TTL, the cache is always flushed for every create, update, and -delete action. ::: + +::: warning Forced Flush +Regardless of TTL, the cache is always flushed for every create, update, and +delete action. +::: + ### `CACHE_NAMESPACE` diff --git a/docs/reference/error-codes.md b/docs/reference/error-codes.md index 2b22ef7812..f67ebe1107 100644 --- a/docs/reference/error-codes.md +++ b/docs/reference/error-codes.md @@ -1,5 +1,7 @@ # Error Codes +@TODO + | Error Code | Description | | --------------------- | ---------------------------------------------- | | `FAILED_VALIDATION` | Validation for this particular item failed | @@ -12,5 +14,9 @@ | `ROUTE_NOT_FOUND` | Endpoint does not exist | | `SERVICE_UNAVAILABLE` | Could not use external service | -:::warning Security To prevent leaking which items exist, all actions for non-existing items will -return a `FORBIDDEN` error. ::: + +::: warning Security +To prevent leaking which items exist, all actions for non-existing items will +return a `FORBIDDEN` error. +::: + diff --git a/docs/reference/filter-rules.md b/docs/reference/filter-rules.md index 23a1827793..37d33446ea 100644 --- a/docs/reference/filter-rules.md +++ b/docs/reference/filter-rules.md @@ -4,6 +4,8 @@ > define their rules. This page describes the syntax for creating flat, relational, or complex > filter rules. +@TODO check+extend + ## Syntax - **Field** — Any valid root field, [relational field](#), or [logical operator](#) @@ -72,8 +74,8 @@ ## Relational You can target related values by nesting field names. For example, if you have a relational -[Many-to-One](#) `author` field, you can set a rule for the `author.name` field using the following -syntax. +[Many-to-One](/guides/field-types/many-to-one-field) `author` field, you can set a rule for the +`author.name` field using the following syntax. ```json { From 66517fdd2b66f094983fc41288e737f844b026d6 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 18:02:47 -0500 Subject: [PATCH 093/357] Soft-launch new docs --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index cb144d9f43..ac0bf60738 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.19-1", "description": "", "main": "index.js", "scripts": { From 10a63ca1f3fb83402273a0dc79da461ecf3a1284 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 18:07:16 -0500 Subject: [PATCH 094/357] Add version notice --- docs/getting-started/introduction.md | 7 +++++++ docs/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index d7516ad83a..37940e6762 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -3,6 +3,13 @@ > These Docs will help get you up-and-running quickly, guide you through advanced features, and > explain the concepts that make Directus so unique. + +::: warning +Important: This is the documentation for the new Directus 9 platform written in Node.js. +If you are looking for the previous Directus 8 (PHP) docs, you can find them [here](https://v8.docs.directus.io). +::: + + ## What is Directus? **Directus is an open-source platform that provides a real-time API and intuitive Admin App for your diff --git a/docs/package.json b/docs/package.json index ac0bf60738..9f02b98d02 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.19-1", + "version": "9.0.0-rc.19-2", "description": "", "main": "index.js", "scripts": { From 68d3df37b52f086ad9e75742b46a7faa666fe6a7 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 1 Dec 2020 18:25:23 -0500 Subject: [PATCH 095/357] Fix info blocks --- docs/getting-started/contributing.md | 8 ++++++-- docs/getting-started/introduction.md | 8 ++++++-- docs/package.json | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/getting-started/contributing.md b/docs/getting-started/contributing.md index 73f9d2c2bb..ecb7c30fc8 100644 --- a/docs/getting-started/contributing.md +++ b/docs/getting-started/contributing.md @@ -27,10 +27,14 @@ Feature requests are a great way to let our team know what should be prioritized upvote [existing submissions](https://github.com/directus/directus/discussions) all via our GitHub Discussions board. -::: warning The 80/20 Rule To keep the Directus codebase as clean and simple as possible, we will + +::: warning The 80/20 Rule +To keep the Directus codebase as clean and simple as possible, we will only consider approving features that we feel at least 80% of our user-base will find valuable. If your feature request falls within the 20% range, it is considered an edge-case and should be -implemented as an extension. ::: +implemented as an extension. +::: + ## RFCs diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 37940e6762..9618597ac4 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -84,8 +84,12 @@ up-to-date! - Guides: Problem Oriented. Follow along with steps while working. - Reference: Information Oriented. Look up info and specs while working. -::: tip Versioned Docs Docs for specific versions of Directus 9+ are available within the individual -Project's App Documentation module. ::: + +::: tip Versioned Docs +Docs for specific versions of Directus 9+ are available within the individual +Project's App Documentation module. +::: + +::: danger Immutable Keys +The collection name, primary key name/type, and system field names can not +be modified after the collection is created. +::: + -::: Database Tables Keep in mind that Directus Collections are just a database tables. Therefore you + +::: tip Database Tables +Keep in mind that Directus Collections are just a database tables. Therefore you can import or create a table directly in the database, and it will automatically appear within Directus. The first time you manage that table, a `directus_collections` record will be created with -default values. ::: +default values. +::: + ## Configuring a Collection @@ -108,6 +116,6 @@ configured for you. ::: danger Irreversible Change This action is permanent and can not be undone. Please proceed with -caution. +caution. ::: diff --git a/docs/guides/projects.md b/docs/guides/projects.md index 8ea4e25e6b..4c6fad0a44 100644 --- a/docs/guides/projects.md +++ b/docs/guides/projects.md @@ -39,7 +39,7 @@ accepts a number of environment variables, each is explained in the following re 5. **Delete all Directus system tables** (`directus_*`) from the database -::: Pure SQL +::: tip Pure SQL After completing this process, you will be left with a pure SQL database, with no trace that Directus was ever installed. Any external services connecting to your database's project tables directly (eg: SQL queries) should continue working normally. diff --git a/docs/guides/roles-and-permissions.md b/docs/guides/roles-and-permissions.md index a82ff6b80c..4a9be9c896 100644 --- a/docs/guides/roles-and-permissions.md +++ b/docs/guides/roles-and-permissions.md @@ -67,11 +67,19 @@ Module Navigation field using the Raw Value field label option. ] ``` -:::warning Settings Module The settings module is not controlled by this configuration. It is always -added to the end of the list for any user's with Admin Access. ::: + +::: warning Settings Module +The settings module is not controlled by this configuration. It is always +added to the end of the list for any user's with Admin Access. +::: + -::: Customizing Existing Modules You can enter the link to an existing module to customize its name -or icon. For example, you can use `/collections` to override the Collections module. ::: + +::: tip Customizing Existing Modules +You can enter the link to an existing module to customize its name +or icon. For example, you can use `/collections` to override the Collections module. +::: + ### Customizing the Collection Navigation @@ -158,7 +166,7 @@ simply click the "System Collections" toggle, and then edit permissions using th project collections. -::: Resetting System Permissions +::: tip Resetting System Permissions To reset the role's system permissions for proper App access, expand the system collections and then click "Reset System Permissions" at the bottom of the listing. @@ -180,14 +188,14 @@ permissions. They can then be reassigned to a new role by an admin. -:::warning Last Admin +::: warning Last Admin You must maintain at least one role/user with Admin Access so that you can still properly manage the project. ::: -:::warning Public Role +::: warning Public Role You can not delete the Public role, as it is part of the core platform. To disable it completely, simply turn off all Public access permissions. ::: diff --git a/docs/nav-web.yaml b/docs/nav-web.yaml index 13c32f56f9..3c854219b6 100644 --- a/docs/nav-web.yaml +++ b/docs/nav-web.yaml @@ -6,6 +6,9 @@ - type: page path: /getting-started/introduction title: Introduction + - type: page + path: /getting-started/installation + title: Installation - type: page path: /getting-started/support title: Support @@ -27,6 +30,9 @@ - type: page path: /concepts/app-extensions title: App Extensions + - type: page + path: /concepts/api-extensions + title: API Extensions - type: page path: /concepts/activity-and-versions title: Activity & Versions diff --git a/docs/package.json b/docs/package.json index 4fb0b4f8d8..2ad3691056 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.19-3", + "version": "9.0.0-rc.19-4", "description": "", "main": "index.js", "scripts": { From 8c5db5d9277e9cf11e9177a0a5ce4aed3ab12d5f Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Wed, 2 Dec 2020 12:28:19 -0500 Subject: [PATCH 097/357] Update docs docs docs --- docs/concepts/app-overview.md | 2 +- docs/getting-started/contributing.md | 23 ++++-- docs/getting-started/installation.md | 17 ++-- docs/getting-started/introduction.md | 4 +- docs/guides/installation/aws.md | 69 +++++++++++++++- .../installation/digitalocean-app-platform.md | 40 ++++++++++ .../installation/digitalocean-droplet.md | 3 - .../installation/digitalocean-one-click.md | 18 ----- docs/guides/installation/docker.md | 78 ++++++++++++++++--- docs/guides/installation/google-app-engine.md | 3 - docs/guides/installation/heroku.md | 3 - docs/guides/installation/manual.md | 34 ++++++-- docs/guides/installation/microsoft-azure.md | 3 - docs/guides/setup/caddy.md | 14 +++- docs/guides/setup/nginx.md | 16 +++- docs/nav-web.yaml | 32 ++++++-- docs/package-lock.json | 2 +- docs/package.json | 2 +- 18 files changed, 287 insertions(+), 76 deletions(-) delete mode 100644 docs/guides/installation/digitalocean-droplet.md delete mode 100644 docs/guides/installation/digitalocean-one-click.md delete mode 100644 docs/guides/installation/google-app-engine.md delete mode 100644 docs/guides/installation/heroku.md delete mode 100644 docs/guides/installation/microsoft-azure.md diff --git a/docs/concepts/app-overview.md b/docs/concepts/app-overview.md index cddecad78b..69c1c81b65 100644 --- a/docs/concepts/app-overview.md +++ b/docs/concepts/app-overview.md @@ -215,7 +215,7 @@ in a modal window with the following fields: - **Collection** — The collection affected by the action - **Item** — The item (within the above Collection) affected by the action -# Settings +## Settings This module is only available to users within [admin roles](/concepts/users-roles-and-permissions#administrators-role). This is where your project diff --git a/docs/getting-started/contributing.md b/docs/getting-started/contributing.md index ecb7c30fc8..88e0fc101d 100644 --- a/docs/getting-started/contributing.md +++ b/docs/getting-started/contributing.md @@ -6,15 +6,19 @@ ## Node Monorepo -Our Node.js repository is located at `directus/directus` and houses the Admin App (vue.js 3), -Node.js API, project documentation (markdown), and API Specification (OpenAPI). Directus follows a -monorepo design similar to React or Babel — to learn more about our monorepo's design and structure, -see our [Codebase Overview](#codebase-overview) below. +Our Node.js repository is located at `directus/directus` and houses the Admin App (Vue.js 3), +Node.js API, project documentation (Markdown), API Specification (OpenAPI), and other smaller +packages used internally. Directus follows a monorepo design similar to React or Babel — to learn +more about our monorepo's design and structure, see our [Codebase Overview](#codebase-overview) +below. -To contribute to the project, please follow the instructions located within our GitHub repoitory's +To contribute to the project, please follow the instructions located within our GitHub repository's [contributing.md file](https://github.com/directus/directus/blob/main/contributing.md). - +::: tip Development +Environment Developers looking to work on the project's source code should +follow our [Contributing Guide](/getting-started/contributing). +::: + ## Deployment Guides - [Amazon AWS](/guides/installation/aws) -- [DigitalOcean Droplet](/guides/installation/digitalocean-droplet) -- [DigitalOcean One-Click](/guides/installation/digitalocean-one-click) - [DigitalOcean App Platform](/guides/installation/digitalocean-app-platform) + + ## Optional Setup Guides diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 9618597ac4..699a454df8 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -1,4 +1,4 @@ -# 🐰 Welcome to the Directus Docs! +# Directus Docs > These Docs will help get you up-and-running quickly, guide you through advanced features, and > explain the concepts that make Directus so unique. @@ -19,7 +19,7 @@ headless CMS for managing project content, a database client for modeling and vi as a standalone customizable WebApp. -::: details What's in a name? +::: tip What's in a name? Directus ([duh REKT iss](http://audio.pronouncekiwi.com/Salli/Directus)) is latin for: _laid straight, arranged in lines_. The broadest goal of Directus is to present data in a simple, orderly, and intuitive way. diff --git a/docs/guides/installation/aws.md b/docs/guides/installation/aws.md index b3598eecb5..03ccbf4c71 100644 --- a/docs/guides/installation/aws.md +++ b/docs/guides/installation/aws.md @@ -1,3 +1,70 @@ # AWS -@TODO +While there are many different ways to run Directus on AWS, from single EC2 instances to a full ELB +load-balanced configuration, we like the following combination of services: + +- Elastic Beanstalk (EB) + - Elastic Load-Balancer (ELB) + - Elastic Compute Cloud (EC2) +- CodeDeploy +- Simple Storage Service (S3) +- Relational Database Service (RDS) (Aurora) +- CloudFront +- Route 53 + +## Elastic Beanstalk + +Will run Directus in an autoscaling environment with a load balancer. Makes sure the instances stay +alive, and will replace individual instances in case of unexpected crashes. + +We recommend setting up a repo in GitHub (or another Git provider) and configuring it using +[our manual installation flow](/guides/installation/aws). This allows you to later hook up the repo +to your Elastic Beanstalk instance through CodeDeploy. + +See +[Deploying Node.js applications to Elastic Beanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.html) +for more information. + +Directus' configuration is all set through environment variables. For a full overview of all +available environment variables, see [Environment Variables](/reference/environment-variables) + +## CodeDeploy + +Allows you to automatically deploy updates to your Directus instance or extensions to Elastic +Beanstalk. + +See +[Automatically Deploy from GitHub Using AWS CodeDeploy](https://aws.amazon.com/blogs/devops/automatically-deploy-from-github-using-aws-codedeploy/) +for more information. + +## Simple Storage Service (S3) + +Ideal place to store files uploaded to Directus. Your bucket doesn't have to be publicly accessible +to the web; Directus will stream files from and to the bucket in its /asset endpoint. + +See [Creating a bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html) for +more information. + +## Relational Database Service (RDS) (Aurora) + +While you can technically use any of the SQL based databases offered in AWS, we like to use Aurora. +It's auto-scaling and use-based costs have worked out pretty well for us in the past. + +## CloudFront + +While it's not a technical requirement, it's not a bad idea to configure a CloudFront instance in +front of your EB environment. This protects you from DDoS attacks and allows you to cache repeated +calls to assets in its CDN. + +See +[Using Elastic Beanstalk with Amazon CloudFront](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudfront.html) +for more information. + +## Route 53 + +The last piece of this puzzle is to assign a domain name to your CloudFront instance. You can use +Route 53 for this purpose. + +See +[Routing traffic to an Amazon CloudFront web distribution by using your domain name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) +for more information. diff --git a/docs/guides/installation/digitalocean-app-platform.md b/docs/guides/installation/digitalocean-app-platform.md index e61c3150f5..55056afee8 100644 --- a/docs/guides/installation/digitalocean-app-platform.md +++ b/docs/guides/installation/digitalocean-app-platform.md @@ -1 +1,41 @@ # DigitalOcean App Platform + +## 1) Setup a repo on GitHub + +See the doc on [installing Directus manually](/guides/installation/manual) to learn how to configure +this repo + +## 2) Create a Managed Database instance + +We recommend using Postgres 12. The exact size and need for a replica depends on your usage and +project requirements. + +## 3) Create a new App using your previously created repo + +Make sure to select the database you created in step 2 during the configuration wizard. + +## 4) Configure the environment variables + +See [Environment Variables](/reference/environment-variables) for all available environment +variables. + +DigitalOcean requires you to use SSL connections to managed databases. DigitalOcean provides a bunch +of aliases to often used database properties that can be injected when the database is a component +of your app. To enable SSL connections, set the following environment variables: + +``` +DB_SSL__REJECT_UNAUTHORIZED=true +DB_SSL__CA=${my-database-component-name.CA_CERT} +``` + + +::: warning +Make sure to replace `my-database-component-name` with your actual database component name in the above env vars +::: + + + +::: tip +For ease of configuration, you can rely on any of the other DigitalOcean provided aliases. See [How to Use Environment Variables in App Platform](https://www.digitalocean.com/docs/app-platform/how-to/use-environment-variables/) for more information. +::: + diff --git a/docs/guides/installation/digitalocean-droplet.md b/docs/guides/installation/digitalocean-droplet.md deleted file mode 100644 index 77a984bc33..0000000000 --- a/docs/guides/installation/digitalocean-droplet.md +++ /dev/null @@ -1,3 +0,0 @@ -# DigitalOcean Droplet - -@TODO diff --git a/docs/guides/installation/digitalocean-one-click.md b/docs/guides/installation/digitalocean-one-click.md deleted file mode 100644 index de7f792560..0000000000 --- a/docs/guides/installation/digitalocean-one-click.md +++ /dev/null @@ -1,18 +0,0 @@ -# Installing with DigitalOcean's One-Click - -## 1. Create a DigitalOcean Account - -If you don't already have an account you'll need to create one, you can use -[our referral link](https://m.do.co/c/389c62a20bb5) to get \$100 of free credit! - -## 2. Create a Project - -Navigate to the [Directus One-Click App](https://marketplace.digitalocean.com/apps/directus) within -the DigitalOcean Marketplace and follow these steps: - -- Click "Create Directus Droplet" -- Configure your VPS (any plan/size) -- Choose a hostname (anything you want) -- Click "Create Droplet" - -## 3. TK diff --git a/docs/guides/installation/docker.md b/docs/guides/installation/docker.md index 0b3ade5300..052ed04704 100644 --- a/docs/guides/installation/docker.md +++ b/docs/guides/installation/docker.md @@ -1,29 +1,85 @@ # Installing with Docker +Directus is published to both [DockerHub](https://hub.docker.com/r/directus/directus) and +[GitHub Packages](https://github.com/orgs/directus/packages/container/package/directus) under +`directus/directus`. To run Directus straight from DockerHub, run: + ```bash docker run -p 8055:8055 directus/directus ``` -## Installing Specific Versions +### Installing Specific Versions + +For every version we release, we update/publish three tags. This allows you to use the latest +released version, the latest minor (eg v9.1) or a specific version (eg v9.1.2). To run Directus on a +specific version, run: ```bash docker run -p 8055:8055 directus/directus:v9 +# OR docker run -p 8055:8055 directus/directus:v9.1 +# OR docker run -p 8055:8055 directus/directus:v9.1.2 ``` -## Setting Environment Variables +### Create admin user using docker -```bash -docker run -e ENV_VAR=VALUE -p 8055:8055 directus/directus -``` - -## Create admin user using docker - -To create an admin user using specific credentials using docker set the following environment -variables: +The published Docker image will automatically populate the database, and create a user. To configure +the email/password for this first user, pass the following env vars: ```bash DIRECTUS_ADMIN_EMAIL="admin@example.com" -DIRECTUS_ADMIN_PASSWORD="pass" +DIRECTUS_ADMIN_PASSWORD="d1r3ctu5" +``` + +## Docker Compose + +When using Docker compose, you can use the following setup to get you started: + +```yaml +version: '3.2' +services: + database: + image: postgres:12 + volumes: + - ./data/database:/var/lib/postgresql/data + networks: + - directus + ports: + - 5432:5432 + environment: + POSTGRES_USER: 'directus' + POSTGRES_PASSWORD: 'directus' + POSTGRES_DB: 'directus' + + cache: + image: redis:6 + networks: + - directus + ports: + - 6379:6379 + + directus: + image: directus/directus:v9.0.0-rc.19 + ports: + - 8055:8055 + networks: + - directus + environment: + KEY: '255d861b-5ea1-5996-9aa3-922530ec40b1' + SECRET: '6116487b-cda1-52c2-b5b5-c8022c45e263' + + DB_CLIENT: 'pg' + DB_HOST: 'database' + DB_PORT: '5432' + DB_DATABASE: 'directus' + DB_USER: 'directus' + DB_PASSWORD: 'directus' + + CACHE_ENABLED: 'true' + CACHE_STORE: 'redis' + CACHE_REDIS: 'redis://cache:6379' + +networks: + directus: ``` diff --git a/docs/guides/installation/google-app-engine.md b/docs/guides/installation/google-app-engine.md deleted file mode 100644 index 699ef81093..0000000000 --- a/docs/guides/installation/google-app-engine.md +++ /dev/null @@ -1,3 +0,0 @@ -# Google App Engine - -@TODO diff --git a/docs/guides/installation/heroku.md b/docs/guides/installation/heroku.md deleted file mode 100644 index 70f707780a..0000000000 --- a/docs/guides/installation/heroku.md +++ /dev/null @@ -1,3 +0,0 @@ -# Installing with Heroku - -## 1. TK diff --git a/docs/guides/installation/manual.md b/docs/guides/installation/manual.md index e133a2c906..2918b35d5c 100644 --- a/docs/guides/installation/manual.md +++ b/docs/guides/installation/manual.md @@ -1,11 +1,29 @@ # Installing Manually -## 1. Setup a Project + +::: tip Automation +We've created a little CLI tool you can run that does this process automatically. For more info, check the doc on [installing through the CLI](/guides/installation/cli). +::: + -Add a `package.json` by running the following command. +## 1. Setup a Project Folder + +And add a `package.json` by running the following command. ```bash -npm init +npm init -y +``` + +We recommend aliasing the `start` script to Directus' start for easier deployments to services like +[AWS](/guides/installation/aws) or +[DigitalOcean App Platform](/guides/installation/digitalocean-app-platform). + +```json +{ + "scripts": { + "start": "directus start" + } +} ``` ## 2. Install Directus @@ -14,9 +32,10 @@ npm init npm install directus ``` -## 3. Install Database Driver +## 3. Install one of the Database Drivers -Choose the [database vendor](#) you will be working with, and install its driver. +Choose the [database vendor](/guides/installation/cli#databases) you will be working with, and +install its driver. ```bash npm install pg @@ -24,9 +43,12 @@ npm install pg ## 4. Install Optional Dependencies -At this point you have the option of installing other dependencies, such as Redis. +At this point you have the option of installing other dependencies. If you're planning on utilizing +Redis/Memcached, make sure to install `ioredis`/`memcached` respectively. ## 5. Setup a Configuration File Finally, you'll need to setup your `.env` file, or configure the environment variables through other means, such as Docker, etc. + +See [Environment Variables](/references/environment-variables) for all available variables. diff --git a/docs/guides/installation/microsoft-azure.md b/docs/guides/installation/microsoft-azure.md deleted file mode 100644 index 998809b973..0000000000 --- a/docs/guides/installation/microsoft-azure.md +++ /dev/null @@ -1,3 +0,0 @@ -# Microsoft Azure - -@TODO diff --git a/docs/guides/setup/caddy.md b/docs/guides/setup/caddy.md index ad7eb4a72b..f100694478 100644 --- a/docs/guides/setup/caddy.md +++ b/docs/guides/setup/caddy.md @@ -1,3 +1,15 @@ # Caddy Setup Guide -@TODO +Run + +```bash +caddy reverse-proxy --to 127.0.0.1:8055 +``` + +or setup a caddy file with the following contents: + +``` +localhost + +reverse_proxy 127.0.0.1:8055 +``` diff --git a/docs/guides/setup/nginx.md b/docs/guides/setup/nginx.md index d29d348ba0..745a3e3943 100644 --- a/docs/guides/setup/nginx.md +++ b/docs/guides/setup/nginx.md @@ -1,3 +1,17 @@ # Nginx Setup Guide -@TODO +You can configure `/etc/nginx/sites-available/default` with the following config to use it as a +reverse proxy to Directus: + +``` +. . . + location / { + proxy_pass http://localhost:8055; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } +} +``` diff --git a/docs/nav-web.yaml b/docs/nav-web.yaml index 3c854219b6..795a3a1f8d 100644 --- a/docs/nav-web.yaml +++ b/docs/nav-web.yaml @@ -1,6 +1,6 @@ # Note: this uses VuePress' sidebar syntax -- title: 🐰 Getting Started +- title: Getting Started collapsable: false children: - type: page @@ -19,7 +19,7 @@ path: /getting-started/backing-directus title: Backing Directus -- title: 🎓 Concepts +- title: Concepts children: - type: page path: /concepts/platform-overview @@ -49,23 +49,41 @@ path: /concepts/users-roles-and-permissions title: Users, Roles, and Permissions -- title: 📖 Guides +- title: Guides children: + - type: page + path: /guides/projects + title: Projects - type: page path: /guides/collections title: Collections - type: page path: /guides/fields title: Fields - - type: page - path: /guides/projects - title: Projects - type: page path: /guides/roles-and-permissions title: Roles & Permissions - type: page path: /guides/presets title: Presets + - type : group + title: Installation + children: + - type: page + path: /guides/installation/cli + title: CLI (Recommended) + - type: page + path: /guides/installation/manual + title: Manually + - type: page + path: /guides/installation/docker + title: Docker + - type: page + path: /guides/installation/digitalocean-app-platform + title: DigitalOcean App Platform + - type: page + path: /guides/installation/aws + title: AWS - type: group title: Extensions children: @@ -97,7 +115,7 @@ path: /guides/extensions/accessing-data title: Accessing Data -- title: 🚀 Reference +- title: Reference children: - type: page path: /reference/environment-variables diff --git a/docs/package-lock.json b/docs/package-lock.json index bf42a84f09..0006a345b1 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,6 +1,6 @@ { "name": "@directus/docs", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.19-4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/docs/package.json b/docs/package.json index 2ad3691056..695c560e49 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.19-4", + "version": "9.0.0-rc.19-5", "description": "", "main": "index.js", "scripts": { From f5c453b02cc25dee55758db65f535348b67b891f Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Wed, 2 Dec 2020 16:59:41 -0300 Subject: [PATCH 098/357] Removed background-color from m2a-builder class --- app/src/interfaces/m2a-builder/m2a-builder.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/interfaces/m2a-builder/m2a-builder.vue b/app/src/interfaces/m2a-builder/m2a-builder.vue index b370a2f56a..18f5dbd9f5 100644 --- a/app/src/interfaces/m2a-builder/m2a-builder.vue +++ b/app/src/interfaces/m2a-builder/m2a-builder.vue @@ -576,9 +576,9 @@ export default defineComponent({ From 2785135d3420057b6be220afdce6e1a004b1183e Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Thu, 3 Dec 2020 13:04:20 -0500 Subject: [PATCH 110/357] Update README.md --- api/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/README.md b/api/README.md index f165fad303..eb85c373b3 100644 --- a/api/README.md +++ b/api/README.md @@ -4,9 +4,6 @@ Welcome to the preview release of the next major version of Directus. -**NOTE:** This is pre-release software and should be treated as such. DO NOT use this in production. -Migrations between versions aren't provided, and breaking changes might happen at any release. - ## ⚙️ Installation _Directus requires NodeJS 10+_ From 9091d6e03895f930ec48a08a364b668ee73d15af Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Thu, 3 Dec 2020 13:19:52 -0500 Subject: [PATCH 111/357] More adventures in package-lock --- package-lock.json | 191 ++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9bafc8784b..30c70cfa1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7106,13 +7106,6 @@ "supports-color": "^5.3.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -7150,76 +7143,6 @@ "worker-rpc": "^0.1.0" } }, - "fork-ts-checker-webpack-plugin-v5": { - "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", - "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", - "dev": true, - "optional": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@types/json-schema": "^7.0.5", - "chalk": "^4.1.0", - "cosmiconfig": "^6.0.0", - "deepmerge": "^4.2.2", - "fs-extra": "^9.0.0", - "memfs": "^3.1.2", - "minimatch": "^3.0.4", - "schema-utils": "2.7.0", - "semver": "^7.3.2", - "tapable": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true, - "optional": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "globby": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", @@ -7236,13 +7159,6 @@ "slash": "^2.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -7266,18 +7182,6 @@ } } }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "dev": true, - "optional": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -7674,9 +7578,9 @@ "dev": true }, "vue-loader-v16": { - "version": "npm:vue-loader@16.0.0-rc.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.2.tgz", - "integrity": "sha512-cz8GK4dgIf1UTC+do80pGvh8BHcCRHLIQVHV9ONVQ8wtoqS9t/+H02rKcQP+TVNg7khgLyQV2+8eHUq7/AFq3g==", + "version": "npm:vue-loader@16.1.0", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz", + "integrity": "sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ==", "dev": true, "optional": true, "requires": { @@ -17008,6 +16912,95 @@ } } }, + "fork-ts-checker-webpack-plugin-v5": { + "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", + "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", + "dev": true, + "optional": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/json-schema": "^7.0.5", + "chalk": "^4.1.0", + "cosmiconfig": "^6.0.0", + "deepmerge": "^4.2.2", + "fs-extra": "^9.0.0", + "memfs": "^3.1.2", + "minimatch": "^3.0.4", + "schema-utils": "2.7.0", + "semver": "^7.3.2", + "tapable": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, + "optional": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "form-data": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", From 5bcb004ca690390379517436b9eed54f376206fb Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Thu, 3 Dec 2020 13:23:00 -0500 Subject: [PATCH 112/357] v9.0.0-rc.20 --- api/package.json | 2 +- app/package.json | 2 +- docs/package-lock.json | 2 +- docs/package.json | 2 +- lerna.json | 2 +- packages/create-directus-project/package.json | 2 +- packages/format-title/package.json | 2 +- packages/schema/package.json | 2 +- packages/sdk-js/package.json | 2 +- packages/specs/package-lock.json | 2 +- packages/specs/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/package.json b/api/package.json index 0c8e0af828..a378db06c0 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "directus", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "license": "GPL-3.0-only", "homepage": "https://github.com/directus/directus#readme", "description": "Directus is a real-time API and App dashboard for managing SQL database content.", diff --git a/app/package.json b/app/package.json index 3f589ce14a..3f731550b8 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@directus/app", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "private": false, "description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases", "author": "Rijk van Zanten ", diff --git a/docs/package-lock.json b/docs/package-lock.json index 0006a345b1..27b7b00be4 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,6 +1,6 @@ { "name": "@directus/docs", - "version": "9.0.0-rc.19-4", + "version": "9.0.0-rc.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/docs/package.json b/docs/package.json index 695c560e49..d58a0309ff 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.19-5", + "version": "9.0.0-rc.20", "description": "", "main": "index.js", "scripts": { diff --git a/lerna.json b/lerna.json index 2fa73a493d..c6032710b8 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,7 @@ "docs", "packages/*" ], - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "command": { "bootstrap": { "npmClientArgs": [ diff --git a/packages/create-directus-project/package.json b/packages/create-directus-project/package.json index 8bf9d05518..d263fcec5b 100644 --- a/packages/create-directus-project/package.json +++ b/packages/create-directus-project/package.json @@ -1,6 +1,6 @@ { "name": "create-directus-project", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "description": "A small installer util that will create a directory, add boilerplate folders, and install Directus through npm.", "main": "lib/index.js", "bin": "./lib/index.js", diff --git a/packages/format-title/package.json b/packages/format-title/package.json index d04db4824a..bc68f0c21b 100644 --- a/packages/format-title/package.json +++ b/packages/format-title/package.json @@ -1,6 +1,6 @@ { "name": "@directus/format-title", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "description": "Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)", "keywords": [ "title-case", diff --git a/packages/schema/package.json b/packages/schema/package.json index 3753fe661c..228f5737a9 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@directus/schema", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "description": "Utility for extracting information about existing DB schema", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk-js/package.json b/packages/sdk-js/package.json index c52ff27086..149aaa74da 100644 --- a/packages/sdk-js/package.json +++ b/packages/sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "@directus/sdk-js", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "description": "The official Directus SDK for use in JavaScript!", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/specs/package-lock.json b/packages/specs/package-lock.json index 705b1e2398..62e9c53c40 100644 --- a/packages/specs/package-lock.json +++ b/packages/specs/package-lock.json @@ -1,6 +1,6 @@ { "name": "@directus/specs", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/specs/package.json b/packages/specs/package.json index a0a65df12f..4d943b4d4c 100644 --- a/packages/specs/package.json +++ b/packages/specs/package.json @@ -1,6 +1,6 @@ { "name": "@directus/specs", - "version": "9.0.0-rc.19", + "version": "9.0.0-rc.20", "description": "OpenAPI Specification of the Directus API", "main": "index.js", "scripts": { From af38cd22288fede606ba97110a6d9c43ffd5e98b Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Fri, 4 Dec 2020 04:02:42 +0100 Subject: [PATCH 113/357] Add format-title dependency to the app package This fixes typescript not finding the format-title package while building the app. --- app/package.json | 3 + package-lock.json | 191 +++++++++++++++++++++++++--------------------- 2 files changed, 105 insertions(+), 89 deletions(-) diff --git a/app/package.json b/app/package.json index 3f731550b8..8def2ff6bd 100644 --- a/app/package.json +++ b/app/package.json @@ -29,6 +29,9 @@ "prepublishOnly": "npm run build" }, "gitHead": "4476da28dbbc2824e680137aa28b2b91b5afabec", + "dependencies": { + "@directus/format-title": "file:../packages/format-title" + }, "devDependencies": { "@vue/cli-plugin-babel": "^4.5.8", "@vue/cli-plugin-eslint": "^4.5.8", diff --git a/package-lock.json b/package-lock.json index 30c70cfa1b..4f901ea386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1935,6 +1935,9 @@ }, "@directus/app": { "version": "file:app", + "requires": { + "@directus/format-title": "file:packages/format-title" + }, "dependencies": { "jsonlint": { "version": "1.6.3", @@ -7106,6 +7109,13 @@ "supports-color": "^5.3.0" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -7143,6 +7153,79 @@ "worker-rpc": "^0.1.0" } }, + "fork-ts-checker-webpack-plugin-v5": { + "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", + "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", + "dev": true, + "optional": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/json-schema": "^7.0.5", + "chalk": "^4.1.0", + "cosmiconfig": "^6.0.0", + "deepmerge": "^4.2.2", + "fs-extra": "^9.0.0", + "memfs": "^3.1.2", + "minimatch": "^3.0.4", + "schema-utils": "2.7.0", + "semver": "^7.3.2", + "tapable": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "optional": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "globby": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", @@ -7159,6 +7242,13 @@ "slash": "^2.0.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -7182,6 +7272,18 @@ } } }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, + "optional": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -16912,95 +17014,6 @@ } } }, - "fork-ts-checker-webpack-plugin-v5": { - "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", - "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", - "dev": true, - "optional": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@types/json-schema": "^7.0.5", - "chalk": "^4.1.0", - "cosmiconfig": "^6.0.0", - "deepmerge": "^4.2.2", - "fs-extra": "^9.0.0", - "memfs": "^3.1.2", - "minimatch": "^3.0.4", - "schema-utils": "2.7.0", - "semver": "^7.3.2", - "tapable": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "dev": true, - "optional": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "form-data": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", From 4f84b15850b66ef985c2809ab23a009079a9fce7 Mon Sep 17 00:00:00 2001 From: Meldiron Date: Fri, 4 Dec 2020 17:12:53 +0100 Subject: [PATCH 114/357] Fixed documentation bux `color` should be `type` as described by props in component itself. --- app/src/components/v-notice/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/v-notice/readme.md b/app/src/components/v-notice/readme.md index 29baec1b82..efd0b5ffb8 100644 --- a/app/src/components/v-notice/readme.md +++ b/app/src/components/v-notice/readme.md @@ -7,7 +7,7 @@ ## Props | Prop | Description | Default | |-----------|--------------------------------------------------------------------|---------| -| `color` | One of `info`, `success`, `warning`, `danger` | `info` | +| `type` | One of `info`, `success`, `warning`, `danger` | `info` | | `icon` | Custom icon name, or false if you want to hide the icon completely | `null` | | `center` | Render notice content centered | `false` | From 8123e1fa9b705619ffe2935acf7b07c8989f8c9f Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Fri, 4 Dec 2020 15:39:31 -0500 Subject: [PATCH 115/357] Create website-docs-deploy.yml --- .github/workflows/website-docs-deploy.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/website-docs-deploy.yml diff --git a/.github/workflows/website-docs-deploy.yml b/.github/workflows/website-docs-deploy.yml new file mode 100644 index 0000000000..f5340603c0 --- /dev/null +++ b/.github/workflows/website-docs-deploy.yml @@ -0,0 +1,21 @@ +name: Deploy Website / Docs + +on: + schedule: + - cron: '59 23 * * *' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: satak/webrequest-action@master + with: + url: {{ secrets.BUILD_HOOK_WEBSITE }} + method: POST + + - uses: satak/webrequest-action@master + with: + url: {{ secrets.BUILD_HOOK_DOCS }} + method: POST From 52d4890b190c892a58baf233a19a19d0e3546944 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Fri, 4 Dec 2020 15:41:03 -0500 Subject: [PATCH 116/357] Update website-docs-deploy.yml --- .github/workflows/website-docs-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/website-docs-deploy.yml b/.github/workflows/website-docs-deploy.yml index f5340603c0..031aca12ba 100644 --- a/.github/workflows/website-docs-deploy.yml +++ b/.github/workflows/website-docs-deploy.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: satak/webrequest-action@master with: - url: {{ secrets.BUILD_HOOK_WEBSITE }} + url: ${{ secrets.BUILD_HOOK_WEBSITE }} method: POST - uses: satak/webrequest-action@master with: - url: {{ secrets.BUILD_HOOK_DOCS }} + url: ${{ secrets.BUILD_HOOK_DOCS }} method: POST From 6eef331b3c8013cbb052d1118171e837ce21ff03 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Fri, 4 Dec 2020 18:01:22 -0500 Subject: [PATCH 117/357] Add missing env vars --- docs/reference/environment-variables.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/reference/environment-variables.md b/docs/reference/environment-variables.md index 7b381050fb..9d2bd8f35e 100644 --- a/docs/reference/environment-variables.md +++ b/docs/reference/environment-variables.md @@ -65,7 +65,8 @@ extend the `DB_*` environment variables with any config you need to pass to the ### `DB_CONNECTION_STRING` (Postgres Only) -When using Postgres, you can submit a connection string instead of individual properties. Using this will ignore any of the other connection settings. +When using Postgres, you can submit a connection string instead of individual properties. Using this +will ignore any of the other connection settings. ## Security @@ -100,6 +101,14 @@ Value for `sameSite` in the refresh token cookie when in cookie mode.
**Defau Whether or not to enable the CORS headers.
**Default: `true`** +### `CORS_ORIGIN` + +Value for the `Access-Control-Allow-Origin` header. Possible values: + +- `true` - reflect the Origin header +- String - set the origin to a specific domain +- CSV - multiple domains + ### `CORS_METHODS` Value for the `Access-Control-Allow-Methods` header.
**Default: `GET,POST,PATCH,DELETE`** From 2055ce27fa8cba2e31b291726ed10e4222675646 Mon Sep 17 00:00:00 2001 From: e01 Date: Sun, 6 Dec 2020 12:41:39 +0200 Subject: [PATCH 118/357] Fix v-fancy-select icon stretching --- app/src/components/v-fancy-select/v-fancy-select.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/v-fancy-select/v-fancy-select.vue b/app/src/components/v-fancy-select/v-fancy-select.vue index cf0d8c8611..7cd5518b3c 100644 --- a/app/src/components/v-fancy-select/v-fancy-select.vue +++ b/app/src/components/v-fancy-select/v-fancy-select.vue @@ -115,7 +115,7 @@ export default defineComponent({ } .content { - flex-grow: 1; + flex: 1; .description { opacity: 0.6; From a4ceab217d9419e6a5d018fbf7b8b8c59908a67c Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Sun, 6 Dec 2020 23:07:52 +0100 Subject: [PATCH 119/357] Improve cli init error message --- api/src/cli/commands/init/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/cli/commands/init/index.ts b/api/src/cli/commands/init/index.ts index 883ce402db..f5a4dbc2d4 100644 --- a/api/src/cli/commands/init/index.ts +++ b/api/src/cli/commands/init/index.ts @@ -53,7 +53,7 @@ export default async function init(options: Record) { console.log(); console.log('Something went wrong while seeding the database:'); console.log(); - console.log(`${err.code && chalk.red(`[${err.code}]`)} ${err.message}`); + console.log(`${chalk.red(`[${err.code || 'Error'}]`)} ${err.message}`); console.log(); console.log('Please try again'); console.log(); From 04b0dabdf9cff1e47cc92d4a06bad78ad952f578 Mon Sep 17 00:00:00 2001 From: Jimmy Saenz Date: Sun, 6 Dec 2020 22:39:07 -0600 Subject: [PATCH 120/357] Fix broken link (env variables) --- docs/guides/installation/manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/installation/manual.md b/docs/guides/installation/manual.md index 2918b35d5c..c5a077873b 100644 --- a/docs/guides/installation/manual.md +++ b/docs/guides/installation/manual.md @@ -51,4 +51,4 @@ Redis/Memcached, make sure to install `ioredis`/`memcached` respectively. Finally, you'll need to setup your `.env` file, or configure the environment variables through other means, such as Docker, etc. -See [Environment Variables](/references/environment-variables) for all available variables. +See [Environment Variables](/reference/environment-variables) for all available variables. From b0cc00059202dac570677cea168f19d88f97e874 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 7 Dec 2020 11:54:00 -0500 Subject: [PATCH 121/357] Fix arrow keys in v-input db-safe Fixes #3336 --- app/src/components/v-input/v-input.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/v-input/v-input.vue b/app/src/components/v-input/v-input.vue index 9058553bd1..f8d6aa5bef 100644 --- a/app/src/components/v-input/v-input.vue +++ b/app/src/components/v-input/v-input.vue @@ -165,7 +165,7 @@ export default defineComponent({ if (props.dbSafe === true) { const dbSafeCharacters = 'abcdefghijklmnopqrstuvwxyz01234567890_ '.split(''); - const isAllowed = dbSafeCharacters.includes(key) || systemKeys.includes(key); + const isAllowed = dbSafeCharacters.includes(key) || systemKeys.includes(key) || key.startsWith('arrow'); if (isAllowed === false) { event.preventDefault(); From d6878621b5e65d7fab2ad4a29de797d1a5a8660b Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 7 Dec 2020 12:00:35 -0500 Subject: [PATCH 122/357] UNIX "rm rf" to cross-platforrm Rimraf --- api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/package.json b/api/package.json index a378db06c0..d3b0154126 100644 --- a/api/package.json +++ b/api/package.json @@ -52,7 +52,7 @@ }, "scripts": { "start": "npx directus start", - "build": "rm -rf dist && tsc --build && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist", + "build": "rimraf dist && tsc --build && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist", "dev": "cross-env NODE_ENV=development ts-node-dev --files src/start.ts --respawn --watch \"src/**/*.ts\" --watch \".env\" --transpile-only", "cli": "cross-env NODE_ENV=development ts-node --script-mode --transpile-only src/cli/index.ts", "prepublishOnly": "npm run build" From 70c6484fcc4a44dded37593533776b2ea9ada333 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 7 Dec 2020 14:27:57 -0500 Subject: [PATCH 123/357] Fix download button not having token Fixes #3305 --- app/src/modules/files/routes/item.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/modules/files/routes/item.vue b/app/src/modules/files/routes/item.vue index abf1a8c49b..a3d3983889 100644 --- a/app/src/modules/files/routes/item.vue +++ b/app/src/modules/files/routes/item.vue @@ -417,7 +417,7 @@ export default defineComponent({ } function downloadFile() { - const filePath = getRootPath() + `assets/${props.primaryKey}?download`; + const filePath = addTokenToURL(getRootPath() + `assets/${props.primaryKey}?download`); window.open(filePath, '_blank'); } From 877b32807ec19075d0707c063504d3523f2bc404 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 7 Dec 2020 15:55:38 -0500 Subject: [PATCH 124/357] Add indeterminate state to toggle interface --- app/src/interfaces/toggle/toggle.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/interfaces/toggle/toggle.vue b/app/src/interfaces/toggle/toggle.vue index 90ac29ad63..2e9f64a7f2 100644 --- a/app/src/interfaces/toggle/toggle.vue +++ b/app/src/interfaces/toggle/toggle.vue @@ -5,6 +5,7 @@ :icon-off="iconOff" :label="label" :input-value="value" + :indeterminate="value === null" @change="$listeners.input" :style="{ '--v-checkbox-color': color, From eca57e5be60de664693ce2dbe39d553885239e3a Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 7 Dec 2020 16:02:02 -0500 Subject: [PATCH 125/357] Fix boolean filter value status --- .../private/components/filter-sidebar-detail/filter-input.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/private/components/filter-sidebar-detail/filter-input.vue b/app/src/views/private/components/filter-sidebar-detail/filter-input.vue index 084c57710d..64cdbc427a 100644 --- a/app/src/views/private/components/filter-sidebar-detail/filter-input.vue +++ b/app/src/views/private/components/filter-sidebar-detail/filter-input.vue @@ -46,7 +46,7 @@