-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #596 from adobecom/2410
DC MILO 0.2410
- Loading branch information
Showing
38 changed files
with
1,720 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
test/e2e | ||
test/e2e | ||
test/edgeworkers | ||
edgeworkers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: EdgeWorker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testCodeBranch: | ||
description: 'Test Code Branch' | ||
required: true | ||
default: 'stage' | ||
type: string | ||
edgeworker: | ||
description: 'Edge Worker' | ||
type: choice | ||
required: true | ||
default: 'Acrobat_DC_web_stg' | ||
options: | ||
- 'Acrobat_DC_web_stg' | ||
- 'Acrobat_DC_web_prod' | ||
network: | ||
description: 'Network' | ||
type: choice | ||
required: true | ||
default: 'staging' | ||
options: | ||
- 'staging' | ||
- 'production' | ||
|
||
jobs: | ||
deploy-edgeworker: | ||
name: Deploy EdgeWorker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.testCodeBranch }} | ||
|
||
- name: Build Edge Worker Scripts | ||
run: | | ||
npm run ewbuild | ||
npm run ewprod2stg | ||
- name: Deploy Edge Worker | ||
uses: jdmevo123/akamai-edgeworker-action@1.1 | ||
env: | ||
EDGERC: ${{ secrets.AKAMAI_EDGERC }} | ||
WORKER_DIR: edgeworkers/${{ inputs.edgeworker }} | ||
with: | ||
edgeworkersName: ${{ inputs.edgeworker }} | ||
network: ${{ inputs.network }} | ||
groupid: '58544' |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# DC CODEOWNERS | ||
# When you create a new block or tool please establish ownership in this file. | ||
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
|
||
# DC Core | ||
/acrobat/ @NadiiaSokolova | ||
|
||
# DC Blocks | ||
/acrobat/blocks/ @NadiiaSokolova |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* eslint-disable compat/compat */ | ||
/* c8 ignore next 53 */ | ||
export default async function geoPhoneNumber() { | ||
const geoTwo = await fetch('https://geo2.adobe.com/json/'); | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const geoData = await geoTwo.json(); | ||
|
||
let newLocale = urlParams.get('akamaiLocale')?.toLowerCase() | ||
|| geoData?.country?.toLowerCase() | ||
|| JSON.parse(sessionStorage.getItem('international'))?.country?.toLowerCase() | ||
|| JSON.parse(sessionStorage.getItem('feds_location'))?.country?.toLowerCase() | ||
|| ''; | ||
|
||
if (newLocale === 'us' || newLocale === '/' || newLocale === '//') { | ||
newLocale = '/'; | ||
} else { | ||
newLocale = `/${newLocale}/`; | ||
} | ||
|
||
const updatePhoneNumber = (visNum, i) => { | ||
const phoneNumberEle = document.querySelector(`.${i}`); | ||
phoneNumberEle.href = `tel:${visNum}`; | ||
phoneNumberEle.innerText = visNum; | ||
}; | ||
|
||
const placeHolderJson = await fetch(`${newLocale}dc-shared/placeholders.json`); | ||
if (placeHolderJson.status !== 200) return; | ||
const placeHolderJsonData = await placeHolderJson.json(); | ||
window.dcpns = placeHolderJsonData.data; | ||
const globalPhoneNumbers = new CustomEvent('DCNumbers:Ready'); | ||
window.dispatchEvent(globalPhoneNumbers); | ||
|
||
document.querySelectorAll('a[class*="geo-pn"]').forEach((phoneNumber) => { | ||
const numberType = phoneNumber.getAttribute('number-type'); | ||
const numberID = phoneNumber.classList[0]; | ||
placeHolderJsonData.data.forEach((val) => { | ||
if (val.key === numberType) { | ||
updatePhoneNumber(val.value, numberID); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
const frags = document.querySelectorAll('.fragment [href*="tel"]'); | ||
window.addEventListener('DCNumbers:Ready', () => { | ||
frags.forEach((f) => { | ||
const fragPhoneType = `phone-${f.href.split(' ')[1]}`; | ||
window.dcpns.forEach((val) => { | ||
if (val.key === fragPhoneType) { | ||
f.innerText = val.value; | ||
f.href = `tel: ${val.value}`; | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"edgeworker-version": "0.83", | ||
"description" : "remove hash for legacy.js IE/Trident script" | ||
} |
Oops, something went wrong.