Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #939 from wbstry/mwpw-133351
Browse files Browse the repository at this point in the history
fix(untranslated-ckg-pills): metadata key fix & CKG pill altText logic fix
  • Loading branch information
JingleH committed Jul 17, 2023
2 parents 60ac7f5 + f8dc094 commit 599da56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions express/scripts/ckg-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function fetchLinkList() {
}

function matchCKGResult(ckgData, pageData) {
const ckgMatch = pageData.ckgID === ckgData.ckgID;
const ckgMatch = pageData.ckgid === ckgData.ckgID;
const pageDataTasks = pageData.tasks ?? pageData.templateTasks;
const taskMatch = ckgData.tasks?.toLowerCase() === pageDataTasks?.toLowerCase();
const currentLocale = getLocale(window.location);
Expand Down Expand Up @@ -150,15 +150,15 @@ async function updateLinkList(container, linkPill, list) {

if (pillsMapping) {
const alternateText = pillsMapping.find((row) => window.location.pathname === `${urlPrefix}${row['Express SEO URL']}` && d.ckgID === row['CKG Pill ID']);

if (alternateText && alternateText[`${localeColumnString}`]) {
const hasAlternateTextForLocale = alternateText && alternateText[`${localeColumnString}`];
if (hasAlternateTextForLocale) {
displayText = alternateText[`${localeColumnString}`];
if (templatePageData) {
templatePageData.altShortTitle = displayText;
}
}

hideUntranslatedPill = !displayText && locale !== 'us';
hideUntranslatedPill = !hasAlternateTextForLocale && locale !== 'us';
}

if (templatePageData) {
Expand Down

0 comments on commit 599da56

Please sign in to comment.