-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add SpecialReportAlt card styles #25602
Conversation
67f0a14
to
efe1db1
Compare
bc0da19
to
ec7b2ec
Compare
val tags = content.tags.map(_.id).toSeq | ||
extractCampaigns(tags) match { | ||
case Nil => CardStyle(content, TrailMetaData.empty) | ||
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialReportAlt") SpecialReportAlt else SpecialReport |
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.
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialReportAlt") SpecialReportAlt else SpecialReport | |
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialreportalt") SpecialReportAlt else SpecialReport |
@@ -21,6 +22,7 @@ object CardStylePicker { | |||
val tags = FaciaContentUtils.tags(content).map(_.id) | |||
extractCampaigns(tags) match { | |||
case Nil => FaciaContentUtils.cardStyle(content) | |||
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialReportAlt") SpecialReportAlt else SpecialReport |
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.
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialReportAlt") SpecialReportAlt else SpecialReport | |
case campaign:: _ => if(campaign.id.toString.toLowerCase() == "specialreportalt") SpecialReportAlt else SpecialReport |
common/app/model/meta.scala
Outdated
@@ -286,6 +286,7 @@ object ContentFormat { | |||
case "CulturePillar" => CulturePillar | |||
case "LifestylePillar" => LifestylePillar | |||
case "SpecialReportTheme" => SpecialReportTheme | |||
// case "SpecialReportAltTheme" => SpecialReportAltTheme |
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.
// case "SpecialReportAltTheme" => SpecialReportAltTheme | |
case "SpecialReportAltTheme" => SpecialReportAltTheme |
Co-Authored-By: Ioanna Kokkini <ioannakok@users.noreply.github.com>
Co-Authored-By: Ioanna Kokkini <ioannakok@users.noreply.github.com>
Co-Authored-By: Ioanna Kokkini <ioannakok@users.noreply.github.com>
And remove unused parameter
c35acc6
to
3af4466
Compare
3621d40
to
b7deaa9
Compare
val tags = content.tags.map(_.id).toSeq | ||
extractCampaigns(tags) match { | ||
case Nil => CardStyle(content, TrailMetaData.empty) | ||
case _ => SpecialReport | ||
case campaign :: _ => | ||
if (campaign.id.toString.toLowerCase() == "specialreportalt") SpecialReportAlt else SpecialReport |
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.
The campaign information is coming from extractCampaigns
--> CampaignAgent
--> targeting-client
. There is already a campaign set up with this campaign id in the targeting-tool
} | ||
} | ||
|
||
def apply(content: FaciaContent): CardStyle = { | ||
val tags = FaciaContentUtils.tags(content).map(_.id) | ||
extractCampaigns(tags) match { | ||
case Nil => FaciaContentUtils.cardStyle(content) | ||
case _ => SpecialReport | ||
case campaign :: _ => | ||
if (campaign.id.toString.toLowerCase() == "specialreportalt") SpecialReportAlt else SpecialReport |
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.
Same as above
@@ -13,7 +13,7 @@ object FaciaContentConvert { | |||
def contentToFaciaContent(content: Content): PressedContent = { | |||
val frontendContent = model.Content(content) | |||
val trailMetaData = TrailMetaData.empty | |||
val cardStyle = CardStylePicker(content, trailMetaData) | |||
val cardStyle = CardStylePicker(content) |
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.
This is just removing an unused parameter
@@ -192,6 +194,7 @@ object GetClasses { | |||
BreakingPalette -> "fc-container--breaking-palette", | |||
EventPalette -> "fc-container--event-palette", | |||
EventAltPalette -> "fc-container--event-alt-palette", | |||
SpecialReportAltPalette -> "fc-container--special-report-alt-palette", |
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.
There is a PR to add styles for this class.
@@ -183,7 +197,7 @@ $pillars: ( | |||
color: map-get($palette, kicker); | |||
} | |||
|
|||
&.fc-item--type-immersive.fc-item--has-boosted-title:not(.fc-item--pillar-special-report) .fc-item__standfirst { | |||
&.fc-item--type-immersive.fc-item--has-boosted-title:not(.fc-item--pillar-special-report):not(.fc-item--pillar-special-report-alt) .fc-item__standfirst { |
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 tried
:not(.fc-item--pillar-special-report, .fc-item--pillar-special-report-alt)
but didn't work!
background-color: $special-report-alt-faded !important; | ||
|
||
.fc-item__container.u-faux-block-link--hover { | ||
background-color: $special-report-alt-faded !important; |
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 am sorry I had to add !important
to so many places but it wouldn't pick up the right colour for SpecialReportAlt. Given that fronts migration to DCR is in progress I don't think this is a huge problem but happy to discuss if anyone thinks otherwise!
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.
Agreed!
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.
Looks good!
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.
As you have mentioned, there are a few issues with the CSS styles, mainly the abundant use of !important
, but this code base is soon to be legacy, so I believe it’s an acceptable compromise.
background-color: $special-report-alt-faded !important; | ||
|
||
.fc-item__container.u-faux-block-link--hover { | ||
background-color: $special-report-alt-faded !important; |
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.
Agreed!
@@ -5,6 +5,8 @@ | |||
@import views.support.RenderClasses | |||
@import conf.switches.Switches.AusRegionSelector | |||
|
|||
@import views.html.fragments.containers.facia_cards.slice |
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.
are these imports here intentionally? (I couldn't spot any new code that makes use of them)
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.
You're right! There is existing code that uses them and IntelliJ was complaining about the missing imports although the code was compiling successfully 🤷♀️
I thought I'd add them just because not having the imports didn't feel right although indeed it doesn't really make a difference!
What does this change?
SpecialReportAltTheme
coming from capi-clientSpecialReportAlt
CardStyle
coming from facia-clientSpecialReportAlt
card stylesSpecialReportAltPalette
(pending: https://github.com/guardian/interactive-atom-container-colours/pull/4)facia-press
decides thatCardStyle
will beSpecialReportAlt
.Previous PRs
SpecialReportAltTheme
toFormat
content-api-scala-client#371SpecialReportAlt
toCardStyle
facia-scala-client#280Does this change need to be reproduced in dotcom-rendering ?
The following PRs have already been merged:
SpecialReportAltTheme
and adds SpecialReportAlt articles styles: Add articles styles for SpecialReportAlt dotcom-rendering#6313SpecialReportAltPalette
and adds styles: Add SpecialReportAltPalette dotcom-rendering#6335Screenshots
Standard type
Comment type
With media type
What is the value of this and can you measure success?
Checklist
Does this affect other platforms?
Does this affect GLabs Paid Content Pages? Should it have support for Paid Content?
Does this change break ad-free?
Does this change update the version of CAPI we're using?
Accessibility test checklist
Tested
Tested in CODE and verified these changes don't break any existing card styles.
Further testing: At the moment we have no SpecialReportAlt articles published. Once this gets merged we are planning to do an e2e test "Tools Game" in CODE environment and
with different pillars to make sure all are being overridden correctly