From 49841e72c06adc723660f41335e85e5805562e96 Mon Sep 17 00:00:00 2001 From: nicwands Date: Mon, 8 Jun 2026 11:56:02 -0400 Subject: [PATCH] content structure --- docker-compose.yml | 1 + .../global/content-types/global/schema.json | 7 +++-- src/api/home/content-types/home/schema.json | 20 +++++++++++++ src/api/home/controllers/home.ts | 7 +++++ src/api/home/routes/home.ts | 7 +++++ src/api/home/services/home.ts | 7 +++++ src/components/global/descriptive-list.json | 17 +++++++++++ src/components/global/mosaic-item.json | 10 ++++++- types/generated/components.d.ts | 17 ++++++++++- types/generated/contentTypes.d.ts | 29 ++++++++++++++++++- 10 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 src/api/home/content-types/home/schema.json create mode 100644 src/api/home/controllers/home.ts create mode 100644 src/api/home/routes/home.ts create mode 100644 src/api/home/services/home.ts create mode 100644 src/components/global/descriptive-list.json diff --git a/docker-compose.yml b/docker-compose.yml index 407f241..a9b510b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: image: strapi-cms:latest restart: unless-stopped env_file: .env + user: "${DOCKER_USER:-1000}:${DOCKER_GROUP:-1000}" environment: DATABASE_CLIENT: ${DATABASE_CLIENT} DATABASE_HOST: strapiDB diff --git a/src/api/global/content-types/global/schema.json b/src/api/global/content-types/global/schema.json index add740c..55b3910 100644 --- a/src/api/global/content-types/global/schema.json +++ b/src/api/global/content-types/global/schema.json @@ -11,9 +11,12 @@ }, "pluginOptions": {}, "attributes": { - "mosaic_items": { + "header_copy": { + "type": "blocks" + }, + "header_dl": { "type": "component", - "component": "global.mosaic-item", + "component": "global.descriptive-list", "repeatable": true }, "seo": { diff --git a/src/api/home/content-types/home/schema.json b/src/api/home/content-types/home/schema.json new file mode 100644 index 0000000..ef8b4cb --- /dev/null +++ b/src/api/home/content-types/home/schema.json @@ -0,0 +1,20 @@ +{ + "kind": "singleType", + "collectionName": "homes", + "info": { + "singularName": "home", + "pluralName": "homes", + "displayName": "Home" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "mosaic_items": { + "type": "component", + "component": "global.mosaic-item", + "repeatable": true + } + } +} diff --git a/src/api/home/controllers/home.ts b/src/api/home/controllers/home.ts new file mode 100644 index 0000000..d468c8e --- /dev/null +++ b/src/api/home/controllers/home.ts @@ -0,0 +1,7 @@ +/** + * home controller + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreController('api::home.home'); diff --git a/src/api/home/routes/home.ts b/src/api/home/routes/home.ts new file mode 100644 index 0000000..ad8b509 --- /dev/null +++ b/src/api/home/routes/home.ts @@ -0,0 +1,7 @@ +/** + * home router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::home.home'); diff --git a/src/api/home/services/home.ts b/src/api/home/services/home.ts new file mode 100644 index 0000000..441af19 --- /dev/null +++ b/src/api/home/services/home.ts @@ -0,0 +1,7 @@ +/** + * home service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::home.home'); diff --git a/src/components/global/descriptive-list.json b/src/components/global/descriptive-list.json new file mode 100644 index 0000000..59e70e4 --- /dev/null +++ b/src/components/global/descriptive-list.json @@ -0,0 +1,17 @@ +{ + "collectionName": "components_global_descriptive_lists", + "info": { + "displayName": "Descriptive List", + "icon": "bulletList" + }, + "options": {}, + "attributes": { + "label": { + "type": "string" + }, + "content": { + "type": "blocks" + } + }, + "config": {} +} diff --git a/src/components/global/mosaic-item.json b/src/components/global/mosaic-item.json index fe54222..7cd3669 100644 --- a/src/components/global/mosaic-item.json +++ b/src/components/global/mosaic-item.json @@ -13,7 +13,15 @@ "images" ] }, - "note": { + "title": { + "type": "string" + }, + "dl": { + "type": "component", + "component": "global.descriptive-list", + "repeatable": true + }, + "content": { "type": "blocks" } }, diff --git a/types/generated/components.d.ts b/types/generated/components.d.ts index 49222aa..78e80d4 100644 --- a/types/generated/components.d.ts +++ b/types/generated/components.d.ts @@ -1,5 +1,17 @@ import type { Schema, Struct } from '@strapi/strapi'; +export interface GlobalDescriptiveList extends Struct.ComponentSchema { + collectionName: 'components_global_descriptive_lists'; + info: { + displayName: 'Descriptive List'; + icon: 'bulletList'; + }; + attributes: { + content: Schema.Attribute.Blocks; + label: Schema.Attribute.String; + }; +} + export interface GlobalMosaicItem extends Struct.ComponentSchema { collectionName: 'components_global_mosaic_items'; info: { @@ -7,8 +19,10 @@ export interface GlobalMosaicItem extends Struct.ComponentSchema { icon: 'apps'; }; attributes: { + content: Schema.Attribute.Blocks; + dl: Schema.Attribute.Component<'global.descriptive-list', true>; image: Schema.Attribute.Media<'images'>; - note: Schema.Attribute.Blocks; + title: Schema.Attribute.String; }; } @@ -28,6 +42,7 @@ export interface GlobalSeo extends Struct.ComponentSchema { declare module '@strapi/strapi' { export module Public { export interface ComponentSchemas { + 'global.descriptive-list': GlobalDescriptiveList; 'global.mosaic-item': GlobalMosaicItem; 'global.seo': GlobalSeo; } diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 3976cf0..c1d2990 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -454,13 +454,14 @@ export interface ApiGlobalGlobal extends Struct.SingleTypeSchema { createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + header_copy: Schema.Attribute.Blocks; + header_dl: Schema.Attribute.Component<'global.descriptive-list', true>; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation< 'oneToMany', 'api::global.global' > & Schema.Attribute.Private; - mosaic_items: Schema.Attribute.Component<'global.mosaic-item', true>; publishedAt: Schema.Attribute.DateTime; seo: Schema.Attribute.Component<'global.seo', false>; updatedAt: Schema.Attribute.DateTime; @@ -469,6 +470,31 @@ export interface ApiGlobalGlobal extends Struct.SingleTypeSchema { }; } +export interface ApiHomeHome extends Struct.SingleTypeSchema { + collectionName: 'homes'; + info: { + displayName: 'Home'; + pluralName: 'homes'; + singularName: 'home'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + 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>; + publishedAt: Schema.Attribute.DateTime; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + export interface PluginContentReleasesRelease extends Struct.CollectionTypeSchema { collectionName: 'strapi_releases'; @@ -981,6 +1007,7 @@ declare module '@strapi/strapi' { 'admin::transfer-token-permission': AdminTransferTokenPermission; 'admin::user': AdminUser; 'api::global.global': ApiGlobalGlobal; + 'api::home.home': ApiHomeHome; 'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::i18n.locale': PluginI18NLocale;