Skip to content

Commit

Permalink
refactor: Removes embedded/index.tsx warnings (apache#20193)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and philipher29 committed Jun 9, 2022
1 parent 9267f42 commit d5bc24c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions superset-frontend/src/embedded/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React, { lazy, Suspense } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import { makeApi, t } from '@superset-ui/core';
import { makeApi, t, logging } from '@superset-ui/core';
import { Switchboard } from '@superset-ui/switchboard';
import { bootstrapData } from 'src/preamble';
import setupClient from 'src/setup/setupClient';
Expand All @@ -35,7 +35,7 @@ const debugMode = process.env.WEBPACK_MODE === 'development';

function log(...info: unknown[]) {
if (debugMode) {
console.debug(`[superset]`, ...info);
logging.debug(`[superset]`, ...info);
}
}

Expand Down Expand Up @@ -69,16 +69,16 @@ const appMountPoint = document.getElementById('app')!;

const MESSAGE_TYPE = '__embedded_comms__';

function showFailureMessage(message: string) {
appMountPoint.innerHTML = message;
}

if (!window.parent || window.parent === window) {
showFailureMessage(
'This page is intended to be embedded in an iframe, but it looks like that is not the case.',
);
}

function showFailureMessage(message: string) {
appMountPoint.innerHTML = message;
}

// if the page is embedded in an origin that hasn't
// been authorized by the curator, we forbid access entirely.
// todo: check the referrer on the route serving this page instead
Expand Down Expand Up @@ -134,7 +134,7 @@ function start() {
},
err => {
// something is most likely wrong with the guest token
console.error(err);
logging.error(err);
showFailureMessage(
'Something went wrong with embedded authentication. Check the dev console for details.',
);
Expand Down

0 comments on commit d5bc24c

Please sign in to comment.