-
Notifications
You must be signed in to change notification settings - Fork 5
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
cards: Update all product cards to use new/updated fields #411
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
30016c3
cards: Update all product cards to use new/updated fields
creotutar 261f7bc
product-prominentimage: add tag as stock status
creotutar 158c930
Hide show more details by default, because rich text description
creotutar a633a0b
Tag should be commented out by default
creotutar 9ee9e7c
Keep the way we comment things out consistent
creotutar 4ad353c
Fix consistent comment change for multilang cards
creotutar dd4fd23
Null-check description so decription can be null as before
creotutar 490ecbb
Use fieldName richTextDescription and target top
creotutar be5b431
Add $ for regular product cards, default strings to empty
creotutar 972a7d5
Add clickable card
creotutar 15a4c1d
Add variables to the default file
creotutar 4222a34
Use new alt text field
creotutar ce75b9c
Remove special stock status logic as request from PM
creotutar 4221af7
Remove $ for multilang clickable card
creotutar 6be8299
Add comment for rtf showMoreDetails, remove interpolated string
creotutar 62a137e
Use new price field, not c_price
creotutar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,27 +12,30 @@ class multilang_product_standardCardComponent extends BaseCard['multilang-produc | |
* @param profile profile of the entity in the card | ||
*/ | ||
dataForRender(profile) { | ||
let price = ''; | ||
if (profile.c_price) { | ||
price = `$${profile.c_price}`; | ||
let imageUrl = ''; | ||
let alternateText = ''; | ||
if (profile.photoGallery && profile.photoGallery[0]) { | ||
imageUrl = Formatter.image(profile.photoGallery[0]).url; | ||
alternateText = Formatter.image(profile.photoGallery[0]).alternateText; | ||
} | ||
|
||
return { | ||
title: profile.name, // The header text of the card | ||
url: profile.landingPageUrl, // If the card title is a clickable link, set URL here | ||
target: '_top', // If the title's URL should open in a new tab, etc. | ||
image: Formatter.image(profile.c_photo).url, // The URL of the image to display on the card | ||
altText: Formatter.image(profile.c_photo).alternateText, // The alt text of the image to display on the card | ||
image: imageUrl, // The URL of the image to display on the card | ||
altText: alternateText, // The alternate text for the image | ||
titleEventOptions: this.addDefaultEventOptions(), | ||
subtitle: price, // The sub-header text of the card | ||
details: profile.description, // The text in the body of the card | ||
subtitle: profile.price && profile.price.value ? profile.price.value : '', // The sub-header text of the card | ||
details: profile.richTextDescription ? ANSWERS.formatRichText(profile.richTextDescription, 'richTextDescription', '_top') : null, // The text in the body of the card | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this card need a tag (and weight) placeholder? |
||
// 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: { | ||
showMoreLimit: 350, // Character count limit | ||
showMoreText: {{ translateJS phrase='Show more' }}, // Label when toggle will show truncated text | ||
showLessText: {{ translateJS phrase='Show less' }} // Label when toggle will hide truncated text | ||
}, | ||
// Note: If you are using rich text for the details, you should not enable this feature. | ||
// showMoreDetails: { | ||
// showMoreLimit: 350, // Character count limit | ||
// showMoreText: {{ translateJS phrase='Show more' }}, // Label when toggle will show truncated text | ||
// showLessText: {{ translateJS phrase='Show less' }} // Label when toggle will hide truncated text | ||
// }, | ||
// The primary CTA of the card | ||
CTA1: { | ||
label: profile.c_primaryCTA ? profile.c_primaryCTA.label : null, // The CTA's label | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this commented out by default? Do we need weight in the card(s)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: Commented out, yes according to spec
What do you mean by weight?