Skip to content

Commit

Permalink
add Testimonials section to strapi (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslavzeman authored Mar 27, 2024
1 parent cd3d8a7 commit 2c6ea48
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 2 deletions.
40 changes: 40 additions & 0 deletions next/backend/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,21 @@ export type ComponentBlocksSubpage = {
title?: Maybe<Scalars['String']['output']>
}

export type ComponentBlocksTestimonialItem = {
__typename?: 'ComponentBlocksTestimonialItem'
id: Scalars['ID']['output']
name: Scalars['String']['output']
quote: Scalars['String']['output']
}

export type ComponentBlocksTestimonialItemFiltersInput = {
and?: InputMaybe<Array<InputMaybe<ComponentBlocksTestimonialItemFiltersInput>>>
name?: InputMaybe<StringFilterInput>
not?: InputMaybe<ComponentBlocksTestimonialItemFiltersInput>
or?: InputMaybe<Array<InputMaybe<ComponentBlocksTestimonialItemFiltersInput>>>
quote?: InputMaybe<StringFilterInput>
}

export type ComponentBlocksTimelineItem = {
__typename?: 'ComponentBlocksTimelineItem'
content?: Maybe<Scalars['String']['output']>
Expand Down Expand Up @@ -1413,6 +1428,21 @@ export type ComponentSectionsSubpageListSubpageListArgs = {
sort?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>
}

export type ComponentSectionsTestimonials = {
__typename?: 'ComponentSectionsTestimonials'
hasBackground?: Maybe<Scalars['Boolean']['output']>
id: Scalars['ID']['output']
testimonials: Array<Maybe<ComponentBlocksTestimonialItem>>
text?: Maybe<Scalars['String']['output']>
title?: Maybe<Scalars['String']['output']>
}

export type ComponentSectionsTestimonialsTestimonialsArgs = {
filters?: InputMaybe<ComponentBlocksTestimonialItemFiltersInput>
pagination?: InputMaybe<PaginationArg>
sort?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>
}

export type ComponentSectionsTextWithImage = {
__typename?: 'ComponentSectionsTextWithImage'
content?: Maybe<Scalars['String']['output']>
Expand Down Expand Up @@ -1976,6 +2006,7 @@ export type GenericMorph =
| ComponentBlocksProsAndConsCard
| ComponentBlocksSpaceInfo
| ComponentBlocksSubpage
| ComponentBlocksTestimonialItem
| ComponentBlocksTimelineItem
| ComponentBlocksTopServicesItem
| ComponentBlocksVideo
Expand Down Expand Up @@ -2020,6 +2051,7 @@ export type GenericMorph =
| ComponentSectionsRegulationsList
| ComponentSectionsSpace
| ComponentSectionsSubpageList
| ComponentSectionsTestimonials
| ComponentSectionsTextWithImage
| ComponentSectionsTimeline
| ComponentSectionsTopServices
Expand Down Expand Up @@ -3190,6 +3222,7 @@ export type PageSectionsDynamicZone =
| ComponentSectionsRegulations
| ComponentSectionsRegulationsList
| ComponentSectionsSpace
| ComponentSectionsTestimonials
| ComponentSectionsTextWithImage
| ComponentSectionsTimeline
| ComponentSectionsVideos
Expand Down Expand Up @@ -8979,6 +9012,7 @@ export type PageBySlugQuery = {
text?: string | null
}
| { __typename: 'ComponentSectionsSpace' }
| { __typename: 'ComponentSectionsTestimonials' }
| {
__typename: 'ComponentSectionsTextWithImage'
hasBackground?: boolean | null
Expand Down Expand Up @@ -10117,6 +10151,7 @@ export type PageEntityFragment = {
text?: string | null
}
| { __typename: 'ComponentSectionsSpace' }
| { __typename: 'ComponentSectionsTestimonials' }
| {
__typename: 'ComponentSectionsTextWithImage'
hasBackground?: boolean | null
Expand Down Expand Up @@ -13190,6 +13225,10 @@ type Sections_ComponentSectionsRegulationsList_Fragment = {

type Sections_ComponentSectionsSpace_Fragment = { __typename: 'ComponentSectionsSpace' }

type Sections_ComponentSectionsTestimonials_Fragment = {
__typename: 'ComponentSectionsTestimonials'
}

type Sections_ComponentSectionsTextWithImage_Fragment = {
__typename: 'ComponentSectionsTextWithImage'
hasBackground?: boolean | null
Expand Down Expand Up @@ -13270,6 +13309,7 @@ export type SectionsFragment =
| Sections_ComponentSectionsRegulations_Fragment
| Sections_ComponentSectionsRegulationsList_Fragment
| Sections_ComponentSectionsSpace_Fragment
| Sections_ComponentSectionsTestimonials_Fragment
| Sections_ComponentSectionsTextWithImage_Fragment
| Sections_ComponentSectionsTimeline_Fragment
| Sections_ComponentSectionsVideos_Fragment
Expand Down
50 changes: 48 additions & 2 deletions strapi/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,26 @@ input ComponentBlocksSubpageInput {
title: String
}

type ComponentBlocksTestimonialItem {
id: ID!
name: String!
quote: String!
}

input ComponentBlocksTestimonialItemFiltersInput {
and: [ComponentBlocksTestimonialItemFiltersInput]
name: StringFilterInput
not: ComponentBlocksTestimonialItemFiltersInput
or: [ComponentBlocksTestimonialItemFiltersInput]
quote: StringFilterInput
}

input ComponentBlocksTestimonialItemInput {
id: ID
name: String
quote: String
}

type ComponentBlocksTimelineItem {
content: String
id: ID!
Expand Down Expand Up @@ -1803,6 +1823,32 @@ input ComponentSectionsSubpageListInput {
subpageList: [ComponentBlocksPageLinkInput]
}

type ComponentSectionsTestimonials {
hasBackground: Boolean
id: ID!
testimonials(filters: ComponentBlocksTestimonialItemFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [ComponentBlocksTestimonialItem]!
text: String
title: String
}

input ComponentSectionsTestimonialsFiltersInput {
and: [ComponentSectionsTestimonialsFiltersInput]
hasBackground: BooleanFilterInput
not: ComponentSectionsTestimonialsFiltersInput
or: [ComponentSectionsTestimonialsFiltersInput]
testimonials: ComponentBlocksTestimonialItemFiltersInput
text: StringFilterInput
title: StringFilterInput
}

input ComponentSectionsTestimonialsInput {
hasBackground: Boolean
id: ID
testimonials: [ComponentBlocksTestimonialItemInput]
text: String
title: String
}

type ComponentSectionsTextWithImage {
content: String
hasBackground: Boolean
Expand Down Expand Up @@ -2411,7 +2457,7 @@ type GeneralRelationResponseCollection {
data: [GeneralEntity!]!
}

union GenericMorph = Alert | BlogPost | ComponentAccordionItemsFlatText | ComponentAccordionItemsInstitution | ComponentAccordionItemsInstitutionNarrow | ComponentBlocksBlogPostLink | ComponentBlocksBookmarkLink | ComponentBlocksCommonLink | ComponentBlocksComparisonCard | ComponentBlocksComparisonItem | ComponentBlocksContactCard | ComponentBlocksDocListExtensions | ComponentBlocksFile | ComponentBlocksFileItem | ComponentBlocksFooterColumn | ComponentBlocksFooterContactItem | ComponentBlocksFooterSection | ComponentBlocksGalleryItem | ComponentBlocksHomepageBookmark | ComponentBlocksHomepageHighlightsItem | ComponentBlocksIconWithTitleAndDescription | ComponentBlocksInBa | ComponentBlocksNumericalListItem | ComponentBlocksPageLink | ComponentBlocksProsAndConsCard | ComponentBlocksSpaceInfo | ComponentBlocksSubpage | ComponentBlocksTimelineItem | ComponentBlocksTopServicesItem | ComponentBlocksVideo | ComponentGeneralHeader | ComponentGeneralHeaderLink | ComponentMenuMenuItem | ComponentMenuMenuLink | ComponentMenuMenuSection | ComponentOsItemsAdvancedAccordionDepartment | ComponentOsItemsAdvancedAccordionItem | ComponentOsItemsAdvancedAccordionSubItem | ComponentOsItemsAdvancedAccordionSubSubItem | ComponentSectionsAccordion | ComponentSectionsBanner | ComponentSectionsBlogPostsByCategory | ComponentSectionsBlogPostsByTags | ComponentSectionsBlogPostsList | ComponentSectionsCalculator | ComponentSectionsColumnedText | ComponentSectionsComparisonSection | ComponentSectionsContactsSection | ComponentSectionsDivider | ComponentSectionsDocumentList | ComponentSectionsFeaturedBlogPosts | ComponentSectionsFileList | ComponentSectionsGallery | ComponentSectionsHomepageEvents | ComponentSectionsHomepageHighlights | ComponentSectionsHomepageMayorAndCouncil | ComponentSectionsHomepageTabs | ComponentSectionsIconTitleDesc | ComponentSectionsIframe | ComponentSectionsInbaArticlesList | ComponentSectionsInbaReleases | ComponentSectionsLinks | ComponentSectionsNarrowText | ComponentSectionsNumericalList | ComponentSectionsOfficialBoard | ComponentSectionsOrganizationalStructure | ComponentSectionsProsAndConsSection | ComponentSectionsRegulations | ComponentSectionsRegulationsList | ComponentSectionsSpace | ComponentSectionsSubpageList | ComponentSectionsTextWithImage | ComponentSectionsTimeline | ComponentSectionsTopServices | ComponentSectionsVideos | ComponentSectionsWaves | ComponentTaxAdministratorsTaxAdministrator | Footer | General | Homepage | I18NLocale | InbaArticle | InbaRelease | InbaTag | Menu | Page | PageCategory | PageSubcategory | Regulation | Tag | TaxAdministratorsList | UploadFile | UploadFolder | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser | Vzn
union GenericMorph = Alert | BlogPost | ComponentAccordionItemsFlatText | ComponentAccordionItemsInstitution | ComponentAccordionItemsInstitutionNarrow | ComponentBlocksBlogPostLink | ComponentBlocksBookmarkLink | ComponentBlocksCommonLink | ComponentBlocksComparisonCard | ComponentBlocksComparisonItem | ComponentBlocksContactCard | ComponentBlocksDocListExtensions | ComponentBlocksFile | ComponentBlocksFileItem | ComponentBlocksFooterColumn | ComponentBlocksFooterContactItem | ComponentBlocksFooterSection | ComponentBlocksGalleryItem | ComponentBlocksHomepageBookmark | ComponentBlocksHomepageHighlightsItem | ComponentBlocksIconWithTitleAndDescription | ComponentBlocksInBa | ComponentBlocksNumericalListItem | ComponentBlocksPageLink | ComponentBlocksProsAndConsCard | ComponentBlocksSpaceInfo | ComponentBlocksSubpage | ComponentBlocksTestimonialItem | ComponentBlocksTimelineItem | ComponentBlocksTopServicesItem | ComponentBlocksVideo | ComponentGeneralHeader | ComponentGeneralHeaderLink | ComponentMenuMenuItem | ComponentMenuMenuLink | ComponentMenuMenuSection | ComponentOsItemsAdvancedAccordionDepartment | ComponentOsItemsAdvancedAccordionItem | ComponentOsItemsAdvancedAccordionSubItem | ComponentOsItemsAdvancedAccordionSubSubItem | ComponentSectionsAccordion | ComponentSectionsBanner | ComponentSectionsBlogPostsByCategory | ComponentSectionsBlogPostsByTags | ComponentSectionsBlogPostsList | ComponentSectionsCalculator | ComponentSectionsColumnedText | ComponentSectionsComparisonSection | ComponentSectionsContactsSection | ComponentSectionsDivider | ComponentSectionsDocumentList | ComponentSectionsFeaturedBlogPosts | ComponentSectionsFileList | ComponentSectionsGallery | ComponentSectionsHomepageEvents | ComponentSectionsHomepageHighlights | ComponentSectionsHomepageMayorAndCouncil | ComponentSectionsHomepageTabs | ComponentSectionsIconTitleDesc | ComponentSectionsIframe | ComponentSectionsInbaArticlesList | ComponentSectionsInbaReleases | ComponentSectionsLinks | ComponentSectionsNarrowText | ComponentSectionsNumericalList | ComponentSectionsOfficialBoard | ComponentSectionsOrganizationalStructure | ComponentSectionsProsAndConsSection | ComponentSectionsRegulations | ComponentSectionsRegulationsList | ComponentSectionsSpace | ComponentSectionsSubpageList | ComponentSectionsTestimonials | ComponentSectionsTextWithImage | ComponentSectionsTimeline | ComponentSectionsTopServices | ComponentSectionsVideos | ComponentSectionsWaves | ComponentTaxAdministratorsTaxAdministrator | Footer | General | Homepage | I18NLocale | InbaArticle | InbaRelease | InbaTag | Menu | Page | PageCategory | PageSubcategory | Regulation | Tag | TaxAdministratorsList | UploadFile | UploadFolder | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser | Vzn

type Homepage {
bookmarkTourists: ComponentBlocksHomepageBookmark
Expand Down Expand Up @@ -3104,7 +3150,7 @@ type PageRelationResponseCollection {
data: [PageEntity!]!
}

union PageSectionsDynamicZone = ComponentSectionsAccordion | ComponentSectionsBanner | ComponentSectionsBlogPostsByCategory | ComponentSectionsBlogPostsByTags | ComponentSectionsBlogPostsList | ComponentSectionsCalculator | ComponentSectionsColumnedText | ComponentSectionsComparisonSection | ComponentSectionsContactsSection | ComponentSectionsDivider | ComponentSectionsDocumentList | ComponentSectionsFeaturedBlogPosts | ComponentSectionsFileList | ComponentSectionsGallery | ComponentSectionsIconTitleDesc | ComponentSectionsIframe | ComponentSectionsInbaArticlesList | ComponentSectionsInbaReleases | ComponentSectionsLinks | ComponentSectionsNarrowText | ComponentSectionsNumericalList | ComponentSectionsOfficialBoard | ComponentSectionsOrganizationalStructure | ComponentSectionsProsAndConsSection | ComponentSectionsRegulations | ComponentSectionsRegulationsList | ComponentSectionsSpace | ComponentSectionsTextWithImage | ComponentSectionsTimeline | ComponentSectionsVideos | ComponentSectionsWaves | Error
union PageSectionsDynamicZone = ComponentSectionsAccordion | ComponentSectionsBanner | ComponentSectionsBlogPostsByCategory | ComponentSectionsBlogPostsByTags | ComponentSectionsBlogPostsList | ComponentSectionsCalculator | ComponentSectionsColumnedText | ComponentSectionsComparisonSection | ComponentSectionsContactsSection | ComponentSectionsDivider | ComponentSectionsDocumentList | ComponentSectionsFeaturedBlogPosts | ComponentSectionsFileList | ComponentSectionsGallery | ComponentSectionsIconTitleDesc | ComponentSectionsIframe | ComponentSectionsInbaArticlesList | ComponentSectionsInbaReleases | ComponentSectionsLinks | ComponentSectionsNarrowText | ComponentSectionsNumericalList | ComponentSectionsOfficialBoard | ComponentSectionsOrganizationalStructure | ComponentSectionsProsAndConsSection | ComponentSectionsRegulations | ComponentSectionsRegulationsList | ComponentSectionsSpace | ComponentSectionsTestimonials | ComponentSectionsTextWithImage | ComponentSectionsTimeline | ComponentSectionsVideos | ComponentSectionsWaves | Error

scalar PageSectionsDynamicZoneInput

Expand Down
1 change: 1 addition & 0 deletions strapi/src/api/page/content-types/page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"sections.regulations",
"sections.regulations-list",
"sections.space",
"sections.testimonials",
"sections.text-with-image",
"sections.timeline",
"sections.videos",
Expand Down
17 changes: 17 additions & 0 deletions strapi/src/components/blocks/testimonial-item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"collectionName": "components_blocks_testimonial_items",
"info": {
"displayName": "testimonial item"
},
"options": {},
"attributes": {
"name": {
"type": "string",
"required": true
},
"quote": {
"type": "text",
"required": true
}
}
}
26 changes: 26 additions & 0 deletions strapi/src/components/sections/testimonials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"collectionName": "components_sections_testimonials",
"info": {
"displayName": "Testimonials",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"text": {
"type": "string"
},
"hasBackground": {
"type": "boolean"
},
"testimonials": {
"type": "component",
"repeatable": true,
"component": "blocks.testimonial-item",
"min": 1,
"required": true
}
}
}

0 comments on commit 2c6ea48

Please sign in to comment.