Skip to content

Commit

Permalink
Merge pull request #650 from adobecom/2419
Browse files Browse the repository at this point in the history
DC MILO 0.2419
  • Loading branch information
Blainegunn authored May 7, 2024
2 parents 4a0d9b8 + 545145b commit 9afe37f
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 43 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/deploy-edgeworker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
required: true
default: 'Acrobat_DC_web_stg'
options:
- 'Acrobat_DC_web_stg'
- 'Acrobat_DC_web_prod'
- 'Acrobat_DC_web_stg'
- 'Acrobat_DC_web_prod'
network:
description: 'Network'
type: choice
Expand All @@ -24,6 +24,11 @@ on:
options:
- 'staging'
- 'production'
description:
description: 'Bundle Description'
type: string
required: true
default: 'Bundle Description'

jobs:
deploy-edgeworker:
Expand All @@ -38,8 +43,11 @@ jobs:
- name: Build Edge Worker Scripts
run: |
npm run ewbuild
npm run ewprod2stg
npm run ewprod2stg
npm run ewsetbundle ${{ inputs.edgeworker }} "${{ inputs.description }}"
env:
EDGERC: ${{ secrets.AKAMAI_EDGERC }}

- name: Deploy Edge Worker
uses: jdmevo123/[email protected]
env:
Expand Down
Binary file removed acrobat/img/backgrounds/chat-pdf.png
Binary file not shown.
70 changes: 37 additions & 33 deletions acrobat/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const locales = {
ca_fr: { ietf: 'fr-CA', tk: 'vrk5vyv.css' },
cl: { ietf: 'es-CL', tk: 'oln4yqj.css' },
co: { ietf: 'es-CO', tk: 'oln4yqj.css' },
la: { ietf: 'es-LA', tk: 'oln4yqj.css' },
la: { ietf: 'es', tk: 'oln4yqj.css' },
mx: { ietf: 'es-MX', tk: 'oln4yqj.css' },
pe: { ietf: 'es-PE', tk: 'oln4yqj.css' },
'': { ietf: 'en-US', tk: 'hah7vzn.css' },
Expand Down Expand Up @@ -179,41 +179,41 @@ const locales = {
pl: { ietf: 'pl-PL', tk: 'aaz7dvd.css' },
pt: { ietf: 'pt-PT', tk: 'inq1xob.css' },
ro: { ietf: 'ro-RO', tk: 'qxw8hzm.css' },
sa_en: { ietf: 'en', tk: 'pps7abe.css' },
sa_en: { ietf: 'en-SA', tk: 'pps7abe.css' },
ch_de: { ietf: 'de-CH', tk: 'vin7zsi.css' },
si: { ietf: 'sl-SI', tk: 'aaz7dvd.css' },
sk: { ietf: 'en-SK', tk: 'aaz7dvd.css' },
sk: { ietf: 'sk-SK', tk: 'aaz7dvd.css' },
ch_fr: { ietf: 'fr-CH', tk: 'vrk5vyv.css' },
fi: { ietf: 'fi-FI', tk: 'aaz7dvd.css' },
se: { ietf: 'sv-SE', tk: 'fpk1pcd.css' },
ch_it: { ietf: 'it-CH', tk: 'bbf5pok.css' },
tr: { ietf: 'tr-TR', tk: 'aaz7dvd.css' },
ae_en: { ietf: 'en', tk: 'pps7abe.css' },
ae_en: { ietf: 'ar-EN', tk: 'pps7abe.css' },
uk: { ietf: 'en-GB', tk: 'pps7abe.css' },
at: { ietf: 'de-AT', tk: 'vin7zsi.css' },
cz: { ietf: 'cs-CZ', tk: 'aaz7dvd.css' },
bg: { ietf: 'bg-BG', tk: 'aaz7dvd.css' },
ru: { ietf: 'ru-RU', tk: 'aaz7dvd.css' },
ua: { ietf: 'uk-UA', tk: 'aaz7dvd.css' },
il_he: { ietf: 'he', tk: 'nwq1mna.css', dir: 'rtl' },
ae_ar: { ietf: 'ar', tk: 'nwq1mna.css', dir: 'rtl' },
ae_ar: { ietf: 'ar-AE', tk: 'nwq1mna.css', dir: 'rtl' },
mena_ar: { ietf: 'ar', tk: 'dis2dpj.css', dir: 'rtl' },
sa_ar: { ietf: 'ar', tk: 'nwq1mna.css', dir: 'rtl' },
sa_ar: { ietf: 'ar-SA', tk: 'nwq1mna.css', dir: 'rtl' },
// Asia Pacific
au: { ietf: 'en-AU', tk: 'pps7abe.css' },
hk_en: { ietf: 'en-HK', tk: 'pps7abe.css' },
in: { ietf: 'en-GB', tk: 'pps7abe.css' },
id_id: { ietf: 'id', tk: 'czc0mun.css' },
id_en: { ietf: 'en', tk: 'pps7abe.css' },
my_ms: { ietf: 'ms', tk: 'sxj4tvo.css' },
my_en: { ietf: 'en-GB', tk: 'pps7abe.css' },
nz: { ietf: 'en-GB', tk: 'pps7abe.css' },
ph_en: { ietf: 'en', tk: 'pps7abe.css' },
ph_fil: { ietf: 'fil-PH', tk: 'ict8rmp.css' },
in: { ietf: 'en-IN', tk: 'pps7abe.css' },
id_id: { ietf: 'id-ID', tk: 'czc0mun.css' },
id_en: { ietf: 'en-ID', tk: 'pps7abe.css' },
my_ms: { ietf: 'ms-MY', tk: 'sxj4tvo.css' },
my_en: { ietf: 'en-MY', tk: 'pps7abe.css' },
nz: { ietf: 'en-NZ', tk: 'pps7abe.css' },
ph_en: { ietf: 'en-PH', tk: 'pps7abe.css' },
ph_fil: { ietf: 'tl-PH', tk: 'ict8rmp.css' },
sg: { ietf: 'en-SG', tk: 'pps7abe.css' },
th_en: { ietf: 'en', tk: 'pps7abe.css' },
in_hi: { ietf: 'hi', tk: 'aaa8deh.css' },
th_th: { ietf: 'th', tk: 'aaz7dvd.css' },
th_en: { ietf: 'en-TH', tk: 'pps7abe.css' },
in_hi: { ietf: 'hi-IN', tk: 'aaa8deh.css' },
th_th: { ietf: 'th-TH', tk: 'aaz7dvd.css' },
cn: { ietf: 'zh-CN', tk: 'puu3xkp' },
hk_zh: { ietf: 'zh-HK', tk: 'jay0ecd' },
tw: { ietf: 'zh-TW', tk: 'jay0ecd' },
Expand All @@ -222,22 +222,22 @@ const locales = {
// Langstore Support.
langstore: { ietf: 'en-US', tk: 'hah7vzn.css' },
// geo expansion MWPW-124903
za: { ietf: 'en-GB', tk: 'pps7abe.css' }, // South Africa (GB English)
ng: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Nigeria (GB English)
cr: { ietf: 'es-419', tk: 'oln4yqj.css' }, // Costa Rica (Spanish Latin America)
ec: { ietf: 'es-419', tk: 'oln4yqj.css' }, // Ecuador (Spanish Latin America)
pr: { ietf: 'es-419', tk: 'oln4yqj.css' }, // Puerto Rico (Spanish Latin America)
gt: { ietf: 'es-419', tk: 'oln4yqj.css' }, // Guatemala (Spanish Latin America)
eg_ar: { ietf: 'ar', tk: 'nwq1mna.css', dir: 'rtl' }, // Egypt (Arabic)
kw_ar: { ietf: 'ar', tk: 'nwq1mna.css', dir: 'rtl' }, // Kuwait (Arabic)
qa_ar: { ietf: 'ar', tk: 'nwq1mna.css', dir: 'rtl' }, // Quatar (Arabic)
eg_en: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Egypt (GB English)
kw_en: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Kuwait (GB English)
qa_en: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Qatar (GB English)
gr_el: { ietf: 'el', tk: 'fnx0rsr.css' }, // Greece (Greek)
za: { ietf: 'en-ZA', tk: 'pps7abe.css' }, // South Africa (GB English)
ng: { ietf: 'en-NG', tk: 'pps7abe.css' }, // Nigeria (GB English)
cr: { ietf: 'es-CR', tk: 'oln4yqj.css' }, // Costa Rica (Spanish Latin America)
ec: { ietf: 'es-EC', tk: 'oln4yqj.css' }, // Ecuador (Spanish Latin America)
pr: { ietf: 'es-PR', tk: 'oln4yqj.css' }, // Puerto Rico (Spanish Latin America)
gt: { ietf: 'es-GT', tk: 'oln4yqj.css' }, // Guatemala (Spanish Latin America)
eg_ar: { ietf: 'ar-EG', tk: 'nwq1mna.css', dir: 'rtl' }, // Egypt (Arabic)
kw_ar: { ietf: 'ar-KW', tk: 'nwq1mna.css', dir: 'rtl' }, // Kuwait (Arabic)
qa_ar: { ietf: 'ar-QA', tk: 'nwq1mna.css', dir: 'rtl' }, // Quatar (Arabic)
eg_en: { ietf: 'en-EG', tk: 'pps7abe.css' }, // Egypt (GB English)
kw_en: { ietf: 'en-KW', tk: 'pps7abe.css' }, // Kuwait (GB English)
qa_en: { ietf: 'en-QA', tk: 'pps7abe.css' }, // Qatar (GB English)
gr_el: { ietf: 'el-GR', tk: 'fnx0rsr.css' }, // Greece (Greek)
el: { ietf: 'el', tk: 'aaz7dvd.css' },
vn_vi: { ietf: 'vi', tk: 'jii8bki.css' },
vn_en: { ietf: 'en-GB', tk: 'pps7abe.css' },
vn_vi: { ietf: 'vi-VN', tk: 'jii8bki.css' },
vn_en: { ietf: 'en-VN', tk: 'pps7abe.css' },
};

// Add any config options.
Expand All @@ -258,6 +258,10 @@ const CONFIG = {
dcstage: {
pdfViewerClientId: '2522674a708e4ddf8bbd62e18585ae4b',
pdfViewerReportSuite: 'adbadobedxqa',
},
page: {
pdfViewerClientId: 'a42d91c0e5ec46f982d2da0846d9f7d0',
pdfViewerReportSuite: 'adbadobedxqa',
},
stage: {
edgeConfigId: 'e065836d-be57-47ef-b8d1-999e1657e8fd',
Expand Down Expand Up @@ -290,7 +294,7 @@ const CONFIG = {
imsScope: 'AdobeID,openid,gnav,pps.read,firefly_api,additional_info.roles,read_organizations',
};

// Setting alternative Jarcis client ID for these paths
// Setting alternative Jarvis client ID for these paths
if (window.location.pathname.match('/sign/')
|| window.location.pathname.match('/documentcloud/')
|| window.location.pathname.match('/acrobat/business/')) {
Expand Down
5 changes: 1 addition & 4 deletions acrobat/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ div[data-section="widget"] {

#dc-converter-widget[verb=chat-pdf] {
background-color: #fff;
background-image: url('../img/backgrounds/chat-pdf.png');
background-position: top left;
background-image: radial-gradient(at 1% 0,#ff715b 0,transparent 50%),radial-gradient(at 48% 89%,#fff 0,transparent 50%),radial-gradient(at 100% 00%,#fff 0,transparent 50%),radial-gradient(at 1% 85%,#fff 0,transparent 50%),radial-gradient(at 93% 33%,#6d51f9 0,transparent 50%),radial-gradient(at 44% 55%,#c8e1fd 0,transparent 50%),radial-gradient(at 11% 22%,#fe4b38 0,transparent 50%),radial-gradient(at 88% 4%,#ea0f00 0,transparent 50%),radial-gradient(at 45% 0,#fe4b38 0,transparent 50%);
min-height: 623px;
background-repeat: no-repeat;
background-size: contain;
}

/* DC Widget Override */
Expand Down
89 changes: 89 additions & 0 deletions edgeworkers/scripts/setbundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Environment variables:
* - EDGERC: The content of the .edgerc file
* Command Arguments:
* - edgeworker name: The name of the EdgeWorker
* example: 'Acrobat_DC_web_prod' or 'Acrobat_DC_web_stg'
* - description: The description of the bundle
*/
const fs = require('fs');
const os = require('os');
const EdgeGrid = require('akamai-edgegrid');
const { compareVersions } = require('compare-versions');

const egSend = (eg, path, method, body) => {
eg.auth({ path, method, body });

return new Promise((resolve, reject) => {
eg.send(function (error, response, body) {
if (error) {
reject(error);
} else {
resolve(JSON.parse(body));
}
});
});
};


async function main() {
const edgeworkerName = process.argv.length > 2 ? process.argv[2] : null;
const description = process.argv.length > 3 ? process.argv[3] : null;

if (!edgeworkerName) {
console.error('Please provide the name of the EdgeWorker');
process.exit(1);
}

if (process.env.EDGERC) {
fs.writeFileSync('.edgerc', process.env.EDGERC, 'utf8');
}

const edgercPath = fs.existsSync('.edgerc') ? '.edgerc' : `${os.homedir()}/.edgerc`;

const eg = new EdgeGrid({ path: edgercPath, section: 'edgeworkers' });

let body = await egSend(eg, '/edgeworkers/v1/ids', 'GET');
const edgeWorkers = body.edgeWorkerIds;
const edgeWorker = edgeWorkers.find((ew) => ew.name === edgeworkerName);

if (!edgeWorker) {
console.error(`EdgeWorker ${edgeworkerName} not found`);
process.exit(1);
}

body = await egSend(
eg,
`/edgeworkers/v1/ids/${edgeWorker.edgeWorkerId}/versions`,
'GET'
);
const versions = body.versions.map((x) => x.version).sort(compareVersions);
const latestVersion = versions[versions.length - 1];

console.log(`The latest version of ${edgeworkerName} is ${latestVersion}`);

const bundleJsonPath = `edgeworkers/${edgeworkerName}/bundle.json`;

if (!fs.existsSync(bundleJsonPath)) {
console.error(`Bundle file ${bundleJsonPath} not found`);
process.exit(1);
}

let bundleJson = JSON.parse(fs.readFileSync(bundleJsonPath, 'utf8'));

let versionSegs = latestVersion.split('.').map(x => parseInt(x));
versionSegs[versionSegs.length - 1] += 1;

bundleJson['edgeworker-version'] = versionSegs.join('.');

if (description) {
bundleJson.description = description;
}

console.log(`New bundle info: ${JSON.stringify(bundleJson, null, 2)}`);

fs.writeFileSync(bundleJsonPath, JSON.stringify(bundleJson, null, 2), 'utf8');
}

main();
Loading

0 comments on commit 9afe37f

Please sign in to comment.