-
Notifications
You must be signed in to change notification settings - Fork 211
MWPW-164493 [Plans] Merch card for Plans page students tab #3933
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
Conversation
|
| width: var(--consonant-merch-card-plans-width); | ||
| } | ||
| merch-card[variant="plans"][size="students"] { |
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.
please do not use size field for this. You need to add a new attribute like customer-segment
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.
Customer segment? You probably mean Market segment (COM / EDU)?
Customer segment is INDIVIDUAL / TEAM, that would be probably needed for business cards.
So @yesil we will need another field in odin for market segment and new dropdown in card editor with values for COM and EDU, right?
Actually, instead of COM/EDU we better have options like : Individuals, Business, Students, Universities.
You ruined mine and @3ch023's idea to make this extremely simple. :)
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.
@bozojovicic sorry, width="students" is a no go for me.
we can also create plans-edu variant, and re-use the same plans variant code without having to add a new field.
cc: @3ch023
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.
we can, but isn't it too much code to just have a slightly different card width?
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.
- we don't add a new field, just a new 'width' variation
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.
| allowedBorderColors: ['spectrum-yellow-300-plans', 'spectrum-gray-300-plans'], | ||
| borderColor: { attribute: 'border-color' }, | ||
| size: ['wide', 'super-wide'], | ||
| size: ['wide', 'super-wide', 'students'], |
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.
What if there is a wide Student card? We should not misuse fields.
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.
we add 'studebts-wide' option then
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.
I had a call with Ilyas and he explained his ideas so this comment is no longer relevant. It is not much different from what I already did. The biggest difference is - I rebased this PR to his branch MWPW-170799.
|
@bozojovicic pls add a marquee to your test page with a card and use it in before/after instead of a start page |
|
|
||
| await test.step('step-2: Verify Plans Students Merch Card CSS', async () => { | ||
| await expect(acomPage.getCard(data.id)).toBeVisible(); | ||
| await expect(acomPage.getCard(data.id)).toHaveAttribute('segment', 'students'); |
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.
cool!
| padding: 2px 10px 3px; | ||
| } | ||
| :host([variant='plans'][segment='students']) { |
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 still need segment='students' ? should we simply use host([variant='plans-edu'] ?
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.
@yesil With host([variant='plans-edu'] none of those styles for merch-card[variant="plans"] will not be applied (and we need them for students card as well) so I either need to do add segment='students' attribute to the card or I would need to add merch-card[variant="plans-edu"] to every single CSS selector merch-card[variant="plans"] which is not a solution really.
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.
what if we change them from :host([variant='plans']) to : :host([variant^='plans'])
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.
Good idea! Done with merch-card[variant^="plans"] and merch-card[variant="plans-edu"]
No more segment attribute.
libs/features/mas/src/hydrate.js
Outdated
| ANALYTICS_SECTION_ATTR, | ||
| ]; | ||
| attributesToRemove.forEach(attr => merchCard.removeAttribute(attr)); | ||
| if (variant === 'plans') merchCard.removeAttribute('segment'); |
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.
| if (variant === 'plans') merchCard.removeAttribute('segment'); | |
| merchCard.removeAttribute('segment'); |
no need to check for a variant, just always delete it
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.
I can't. If I do that without this check I will lose styles for students card. Let me explain why I need this :
we open the card editor in mas for students card
when I change the variant from "plans students" to "plans" I need to remove the "segment" attribute
otherwise styles for students card will be applied although we changed it to plans
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.
Deleted. :)
|
@bozojovicic |
@Roycethan @bozojovicic that should be enabled with Ilyas's PR (but not ready yet): #3971 |



Plans card for students tab. Will be used outside card collection. Requested width 568px.
Authored in MAS Studio with new variant "Plans students".
Test Milo page https://mwpw164493students--milo--bozojovicic.aem.page/drafts/bozo/students?martech=off
MAS PR mas/pull/236
MAS studio test page
mwpw-164493--mas--adobecom.aem.live/studio.html?milolibs=mwpw164493students--milo--bozojovicic#path=sandbox&page=content&query=78856cda-ba13-424d-ac46-be79ac6545cbResolves: MWPW-164493
Test URLs: