From fa87fce98412793ed6fb1cfeee3bb3b90ee83d53 Mon Sep 17 00:00:00 2001 From: DrMint Date: Fri, 18 Feb 2022 14:15:27 +0100 Subject: [PATCH] Added some wiki foundation --- .../website-interface/schema.json | 81 ++++++++++--------- .../content-types/wiki-page-type/schema.json | 26 ++++++ .../controllers/wiki-page-type.js | 9 +++ .../wiki-page-type/routes/wiki-page-type.js | 9 +++ .../wiki-page-type/services/wiki-page-type.js | 9 +++ .../content-types/wiki-page/schema.json | 40 +++++++++ src/api/wiki-page/controllers/wiki-page.js | 9 +++ src/api/wiki-page/routes/wiki-page.js | 9 +++ src/api/wiki-page/services/wiki-page.js | 9 +++ .../collections-component/titles.json | 14 ++++ .../wiki-definition.json | 23 ++++++ src/components/sets/wiki-set.json | 59 ++++++++++++++ 12 files changed, 261 insertions(+), 36 deletions(-) create mode 100644 src/api/wiki-page-type/content-types/wiki-page-type/schema.json create mode 100644 src/api/wiki-page-type/controllers/wiki-page-type.js create mode 100644 src/api/wiki-page-type/routes/wiki-page-type.js create mode 100644 src/api/wiki-page-type/services/wiki-page-type.js create mode 100644 src/api/wiki-page/content-types/wiki-page/schema.json create mode 100644 src/api/wiki-page/controllers/wiki-page.js create mode 100644 src/api/wiki-page/routes/wiki-page.js create mode 100644 src/api/wiki-page/services/wiki-page.js create mode 100644 src/components/collections-component/titles.json create mode 100644 src/components/collections-component/wiki-definition.json create mode 100644 src/components/sets/wiki-set.json diff --git a/src/api/website-interface/content-types/website-interface/schema.json b/src/api/website-interface/content-types/website-interface/schema.json index 157bdc1..2a6a1ed 100644 --- a/src/api/website-interface/content-types/website-interface/schema.json +++ b/src/api/website-interface/content-types/website-interface/schema.json @@ -22,24 +22,9 @@ "main_library_description": { "type": "string" }, - "main_hub": { - "type": "string" - }, - "main_hub_description": { - "type": "string" - }, - "main_chronology": { - "type": "string" - }, - "main_chronology_description": { - "type": "string" - }, "main_news": { "type": "string" }, - "main_data": { - "type": "string" - }, "main_merch": { "type": "string" }, @@ -127,27 +112,6 @@ "library_item_type_information": { "type": "string" }, - "chronology_description": { - "type": "text" - }, - "chronology_timelines": { - "type": "string" - }, - "chronology_timelines_description": { - "type": "string" - }, - "chronology_overview": { - "type": "string" - }, - "chronology_overview_description": { - "type": "string" - }, - "chronology_walkthrough": { - "type": "string" - }, - "chronology_walkthrough_description": { - "type": "string" - }, "library_item_front_matter": { "type": "string" }, @@ -201,6 +165,51 @@ }, "global_right_to_left": { "type": "string" + }, + "main_wiki": { + "type": "string" + }, + "main_wiki_description": { + "type": "string" + }, + "main_chronicles": { + "type": "string" + }, + "main_chronicles_description": { + "type": "string" + }, + "library_items": { + "type": "string" + }, + "library_items_description": { + "type": "string" + }, + "library_content": { + "type": "string" + }, + "library_content_description": { + "type": "string" + }, + "wiki_description": { + "type": "text" + }, + "news_description": { + "type": "text" + }, + "chronicles_description": { + "type": "text" + }, + "gallery_description": { + "type": "text" + }, + "archives_description": { + "type": "text" + }, + "about_us_description": { + "type": "text" + }, + "merch_description": { + "type": "text" } } } diff --git a/src/api/wiki-page-type/content-types/wiki-page-type/schema.json b/src/api/wiki-page-type/content-types/wiki-page-type/schema.json new file mode 100644 index 0000000..b458618 --- /dev/null +++ b/src/api/wiki-page-type/content-types/wiki-page-type/schema.json @@ -0,0 +1,26 @@ +{ + "kind": "collectionType", + "collectionName": "wiki_page_types", + "info": { + "singularName": "wiki-page-type", + "pluralName": "wiki-page-types", + "displayName": "🟥 Wiki Page Types", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "slug": { + "type": "string", + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "unique": true, + "required": true + }, + "titles": { + "type": "component", + "repeatable": true, + "component": "translations.simple-title" + } + } +} diff --git a/src/api/wiki-page-type/controllers/wiki-page-type.js b/src/api/wiki-page-type/controllers/wiki-page-type.js new file mode 100644 index 0000000..4c885d1 --- /dev/null +++ b/src/api/wiki-page-type/controllers/wiki-page-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page-type controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::wiki-page-type.wiki-page-type'); diff --git a/src/api/wiki-page-type/routes/wiki-page-type.js b/src/api/wiki-page-type/routes/wiki-page-type.js new file mode 100644 index 0000000..d8221ae --- /dev/null +++ b/src/api/wiki-page-type/routes/wiki-page-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page-type router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::wiki-page-type.wiki-page-type'); diff --git a/src/api/wiki-page-type/services/wiki-page-type.js b/src/api/wiki-page-type/services/wiki-page-type.js new file mode 100644 index 0000000..a0416ae --- /dev/null +++ b/src/api/wiki-page-type/services/wiki-page-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page-type service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::wiki-page-type.wiki-page-type'); diff --git a/src/api/wiki-page/content-types/wiki-page/schema.json b/src/api/wiki-page/content-types/wiki-page/schema.json new file mode 100644 index 0000000..0d7124c --- /dev/null +++ b/src/api/wiki-page/content-types/wiki-page/schema.json @@ -0,0 +1,40 @@ +{ + "kind": "collectionType", + "collectionName": "wiki_pages", + "info": { + "singularName": "wiki-page", + "pluralName": "wiki-pages", + "displayName": "🟥 Wiki Pages", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "slug": { + "type": "string", + "required": true, + "unique": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + }, + "thumbnail": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "wiki_set": { + "displayName": "wiki_set", + "type": "component", + "repeatable": true, + "component": "sets.wiki-set" + }, + "type": { + "type": "relation", + "relation": "oneToOne", + "target": "api::wiki-page-type.wiki-page-type" + } + } +} diff --git a/src/api/wiki-page/controllers/wiki-page.js b/src/api/wiki-page/controllers/wiki-page.js new file mode 100644 index 0000000..4ebf3ce --- /dev/null +++ b/src/api/wiki-page/controllers/wiki-page.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::wiki-page.wiki-page'); diff --git a/src/api/wiki-page/routes/wiki-page.js b/src/api/wiki-page/routes/wiki-page.js new file mode 100644 index 0000000..aed8a31 --- /dev/null +++ b/src/api/wiki-page/routes/wiki-page.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::wiki-page.wiki-page'); diff --git a/src/api/wiki-page/services/wiki-page.js b/src/api/wiki-page/services/wiki-page.js new file mode 100644 index 0000000..7d06acc --- /dev/null +++ b/src/api/wiki-page/services/wiki-page.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * wiki-page service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::wiki-page.wiki-page'); diff --git a/src/components/collections-component/titles.json b/src/components/collections-component/titles.json new file mode 100644 index 0000000..6543108 --- /dev/null +++ b/src/components/collections-component/titles.json @@ -0,0 +1,14 @@ +{ + "collectionName": "components_collections_component_titles", + "info": { + "displayName": "titles", + "icon": "bullhorn" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + } + } +} diff --git a/src/components/collections-component/wiki-definition.json b/src/components/collections-component/wiki-definition.json new file mode 100644 index 0000000..ed4e1d7 --- /dev/null +++ b/src/components/collections-component/wiki-definition.json @@ -0,0 +1,23 @@ +{ + "collectionName": "components_collections_component_wiki_definitions", + "info": { + "displayName": "wiki-definition", + "icon": "pen" + }, + "options": {}, + "attributes": { + "definition": { + "type": "text" + }, + "categories": { + "type": "relation", + "relation": "oneToMany", + "target": "api::category.category" + }, + "source": { + "type": "relation", + "relation": "oneToOne", + "target": "api::source.source" + } + } +} diff --git a/src/components/sets/wiki-set.json b/src/components/sets/wiki-set.json new file mode 100644 index 0000000..a71f906 --- /dev/null +++ b/src/components/sets/wiki-set.json @@ -0,0 +1,59 @@ +{ + "collectionName": "components_sets_wiki_sets", + "info": { + "displayName": "wiki_set", + "icon": "at", + "description": "" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "status": { + "type": "enumeration", + "enum": [ + "Incomplete", + "Draft", + "Review", + "Done" + ], + "required": true, + "default": "Incomplete" + }, + "titles": { + "displayName": "titles", + "type": "component", + "repeatable": true, + "component": "collections-component.titles" + }, + "summary": { + "type": "text" + }, + "body": { + "type": "richtext" + }, + "source_language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "authors": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "translators": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "proofreaders": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + } + } +}