From 0df375bb3382a90fdb7797eb4bed4b5068ba821a Mon Sep 17 00:00:00 2001 From: krupa Date: Thu, 6 Feb 2025 13:10:20 +0530 Subject: [PATCH] feat: add new faq component for the faq page and add fields in contact us form --- src/api/faq/content-types/faq/schema.json | 3 ++- .../section-faqs/fa-qs-page-section.json | 15 +++++++++++++++ .../frequently-asked-question.json | 8 ++++++-- src/components/section-forms/contact.json | 15 ++++++++++++++- types/generated/components.d.ts | 18 ++++++++++++++++++ types/generated/contentTypes.d.ts | 1 + 6 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 src/components/section-faqs/fa-qs-page-section.json diff --git a/src/api/faq/content-types/faq/schema.json b/src/api/faq/content-types/faq/schema.json index f3ea801..484e35b 100644 --- a/src/api/faq/content-types/faq/schema.json +++ b/src/api/faq/content-types/faq/schema.json @@ -18,7 +18,8 @@ "section-hero.resource-hero-section", "section-faqs.frequently-asked-question", "section-cta.banner", - "seo.seo" + "seo.seo", + "section-faqs.fa-qs-page-section" ] }, "seo": { diff --git a/src/components/section-faqs/fa-qs-page-section.json b/src/components/section-faqs/fa-qs-page-section.json new file mode 100644 index 0000000..4e273ee --- /dev/null +++ b/src/components/section-faqs/fa-qs-page-section.json @@ -0,0 +1,15 @@ +{ + "collectionName": "components_section_faqs_fa_qs_page_sections", + "info": { + "displayName": "FAQs Page Section", + "description": "" + }, + "options": {}, + "attributes": { + "faqs": { + "type": "component", + "repeatable": true, + "component": "elements.faq-item" + } + } +} diff --git a/src/components/section-faqs/frequently-asked-question.json b/src/components/section-faqs/frequently-asked-question.json index 5b3b303..4ecdc38 100644 --- a/src/components/section-faqs/frequently-asked-question.json +++ b/src/components/section-faqs/frequently-asked-question.json @@ -1,7 +1,8 @@ { "collectionName": "components_section_faqs_frequently_asked_questions", "info": { - "displayName": "Frequently Asked Question" + "displayName": "Frequently Asked Question", + "description": "" }, "options": {}, "attributes": { @@ -15,6 +16,9 @@ "repeatable": true, "component": "elements.faq-item", "required": true + }, + "subTitle": { + "type": "string" } } -} \ No newline at end of file +} diff --git a/src/components/section-forms/contact.json b/src/components/section-forms/contact.json index fba30f0..708c0b4 100644 --- a/src/components/section-forms/contact.json +++ b/src/components/section-forms/contact.json @@ -1,7 +1,8 @@ { "collectionName": "components_section_forms_contacts", "info": { - "displayName": "Contact" + "displayName": "Contact", + "description": "" }, "options": {}, "attributes": { @@ -9,6 +10,18 @@ "type": "component", "repeatable": false, "component": "elements.heading" + }, + "description": { + "type": "text", + "required": false + }, + "items": { + "type": "component", + "repeatable": true, + "component": "elements.items" + }, + "subTitle": { + "type": "text" } } } diff --git a/types/generated/components.d.ts b/types/generated/components.d.ts index f826060..46de6d6 100644 --- a/types/generated/components.d.ts +++ b/types/generated/components.d.ts @@ -480,16 +480,29 @@ export interface SectionCtaPlainCta extends Struct.ComponentSchema { }; } +export interface SectionFaqsFaQsPageSection extends Struct.ComponentSchema { + collectionName: 'components_section_faqs_fa_qs_page_sections'; + info: { + description: ''; + displayName: 'FAQs Page Section'; + }; + attributes: { + faqs: Schema.Attribute.Component<'elements.faq-item', true>; + }; +} + export interface SectionFaqsFrequentlyAskedQuestion extends Struct.ComponentSchema { collectionName: 'components_section_faqs_frequently_asked_questions'; info: { + description: ''; displayName: 'Frequently Asked Question'; }; attributes: { faqs: Schema.Attribute.Component<'elements.faq-item', true> & Schema.Attribute.Required; heading: Schema.Attribute.Component<'elements.heading', false>; + subTitle: Schema.Attribute.String; }; } @@ -597,10 +610,14 @@ export interface SectionFeaturesTabsFeatures extends Struct.ComponentSchema { export interface SectionFormsContact extends Struct.ComponentSchema { collectionName: 'components_section_forms_contacts'; info: { + description: ''; displayName: 'Contact'; }; attributes: { + description: Schema.Attribute.Text; heading: Schema.Attribute.Component<'elements.heading', false>; + items: Schema.Attribute.Component<'elements.items', true>; + subTitle: Schema.Attribute.Text; }; } @@ -885,6 +902,7 @@ declare module '@strapi/strapi' { 'section-cta.banner': SectionCtaBanner; 'section-cta.call-to-action': SectionCtaCallToAction; 'section-cta.plain-cta': SectionCtaPlainCta; + 'section-faqs.fa-qs-page-section': SectionFaqsFaQsPageSection; 'section-faqs.frequently-asked-question': SectionFaqsFrequentlyAskedQuestion; 'section-features.feature-list': SectionFeaturesFeatureList; 'section-features.feature-sub-page-top-tabs': SectionFeaturesFeatureSubPageTopTabs; diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index fca51d5..0740423 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -726,6 +726,7 @@ export interface ApiFaqFaq extends Struct.SingleTypeSchema { 'section-faqs.frequently-asked-question', 'section-cta.banner', 'seo.seo', + 'section-faqs.fa-qs-page-section', ] >; createdAt: Schema.Attribute.DateTime;