mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-21 07:28:26 +03:00
fix console lint issues, code formatting (#3028)
This commit is contained in:
parent
3d6e4bc09a
commit
3d4f28551d
@ -6,4 +6,5 @@ const defaultState = {
|
|||||||
requestError: null,
|
requestError: null,
|
||||||
error: null,
|
error: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultState;
|
export default defaultState;
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
import React from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { inputChecker } from './utils';
|
import { inputChecker } from './utils';
|
||||||
|
|
||||||
export default class InputChecker extends React.Component {
|
class InputChecker extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.state = {
|
this.state = {
|
||||||
isError: false,
|
isError: false,
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onBlur = this.onBlur.bind(this);
|
||||||
}
|
}
|
||||||
onBlur(e) {
|
onBlur(e) {
|
||||||
const val = e.target.value;
|
const val = e.target.value;
|
||||||
@ -55,7 +57,7 @@ export default class InputChecker extends React.Component {
|
|||||||
placeholder={placeholder || 'new input'}
|
placeholder={placeholder || 'new input'}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
onBlur={this.onBlur.bind(this)}
|
onBlur={this.onBlur}
|
||||||
data-index-id={indexId || 0}
|
data-index-id={indexId || 0}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
title={this.state.errorMessage || title}
|
title={this.state.errorMessage || title}
|
||||||
@ -74,3 +76,5 @@ InputChecker.propTypes = {
|
|||||||
indexId: PropTypes.number,
|
indexId: PropTypes.number,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default InputChecker;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { generateHeaderSyms } from './HeaderReducer';
|
import { generateHeaderSyms } from './HeaderReducer';
|
||||||
import DropdownButton from '../../DropdownButton/DropdownButton';
|
import DropdownButton from '../../DropdownButton/DropdownButton';
|
||||||
@ -199,6 +200,12 @@ class Header extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add proptypes
|
Header.propTypes = {
|
||||||
|
headers: PropTypes.array,
|
||||||
|
isDisabled: PropTypes.bool,
|
||||||
|
typeOptions: PropTypes.array,
|
||||||
|
placeHolderText: PropTypes.string,
|
||||||
|
keyInputPlaceholder: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
export default Header;
|
export default Header;
|
||||||
|
@ -9,8 +9,6 @@ const defaultState = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/* */
|
|
||||||
|
|
||||||
/* Action constants */
|
/* Action constants */
|
||||||
const generateHeaderSyms = (prefix = 'API_HEADER') => {
|
const generateHeaderSyms = (prefix = 'API_HEADER') => {
|
||||||
// TODO: change this anti-pattern
|
// TODO: change this anti-pattern
|
||||||
@ -25,7 +23,6 @@ const generateHeaderSyms = (prefix = 'API_HEADER') => {
|
|||||||
DELETE_HEADER: `${prefix}/DELETE_HEADER`,
|
DELETE_HEADER: `${prefix}/DELETE_HEADER`,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/* */
|
|
||||||
|
|
||||||
const generateReducer = (eventPrefix, defaultHeaders) => {
|
const generateReducer = (eventPrefix, defaultHeaders) => {
|
||||||
/* Action constants */
|
/* Action constants */
|
||||||
@ -41,7 +38,6 @@ const generateReducer = (eventPrefix, defaultHeaders) => {
|
|||||||
ADD_NEW_HEADER,
|
ADD_NEW_HEADER,
|
||||||
UPDATE_HEADERS,
|
UPDATE_HEADERS,
|
||||||
} = generateHeaderSyms(eventPrefix);
|
} = generateHeaderSyms(eventPrefix);
|
||||||
/* */
|
|
||||||
|
|
||||||
/* Reducer */
|
/* Reducer */
|
||||||
const headerReducer = (state = defaultState, action) => {
|
const headerReducer = (state = defaultState, action) => {
|
||||||
@ -112,7 +108,6 @@ const generateReducer = (eventPrefix, defaultHeaders) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return headerReducer;
|
return headerReducer;
|
||||||
/* */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export { generateHeaderSyms };
|
export { generateHeaderSyms };
|
||||||
|
@ -1 +1,3 @@
|
|||||||
export rightContainerConnector from './RightContainer/RightContainer';
|
import rightContainerConnector from './RightContainer/RightContainer';
|
||||||
|
|
||||||
|
export { rightContainerConnector };
|
||||||
|
@ -38,7 +38,7 @@ class QueryBuilderJson extends React.Component {
|
|||||||
const isCustomJsonObject = object => {
|
const isCustomJsonObject = object => {
|
||||||
// check if it is an array
|
// check if it is an array
|
||||||
if (object instanceof Array) {
|
if (object instanceof Array) {
|
||||||
// if empty array
|
// check if is an empty array
|
||||||
if (object.length === 0) {
|
if (object.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ class QueryBuilderJson extends React.Component {
|
|||||||
for (let i = 0; i < object.length; i++) {
|
for (let i = 0; i < object.length; i++) {
|
||||||
const objectElement = object[i];
|
const objectElement = object[i];
|
||||||
|
|
||||||
if (!objectElement instanceof Object) {
|
if (!(objectElement instanceof Object)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ class DragFoldTable extends Component {
|
|||||||
|
|
||||||
header.ondrop = e => {
|
header.ondrop = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const { target, dataTransfer } = e;
|
|
||||||
if (this.dragged) {
|
if (this.dragged) {
|
||||||
this.reorder.push({ a: i, b: this.dragged });
|
this.reorder.push({ a: i, b: this.dragged });
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
/**
|
import App from './App/App';
|
||||||
* Export component modules
|
import Main from './Main/Main';
|
||||||
*/
|
import PageNotFound from './Error/PageNotFound';
|
||||||
|
import Login from './Login/Login';
|
||||||
|
|
||||||
export App from './App/App';
|
export { App, Main, PageNotFound, Login };
|
||||||
export Main from './Main/Main';
|
|
||||||
export PageNotFound from './Error/PageNotFound';
|
|
||||||
export Login from './Login/Login';
|
|
||||||
|
@ -15,8 +15,8 @@ const environment = {
|
|||||||
|
|
||||||
module.exports = Object.assign(
|
module.exports = Object.assign(
|
||||||
{
|
{
|
||||||
host: host,
|
host,
|
||||||
port: port,
|
port,
|
||||||
},
|
},
|
||||||
environment
|
environment
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,7 @@ const sanitiseUrl = path => {
|
|||||||
return dataHandler(path.slice(DATA_PATH.length));
|
return dataHandler(path.slice(DATA_PATH.length));
|
||||||
}
|
}
|
||||||
if (path.indexOf(API_EXPLORER_PATH) === 0) {
|
if (path.indexOf(API_EXPLORER_PATH) === 0) {
|
||||||
return apiExplorerHandler(path.slice(API_EXPLORER_PATH.length));
|
return apiExplorerHandler();
|
||||||
}
|
}
|
||||||
if (path.indexOf(REMOTE_SCHEMAS_PATH) === 0) {
|
if (path.indexOf(REMOTE_SCHEMAS_PATH) === 0) {
|
||||||
return remoteSchemasHandler(path.slice(REMOTE_SCHEMAS_PATH.length));
|
return remoteSchemasHandler(path.slice(REMOTE_SCHEMAS_PATH.length));
|
||||||
|
Loading…
Reference in New Issue
Block a user