From 734654988f23021e4c362d1e8b131a059f5760c8 Mon Sep 17 00:00:00 2001 From: DrMint Date: Thu, 2 Jun 2022 16:13:37 +0200 Subject: [PATCH] New version of wiki pages --- package-lock.json | 56 ++++++++++++++++++- package.json | 3 +- .../content-types/glossary-item/schema.json | 8 --- .../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 | 24 +++++--- .../collections-component/aliases.json | 15 +++++ .../collections-component/body.json | 45 +++++++++++++++ .../page-builder-component/pane.json | 13 ----- .../page-builder-component/tab.json | 14 ----- src/components/page-builder/grid.json | 5 -- src/components/page-builder/tabs.json | 9 +-- src/components/page-builder/text.json | 14 ----- src/components/sets/wiki-set.json | 5 -- .../translations/chronology-item.json | 6 +- src/components/translations/posts.json | 15 +++++ src/components/translations/wiki-post.json | 37 ++++++++++++ src/components/translations/wiki.json | 35 ++++++++++++ .../wiki-specialization/chronology.json | 30 ++++++++++ .../wiki-specialization/glossary-item.json | 21 +++++++ src/components/wiki-specialization/post.json | 22 ++++++++ .../wiki-specialization/weapon.json | 21 +++++++ 24 files changed, 318 insertions(+), 133 deletions(-) delete mode 100644 src/api/wiki-page-type/content-types/wiki-page-type/schema.json delete mode 100644 src/api/wiki-page-type/controllers/wiki-page-type.js delete mode 100644 src/api/wiki-page-type/routes/wiki-page-type.js delete mode 100644 src/api/wiki-page-type/services/wiki-page-type.js create mode 100644 src/components/collections-component/aliases.json create mode 100644 src/components/collections-component/body.json delete mode 100644 src/components/page-builder-component/pane.json delete mode 100644 src/components/page-builder-component/tab.json delete mode 100644 src/components/page-builder/text.json create mode 100644 src/components/translations/wiki-post.json create mode 100644 src/components/translations/wiki.json create mode 100644 src/components/wiki-specialization/chronology.json create mode 100644 src/components/wiki-specialization/glossary-item.json create mode 100644 src/components/wiki-specialization/post.json create mode 100644 src/components/wiki-specialization/weapon.json diff --git a/package-lock.json b/package-lock.json index 8d6c07f..8a4f2f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "dependencies": { "@strapi/plugin-graphql": "4.1.11", "@strapi/strapi": "4.1.11", - "sqlite3": "5.0.8" + "sqlite3": "5.0.8", + "strapi-plugin-meilisearch": "^0.6.4" }, "engines": { "node": ">=12.x.x <=16.x.x", @@ -6303,6 +6304,14 @@ "yarn": ">=1" } }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -11190,6 +11199,14 @@ "node": ">= 0.6" } }, + "node_modules/meilisearch": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/meilisearch/-/meilisearch-0.25.1.tgz", + "integrity": "sha512-20jO0pK9BhghxHSkOLbdoYn58h/Z0PNL3JQcRq7ipNIeqrxkAetCZZ6ttJC3uxcz0jVglmiFoSXu3Z/lEOLOLQ==", + "dependencies": { + "cross-fetch": "^3.1.5" + } + }, "node_modules/memfs": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", @@ -15179,6 +15196,18 @@ "ci-info": "^3.1.1" } }, + "node_modules/strapi-plugin-meilisearch": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/strapi-plugin-meilisearch/-/strapi-plugin-meilisearch-0.6.4.tgz", + "integrity": "sha512-ajlulIF/HffbnUiUOd10FSIiqlsKDFXRinHIPI73fbLjNnLXNgnnkXgwsGiH1FprnL+VO7afWd6Vowmya3Bbpw==", + "dependencies": { + "@strapi/utils": "^4.1.9", + "meilisearch": "^0.25.1" + }, + "engines": { + "npm": ">=6.0.0" + } + }, "node_modules/stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -21874,6 +21903,14 @@ "cross-spawn": "^7.0.1" } }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -25505,6 +25542,14 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, + "meilisearch": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/meilisearch/-/meilisearch-0.25.1.tgz", + "integrity": "sha512-20jO0pK9BhghxHSkOLbdoYn58h/Z0PNL3JQcRq7ipNIeqrxkAetCZZ6ttJC3uxcz0jVglmiFoSXu3Z/lEOLOLQ==", + "requires": { + "cross-fetch": "^3.1.5" + } + }, "memfs": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", @@ -28557,6 +28602,15 @@ "ci-info": "^3.1.1" } }, + "strapi-plugin-meilisearch": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/strapi-plugin-meilisearch/-/strapi-plugin-meilisearch-0.6.4.tgz", + "integrity": "sha512-ajlulIF/HffbnUiUOd10FSIiqlsKDFXRinHIPI73fbLjNnLXNgnnkXgwsGiH1FprnL+VO7afWd6Vowmya3Bbpw==", + "requires": { + "@strapi/utils": "^4.1.9", + "meilisearch": "^0.25.1" + } + }, "stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", diff --git a/package.json b/package.json index 0304f02..6da7923 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dependencies": { "@strapi/plugin-graphql": "4.1.11", "@strapi/strapi": "4.1.11", - "sqlite3": "5.0.8" + "sqlite3": "5.0.8", + "strapi-plugin-meilisearch": "^0.6.4" }, "author": { "name": "A Strapi developer" diff --git a/src/api/glossary-item/content-types/glossary-item/schema.json b/src/api/glossary-item/content-types/glossary-item/schema.json index 11a2fa8..867526c 100644 --- a/src/api/glossary-item/content-types/glossary-item/schema.json +++ b/src/api/glossary-item/content-types/glossary-item/schema.json @@ -34,14 +34,6 @@ "type": "relation", "relation": "oneToOne", "target": "api::glossary-item-type.glossary-item-type" - }, - "thumbnail": { - "type": "media", - "multiple": false, - "required": false, - "allowedTypes": [ - "images" - ] } } } 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 deleted file mode 100644 index b458618..0000000 --- a/src/api/wiki-page-type/content-types/wiki-page-type/schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "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 deleted file mode 100644 index 4c885d1..0000000 --- a/src/api/wiki-page-type/controllers/wiki-page-type.js +++ /dev/null @@ -1,9 +0,0 @@ -'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 deleted file mode 100644 index d8221ae..0000000 --- a/src/api/wiki-page-type/routes/wiki-page-type.js +++ /dev/null @@ -1,9 +0,0 @@ -'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 deleted file mode 100644 index a0416ae..0000000 --- a/src/api/wiki-page-type/services/wiki-page-type.js +++ /dev/null @@ -1,9 +0,0 @@ -'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 index 0d7124c..1ca65a8 100644 --- a/src/api/wiki-page/content-types/wiki-page/schema.json +++ b/src/api/wiki-page/content-types/wiki-page/schema.json @@ -25,16 +25,24 @@ "images" ] }, - "wiki_set": { - "displayName": "wiki_set", + "Aspects": { + "type": "dynamiczone", + "components": [ + "wiki-specialization.chronology", + "wiki-specialization.glossary-item", + "wiki-specialization.weapon" + ] + }, + "categories": { + "type": "relation", + "relation": "oneToMany", + "target": "api::category.category" + }, + "translations": { + "displayName": "Wiki", "type": "component", "repeatable": true, - "component": "sets.wiki-set" - }, - "type": { - "type": "relation", - "relation": "oneToOne", - "target": "api::wiki-page-type.wiki-page-type" + "component": "translations.wiki" } } } diff --git a/src/components/collections-component/aliases.json b/src/components/collections-component/aliases.json new file mode 100644 index 0000000..c6dfdbf --- /dev/null +++ b/src/components/collections-component/aliases.json @@ -0,0 +1,15 @@ +{ + "collectionName": "components_collections_component_aliases", + "info": { + "displayName": "Aliases", + "icon": "arrow-circle-right", + "description": "" + }, + "options": {}, + "attributes": { + "alias": { + "type": "string", + "required": true + } + } +} diff --git a/src/components/collections-component/body.json b/src/components/collections-component/body.json new file mode 100644 index 0000000..a2d6d4b --- /dev/null +++ b/src/components/collections-component/body.json @@ -0,0 +1,45 @@ +{ + "collectionName": "components_collections_component_bodies", + "info": { + "displayName": "body", + "icon": "align-left", + "description": "" + }, + "options": {}, + "attributes": { + "source_language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "status": { + "type": "enumeration", + "enum": [ + "Incomplete", + "Draft", + "Review", + "Done" + ], + "default": "Incomplete", + "required": true + }, + "body": { + "type": "richtext" + }, + "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" + } + } +} diff --git a/src/components/page-builder-component/pane.json b/src/components/page-builder-component/pane.json deleted file mode 100644 index 96d99a3..0000000 --- a/src/components/page-builder-component/pane.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "collectionName": "components_page_builder_component_panes", - "info": { - "displayName": "Pane", - "icon": "poll-h" - }, - "options": {}, - "attributes": { - "text": { - "type": "richtext" - } - } -} diff --git a/src/components/page-builder-component/tab.json b/src/components/page-builder-component/tab.json deleted file mode 100644 index c18158b..0000000 --- a/src/components/page-builder-component/tab.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "collectionName": "components_page_builder_component_tabs", - "info": { - "displayName": "Tab", - "icon": "folder-plus", - "description": "" - }, - "options": {}, - "attributes": { - "text": { - "type": "richtext" - } - } -} diff --git a/src/components/page-builder/grid.json b/src/components/page-builder/grid.json index a3a0908..18abbd2 100644 --- a/src/components/page-builder/grid.json +++ b/src/components/page-builder/grid.json @@ -13,11 +13,6 @@ "max": 10, "required": true, "default": 1 - }, - "panes": { - "type": "component", - "repeatable": true, - "component": "page-builder-component.pane" } } } diff --git a/src/components/page-builder/tabs.json b/src/components/page-builder/tabs.json index a3bbc8a..fd89367 100644 --- a/src/components/page-builder/tabs.json +++ b/src/components/page-builder/tabs.json @@ -6,12 +6,5 @@ "description": "" }, "options": {}, - "attributes": { - "tabs": { - "displayName": "tab", - "type": "component", - "repeatable": true, - "component": "page-builder-component.tab" - } - } + "attributes": {} } diff --git a/src/components/page-builder/text.json b/src/components/page-builder/text.json deleted file mode 100644 index baeadd0..0000000 --- a/src/components/page-builder/text.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "collectionName": "components_page_builder_texts", - "info": { - "displayName": "Text", - "icon": "align-left", - "description": "" - }, - "options": {}, - "attributes": { - "text": { - "type": "richtext" - } - } -} diff --git a/src/components/sets/wiki-set.json b/src/components/sets/wiki-set.json index a71f906..a066942 100644 --- a/src/components/sets/wiki-set.json +++ b/src/components/sets/wiki-set.json @@ -40,11 +40,6 @@ "relation": "oneToOne", "target": "api::language.language" }, - "authors": { - "type": "relation", - "relation": "oneToMany", - "target": "api::recorder.recorder" - }, "translators": { "type": "relation", "relation": "oneToMany", diff --git a/src/components/translations/chronology-item.json b/src/components/translations/chronology-item.json index 7826584..fdcd163 100644 --- a/src/components/translations/chronology-item.json +++ b/src/components/translations/chronology-item.json @@ -15,9 +15,6 @@ "title": { "type": "string" }, - "description": { - "type": "text" - }, "note": { "type": "text" }, @@ -31,6 +28,9 @@ ], "default": "Done", "required": true + }, + "description": { + "type": "richtext" } } } diff --git a/src/components/translations/posts.json b/src/components/translations/posts.json index d894494..834644f 100644 --- a/src/components/translations/posts.json +++ b/src/components/translations/posts.json @@ -41,6 +41,21 @@ ], "default": "Incomplete", "required": true + }, + "translators": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "proofreaders": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + }, + "source_language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" } } } diff --git a/src/components/translations/wiki-post.json b/src/components/translations/wiki-post.json new file mode 100644 index 0000000..da5e87c --- /dev/null +++ b/src/components/translations/wiki-post.json @@ -0,0 +1,37 @@ +{ + "collectionName": "components_translations_wiki_posts", + "info": { + "displayName": "wiki-post", + "icon": "outdent" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "source_language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "status": { + "type": "enumeration", + "enum": [ + "Incomplete", + "Draft", + "Review", + "Done" + ], + "default": "Incomplete", + "required": true + }, + "summary": { + "type": "text" + }, + "body": { + "type": "richtext" + } + } +} diff --git a/src/components/translations/wiki.json b/src/components/translations/wiki.json new file mode 100644 index 0000000..94b7a23 --- /dev/null +++ b/src/components/translations/wiki.json @@ -0,0 +1,35 @@ +{ + "collectionName": "components_translations_wikis", + "info": { + "displayName": "Wiki", + "icon": "swatchbook", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + }, + "aliases": { + "displayName": "Aliases", + "type": "component", + "repeatable": true, + "component": "collections-component.aliases" + }, + "body": { + "displayName": "body", + "type": "component", + "repeatable": false, + "component": "collections-component.body" + }, + "summary": { + "type": "text" + }, + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +} diff --git a/src/components/wiki-specialization/chronology.json b/src/components/wiki-specialization/chronology.json new file mode 100644 index 0000000..ee7c943 --- /dev/null +++ b/src/components/wiki-specialization/chronology.json @@ -0,0 +1,30 @@ +{ + "collectionName": "components_wiki_specialization_chronologies", + "info": { + "displayName": "Chronology Event", + "icon": "history", + "description": "" + }, + "options": {}, + "attributes": { + "translations": { + "type": "component", + "repeatable": true, + "component": "translations.chronology-item" + }, + "source": { + "type": "relation", + "relation": "oneToOne", + "target": "api::source.source" + }, + "date": { + "type": "component", + "repeatable": false, + "component": "basics.datepicker", + "required": true + }, + "displayed_date": { + "type": "string" + } + } +} diff --git a/src/components/wiki-specialization/glossary-item.json b/src/components/wiki-specialization/glossary-item.json new file mode 100644 index 0000000..f9a4d5f --- /dev/null +++ b/src/components/wiki-specialization/glossary-item.json @@ -0,0 +1,21 @@ +{ + "collectionName": "components_wiki_specialization_glossary_items", + "info": { + "displayName": "Glossary Definition", + "icon": "ad", + "description": "" + }, + "options": {}, + "attributes": { + "translations": { + "type": "component", + "repeatable": true, + "component": "translations.glossary-definition" + }, + "source": { + "type": "relation", + "relation": "oneToOne", + "target": "api::source.source" + } + } +} diff --git a/src/components/wiki-specialization/post.json b/src/components/wiki-specialization/post.json new file mode 100644 index 0000000..6e5e3ab --- /dev/null +++ b/src/components/wiki-specialization/post.json @@ -0,0 +1,22 @@ +{ + "collectionName": "components_wiki_specialization_posts", + "info": { + "displayName": "Post", + "icon": "book-reader", + "description": "" + }, + "options": {}, + "attributes": { + "translations": { + "displayName": "wiki-post", + "type": "component", + "repeatable": true, + "component": "translations.wiki-post" + }, + "authors": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" + } + } +} diff --git a/src/components/wiki-specialization/weapon.json b/src/components/wiki-specialization/weapon.json new file mode 100644 index 0000000..dc1c198 --- /dev/null +++ b/src/components/wiki-specialization/weapon.json @@ -0,0 +1,21 @@ +{ + "collectionName": "components_wiki_specialization_weapons", + "info": { + "displayName": "Weapon Story", + "icon": "tools", + "description": "" + }, + "options": {}, + "attributes": { + "translations": { + "type": "component", + "repeatable": true, + "component": "translations.weapon-story-story" + }, + "source": { + "type": "relation", + "relation": "oneToOne", + "target": "api::source.source" + } + } +}