From 23e467d4fceb35c69c7c35e97ae00bd1de203d10 Mon Sep 17 00:00:00 2001 From: DrMint Date: Sat, 18 Dec 2021 20:23:32 +0100 Subject: [PATCH] Added the audio and video sets --- .../content-types/audio-set/schema.json | 34 ++++++++++++++++++ src/api/audio-set/controllers/audio-set.js | 9 +++++ src/api/audio-set/routes/audio-set.js | 9 +++++ src/api/audio-set/services/audio-set.js | 9 +++++ .../content-types/chronology-era/schema.json | 2 +- .../content-types/chronology-item/schema.json | 2 +- .../glossary-item-type/schema.json | 3 +- .../content-types/glossary-item/schema.json | 2 +- .../content-types/library-content/schema.json | 21 +++++++++-- .../content-types/library-item/schema.json | 2 +- .../content-types/library-variant/schema.json | 2 +- src/api/post/content-types/post/schema.json | 2 +- .../content-types/recorder/schema.json | 2 +- .../content-types/scan-set/schema.json | 2 +- .../source/content-types/source/schema.json | 5 +-- .../content-types/text-set/schema.json | 2 +- .../content-types/video-set/schema.json | 34 ++++++++++++++++++ src/api/video-set/controllers/video-set.js | 9 +++++ src/api/video-set/routes/video-set.js | 9 +++++ src/api/video-set/services/video-set.js | 9 +++++ .../weapon-story-type/schema.json | 2 +- .../content-types/weapon-story/schema.json | 2 +- src/components/basics/source.json | 5 +++ src/components/range/audiovisual-range.json | 18 ---------- src/components/range/game-aspect.json | 13 +++++++ src/components/range/other.json | 13 +++++++ src/components/range/time-range.json | 16 +++++++++ src/components/source/library-text.json | 9 ++--- src/components/translations/audio-sets.json | 15 ++++++++ src/components/translations/video-sets.json | 35 +++++++++++++++++++ 30 files changed, 255 insertions(+), 42 deletions(-) create mode 100644 src/api/audio-set/content-types/audio-set/schema.json create mode 100644 src/api/audio-set/controllers/audio-set.js create mode 100644 src/api/audio-set/routes/audio-set.js create mode 100644 src/api/audio-set/services/audio-set.js create mode 100644 src/api/video-set/content-types/video-set/schema.json create mode 100644 src/api/video-set/controllers/video-set.js create mode 100644 src/api/video-set/routes/video-set.js create mode 100644 src/api/video-set/services/video-set.js delete mode 100644 src/components/range/audiovisual-range.json create mode 100644 src/components/range/game-aspect.json create mode 100644 src/components/range/other.json create mode 100644 src/components/range/time-range.json create mode 100644 src/components/translations/audio-sets.json create mode 100644 src/components/translations/video-sets.json diff --git a/src/api/audio-set/content-types/audio-set/schema.json b/src/api/audio-set/content-types/audio-set/schema.json new file mode 100644 index 0000000..692ca09 --- /dev/null +++ b/src/api/audio-set/content-types/audio-set/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "audio_sets", + "info": { + "singularName": "audio-set", + "pluralName": "audio-sets", + "displayName": "🟡 Audio Sets", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "required": true, + "unique": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + }, + "translations": { + "displayName": "Audio Sets", + "type": "component", + "repeatable": true, + "component": "translations.audio-sets" + }, + "library_contents": { + "type": "relation", + "relation": "oneToMany", + "target": "api::library-content.library-content", + "mappedBy": "audio_set" + } + } +} diff --git a/src/api/audio-set/controllers/audio-set.js b/src/api/audio-set/controllers/audio-set.js new file mode 100644 index 0000000..7c11c52 --- /dev/null +++ b/src/api/audio-set/controllers/audio-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * audio-set controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::audio-set.audio-set'); diff --git a/src/api/audio-set/routes/audio-set.js b/src/api/audio-set/routes/audio-set.js new file mode 100644 index 0000000..5f05085 --- /dev/null +++ b/src/api/audio-set/routes/audio-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * audio-set router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::audio-set.audio-set'); diff --git a/src/api/audio-set/services/audio-set.js b/src/api/audio-set/services/audio-set.js new file mode 100644 index 0000000..d36cd98 --- /dev/null +++ b/src/api/audio-set/services/audio-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * audio-set service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::audio-set.audio-set'); diff --git a/src/api/chronology-era/content-types/chronology-era/schema.json b/src/api/chronology-era/content-types/chronology-era/schema.json index d449b04..e52b9f2 100644 --- a/src/api/chronology-era/content-types/chronology-era/schema.json +++ b/src/api/chronology-era/content-types/chronology-era/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "chronology-era", "pluralName": "chronology-eras", - "displayName": "Chronology Eras", + "displayName": "🟢 Chronology Eras", "description": "" }, "options": { diff --git a/src/api/chronology-item/content-types/chronology-item/schema.json b/src/api/chronology-item/content-types/chronology-item/schema.json index f63909a..eabd36c 100644 --- a/src/api/chronology-item/content-types/chronology-item/schema.json +++ b/src/api/chronology-item/content-types/chronology-item/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "chronology-item", "pluralName": "chronology-items", - "displayName": "Chronology Items", + "displayName": "🟢 Chronology Items", "description": "" }, "options": { diff --git a/src/api/glossary-item-type/content-types/glossary-item-type/schema.json b/src/api/glossary-item-type/content-types/glossary-item-type/schema.json index b5b3563..48a06ca 100644 --- a/src/api/glossary-item-type/content-types/glossary-item-type/schema.json +++ b/src/api/glossary-item-type/content-types/glossary-item-type/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "glossary-item-type", "pluralName": "glossary-item-types", - "displayName": "Glossary Item Types" + "displayName": "🟣 Glossary Item Types", + "description": "" }, "options": { "draftAndPublish": false 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 4b5ff9f..867526c 100644 --- a/src/api/glossary-item/content-types/glossary-item/schema.json +++ b/src/api/glossary-item/content-types/glossary-item/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "glossary-item", "pluralName": "glossary-items", - "displayName": "Glossary Items", + "displayName": "🟣 Glossary Items", "description": "" }, "options": { diff --git a/src/api/library-content/content-types/library-content/schema.json b/src/api/library-content/content-types/library-content/schema.json index cd2a89c..cc575e5 100644 --- a/src/api/library-content/content-types/library-content/schema.json +++ b/src/api/library-content/content-types/library-content/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "library-content", "pluralName": "library-contents", - "displayName": "Library Contents", + "displayName": "🟠 Library Contents", "description": "" }, "options": { @@ -46,10 +46,25 @@ "type": "dynamiczone", "components": [ "range.page-range", - "range.audiovisual-range" + "range.time-range", + "range.game-aspect", + "range.other" ], "required": true, - "max": 1 + "max": 1, + "min": 1 + }, + "audio_set": { + "type": "relation", + "relation": "manyToOne", + "target": "api::audio-set.audio-set", + "inversedBy": "library_contents" + }, + "video_set": { + "type": "relation", + "relation": "manyToOne", + "target": "api::video-set.video-set", + "inversedBy": "library_contents" } } } diff --git a/src/api/library-item/content-types/library-item/schema.json b/src/api/library-item/content-types/library-item/schema.json index e897307..c81b9b8 100644 --- a/src/api/library-item/content-types/library-item/schema.json +++ b/src/api/library-item/content-types/library-item/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "library-item", "pluralName": "library-items", - "displayName": "Library Items", + "displayName": "🔴 Library Items", "description": "" }, "options": { diff --git a/src/api/library-variant/content-types/library-variant/schema.json b/src/api/library-variant/content-types/library-variant/schema.json index 36a5d16..5e71340 100644 --- a/src/api/library-variant/content-types/library-variant/schema.json +++ b/src/api/library-variant/content-types/library-variant/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "library-variant", "pluralName": "library-variants", - "displayName": "Library Variants", + "displayName": "🔴 Library Variants", "description": "" }, "options": { diff --git a/src/api/post/content-types/post/schema.json b/src/api/post/content-types/post/schema.json index 22a8e95..e192e7c 100644 --- a/src/api/post/content-types/post/schema.json +++ b/src/api/post/content-types/post/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "post", "pluralName": "posts", - "displayName": "Posts", + "displayName": "⚫ Posts", "description": "" }, "options": { diff --git a/src/api/recorder/content-types/recorder/schema.json b/src/api/recorder/content-types/recorder/schema.json index 8569d90..8e22344 100644 --- a/src/api/recorder/content-types/recorder/schema.json +++ b/src/api/recorder/content-types/recorder/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "recorder", "pluralName": "recorders", - "displayName": "Recorders", + "displayName": "⚫ Recorders", "description": "" }, "options": { diff --git a/src/api/scan-set/content-types/scan-set/schema.json b/src/api/scan-set/content-types/scan-set/schema.json index a701b77..e03811b 100644 --- a/src/api/scan-set/content-types/scan-set/schema.json +++ b/src/api/scan-set/content-types/scan-set/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "scan-set", "pluralName": "scan-sets", - "displayName": "Scan Sets", + "displayName": "🟡 Scan Sets", "description": "" }, "options": { diff --git a/src/api/source/content-types/source/schema.json b/src/api/source/content-types/source/schema.json index a7007c7..588ab76 100644 --- a/src/api/source/content-types/source/schema.json +++ b/src/api/source/content-types/source/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "source", "pluralName": "sources", - "displayName": "Sources", + "displayName": "⚫ Sources", "description": "" }, "options": { @@ -24,7 +24,8 @@ }, "name": { "type": "string", - "required": false + "required": true, + "unique": true } } } diff --git a/src/api/text-set/content-types/text-set/schema.json b/src/api/text-set/content-types/text-set/schema.json index e32603a..08ab59e 100644 --- a/src/api/text-set/content-types/text-set/schema.json +++ b/src/api/text-set/content-types/text-set/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "text-set", "pluralName": "text-sets", - "displayName": "Text Sets", + "displayName": "🟡 Text Sets", "description": "" }, "options": { diff --git a/src/api/video-set/content-types/video-set/schema.json b/src/api/video-set/content-types/video-set/schema.json new file mode 100644 index 0000000..f515c23 --- /dev/null +++ b/src/api/video-set/content-types/video-set/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "video_sets", + "info": { + "singularName": "video-set", + "pluralName": "video-sets", + "displayName": "🟡 Video Sets", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "unique": true, + "required": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + }, + "translations": { + "displayName": "Video Sets", + "type": "component", + "repeatable": true, + "component": "translations.video-sets" + }, + "library_contents": { + "type": "relation", + "relation": "oneToMany", + "target": "api::library-content.library-content", + "mappedBy": "video_set" + } + } +} diff --git a/src/api/video-set/controllers/video-set.js b/src/api/video-set/controllers/video-set.js new file mode 100644 index 0000000..88e45ac --- /dev/null +++ b/src/api/video-set/controllers/video-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-set controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::video-set.video-set'); diff --git a/src/api/video-set/routes/video-set.js b/src/api/video-set/routes/video-set.js new file mode 100644 index 0000000..435a7cf --- /dev/null +++ b/src/api/video-set/routes/video-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-set router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::video-set.video-set'); diff --git a/src/api/video-set/services/video-set.js b/src/api/video-set/services/video-set.js new file mode 100644 index 0000000..d0e72e0 --- /dev/null +++ b/src/api/video-set/services/video-set.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-set service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::video-set.video-set'); diff --git a/src/api/weapon-story-type/content-types/weapon-story-type/schema.json b/src/api/weapon-story-type/content-types/weapon-story-type/schema.json index a72922a..b7621a6 100644 --- a/src/api/weapon-story-type/content-types/weapon-story-type/schema.json +++ b/src/api/weapon-story-type/content-types/weapon-story-type/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "weapon-story-type", "pluralName": "weapon-story-types", - "displayName": "Weapon Story Types", + "displayName": "🟤 Weapon Story Types", "description": "" }, "options": { diff --git a/src/api/weapon-story/content-types/weapon-story/schema.json b/src/api/weapon-story/content-types/weapon-story/schema.json index d480854..e283cb3 100644 --- a/src/api/weapon-story/content-types/weapon-story/schema.json +++ b/src/api/weapon-story/content-types/weapon-story/schema.json @@ -4,7 +4,7 @@ "info": { "singularName": "weapon-story", "pluralName": "weapon-stories", - "displayName": "Weapon Stories", + "displayName": "🟤 Weapon Stories", "description": "" }, "options": { diff --git a/src/components/basics/source.json b/src/components/basics/source.json index 2e8020f..50d1a29 100644 --- a/src/components/basics/source.json +++ b/src/components/basics/source.json @@ -44,6 +44,11 @@ }, "footnotes": { "type": "text" + }, + "Subbers": { + "type": "relation", + "relation": "oneToMany", + "target": "api::recorder.recorder" } } } diff --git a/src/components/range/audiovisual-range.json b/src/components/range/audiovisual-range.json deleted file mode 100644 index be400ea..0000000 --- a/src/components/range/audiovisual-range.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "collectionName": "components_range_audiovisual_ranges", - "info": { - "displayName": "Audiovisual Range", - "icon": "camera" - }, - "options": {}, - "attributes": { - "starting_time": { - "type": "time", - "required": true - }, - "ending_time": { - "type": "time", - "required": true - } - } -} diff --git a/src/components/range/game-aspect.json b/src/components/range/game-aspect.json new file mode 100644 index 0000000..472c7bb --- /dev/null +++ b/src/components/range/game-aspect.json @@ -0,0 +1,13 @@ +{ + "collectionName": "components_range_game_aspects", + "info": { + "displayName": "Game Aspect", + "icon": "tv" + }, + "options": {}, + "attributes": { + "note": { + "type": "text" + } + } +} diff --git a/src/components/range/other.json b/src/components/range/other.json new file mode 100644 index 0000000..6ccefe6 --- /dev/null +++ b/src/components/range/other.json @@ -0,0 +1,13 @@ +{ + "collectionName": "components_range_others", + "info": { + "displayName": "Other", + "icon": "question-circle" + }, + "options": {}, + "attributes": { + "note": { + "type": "text" + } + } +} diff --git a/src/components/range/time-range.json b/src/components/range/time-range.json new file mode 100644 index 0000000..59a4d7f --- /dev/null +++ b/src/components/range/time-range.json @@ -0,0 +1,16 @@ +{ + "collectionName": "components_range_time_ranges", + "info": { + "displayName": "Time Range", + "icon": "hourglass-half" + }, + "options": {}, + "attributes": { + "starting_time": { + "type": "time" + }, + "ending_time": { + "type": "time" + } + } +} diff --git a/src/components/source/library-text.json b/src/components/source/library-text.json index fd8eaf8..21b771c 100644 --- a/src/components/source/library-text.json +++ b/src/components/source/library-text.json @@ -2,7 +2,8 @@ "collectionName": "components_source_library_texts", "info": { "displayName": "Library Text", - "icon": "align-right" + "icon": "align-justify", + "description": "" }, "options": {}, "attributes": { @@ -10,12 +11,6 @@ "type": "relation", "relation": "oneToOne", "target": "api::text-set.text-set" - }, - "range": { - "type": "component", - "repeatable": false, - "component": "range.page-range", - "required": true } } } diff --git a/src/components/translations/audio-sets.json b/src/components/translations/audio-sets.json new file mode 100644 index 0000000..2f00998 --- /dev/null +++ b/src/components/translations/audio-sets.json @@ -0,0 +1,15 @@ +{ + "collectionName": "components_translations_audio_sets", + "info": { + "displayName": "Audio Sets", + "icon": "file-audio" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +} diff --git a/src/components/translations/video-sets.json b/src/components/translations/video-sets.json new file mode 100644 index 0000000..8f74fb5 --- /dev/null +++ b/src/components/translations/video-sets.json @@ -0,0 +1,35 @@ +{ + "collectionName": "components_translations_video_sets", + "info": { + "displayName": "Video Sets", + "icon": "file-video", + "description": "" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "video_url": { + "type": "string" + }, + "video_embed": { + "type": "string" + }, + "source": { + "type": "component", + "repeatable": false, + "component": "basics.source", + "required": true + }, + "subfile": { + "allowedTypes": [ + "files" + ], + "type": "media", + "multiple": false + } + } +}