Groups Metadata type is now a thing, hurray

This commit is contained in:
DrMint 2022-03-06 00:42:35 +01:00
parent 4c7134ed2e
commit 810fb017d0
12 changed files with 94 additions and 23 deletions

View File

@ -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",

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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
},

View File

@ -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"
}
}
}

View File

@ -0,0 +1,9 @@
'use strict';
/**
* metadata-type controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::metadata-type.metadata-type');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* metadata-type router.
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::metadata-type.metadata-type');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* metadata-type service.
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::metadata-type.metadata-type');

View File

@ -249,6 +249,9 @@
},
"select_option_sidebar": {
"type": "string"
},
"group": {
"type": "string"
}
}
}

View File

@ -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"
}
}
}

View File

@ -6,11 +6,5 @@
"description": ""
},
"options": {},
"attributes": {
"subtype": {
"type": "relation",
"relation": "oneToOne",
"target": "api::other-subtype.other-subtype"
}
}
"attributes": {}
}