Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/api/page/content-types/page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@
"components": {
"type": "dynamiczone",
"components": [
"ui.hero",
"ui.kernwaarden"
"ui.image",
"ui.image-met-titel",
"ui.text",
"ui.opsomming",
"ui.titel",
"ui.quote"
],
"pluginOptions": {
"i18n": {
Expand Down Expand Up @@ -73,6 +77,10 @@
"type": "uid",
"targetField": "title_cms",
"required": true
},
"tagline": {
"type": "string",
"required": true
}
}
}
53 changes: 53 additions & 0 deletions src/api/page/middlewares/page-populate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'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();
};
};
27 changes: 18 additions & 9 deletions src/api/page/routes/page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
'use strict';

/**
* page router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::page.page');
'use strict';

/**
* page router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::page.page', {
config: {
find: {
middlewares: ['api::page.page-populate']
},
findOne: {
middlewares: ['api::page.page-populate']
},
}
});
14 changes: 14 additions & 0 deletions src/components/elements/list-item-text.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"collectionName": "components_elements_list_item_texts",
"info": {
"displayName": "List Item text",
"icon": "bulletList"
},
"options": {},
"attributes": {
"text": {
"type": "text",
"required": true
}
}
}
5 changes: 3 additions & 2 deletions src/components/elements/list-item.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collectionName": "components_elements_list_items",
"info": {
"displayName": "List Item",
"icon": "bulletList"
"displayName": "List Item met description",
"icon": "bulletList",
"description": ""
},
"options": {},
"attributes": {
Expand Down
17 changes: 17 additions & 0 deletions src/components/ui/opsomming.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"collectionName": "components_ui_opsommings",
"info": {
"displayName": "Opsomming",
"icon": "bulletList",
"description": ""
},
"options": {},
"attributes": {
"items": {
"type": "component",
"repeatable": true,
"component": "elements.list-item-text",
"required": true
}
}
}
21 changes: 21 additions & 0 deletions src/components/ui/quote.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"collectionName": "components_ui_quotes",
"info": {
"displayName": "Quote",
"icon": "quote"
},
"options": {},
"attributes": {
"quote": {
"type": "text",
"required": true
},
"name": {
"type": "string",
"required": true
},
"jobTitle": {
"type": "string"
}
}
}
14 changes: 14 additions & 0 deletions src/components/ui/text.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"collectionName": "components_ui_texts",
"info": {
"displayName": "Text",
"icon": "feather"
},
"options": {},
"attributes": {
"content": {
"type": "richtext",
"required": true
}
}
}
19 changes: 19 additions & 0 deletions src/components/ui/titel.json
Original file line number Diff line number Diff line change
@@ -0,0 +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
}
}
}
69 changes: 68 additions & 1 deletion types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export interface ElementsButton extends Struct.ComponentSchema {
export interface ElementsListItem extends Struct.ComponentSchema {
collectionName: 'components_elements_list_items';
info: {
displayName: 'List Item';
description: '';
displayName: 'List Item met description';
icon: 'bulletList';
};
attributes: {
Expand All @@ -28,6 +29,17 @@ export interface ElementsListItem extends Struct.ComponentSchema {
};
}

export interface ElementsListItemText extends Struct.ComponentSchema {
collectionName: 'components_elements_list_item_texts';
info: {
displayName: 'List Item text';
icon: 'bulletList';
};
attributes: {
text: Schema.Attribute.Text & Schema.Attribute.Required;
};
}

export interface ElementsListItemWithIcon extends Struct.ComponentSchema {
collectionName: 'components_elements_list_item_with_icons';
info: {
Expand Down Expand Up @@ -163,6 +175,32 @@ export interface UiMissieMetStatistieken extends Struct.ComponentSchema {
};
}

export interface UiOpsomming extends Struct.ComponentSchema {
collectionName: 'components_ui_opsommings';
info: {
description: '';
displayName: 'Opsomming';
icon: 'bulletList';
};
attributes: {
items: Schema.Attribute.Component<'elements.list-item-text', true> &
Schema.Attribute.Required;
};
}

export interface UiQuote extends Struct.ComponentSchema {
collectionName: 'components_ui_quotes';
info: {
displayName: 'Quote';
icon: 'quote';
};
attributes: {
jobTitle: Schema.Attribute.String;
name: Schema.Attribute.String & Schema.Attribute.Required;
quote: Schema.Attribute.Text & Schema.Attribute.Required;
};
}

export interface UiTeam extends Struct.ComponentSchema {
collectionName: 'components_ui_teams';
info: {
Expand All @@ -177,11 +215,36 @@ export interface UiTeam extends Struct.ComponentSchema {
};
}

export interface UiText extends Struct.ComponentSchema {
collectionName: 'components_ui_texts';
info: {
displayName: 'Text';
icon: 'feather';
};
attributes: {
content: Schema.Attribute.RichText & Schema.Attribute.Required;
};
}

export interface UiTitel extends Struct.ComponentSchema {
collectionName: 'components_ui_titels';
info: {
description: '';
displayName: 'Subtitel met text';
icon: 'bold';
};
attributes: {
content: Schema.Attribute.RichText & Schema.Attribute.Required;
title: Schema.Attribute.String & Schema.Attribute.Required;
};
}

declare module '@strapi/strapi' {
export module Public {
export interface ComponentSchemas {
'elements.button': ElementsButton;
'elements.list-item': ElementsListItem;
'elements.list-item-text': ElementsListItemText;
'elements.list-item-with-icon': ElementsListItemWithIcon;
'elements.social': ElementsSocial;
'ui.hero': UiHero;
Expand All @@ -190,7 +253,11 @@ declare module '@strapi/strapi' {
'ui.kernwaarden': UiKernwaarden;
'ui.klant-logo-s': UiKlantLogoS;
'ui.missie-met-statistieken': UiMissieMetStatistieken;
'ui.opsomming': UiOpsomming;
'ui.quote': UiQuote;
'ui.team': UiTeam;
'ui.text': UiText;
'ui.titel': UiTitel;
}
}
}
12 changes: 11 additions & 1 deletion types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,16 @@ export interface ApiPagePage extends Struct.CollectionTypeSchema {
};
};
attributes: {
components: Schema.Attribute.DynamicZone<['ui.hero', 'ui.kernwaarden']> &
components: Schema.Attribute.DynamicZone<
[
'ui.image',
'ui.image-met-titel',
'ui.text',
'ui.opsomming',
'ui.titel',
'ui.quote',
]
> &
Schema.Attribute.SetPluginOptions<{
i18n: {
localized: true;
Expand Down Expand Up @@ -705,6 +714,7 @@ export interface ApiPagePage extends Struct.CollectionTypeSchema {
}> &
Schema.Attribute.DefaultTo<'dotnet'>;
slug: Schema.Attribute.UID<'title_cms'> & Schema.Attribute.Required;
tagline: Schema.Attribute.String & Schema.Attribute.Required;
title_cms: Schema.Attribute.String &
Schema.Attribute.Required &
Schema.Attribute.SetPluginOptions<{
Expand Down