Groups Metadata type is now a thing, hurray
This commit is contained in:
		
							parent
							
								
									4c7134ed2e
								
							
						
					
					
						commit
						810fb017d0
					
				| @ -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", | ||||||
| @ -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'); | ||||||
| @ -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'); | ||||||
| @ -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'); | ||||||
| @ -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 | ||||||
|     }, |     }, | ||||||
|  | |||||||
| @ -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" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										9
									
								
								src/api/metadata-type/controllers/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/api/metadata-type/controllers/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  *  metadata-type controller | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | const { createCoreController } = require('@strapi/strapi').factories; | ||||||
|  | 
 | ||||||
|  | module.exports = createCoreController('api::metadata-type.metadata-type'); | ||||||
							
								
								
									
										9
									
								
								src/api/metadata-type/routes/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/api/metadata-type/routes/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * metadata-type router. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | const { createCoreRouter } = require('@strapi/strapi').factories; | ||||||
|  | 
 | ||||||
|  | module.exports = createCoreRouter('api::metadata-type.metadata-type'); | ||||||
							
								
								
									
										9
									
								
								src/api/metadata-type/services/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/api/metadata-type/services/metadata-type.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * metadata-type service. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | const { createCoreService } = require('@strapi/strapi').factories; | ||||||
|  | 
 | ||||||
|  | module.exports = createCoreService('api::metadata-type.metadata-type'); | ||||||
| @ -249,6 +249,9 @@ | |||||||
|     }, |     }, | ||||||
|     "select_option_sidebar": { |     "select_option_sidebar": { | ||||||
|       "type": "string" |       "type": "string" | ||||||
|  |     }, | ||||||
|  |     "group": { | ||||||
|  |       "type": "string" | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										21
									
								
								src/components/metadata/group.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/components/metadata/group.json
									
									
									
									
									
										Normal 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" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -6,11 +6,5 @@ | |||||||
|     "description": "" |     "description": "" | ||||||
|   }, |   }, | ||||||
|   "options": {}, |   "options": {}, | ||||||
|   "attributes": { |   "attributes": {} | ||||||
|     "subtype": { |  | ||||||
|       "type": "relation", |  | ||||||
|       "relation": "oneToOne", |  | ||||||
|       "target": "api::other-subtype.other-subtype" |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 DrMint
						DrMint