move mosaic items to collection type
This commit is contained in:
parent
d4f66f34db
commit
64e3207ffb
10 changed files with 161 additions and 42 deletions
|
|
@ -12,9 +12,9 @@
|
|||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"mosaic_items": {
|
||||
"type": "component",
|
||||
"component": "global.mosaic-item",
|
||||
"repeatable": true
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::mosaic-item.mosaic-item"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
41
src/api/mosaic-item/content-types/mosaic-item/schema.json
Normal file
41
src/api/mosaic-item/content-types/mosaic-item/schema.json
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "mosaic_items",
|
||||
"info": {
|
||||
"singularName": "mosaic-item",
|
||||
"pluralName": "mosaic-items",
|
||||
"displayName": "Mosaic Item"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"slug": {
|
||||
"type": "uid",
|
||||
"targetField": "title"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "media",
|
||||
"multiple": false,
|
||||
"allowedTypes": [
|
||||
"images"
|
||||
]
|
||||
},
|
||||
"dl": {
|
||||
"type": "component",
|
||||
"component": "global.descriptive-list",
|
||||
"repeatable": true
|
||||
},
|
||||
"content": {
|
||||
"type": "dynamiczone",
|
||||
"components": [
|
||||
"global.copy",
|
||||
"global.media"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/mosaic-item/controllers/mosaic-item.ts
Normal file
7
src/api/mosaic-item/controllers/mosaic-item.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* mosaic-item controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreController('api::mosaic-item.mosaic-item');
|
||||
7
src/api/mosaic-item/routes/mosaic-item.ts
Normal file
7
src/api/mosaic-item/routes/mosaic-item.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* mosaic-item router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::mosaic-item.mosaic-item');
|
||||
7
src/api/mosaic-item/services/mosaic-item.ts
Normal file
7
src/api/mosaic-item/services/mosaic-item.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* mosaic-item service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::mosaic-item.mosaic-item');
|
||||
14
src/components/global/copy.json
Normal file
14
src/components/global/copy.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"collectionName": "components_global_copies",
|
||||
"info": {
|
||||
"displayName": "Copy",
|
||||
"icon": "bold"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"content": {
|
||||
"type": "blocks"
|
||||
}
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
26
src/components/global/media.json
Normal file
26
src/components/global/media.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"collectionName": "components_global_media",
|
||||
"info": {
|
||||
"displayName": "Media",
|
||||
"icon": "landscape"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"image": {
|
||||
"type": "media",
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"allowedTypes": [
|
||||
"images"
|
||||
]
|
||||
},
|
||||
"video": {
|
||||
"type": "media",
|
||||
"multiple": false,
|
||||
"allowedTypes": [
|
||||
"videos"
|
||||
]
|
||||
}
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"collectionName": "components_global_mosaic_items",
|
||||
"info": {
|
||||
"displayName": "Mosaic Item",
|
||||
"icon": "apps"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"image": {
|
||||
"type": "media",
|
||||
"multiple": false,
|
||||
"allowedTypes": [
|
||||
"images"
|
||||
]
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"dl": {
|
||||
"type": "component",
|
||||
"component": "global.descriptive-list",
|
||||
"repeatable": true
|
||||
},
|
||||
"content": {
|
||||
"type": "blocks"
|
||||
}
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
28
types/generated/components.d.ts
vendored
28
types/generated/components.d.ts
vendored
|
|
@ -1,5 +1,16 @@
|
|||
import type { Schema, Struct } from '@strapi/strapi';
|
||||
|
||||
export interface GlobalCopy extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_copies';
|
||||
info: {
|
||||
displayName: 'Copy';
|
||||
icon: 'bold';
|
||||
};
|
||||
attributes: {
|
||||
content: Schema.Attribute.Blocks;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GlobalDescriptiveList extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_descriptive_lists';
|
||||
info: {
|
||||
|
|
@ -12,17 +23,15 @@ export interface GlobalDescriptiveList extends Struct.ComponentSchema {
|
|||
};
|
||||
}
|
||||
|
||||
export interface GlobalMosaicItem extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_mosaic_items';
|
||||
export interface GlobalMedia extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_media';
|
||||
info: {
|
||||
displayName: 'Mosaic Item';
|
||||
icon: 'apps';
|
||||
displayName: 'Media';
|
||||
icon: 'landscape';
|
||||
};
|
||||
attributes: {
|
||||
content: Schema.Attribute.Blocks;
|
||||
dl: Schema.Attribute.Component<'global.descriptive-list', true>;
|
||||
image: Schema.Attribute.Media<'images'>;
|
||||
title: Schema.Attribute.String;
|
||||
image: Schema.Attribute.Media<'images'> & Schema.Attribute.Required;
|
||||
video: Schema.Attribute.Media<'videos'>;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -42,8 +51,9 @@ export interface GlobalSeo extends Struct.ComponentSchema {
|
|||
declare module '@strapi/strapi' {
|
||||
export module Public {
|
||||
export interface ComponentSchemas {
|
||||
'global.copy': GlobalCopy;
|
||||
'global.descriptive-list': GlobalDescriptiveList;
|
||||
'global.mosaic-item': GlobalMosaicItem;
|
||||
'global.media': GlobalMedia;
|
||||
'global.seo': GlobalSeo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
38
types/generated/contentTypes.d.ts
vendored
38
types/generated/contentTypes.d.ts
vendored
|
|
@ -487,7 +487,10 @@ export interface ApiHomeHome extends Struct.SingleTypeSchema {
|
|||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<'oneToMany', 'api::home.home'> &
|
||||
Schema.Attribute.Private;
|
||||
mosaic_items: Schema.Attribute.Component<'global.mosaic-item', true>;
|
||||
mosaic_items: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::mosaic-item.mosaic-item'
|
||||
>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
|
|
@ -495,6 +498,38 @@ export interface ApiHomeHome extends Struct.SingleTypeSchema {
|
|||
};
|
||||
}
|
||||
|
||||
export interface ApiMosaicItemMosaicItem extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'mosaic_items';
|
||||
info: {
|
||||
displayName: 'Mosaic Item';
|
||||
pluralName: 'mosaic-items';
|
||||
singularName: 'mosaic-item';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
content: Schema.Attribute.DynamicZone<['global.copy', 'global.media']>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
dl: Schema.Attribute.Component<'global.descriptive-list', true>;
|
||||
image: Schema.Attribute.Media<'images'>;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::mosaic-item.mosaic-item'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
slug: Schema.Attribute.UID<'title'>;
|
||||
title: Schema.Attribute.String;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginContentReleasesRelease
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'strapi_releases';
|
||||
|
|
@ -1008,6 +1043,7 @@ declare module '@strapi/strapi' {
|
|||
'admin::user': AdminUser;
|
||||
'api::global.global': ApiGlobalGlobal;
|
||||
'api::home.home': ApiHomeHome;
|
||||
'api::mosaic-item.mosaic-item': ApiMosaicItemMosaicItem;
|
||||
'plugin::content-releases.release': PluginContentReleasesRelease;
|
||||
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
||||
'plugin::i18n.locale': PluginI18NLocale;
|
||||
|
|
|
|||
Loading…
Reference in a new issue