Skip to content

Commit

Permalink
Merge pull request #853 from adobecom/MWPW-160129
Browse files Browse the repository at this point in the history
MWPW-160129:  DC Fill and Sign: Stage page use prod library
  • Loading branch information
TsayAdobe authored Oct 21, 2024
2 parents 2b919fe + d727996 commit 1009050
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions acrobat/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ export const [setLibs, getLibs] = (() => {
(prodLibs, location) => {
libs = (() => {
const { hostname, search } = location || window.location;
// eslint-disable-next-line compat/compat
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'main' && hostname === 'www.stage.adobe.com') return 'https://www.adobe.com/libs';
if (branch === 'main' && hostname === 'www.stage.adobe.com') return '/libs';
if (!(hostname.includes('.hlx.') || hostname.includes('local') || hostname.includes('stage'))) return prodLibs;
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.page/libs` : `https://${branch}--milo--adobecom.hlx.page/libs`;
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
})();
return libs;
}, () => libs,
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as sinon from 'sinon';
import { expect } from '@esm-bundle/chai';

describe('Test utils.js', async () => {
it('tests setLibs', async () => {
it('tests setLibs', async () => {
const libs = setLibs('/lib');
expect(libs).to.equal('https://main--milo--adobecom.hlx.page/libs');
expect(libs).to.equal('https://main--milo--adobecom.hlx.live/libs');
});
});

0 comments on commit 1009050

Please sign in to comment.