Skip to content

Commit

Permalink
[DEV-1417] Add news-item entity and news-showcase component to Strapi…
Browse files Browse the repository at this point in the history
… CMS (#666)
  • Loading branch information
marcobottaro authored Feb 27, 2024
1 parent 2f76678 commit b9e82d4
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilled-laws-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"strapi-cms": minor
---

Add news-item entity and news-showcase component to Strapi CMS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
}
},
"attributes": {
"newsShowcase": {
"type": "component",
"repeatable": false,
"pluginOptions": {
"i18n": {
"localized": true
}
},
"component": "common.news-showcase"
},
"productsShowcase": {
"type": "component",
"repeatable": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"kind": "collectionType",
"collectionName": "news_items",
"info": {
"singularName": "news-item",
"pluralName": "news-items",
"displayName": "NewsItem",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"title": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true
},
"link": {
"type": "component",
"repeatable": false,
"pluginOptions": {
"i18n": {
"localized": true
}
},
"component": "common.links",
"required": true
},
"image": {
"type": "media",
"multiple": false,
"allowedTypes": [
"images"
],
"pluginOptions": {
"i18n": {
"localized": true
}
}
},
"comingSoon": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "boolean",
"default": false
}
}
}
7 changes: 7 additions & 0 deletions apps/strapi-cms/src/api/news-item/controllers/news-item.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* news-item controller
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreController('api::news-item.news-item');
7 changes: 7 additions & 0 deletions apps/strapi-cms/src/api/news-item/routes/news-item.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* news-item router
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreRouter('api::news-item.news-item');
7 changes: 7 additions & 0 deletions apps/strapi-cms/src/api/news-item/services/news-item.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* news-item service
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreService('api::news-item.news-item');
23 changes: 23 additions & 0 deletions apps/strapi-cms/src/components/common/news-showcase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collectionName": "components_common_news_showcases",
"info": {
"displayName": "NewsShowcase",
"icon": "bell",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"subTitle": {
"type": "text"
},
"items": {
"type": "relation",
"relation": "oneToMany",
"target": "api::news-item.news-item"
}
}
}

0 comments on commit b9e82d4

Please sign in to comment.