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", "kind": "collectionType",
"collectionName": "other_subtypes", "collectionName": "group_subtypes",
"info": { "info": {
"singularName": "other-subtype", "singularName": "group-subtype",
"pluralName": "other-subtypes", "pluralName": "group-subtypes",
"displayName": "Other Subtypes", "displayName": "Group Subtypes",
"description": "" "description": ""
}, },
"options": { "options": {
@ -13,9 +13,9 @@
"attributes": { "attributes": {
"slug": { "slug": {
"type": "string", "type": "string",
"required": true, "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
"unique": true, "unique": true,
"regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" "required": true
}, },
"titles": { "titles": {
"type": "component", "type": "component",

View File

@ -1,9 +1,9 @@
'use strict'; 'use strict';
/** /**
* other-subtype controller * group-subtype controller
*/ */
const { createCoreController } = require('@strapi/strapi').factories; 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'; 'use strict';
/** /**
* other-subtype router. * group-subtype router.
*/ */
const { createCoreRouter } = require('@strapi/strapi').factories; 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'; 'use strict';
/** /**
* other-subtype service. * group-subtype service.
*/ */
const { createCoreService } = require('@strapi/strapi').factories; 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": {}, "pluginOptions": {},
"type": "dynamiczone", "type": "dynamiczone",
"components": [ "components": [
"metadata.books",
"metadata.video",
"metadata.game",
"metadata.audio", "metadata.audio",
"metadata.other" "metadata.books",
"metadata.game",
"metadata.group",
"metadata.other",
"metadata.video"
], ],
"max": 1 "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": { "select_option_sidebar": {
"type": "string" "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": "" "description": ""
}, },
"options": {}, "options": {},
"attributes": { "attributes": {}
"subtype": {
"type": "relation",
"relation": "oneToOne",
"target": "api::other-subtype.other-subtype"
}
}
} }