mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
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
This commit is contained in:
parent
75674859b3
commit
386ab81b96
@ -65,8 +65,13 @@ export const checkExecuteQueryButton = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const checkQuery = () => {
|
export const checkQuery = () => {
|
||||||
|
if (adminSecret) {
|
||||||
cy.get(getElementFromAlias('header-key-2')).type('someKey');
|
cy.get(getElementFromAlias('header-key-2')).type('someKey');
|
||||||
cy.get(getElementFromAlias('header-value-2')).type('someValue');
|
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')
|
cy.get('textarea')
|
||||||
.first()
|
.first()
|
||||||
|
@ -95,5 +95,4 @@ if (globals.consoleMode === SERVER_CONSOLE_MODE) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
export default globals;
|
export default globals;
|
||||||
|
@ -40,9 +40,6 @@ class Main extends React.Component {
|
|||||||
dispatch(checkServerUpdates()).then(() => {
|
dispatch(checkServerUpdates()).then(() => {
|
||||||
let isUpdateAvailable = false;
|
let isUpdateAvailable = false;
|
||||||
try {
|
try {
|
||||||
this.checkEventsTab().then(() => {
|
|
||||||
this.checkSchemaStitch();
|
|
||||||
});
|
|
||||||
isUpdateAvailable = semver.gt(
|
isUpdateAvailable = semver.gt(
|
||||||
this.props.latestServerVersion,
|
this.props.latestServerVersion,
|
||||||
this.props.serverVersion
|
this.props.serverVersion
|
||||||
@ -62,8 +59,12 @@ class Main extends React.Component {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.checkEventsTab().then(() => {
|
||||||
|
this.checkSchemaStitch();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
checkSchemaStitch() {
|
checkSchemaStitch() {
|
||||||
const showSchemaStitch = semverCheck(
|
const showSchemaStitch = semverCheck(
|
||||||
'schemaStitching',
|
'schemaStitching',
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
|
import { env } from './localDev';
|
||||||
/**
|
/**
|
||||||
* Wrapper component containing HTML metadata and boilerplate tags.
|
* Wrapper component containing HTML metadata and boilerplate tags.
|
||||||
* Used in server-side code only to wrap the string output of the
|
* Used in server-side code only to wrap the string output of the
|
||||||
@ -20,7 +21,6 @@ export default class Html extends Component {
|
|||||||
render() {
|
render() {
|
||||||
const { assets } = this.props;
|
const { assets } = this.props;
|
||||||
const head = Helmet.rewind();
|
const head = Helmet.rewind();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en-us">
|
<html lang="en-us">
|
||||||
<head>
|
<head>
|
||||||
@ -38,19 +38,7 @@ export default class Html extends Component {
|
|||||||
|
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `window.__env={
|
__html: env,
|
||||||
apiHost: '${process.env.API_HOST}',
|
|
||||||
apiPort: '${process.env.API_PORT}',
|
|
||||||
dataApiUrl: '${process.env.DATA_API_URL}',
|
|
||||||
devDataApiUrl: '${process.env.DEV_DATA_API_URL}',
|
|
||||||
adminSecret: '${process.env.ACCESS_KEY}',
|
|
||||||
isAdminKeySet: ${process.env.IS_ADMIN_SECRET_SET ||
|
|
||||||
process.env.IS_ACCESS_KEY_SET},
|
|
||||||
consoleMode: '${process.env.CONSOLE_MODE}',
|
|
||||||
nodeEnv: '${process.env.NODE_ENV}',
|
|
||||||
urlPrefix: '${process.env.URL_PREFIX}',
|
|
||||||
enableTelemetry: ${process.env.ENABLE_TELEMETRY}
|
|
||||||
};`,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
|
35
console/src/helpers/localDev.js
Normal file
35
console/src/helpers/localDev.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
const envObj = `apiHost: '${process.env.API_HOST}',
|
||||||
|
apiPort: '${process.env.API_PORT}',
|
||||||
|
dataApiUrl: '${process.env.DATA_API_URL}',
|
||||||
|
adminSecret: '${process.env.ADMIN_SECRET}',
|
||||||
|
consoleMode: '${process.env.CONSOLE_MODE}',
|
||||||
|
nodeEnv: '${process.env.NODE_ENV}',
|
||||||
|
urlPrefix: '${process.env.URL_PREFIX}',
|
||||||
|
enableTelemetry: ${process.env.ENABLE_TELEMETRY},
|
||||||
|
`;
|
||||||
|
|
||||||
|
let appendObj;
|
||||||
|
|
||||||
|
if (process.env.ADMIN_SECRET !== undefined) {
|
||||||
|
appendObj = `
|
||||||
|
adminSecret: '${process.env.ADMIN_SECRET}`;
|
||||||
|
} else {
|
||||||
|
// ADMIN_SECRET is undefined
|
||||||
|
if (process.env.IS_ADMIN_SECRET_SET !== undefined) {
|
||||||
|
appendObj = `isAdminSecretSet: ${process.env.IS_ADMIN_SECRET_SET}`;
|
||||||
|
} else {
|
||||||
|
// Both ADMIN_SECRET and IS_ADMIN_SECRET_SET is undefined
|
||||||
|
if (process.env.ACCESS_KEY !== undefined) {
|
||||||
|
appendObj = `accessKey: ${process.env.ACCESS_KEY}`;
|
||||||
|
} else {
|
||||||
|
appendObj = `isAccessKeySet: ${process.env.IS_ACCESS_KEY_SET}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const env = `
|
||||||
|
window.__env={\n\t\t${envObj}\t\t${appendObj}
|
||||||
|
};
|
||||||
|
`;
|
||||||
|
|
||||||
|
export { env };
|
Loading…
Reference in New Issue
Block a user