diff --git a/src/api/homepage/content-types/homepage/schema.json b/src/api/homepage/content-types/homepage/schema.json index 147e255..721e4d6 100644 --- a/src/api/homepage/content-types/homepage/schema.json +++ b/src/api/homepage/content-types/homepage/schema.json @@ -1,68 +1,72 @@ -{ - "kind": "collectionType", - "collectionName": "homepages", - "info": { - "singularName": "homepage", - "pluralName": "homepages", - "displayName": "Homepage", - "description": "" - }, - "options": { - "draftAndPublish": true - }, - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "attributes": { - "title": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "string", - "required": true - }, - "description": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "text", - "required": true - }, - "components": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "dynamiczone", - "components": [ - "ui.hero", - "ui.missie-met-statistieken", - "ui.image", - "ui.image-met-titel", - "ui.kernwaarden", - "ui.klant-logo-s", - "ui.team" - ], - "required": true, - "min": 1 - }, - "site": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "enumeration", - "enum": ["cloud", "dotnet"], - "required": true, - "default": "dotnet" - } - } -} +{ + "kind": "collectionType", + "collectionName": "homepages", + "info": { + "singularName": "homepage", + "pluralName": "homepages", + "displayName": "Homepage", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "attributes": { + "title": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "string", + "required": true + }, + "description": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "text", + "required": true + }, + "components": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "dynamiczone", + "components": [ + "ui.hero", + "ui.missie-met-statistieken", + "ui.image", + "ui.image-met-titel", + "ui.kernwaarden", + "ui.klant-logo-s", + "ui.team", + "ui.artikelen-overzicht" + ], + "required": true, + "min": 1 + }, + "site": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "enumeration", + "enum": [ + "cloud", + "dotnet" + ], + "required": true, + "default": "dotnet" + } + } +} diff --git a/src/api/homepage/middlewares/homepage-populate.js b/src/api/homepage/middlewares/homepage-populate.js index 3e4596f..f6ffdbd 100644 --- a/src/api/homepage/middlewares/homepage-populate.js +++ b/src/api/homepage/middlewares/homepage-populate.js @@ -1,89 +1,92 @@ -'use strict'; - -/** - * `homepage-populate` middleware - */ - -const populate = { - components: { - on: { - 'ui.hero': { - populate: { - CTO: { - populate: { - page: { - fields: ['title_website', 'slug'], - }, - }, - }, - link: { - populate: '*', - }, - images: { - fields: ['url', 'alternativeText'], - }, - }, - }, - 'ui.missie-met-statistieken': { - populate: '*', - }, - 'ui.image': { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - 'ui.image-met-titel': { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - 'ui.kernwaarden': { - populate: { - items: { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - }, - }, - 'ui.klant-logo-s': { - populate: { - klant: { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - }, - }, - 'ui.team': { - populate: { - members: { - populate: { - avatar: { - fields: ['url', 'alternativeText'], - }, - }, - }, - }, - }, - }, - }, -}; - -module.exports = (config, { strapi }) => { - return async (ctx, next) => { - strapi.log.info('In homepage-populate middleware.'); - - ctx.query.populate = populate; - - await next(); - }; -}; +'use strict'; + +/** + * `homepage-populate` middleware + */ + +const populate = { + components: { + on: { + 'ui.hero': { + populate: { + CTO: { + populate: { + page: { + fields: ['title_website', 'slug'], + }, + }, + }, + link: { + populate: '*', + }, + images: { + fields: ['url', 'alternativeText'], + }, + }, + }, + 'ui.missie-met-statistieken': { + populate: '*', + }, + 'ui.image': { + populate: { + image: { + fields: ['url', 'alternativeText'], + }, + }, + }, + 'ui.image-met-titel': { + populate: { + image: { + fields: ['url', 'alternativeText'], + }, + }, + }, + 'ui.kernwaarden': { + populate: { + items: { + populate: { + image: { + fields: ['url', 'alternativeText'], + }, + }, + }, + }, + }, + 'ui.klant-logo-s': { + populate: { + klant: { + populate: { + image: { + fields: ['url', 'alternativeText'], + }, + }, + }, + }, + }, + 'ui.team': { + populate: { + members: { + populate: { + avatar: { + fields: ['url', 'alternativeText'], + }, + }, + }, + }, + }, + 'ui.artikelen-overzicht': { + fields: ['title'], + }, + }, + }, +}; + +module.exports = (config, { strapi }) => { + return async (ctx, next) => { + strapi.log.info('In homepage-populate middleware.'); + + ctx.query.populate = populate; + + await next(); + }; +}; diff --git a/src/api/page/content-types/page/schema.json b/src/api/page/content-types/page/schema.json index 9161c75..3a2c843 100644 --- a/src/api/page/content-types/page/schema.json +++ b/src/api/page/content-types/page/schema.json @@ -1,83 +1,86 @@ -{ - "kind": "collectionType", - "collectionName": "pages", - "info": { - "singularName": "page", - "pluralName": "pages", - "displayName": "Page", - "description": "" - }, - "options": { - "draftAndPublish": true - }, - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "attributes": { - "title_website": { - "type": "string", - "required": true, - "pluginOptions": { - "i18n": { - "localized": true - } - } - }, - "description": { - "type": "text", - "required": true, - "pluginOptions": { - "i18n": { - "localized": true - } - } - }, - "components": { - "type": "dynamiczone", - "components": [ - "ui.image", - "ui.image-met-titel", - "ui.text", - "ui.opsomming", - "ui.titel", - "ui.quote" - ], - "pluginOptions": { - "i18n": { - "localized": true - } - } - }, - "site": { - "type": "enumeration", - "enum": ["cloud", "dotnet"], - "required": true, - "default": "dotnet", - "pluginOptions": { - "i18n": { - "localized": false - } - } - }, - "title_cms": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "string", - "required": true - }, - "slug": { - "type": "uid", - "targetField": "title_cms", - "required": true - }, - "tagline": { - "type": "string", - "required": true - } - } -} +{ + "kind": "collectionType", + "collectionName": "pages", + "info": { + "singularName": "page", + "pluralName": "pages", + "displayName": "Page", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "attributes": { + "title_website": { + "type": "string", + "required": true, + "pluginOptions": { + "i18n": { + "localized": true + } + } + }, + "description": { + "type": "text", + "required": true, + "pluginOptions": { + "i18n": { + "localized": true + } + } + }, + "components": { + "type": "dynamiczone", + "components": [ + "ui.text", + "ui.opsomming", + "ui.titel", + "ui.quote", + "ui.page-image", + "ui.artikelen" + ], + "pluginOptions": { + "i18n": { + "localized": true + } + } + }, + "site": { + "type": "enumeration", + "enum": [ + "cloud", + "dotnet" + ], + "required": true, + "default": "dotnet", + "pluginOptions": { + "i18n": { + "localized": false + } + } + }, + "title_cms": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "string", + "required": true + }, + "slug": { + "type": "uid", + "targetField": "title_cms", + "required": true + }, + "tagline": { + "type": "string", + "required": true + } + } +} diff --git a/src/api/page/middlewares/page-populate.js b/src/api/page/middlewares/page-populate.js index c85aff9..df4dcc3 100644 --- a/src/api/page/middlewares/page-populate.js +++ b/src/api/page/middlewares/page-populate.js @@ -1,53 +1,49 @@ -'use strict'; - -/** - * `page-populate` middleware - */ - -const populate = { - components: { - on: { - 'ui.text': { - fields: ['content'], - }, - 'ui.image': { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - 'ui.image-met-titel': { - populate: { - image: { - fields: ['url', 'alternativeText'], - }, - }, - }, - 'ui.opsomming': { - populate: { - items: { - fields: ['text'], - }, - }, - }, - 'ui.titel': { - fields: ['title', 'content'], - }, - 'ui.quote': { - fields: ['quote', 'name', 'jobTitle'], - }, - }, - }, -}; - -module.exports = (config, { strapi }) => { - // Add your own logic here. - return async (ctx, next) => { - strapi.log.info('In page-populate middleware.'); - - ctx.query.populate = populate; - - await next(); - }; -}; +'use strict'; + +/** + * `page-populate` middleware + */ + +const populate = { + components: { + on: { + 'ui.artikelen': { + fields: ['title'], + }, + 'ui.text': { + fields: ['content'], + }, + 'ui.page-image': { + populate: { + image: { + fields: ['url', 'alternativeText'], + }, + }, + }, + 'ui.opsomming': { + populate: { + items: { + fields: ['text'], + }, + }, + }, + 'ui.titel': { + fields: ['title', 'content'], + }, + 'ui.quote': { + fields: ['quote', 'name', 'jobTitle'], + }, + }, + }, +}; + +module.exports = (config, { strapi }) => { + // Add your own logic here. + return async (ctx, next) => { + strapi.log.info('In page-populate middleware.'); + + ctx.query.populate = populate; + + await next(); + }; +}; diff --git a/src/components/ui/artikelen-overzicht.json b/src/components/ui/artikelen-overzicht.json new file mode 100644 index 0000000..9eccfd8 --- /dev/null +++ b/src/components/ui/artikelen-overzicht.json @@ -0,0 +1,14 @@ +{ + "collectionName": "components_ui_artikelen_overzichts", + "info": { + "displayName": "Artikelen overzicht", + "icon": "book" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + } + } +} diff --git a/src/components/ui/artikelen.json b/src/components/ui/artikelen.json new file mode 100644 index 0000000..6d7a214 --- /dev/null +++ b/src/components/ui/artikelen.json @@ -0,0 +1,14 @@ +{ + "collectionName": "components_ui_artikelens", + "info": { + "displayName": "Artikelen", + "icon": "book" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + } + } +} diff --git a/src/components/ui/image-met-titel.json b/src/components/ui/image-met-titel.json index b4b5444..6f77cc0 100644 --- a/src/components/ui/image-met-titel.json +++ b/src/components/ui/image-met-titel.json @@ -1,25 +1,27 @@ -{ - "collectionName": "components_ui_image_met_titels", - "info": { - "displayName": "Image met titel", - "icon": "landscape", - "description": "" - }, - "options": {}, - "attributes": { - "title": { - "type": "string", - "required": true - }, - "image": { - "type": "media", - "multiple": false, - "required": true, - "allowedTypes": ["images"] - }, - "description": { - "type": "text", - "required": true - } - } -} +{ + "collectionName": "components_ui_image_met_titels", + "info": { + "displayName": "Image met titel voor Homepage", + "icon": "picture", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + }, + "image": { + "type": "media", + "multiple": false, + "required": true, + "allowedTypes": [ + "images" + ] + }, + "description": { + "type": "text", + "required": true + } + } +} diff --git a/src/components/ui/image.json b/src/components/ui/image.json index df02714..110cc48 100644 --- a/src/components/ui/image.json +++ b/src/components/ui/image.json @@ -1,17 +1,19 @@ -{ - "collectionName": "components_ui_images", - "info": { - "displayName": "Image", - "icon": "landscape", - "description": "" - }, - "options": {}, - "attributes": { - "image": { - "type": "media", - "multiple": false, - "required": true, - "allowedTypes": ["images"] - } - } -} +{ + "collectionName": "components_ui_images", + "info": { + "displayName": "Image voor Homepage", + "icon": "picture", + "description": "" + }, + "options": {}, + "attributes": { + "image": { + "type": "media", + "multiple": false, + "required": true, + "allowedTypes": [ + "images" + ] + } + } +} diff --git a/src/components/ui/page-image.json b/src/components/ui/page-image.json new file mode 100644 index 0000000..b2d6a84 --- /dev/null +++ b/src/components/ui/page-image.json @@ -0,0 +1,27 @@ +{ + "collectionName": "components_ui_page_images", + "info": { + "displayName": "Image voor Page", + "icon": "picture", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + }, + "description": { + "type": "text", + "required": false + }, + "image": { + "type": "media", + "multiple": false, + "required": true, + "allowedTypes": [ + "images" + ] + } + } +} diff --git a/src/components/ui/text.json b/src/components/ui/text.json index 3f71c13..b64dda1 100644 --- a/src/components/ui/text.json +++ b/src/components/ui/text.json @@ -1,14 +1,15 @@ -{ - "collectionName": "components_ui_texts", - "info": { - "displayName": "Text", - "icon": "feather" - }, - "options": {}, - "attributes": { - "content": { - "type": "richtext", - "required": true - } - } -} +{ + "collectionName": "components_ui_texts", + "info": { + "displayName": "Tekst", + "icon": "feather", + "description": "" + }, + "options": {}, + "attributes": { + "content": { + "type": "richtext", + "required": true + } + } +} diff --git a/src/components/ui/titel.json b/src/components/ui/titel.json index 9073356..dc9428b 100644 --- a/src/components/ui/titel.json +++ b/src/components/ui/titel.json @@ -1,19 +1,19 @@ -{ - "collectionName": "components_ui_titels", - "info": { - "displayName": "Subtitel met text", - "icon": "bold", - "description": "" - }, - "options": {}, - "attributes": { - "title": { - "type": "string", - "required": true - }, - "content": { - "type": "richtext", - "required": true - } - } -} +{ + "collectionName": "components_ui_titels", + "info": { + "displayName": "Subtitel met tekst", + "icon": "bold", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string", + "required": true + }, + "content": { + "type": "richtext", + "required": true + } + } +} diff --git a/types/generated/components.d.ts b/types/generated/components.d.ts index 2410163..2a6a427 100644 --- a/types/generated/components.d.ts +++ b/types/generated/components.d.ts @@ -68,6 +68,28 @@ export interface ElementsSocial extends Struct.ComponentSchema { }; } +export interface UiArtikelen extends Struct.ComponentSchema { + collectionName: 'components_ui_artikelens'; + info: { + displayName: 'Artikelen'; + icon: 'book'; + }; + attributes: { + title: Schema.Attribute.String & Schema.Attribute.Required; + }; +} + +export interface UiArtikelenOverzicht extends Struct.ComponentSchema { + collectionName: 'components_ui_artikelen_overzichts'; + info: { + displayName: 'Artikelen overzicht'; + icon: 'book'; + }; + attributes: { + title: Schema.Attribute.String & Schema.Attribute.Required; + }; +} + export interface UiHero extends Struct.ComponentSchema { collectionName: 'components_ui_heroes'; info: { @@ -88,8 +110,8 @@ export interface UiImage extends Struct.ComponentSchema { collectionName: 'components_ui_images'; info: { description: ''; - displayName: 'Image'; - icon: 'landscape'; + displayName: 'Image voor Homepage'; + icon: 'picture'; }; attributes: { image: Schema.Attribute.Media<'images'> & Schema.Attribute.Required; @@ -100,8 +122,8 @@ export interface UiImageMetTitel extends Struct.ComponentSchema { collectionName: 'components_ui_image_met_titels'; info: { description: ''; - displayName: 'Image met titel'; - icon: 'landscape'; + displayName: 'Image met titel voor Homepage'; + icon: 'picture'; }; attributes: { description: Schema.Attribute.Text & Schema.Attribute.Required; @@ -188,6 +210,20 @@ export interface UiOpsomming extends Struct.ComponentSchema { }; } +export interface UiPageImage extends Struct.ComponentSchema { + collectionName: 'components_ui_page_images'; + info: { + description: ''; + displayName: 'Image voor Page'; + icon: 'picture'; + }; + attributes: { + description: Schema.Attribute.Text; + image: Schema.Attribute.Media<'images'> & Schema.Attribute.Required; + title: Schema.Attribute.String & Schema.Attribute.Required; + }; +} + export interface UiQuote extends Struct.ComponentSchema { collectionName: 'components_ui_quotes'; info: { @@ -218,7 +254,8 @@ export interface UiTeam extends Struct.ComponentSchema { export interface UiText extends Struct.ComponentSchema { collectionName: 'components_ui_texts'; info: { - displayName: 'Text'; + description: ''; + displayName: 'Tekst'; icon: 'feather'; }; attributes: { @@ -230,7 +267,7 @@ export interface UiTitel extends Struct.ComponentSchema { collectionName: 'components_ui_titels'; info: { description: ''; - displayName: 'Subtitel met text'; + displayName: 'Subtitel met tekst'; icon: 'bold'; }; attributes: { @@ -247,6 +284,8 @@ declare module '@strapi/strapi' { 'elements.list-item-text': ElementsListItemText; 'elements.list-item-with-icon': ElementsListItemWithIcon; 'elements.social': ElementsSocial; + 'ui.artikelen': UiArtikelen; + 'ui.artikelen-overzicht': UiArtikelenOverzicht; 'ui.hero': UiHero; 'ui.image': UiImage; 'ui.image-met-titel': UiImageMetTitel; @@ -254,6 +293,7 @@ declare module '@strapi/strapi' { 'ui.klant-logo-s': UiKlantLogoS; 'ui.missie-met-statistieken': UiMissieMetStatistieken; 'ui.opsomming': UiOpsomming; + 'ui.page-image': UiPageImage; 'ui.quote': UiQuote; 'ui.team': UiTeam; 'ui.text': UiText; diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 867fbdc..acbff11 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -609,6 +609,7 @@ export interface ApiHomepageHomepage extends Struct.CollectionTypeSchema { 'ui.kernwaarden', 'ui.klant-logo-s', 'ui.team', + 'ui.artikelen-overzicht', ] > & Schema.Attribute.Required & @@ -679,12 +680,12 @@ export interface ApiPagePage extends Struct.CollectionTypeSchema { attributes: { components: Schema.Attribute.DynamicZone< [ - 'ui.image', - 'ui.image-met-titel', 'ui.text', 'ui.opsomming', 'ui.titel', 'ui.quote', + 'ui.page-image', + 'ui.artikelen', ] > & Schema.Attribute.SetPluginOptions<{