@tanglemedia/directus-core-settings 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,6 +95,3 @@ export async function down(knex) {
95
95
  .update({ module_bar: JSON.stringify(existingModuleBar) });
96
96
  }
97
97
  }
98
-
99
-
100
- // http://localhost:8055/flows/trigger/6f8f5b3d-bf36-474f-8920-7f549e3b5450
@@ -0,0 +1,10 @@
1
+ import { createPermission } from "./helpers/permission.mjs";
2
+
3
+
4
+ export async function up(knex) {
5
+ await createPermission(knex, "directus_folders", "Staff", ["create", "read", "update", "delete", "share"]);
6
+ await createPermission(knex, "directus_dashboards", "Staff", ["read"]);
7
+ await createPermission(knex, "directus_panels", "Staff", ["read"]);
8
+ }
9
+
10
+ export async function down(knex) {}
@@ -0,0 +1,45 @@
1
+ const FLEX_CONTENT_COLLECTION = "tngl_flex_content";
2
+ const FLEX_CONTENT_FIELD = "tngl_flx_cntnt";
3
+
4
+ // Adds the tngl_flx_cntnt foreign key column and registers it in Directus for a given collection.
5
+ // Safe to call if tngl_flex_content isn't installed yet or the field already exists.
6
+ export async function addFlexContentField(knex, collectionName) {
7
+ const flexContentExists = await knex.schema.hasTable(FLEX_CONTENT_COLLECTION);
8
+ if (!flexContentExists) return;
9
+
10
+ const fieldExists = await knex.schema.hasColumn(collectionName, FLEX_CONTENT_FIELD);
11
+ if (fieldExists) return;
12
+
13
+ await knex.schema.alterTable(collectionName, (table) => {
14
+ table.uuid(FLEX_CONTENT_FIELD).nullable();
15
+ table
16
+ .foreign(FLEX_CONTENT_FIELD)
17
+ .references("id")
18
+ .inTable(FLEX_CONTENT_COLLECTION)
19
+ .onDelete("SET NULL");
20
+ });
21
+
22
+ await knex("directus_fields").insert({
23
+ collection: collectionName,
24
+ field: FLEX_CONTENT_FIELD,
25
+ special: "m2o",
26
+ interface: "inline-form-m2o",
27
+ options: null,
28
+ display: null,
29
+ display_options: null,
30
+ readonly: false,
31
+ hidden: false,
32
+ sort: 29,
33
+ width: "full",
34
+ translations: JSON.stringify([
35
+ { language: "en-US", translation: " " },
36
+ { language: "en-CA", translation: " " },
37
+ ]),
38
+ note: null,
39
+ conditions: null,
40
+ required: false,
41
+ group: null,
42
+ validation: null,
43
+ validation_message: null,
44
+ });
45
+ }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "license": "MIT",
8
8
  "icon": "extension",
9
- "version": "0.0.7",
9
+ "version": "0.0.9",
10
10
  "keywords": [
11
11
  "directus",
12
12
  "directus-extension",