Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
cod17828 committed Nov 8, 2024
2 parents 9a8e089 + a2c9080 commit eac7ebd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
5 changes: 4 additions & 1 deletion edsdme/components/SearchCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class SearchCard extends LitElement {
}
<div class="card-text">
<span class="card-date">${this.localizedText['{{last-modified}}']}: ${formatDate(this.data.cardDate, this.ietf)}
<span class="card-size">${this.localizedText['{{size}}']}: ${this.data.contentArea?.size}</span>
${this.data.contentArea?.type !== 'html'
? html`<span class="card-size">${this.localizedText['{{size}}']}: ${this.data.contentArea?.size}</span>`
: ''
}
</span>
<p class="card-description">${this.data.contentArea?.description}</p>
<div class="card-tags-wrapper">${this.cardTags}</div>
Expand Down
14 changes: 6 additions & 8 deletions edsdme/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ export function getCookieValue(key) {
export function getPartnerDataCookieValue(programType, key) {
try {
const partnerDataCookie = getCookieValue('partner_data');
if (!partnerDataCookie) return;
if (!partnerDataCookie) return '';
const partnerDataObj = JSON.parse(decodeURIComponent(partnerDataCookie.toLowerCase()));
const portalData = partnerDataObj?.[programType];
// eslint-disable-next-line consistent-return
return portalData?.[key];
return portalData?.[key] || '';
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error parsing partner data object:', error);
Expand Down Expand Up @@ -318,18 +318,16 @@ function getPartnerLevelParams(portal) {

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

if (!permissionRegion) return `(${regionTagBase}worldwide")`;

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

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

return regionTags.length ? `(${regionTags.join('+OR+')})` : `(${regionTagBase}worldwide")`;
return `(${regionTags.join('+OR+')})`;
}

function extractTableCollectionTags(el) {
Expand Down
8 changes: 4 additions & 4 deletions nala/blocks/announcements/announcements.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export default {
},
announcementCardTitle: 'Worldwide',
numberOfMatchingTitleCardsNonLoggedIn: 6,
numberOfMatchingTitleCardsLoggedIn: 0,
numberOfMatchingTitleCardsLoggedIn: 6,
},
},
{
Expand Down Expand Up @@ -353,7 +353,7 @@ export default {
},
higherPartnerLevelCardTitle: 'CPP Platinum Latin America Announcement',
partnerLevelCardTitle: 'CPP Gold Latin America Announcement',
totalNumberOfCards: 3,
totalNumberOfCards: 10,
numberOfHigherPartnerLevelCards: 0,
numberOfPartnerLevelCards: 1,
},
Expand All @@ -371,7 +371,7 @@ export default {
},
higherPartnerLevelCardTitle: 'CPP Gold Europe East Announcement',
partnerLevelCardTitle: 'CPP Certified Europe East Announcement',
totalNumberOfCards: 2,
totalNumberOfCards: 9,
numberOfHigherPartnerLevelCards: 0,
numberOfPartnerLevelCards: 1,
},
Expand All @@ -389,7 +389,7 @@ export default {
},
higherPartnerLevelCardTitle: 'CPP Certified China Announcement',
partnerLevelCardTitle: 'CPP Registered China Announcement',
totalNumberOfCards: 1,
totalNumberOfCards: 8,
numberOfHigherPartnerLevelCards: 0,
numberOfPartnerLevelCards: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion nala/blocks/region-selectors/region-selectors.page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default class RegionSelectorsPage {
constructor(page) {
this.page = page;
this.regionSelectorPopUp = page.locator('div.region-nav[data-block]');
this.regionSelectorPopUp = page.locator('div.region-nav');
this.profileIconButton = page.locator('.feds-profile-button');

this.oneTrustBanner = page.getByLabel('Cookie banner');
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 @@ -445,7 +445,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%2BAND%2B%28%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%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');
});
it('Preload resources', async () => {
const locales = {
Expand Down

0 comments on commit eac7ebd

Please sign in to comment.