From 386ab81b96dad9176a4c01d845fff166e1d11b1f Mon Sep 17 00:00:00 2001 From: Rishichandra Wawhal Date: Sun, 17 Feb 2019 17:14:52 +0530 Subject: [PATCH] make events and remote-schema tabs independent of update checker (#1604) * fix a bug where update check request failure would stop remote-schemas and event triggers tab from loading * update graphiql test for with and without admin secret * remove dev data api url from localDev env --- .../integration/api-explorer/graphql/spec.js | 9 +++-- console/src/Globals.js | 1 - console/src/components/Main/Main.js | 7 ++-- console/src/helpers/Html.js | 16 ++------- console/src/helpers/localDev.js | 35 +++++++++++++++++++ 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 console/src/helpers/localDev.js diff --git a/console/cypress/integration/api-explorer/graphql/spec.js b/console/cypress/integration/api-explorer/graphql/spec.js index d9b6d1e8b24..75915881c62 100644 --- a/console/cypress/integration/api-explorer/graphql/spec.js +++ b/console/cypress/integration/api-explorer/graphql/spec.js @@ -65,8 +65,13 @@ export const checkExecuteQueryButton = () => { }; export const checkQuery = () => { - cy.get(getElementFromAlias('header-key-2')).type('someKey'); - cy.get(getElementFromAlias('header-value-2')).type('someValue'); + if (adminSecret) { + cy.get(getElementFromAlias('header-key-2')).type('someKey'); + cy.get(getElementFromAlias('header-value-2')).type('someValue'); + } else { + cy.get(getElementFromAlias('header-key-1')).type('someKey'); + cy.get(getElementFromAlias('header-value-1')).type('someValue'); + } cy.get('textarea') .first() diff --git a/console/src/Globals.js b/console/src/Globals.js index 91af98342c0..6f91b967e4c 100644 --- a/console/src/Globals.js +++ b/console/src/Globals.js @@ -95,5 +95,4 @@ if (globals.consoleMode === SERVER_CONSOLE_MODE) { } */ } - export default globals; diff --git a/console/src/components/Main/Main.js b/console/src/components/Main/Main.js index 28c09b1321a..db66a8cb3fa 100644 --- a/console/src/components/Main/Main.js +++ b/console/src/components/Main/Main.js @@ -40,9 +40,6 @@ class Main extends React.Component { dispatch(checkServerUpdates()).then(() => { let isUpdateAvailable = false; try { - this.checkEventsTab().then(() => { - this.checkSchemaStitch(); - }); isUpdateAvailable = semver.gt( this.props.latestServerVersion, this.props.serverVersion @@ -62,8 +59,12 @@ class Main extends React.Component { console.error(e); } }); + this.checkEventsTab().then(() => { + this.checkSchemaStitch(); + }); }); } + checkSchemaStitch() { const showSchemaStitch = semverCheck( 'schemaStitching', diff --git a/console/src/helpers/Html.js b/console/src/helpers/Html.js index 2f2f3828669..a68fbf4f66f 100644 --- a/console/src/helpers/Html.js +++ b/console/src/helpers/Html.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; +import { env } from './localDev'; /** * Wrapper component containing HTML metadata and boilerplate tags. * Used in server-side code only to wrap the string output of the @@ -20,7 +21,6 @@ export default class Html extends Component { render() { const { assets } = this.props; const head = Helmet.rewind(); - return ( @@ -38,19 +38,7 @@ export default class Html extends Component {