diff --git a/src/api/other-subtype/content-types/other-subtype/schema.json b/src/api/group-subtype/content-types/group-subtype/schema.json similarity index 60% rename from src/api/other-subtype/content-types/other-subtype/schema.json rename to src/api/group-subtype/content-types/group-subtype/schema.json index e3a9fed..9eb439b 100644 --- a/src/api/other-subtype/content-types/other-subtype/schema.json +++ b/src/api/group-subtype/content-types/group-subtype/schema.json @@ -1,10 +1,10 @@ { "kind": "collectionType", - "collectionName": "other_subtypes", + "collectionName": "group_subtypes", "info": { - "singularName": "other-subtype", - "pluralName": "other-subtypes", - "displayName": "Other Subtypes", + "singularName": "group-subtype", + "pluralName": "group-subtypes", + "displayName": "Group Subtypes", "description": "" }, "options": { @@ -13,9 +13,9 @@ "attributes": { "slug": { "type": "string", - "required": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "unique": true, - "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + "required": true }, "titles": { "type": "component", diff --git a/src/api/other-subtype/controllers/other-subtype.js b/src/api/group-subtype/controllers/group-subtype.js similarity index 53% rename from src/api/other-subtype/controllers/other-subtype.js rename to src/api/group-subtype/controllers/group-subtype.js index 7f9d8eb..56147f7 100644 --- a/src/api/other-subtype/controllers/other-subtype.js +++ b/src/api/group-subtype/controllers/group-subtype.js @@ -1,9 +1,9 @@ 'use strict'; /** - * other-subtype controller + * group-subtype controller */ const { createCoreController } = require('@strapi/strapi').factories; -module.exports = createCoreController('api::other-subtype.other-subtype'); +module.exports = createCoreController('api::group-subtype.group-subtype'); diff --git a/src/api/other-subtype/routes/other-subtype.js b/src/api/group-subtype/routes/group-subtype.js similarity index 52% rename from src/api/other-subtype/routes/other-subtype.js rename to src/api/group-subtype/routes/group-subtype.js index 605cd9c..0cfb2a2 100644 --- a/src/api/other-subtype/routes/other-subtype.js +++ b/src/api/group-subtype/routes/group-subtype.js @@ -1,9 +1,9 @@ 'use strict'; /** - * other-subtype router. + * group-subtype router. */ const { createCoreRouter } = require('@strapi/strapi').factories; -module.exports = createCoreRouter('api::other-subtype.other-subtype'); +module.exports = createCoreRouter('api::group-subtype.group-subtype'); diff --git a/src/api/other-subtype/services/other-subtype.js b/src/api/group-subtype/services/group-subtype.js similarity index 52% rename from src/api/other-subtype/services/other-subtype.js rename to src/api/group-subtype/services/group-subtype.js index 0cc2d17..b776c5d 100644 --- a/src/api/other-subtype/services/other-subtype.js +++ b/src/api/group-subtype/services/group-subtype.js @@ -1,9 +1,9 @@ 'use strict'; /** - * other-subtype service. + * group-subtype service. */ const { createCoreService } = require('@strapi/strapi').factories; -module.exports = createCoreService('api::other-subtype.other-subtype'); +module.exports = createCoreService('api::group-subtype.group-subtype'); 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 a263a8a..5ef02c3 100644 --- a/src/api/library-item/content-types/library-item/schema.json +++ b/src/api/library-item/content-types/library-item/schema.json @@ -65,11 +65,12 @@ "pluginOptions": {}, "type": "dynamiczone", "components": [ - "metadata.books", - "metadata.video", - "metadata.game", "metadata.audio", - "metadata.other" + "metadata.books", + "metadata.game", + "metadata.group", + "metadata.other", + "metadata.video" ], "max": 1 }, diff --git a/src/api/metadata-type/content-types/metadata-type/schema.json b/src/api/metadata-type/content-types/metadata-type/schema.json new file mode 100644 index 0000000..7677295 --- /dev/null +++ b/src/api/metadata-type/content-types/metadata-type/schema.json @@ -0,0 +1,25 @@ +{ + "kind": "collectionType", + "collectionName": "metadata_types", + "info": { + "singularName": "metadata-type", + "pluralName": "metadata-types", + "displayName": "Metadata Types" + }, + "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/metadata-type/controllers/metadata-type.js b/src/api/metadata-type/controllers/metadata-type.js new file mode 100644 index 0000000..d199c64 --- /dev/null +++ b/src/api/metadata-type/controllers/metadata-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * metadata-type controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::metadata-type.metadata-type'); diff --git a/src/api/metadata-type/routes/metadata-type.js b/src/api/metadata-type/routes/metadata-type.js new file mode 100644 index 0000000..3958761 --- /dev/null +++ b/src/api/metadata-type/routes/metadata-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * metadata-type router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::metadata-type.metadata-type'); diff --git a/src/api/metadata-type/services/metadata-type.js b/src/api/metadata-type/services/metadata-type.js new file mode 100644 index 0000000..e8409b3 --- /dev/null +++ b/src/api/metadata-type/services/metadata-type.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * metadata-type service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::metadata-type.metadata-type'); 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 ed0f223..5f6b743 100644 --- a/src/api/website-interface/content-types/website-interface/schema.json +++ b/src/api/website-interface/content-types/website-interface/schema.json @@ -249,6 +249,9 @@ }, "select_option_sidebar": { "type": "string" + }, + "group": { + "type": "string" } } } diff --git a/src/components/metadata/group.json b/src/components/metadata/group.json new file mode 100644 index 0000000..2a05a76 --- /dev/null +++ b/src/components/metadata/group.json @@ -0,0 +1,21 @@ +{ + "collectionName": "components_metadata_groups", + "info": { + "displayName": "Group", + "icon": "box", + "description": "" + }, + "options": {}, + "attributes": { + "subtype": { + "type": "relation", + "relation": "oneToOne", + "target": "api::group-subtype.group-subtype" + }, + "subitems_type": { + "type": "relation", + "relation": "oneToOne", + "target": "api::metadata-type.metadata-type" + } + } +} diff --git a/src/components/metadata/other.json b/src/components/metadata/other.json index acedfcf..4c76100 100644 --- a/src/components/metadata/other.json +++ b/src/components/metadata/other.json @@ -6,11 +6,5 @@ "description": "" }, "options": {}, - "attributes": { - "subtype": { - "type": "relation", - "relation": "oneToOne", - "target": "api::other-subtype.other-subtype" - } - } + "attributes": {} }