Skip to content

Commit

Permalink
feat: first draft (#193)
Browse files Browse the repository at this point in the history
* feat: first draft

* fix: no data yet
  • Loading branch information
YoanRos authored Jul 18, 2024
1 parent bcf7d4c commit 0dac869
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 0 deletions.
24 changes: 24 additions & 0 deletions api/src/api/plan-page/content-types/plan-page/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"kind": "singleType",
"collectionName": "plan_pages",
"info": {
"singularName": "plan-page",
"pluralName": "plan-pages",
"displayName": "Plan-page ",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"sections": {
"type": "component",
"repeatable": true,
"component": "blocks.urls-section"
}
}
}
9 changes: 9 additions & 0 deletions api/src/api/plan-page/controllers/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page controller
*/

const { createCoreController } = require("@strapi/strapi").factories

module.exports = createCoreController("api::plan-page.plan-page")
9 changes: 9 additions & 0 deletions api/src/api/plan-page/routes/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page router
*/

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

module.exports = createCoreRouter("api::plan-page.plan-page")
9 changes: 9 additions & 0 deletions api/src/api/plan-page/services/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page service
*/

const { createCoreService } = require("@strapi/strapi").factories

module.exports = createCoreService("api::plan-page.plan-page")
21 changes: 21 additions & 0 deletions api/src/components/blocks/urls-section.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"collectionName": "components_blocks_urls_sections",
"info": {
"displayName": "urls-section",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"urls": {
"type": "component",
"repeatable": true,
"component": "micros.titled-url"
},
"parentUrl": {
"type": "string"
}
}
}
16 changes: 16 additions & 0 deletions api/src/components/micros/titled-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"collectionName": "components_micros_titled_urls",
"info": {
"displayName": "titled-url",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"url": {
"type": "string"
}
}
}
27 changes: 27 additions & 0 deletions api/types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ export interface BlocksParternsSection extends Schema.Component {
}
}

export interface BlocksUrlsSection extends Schema.Component {
collectionName: "components_blocks_urls_sections"
info: {
displayName: "urls-section"
description: ""
}
attributes: {
title: Attribute.String
urls: Attribute.Component<"micros.titled-url", true>
parentUrl: Attribute.String
}
}

export interface HeroHero extends Schema.Component {
collectionName: "components_hero_heroes"
info: {
Expand Down Expand Up @@ -70,6 +83,18 @@ export interface MicrosImage extends Schema.Component {
}
}

export interface MicrosTitledUrl extends Schema.Component {
collectionName: "components_micros_titled_urls"
info: {
displayName: "titled-url"
description: ""
}
attributes: {
title: Attribute.String
url: Attribute.String
}
}

export interface NumberCardBlogCard extends Schema.Component {
collectionName: "components_number_card_blog_cards"
info: {
Expand Down Expand Up @@ -189,9 +214,11 @@ declare module "@strapi/types" {
export interface Components {
"blocks.cards-block": BlocksCardsBlock
"blocks.parterns-section": BlocksParternsSection
"blocks.urls-section": BlocksUrlsSection
"hero.hero": HeroHero
"hero.how-it-works": HeroHowItWorks
"micros.image": MicrosImage
"micros.titled-url": MicrosTitledUrl
"number-card.blog-card": NumberCardBlogCard
"number-card.how-itworks-cards": NumberCardHowItworksCards
"number-card.number-card": NumberCardNumberCard
Expand Down
36 changes: 36 additions & 0 deletions api/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,41 @@ export interface ApiPartnersPagePartnersPage extends Schema.SingleType {
}
}

export interface ApiPlanPagePlanPage extends Schema.SingleType {
collectionName: "plan_pages"
info: {
singularName: "plan-page"
pluralName: "plan-pages"
displayName: "Plan-page "
description: ""
}
options: {
draftAndPublish: true
}
attributes: {
title: Attribute.String
sections: Attribute.Component<"blocks.urls-section", true>
createdAt: Attribute.DateTime
updatedAt: Attribute.DateTime
publishedAt: Attribute.DateTime
createdBy: Attribute.Relation<
"api::plan-page.plan-page",
"oneToOne",
"admin::user"
> &
Attribute.Private
updatedBy: Attribute.Relation<
"api::plan-page.plan-page",
"oneToOne",
"admin::user"
> &
Attribute.Private
sitemap_exclude: Attribute.Boolean &
Attribute.Private &
Attribute.DefaultTo<false>
}
}

declare module "@strapi/types" {
export module Shared {
export interface ContentTypes {
Expand All @@ -1139,6 +1174,7 @@ declare module "@strapi/types" {
"api::category.category": ApiCategoryCategory
"api::page.page": ApiPagePage
"api::partners-page.partners-page": ApiPartnersPagePartnersPage
"api::plan-page.plan-page": ApiPlanPagePlanPage
}
}
}

0 comments on commit 0dac869

Please sign in to comment.