Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FAQ card to support answerV2 instead of answer #1142

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Conversation

likimmy
Copy link
Contributor

@likimmy likimmy commented Aug 14, 2023

J=BACK-2436
TEST=manual

Created test site using jambo template and verified that FAQ answer was rendered properly

J=BACK-2436
TEST=manual

Created test site using jambo template and verified that FAQ answer was rendered properly
@likimmy likimmy requested a review from cea2aj August 14, 2023 15:13
@coveralls
Copy link

coveralls commented Aug 14, 2023

Coverage Status

coverage: 8.737%. remained the same when pulling d627612 on fix-faq-answer into e1e7dab on develop.

if (profile.answerV2 && profile.answerV2.html) {
profileAnswer = profile.answerV2.html;
} else if (profile.answerV2 && profile.answerV2.json) {
console.warn('JSON is not supported, please switch to HTML.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we should say use the word 'convert' rather than 'switch' because the feature on the backend uses the word 'convert' as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in most recent commit


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to add a 3rd if statement which maintains this functionality of calling ANSWERS.formatRichText if profile.answers exists. That way if someone upgrades to this version of the hitchhiker-theme, it won't break any existing sites which use the faq-accordion card

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense! i've added that check into the logic in the most recent commit

Copy link
Member

@cea2aj cea2aj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@likimmy likimmy merged commit 9212bc9 into develop Aug 14, 2023
24 of 28 checks passed
@likimmy likimmy deleted the fix-faq-answer branch August 14, 2023 15:51
@likimmy likimmy mentioned this pull request Aug 14, 2023
likimmy added a commit that referenced this pull request Aug 14, 2023
## v1.33.0

### Changes

- Update FAQ card to support answerV2 instead of answer (#1142)
- Update corresponding translation tests for above changes (#1147)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants