diff --git a/cards/faq-accordion/component.js b/cards/faq-accordion/component.js index 1286f47a0..270e4bad1 100644 --- a/cards/faq-accordion/component.js +++ b/cards/faq-accordion/component.js @@ -13,11 +13,20 @@ class faq_accordionCardComponent extends BaseCard['faq-accordion'] { */ dataForRender(profile) { const linkTarget = AnswersExperience.runtimeConfig.get('linkTarget') || '_top'; + let profileAnswer = ''; + if (profile.answerV2 && profile.answerV2.html) { + profileAnswer = profile.answerV2.html; + } else if (profile.answerV2 && profile.answerV2.json) { + console.warn('JSON is not supported, please convert to HTML.') + } else if (profile.answer) { + profileAnswer = ANSWERS.formatRichText(profile.answer, "answer", linkTarget); + } return { title: profile.question || profile.name, // The header text of the card // subtitle: '', // The sub-header text of the card - details: profile.answer ? ANSWERS.formatRichText(profile.answer, "answer", linkTarget) : null, // The text in the body of the card + details: profileAnswer ? profileAnswer : null, // The text in the body + // of the card // If the card's details are longer than a certain character count, you can truncate the // text. A toggle will be supplied that can show or hide the truncated text. // showMoreDetails: { diff --git a/cards/multilang-faq-accordion/component.js b/cards/multilang-faq-accordion/component.js index 791107337..2d6e27c0c 100644 --- a/cards/multilang-faq-accordion/component.js +++ b/cards/multilang-faq-accordion/component.js @@ -13,11 +13,20 @@ class multilang_faq_accordionCardComponent extends BaseCard['multilang-faq-accor */ dataForRender(profile) { const linkTarget = AnswersExperience.runtimeConfig.get('linkTarget') || '_top'; + let profileAnswer = ''; + if (profile.answerV2 && profile.answerV2.html) { + profileAnswer = profile.answerV2.html; + } else if (profile.answerV2 && profile.answerV2.json) { + console.warn('JSON is not supported, please convert to HTML.') + } else if (profile.answer) { + profileAnswer = ANSWERS.formatRichText(profile.answer, "answer", linkTarget); + } return { title: profile.question || profile.name, // The header text of the card // subtitle: '', // The sub-header text of the card - details: profile.answer ? ANSWERS.formatRichText(profile.answer, "answer", linkTarget) : null, // The text in the body of the card + details: profileAnswer ? profileAnswer : null, // The text in the body + // of the card // If the card's details are longer than a certain character count, you can truncate the // text. A toggle will be supplied that can show or hide the truncated text. // showMoreDetails: { diff --git a/package-lock.json b/package-lock.json index e26bcc762..d2252f3d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "devDependencies": { "@axe-core/puppeteer": "^4.5.2", "@babel/core": "^7.9.6", diff --git a/package.json b/package.json index b25e0044b..e5263f31f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "description": "A starter Search theme for hitchhikers", "keywords": [ "jambo", diff --git a/static/package-lock.json b/static/package-lock.json index 873c25e6a..3a11a264d 100644 --- a/static/package-lock.json +++ b/static/package-lock.json @@ -1,12 +1,12 @@ { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "license": "BSD-3-Clause", "dependencies": { "@vimeo/player": "^2.15.3", diff --git a/static/package.json b/static/package.json index 9e4fcbf8d..cea6640ab 100644 --- a/static/package.json +++ b/static/package.json @@ -1,6 +1,6 @@ { "name": "answers-hitchhiker-theme", - "version": "1.32.0", + "version": "1.33.0", "description": "Toolchain for use with the HH Theme", "main": "Gruntfile.js", "scripts": { diff --git a/translations/messages.pot b/translations/messages.pot index 18c7bad3f..2d030978a 100644 --- a/translations/messages.pot +++ b/translations/messages.pot @@ -147,7 +147,7 @@ msgstr "" #: cards/multilang-document-standard/component.js:53 #: cards/multilang-event-standard/component.js:53 -#: cards/multilang-faq-accordion/component.js:51 +#: cards/multilang-faq-accordion/component.js:60 #: cards/multilang-financial-professional-location/component.js:69 #: cards/multilang-job-standard/component.js:44 #: cards/multilang-link-standard/component.js:32 @@ -171,7 +171,7 @@ msgstr[1] "" #: cards/multilang-document-standard/component.js:54 #: cards/multilang-event-standard/component.js:54 -#: cards/multilang-faq-accordion/component.js:52 +#: cards/multilang-faq-accordion/component.js:61 #: cards/multilang-financial-professional-location/component.js:70 #: cards/multilang-job-standard/component.js:45 #: cards/multilang-link-standard/component.js:33 @@ -191,7 +191,7 @@ msgstr "" #: cards/multilang-document-standard/component.js:55 #: cards/multilang-event-standard/component.js:55 -#: cards/multilang-faq-accordion/component.js:53 +#: cards/multilang-faq-accordion/component.js:62 #: cards/multilang-financial-professional-location/component.js:71 #: cards/multilang-job-standard/component.js:46 #: cards/multilang-link-standard/component.js:34