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

Country wide targetting #674

Merged
merged 20 commits into from
Feb 7, 2025
Merged

Country wide targetting #674

merged 20 commits into from
Feb 7, 2025

Conversation

LAKSHMIRPILLAI
Copy link
Contributor

@LAKSHMIRPILLAI LAKSHMIRPILLAI commented Jan 22, 2025

Co-authored with: @charleycampbell

What does this change?

Country wide targeting in RRCP

Trello card

This PR is to enable country wide targeting along with Region wide targeting in RRCP under the 'Target Audience' section .The countries to be targeted can be selected from the dropdown list .The supporting changes in support-dotcom-component are in the SDC PR

How to test

Test in CODE Detailed testing doc is added [here]

  1. Deploy the SAC and SDC branches for the country wide targeting in CODE
  2. Create a test/Modify an existing test to add a country to target from the dropdown and set it to Live
  3. Open the code url https://m.code.dev-theguardian.com in the Chrome and using the bookmark change the geolocation - Instructions to change GeoLocation here ->http://reader-revenue-bookmarklets.s3-website-eu-west-1.amazonaws.com/
  4. The Epic should shown for those geolocation that the test is targeting

Tests for RRCP changes

image

Similar tests were done for Banners, Headers, Liveblog Epics, Apple News Epics and AMP Epics

Images

image

@LAKSHMIRPILLAI LAKSHMIRPILLAI force-pushed the lp-add-target-by-country branch from 1a10039 to e736633 Compare January 22, 2025 12:13
@LAKSHMIRPILLAI LAKSHMIRPILLAI marked this pull request as ready for review January 27, 2025 12:45
@LAKSHMIRPILLAI LAKSHMIRPILLAI requested a review from a team as a code owner January 27, 2025 12:45
@LAKSHMIRPILLAI LAKSHMIRPILLAI marked this pull request as draft January 28, 2025 09:36
@LAKSHMIRPILLAI LAKSHMIRPILLAI marked this pull request as ready for review January 31, 2025 10:38
@LAKSHMIRPILLAI LAKSHMIRPILLAI marked this pull request as draft February 4, 2025 14:12
@LAKSHMIRPILLAI LAKSHMIRPILLAI force-pushed the lp-add-target-by-country branch from 75ee851 to 060d9c5 Compare February 4, 2025 16:51
@LAKSHMIRPILLAI LAKSHMIRPILLAI marked this pull request as ready for review February 5, 2025 09:59
@@ -287,6 +287,7 @@ export const countries: CommonStringObject = {
ZW: 'Zimbabwe',
};

export const countryNames = Object.entries(countries).map(_ => [_[0], _[1]]);
Copy link
Member

Choose a reason for hiding this comment

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

This is quite hard to follow - how about removing this and instead in MultiSelectCountryEditor.tsx define:
const options: Option[] = Object.entries(countries).map(([value, label]) => ({ value, label }));

@LAKSHMIRPILLAI LAKSHMIRPILLAI requested a review from tomrf1 February 6, 2025 11:46
@@ -135,6 +136,35 @@ const BannerTestEditor: React.FC<ValidatedTestEditorProps<BannerTest>> = ({
updateTest({ ...test, locations: updatedRegions });
};

function concatUniqueLocations(countryGroups: Region[], locations: Region[]) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is necessary if we initialise regionTargeting with the country groups from locations.
Here's a proposal for doing this which I think simplifies things a lot - what do you think? -
#682

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is great, I am happy to merge this

simplify locations deprecation
@@ -24,11 +25,16 @@ const useStyles = makeStyles(({ spacing, palette }: Theme) => ({
color: palette.grey[900],
fontWeight: 500,
},
container1: {
Copy link
Member

Choose a reason for hiding this comment

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

could this name be more descriptive?

Copy link
Member

@tomrf1 tomrf1 left a comment

Choose a reason for hiding this comment

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

great!

@LAKSHMIRPILLAI LAKSHMIRPILLAI merged commit 5bf7400 into main Feb 7, 2025
3 checks passed
@LAKSHMIRPILLAI LAKSHMIRPILLAI deleted the lp-add-target-by-country branch February 7, 2025 11:34
@prout-bot
Copy link

Seen on PROD (merged by @LAKSHMIRPILLAI 7 minutes and 28 seconds ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants