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

MWPW-164053-remove-region #163

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions edsdme/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,20 +318,6 @@ function getPartnerLevelParams(portal) {
return partnerLevel ? `(${partnerTagBase}${partnerLevel}"+OR+${partnerTagBase}public")` : `(${partnerTagBase}public")`;
}

function getPartnerRegionParams(portal) {
const permissionRegion = getPartnerDataCookieValue(portal, 'permissionregion');
const regionTagBase = `caas:adobe-partners/${portal}/region/`;

const regionTags = [`"${regionTagBase}worldwide"`];

permissionRegion.split(',').forEach((region) => {
const regionValue = region.trim().replaceAll(' ', '-');
if (regionValue) regionTags.push(`"${regionTagBase}${regionValue}"`);
});

return `(${regionTags.join('+OR+')})`;
}

function extractTableCollectionTags(el) {
let tableCollectionTags = [];
Array.from(el.children).forEach((row) => {
Expand Down Expand Up @@ -374,7 +360,6 @@ function getComplexQueryParams(el, collectionTag) {
const collectionTags = [collectionTag, portalCollectionTag, ...tableTags];

const partnerLevelParams = getPartnerLevelParams(portal);
const partnerRegionParams = getPartnerRegionParams(portal);

const collectionTagsStr = collectionTags.filter((e) => e.length).join('+AND+');
let resulStr = `(${collectionTagsStr})`;
Expand All @@ -384,7 +369,6 @@ function getComplexQueryParams(el, collectionTag) {
resulStr += `+NOT+${qaContentTag}`;
}

if (partnerRegionParams) resulStr += `+AND+${partnerRegionParams}`;
if (partnerLevelParams) resulStr += `+AND+${partnerLevelParams}`;
// eslint-disable-next-line consistent-return
return resulStr;
Expand Down
32 changes: 16 additions & 16 deletions nala/blocks/announcements/announcements.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
tcid: '7',
name: '@desc-regression-announcements-distributor-north-america',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous @circleCi',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -125,7 +125,7 @@ export default {
tcid: '8',
name: '@desc-regression-announcements-distributor-japan',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -142,7 +142,7 @@ export default {
tcid: '9',
name: '@desc-regression-announcements-distributor-india',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -159,7 +159,7 @@ export default {
tcid: '10',
name: '@desc-regression-announcements-platinum-spain',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -176,7 +176,7 @@ export default {
tcid: '11',
name: '@desc-regression-announcements-platinum-latin-america-na-based',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -193,7 +193,7 @@ export default {
tcid: '12',
name: '@desc-regression-announcements-platinum-emea',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -210,7 +210,7 @@ export default {
tcid: '13',
name: '@desc-regression-announcements-gold-latin-america',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -227,7 +227,7 @@ export default {
tcid: '14',
name: '@desc-regression-announcements-gold-uk-europe-west',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -244,7 +244,7 @@ export default {
tcid: '15',
name: '@desc-regression-announcements-certified-europe-east',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -261,7 +261,7 @@ export default {
tcid: '16',
name: '@desc-regression-announcements-certified-pacific',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -278,7 +278,7 @@ export default {
tcid: '17',
name: '@desc-regression-announcements-registered-china',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -295,7 +295,7 @@ export default {
tcid: '18',
name: '@desc-regression-announcements-registered-middle-east-and-africa',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -312,7 +312,7 @@ export default {
tcid: '19',
name: '@desc-regression-logged-in-platinum-user',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -328,7 +328,7 @@ export default {
tcid: '20',
name: '@desc-regression-logged-in-gold-user',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -346,7 +346,7 @@ export default {
tcid: '21',
name: '@desc-regression-logged-in-certified-user',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand All @@ -364,7 +364,7 @@ export default {
tcid: '22',
name: '@desc-regression-logged-in-registered-user',
path: '/channelpartners/drafts/automation/regression/announcements?georouting=off&martech=off',
tags: '@dme-announcements @regression @anonymous',
tags: '@dme-announcements @regression',
data: {
partnerData: {
partnerPortal: 'CPP',
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/utils.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ describe('Test utils.js', () => {
ietf: locale.ietf,
};
const caasUrl = getCaasUrl(block);
expect(caasUrl).toEqual('https://www.adobe.com/chimera-api/collection?originSelection=dme-partners&draft=false&debug=true&flatFile=false&expanded=true&complexQuery=%28%22caas%3Aadobe-partners%2Fcollections%2Fannouncements%22%2BAND%2B%22caas%3Aadobe-partners%2Fcpp%22%2BAND%2B%22caas%3Aadobe-partners%2Fqa-content%22%29%2BNOT%2B%22caas%3Aadobe-partners%2Fqa-content%22%2BAND%2B%28%22caas%3Aadobe-partners%2Fcpp%2Fregion%2Fworldwide%22%2BOR%2B%22caas%3Aadobe-partners%2Fcpp%2Fregion%2Feurope-west%22%29%2BAND%2B%28%22caas%3Aadobe-partners%2Fcpp%2Fpartner-level%2Fplatinum%22%2BOR%2B%22caas%3Aadobe-partners%2Fcpp%2Fpartner-level%2Fpublic%22%29&language=en&country=US');
expect(caasUrl).toEqual('https://www.adobe.com/chimera-api/collection?originSelection=dme-partners&draft=false&debug=true&flatFile=false&expanded=true&complexQuery=%28%22caas%3Aadobe-partners%2Fcollections%2Fannouncements%22%2BAND%2B%22caas%3Aadobe-partners%2Fcpp%22%2BAND%2B%22caas%3Aadobe-partners%2Fqa-content%22%29%2BNOT%2B%22caas%3Aadobe-partners%2Fqa-content%22%2BAND%2B%28%22caas%3Aadobe-partners%2Fcpp%2Fpartner-level%2Fplatinum%22%2BOR%2B%22caas%3Aadobe-partners%2Fcpp%2Fpartner-level%2Fpublic%22%29&language=en&country=US');
});
it('Preload resources', async () => {
const locales = {
Expand Down
Loading