xMerge branch 'master' into exclude-vendor-from-sourcemaps

This commit is contained in:
Steve Faulkner
2020-09-25 18:12:17 -05:00
3 changed files with 25 additions and 41 deletions
+2 -23
View File
@@ -3,8 +3,8 @@ on:
push: push:
branches: branches:
- master - master
- hotfix/* - hotfix/**
- release/* - release/**
pull_request: pull_request:
branches: branches:
- master - master
@@ -196,27 +196,6 @@ jobs:
shell: bash shell: bash
env: env:
NODE_TLS_REJECT_UNAUTHORIZED: 0 NODE_TLS_REJECT_UNAUTHORIZED: 0
endtoendpuppeteer:
name: "End to end puppeteer tests"
needs: [lint, format, compile, unittest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: End to End Puppeteer Tests
run: |
npm ci
npm start &
npm run wait-for-server
npm run test:e2e
shell: bash
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
nuget: nuget:
name: Publish Nuget name: Publish Nuget
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/') if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
+4 -5
View File
@@ -49,18 +49,17 @@ export function sendCachedDataMessage<TResponseDataModel>(
export function sendMessage(data: any): void { export function sendMessage(data: any): void {
if (canSendMessage()) { if (canSendMessage()) {
const dataExplorerWindow = getDataExplorerWindow(window); // We try to find data explorer window first, then fallback to current window
if (dataExplorerWindow) { const portalChildWindow = getDataExplorerWindow(window) || window;
dataExplorerWindow.parent.postMessage( portalChildWindow.parent.postMessage(
{ {
signature: "pcIframe", signature: "pcIframe",
data: data data: data
}, },
dataExplorerWindow.document.referrer portalChildWindow.document.referrer
); );
} }
} }
}
export function canSendMessage(): boolean { export function canSendMessage(): boolean {
return window.parent !== window; return window.parent !== window;
+6
View File
@@ -2,6 +2,8 @@ export const getDataExplorerWindow = (currentWindow: Window): Window | undefined
// Start with the current window and traverse up the parent hierarchy to find a window // Start with the current window and traverse up the parent hierarchy to find a window
// with `dataExplorerPlatform` property // with `dataExplorerPlatform` property
let dataExplorerWindow: Window | undefined = currentWindow; let dataExplorerWindow: Window | undefined = currentWindow;
try {
// TODO: Need to `any` here since the window imports Explorer which can't be in strict mode yet // TODO: Need to `any` here since the window imports Explorer which can't be in strict mode yet
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
while (dataExplorerWindow && (dataExplorerWindow as any).dataExplorerPlatform === undefined) { while (dataExplorerWindow && (dataExplorerWindow as any).dataExplorerPlatform === undefined) {
@@ -12,6 +14,10 @@ export const getDataExplorerWindow = (currentWindow: Window): Window | undefined
dataExplorerWindow = dataExplorerWindow.parent; dataExplorerWindow = dataExplorerWindow.parent;
} }
} }
} catch (error) {
// This can happen if we come across parent from a different origin
dataExplorerWindow = undefined;
}
return dataExplorerWindow; return dataExplorerWindow;
}; };