fix console lint issues, code formatting (#3028)

This commit is contained in:
Kirankumar Ambati 2019-10-07 17:51:02 +05:30 committed by Rikin Kachhia
parent 3d6e4bc09a
commit 3d4f28551d
11 changed files with 29 additions and 23 deletions

View File

@ -6,4 +6,5 @@ const defaultState = {
requestError: null,
error: null,
};
export default defaultState;

View File

@ -1,15 +1,17 @@
import React from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { inputChecker } from './utils';
export default class InputChecker extends React.Component {
class InputChecker extends Component {
constructor() {
super();
this.state = {
isError: false,
errorMessage: '',
};
this.onBlur = this.onBlur.bind(this);
}
onBlur(e) {
const val = e.target.value;
@ -55,7 +57,7 @@ export default class InputChecker extends React.Component {
placeholder={placeholder || 'new input'}
value={value}
onChange={onChange}
onBlur={this.onBlur.bind(this)}
onBlur={this.onBlur}
data-index-id={indexId || 0}
disabled={disabled}
title={this.state.errorMessage || title}
@ -74,3 +76,5 @@ InputChecker.propTypes = {
indexId: PropTypes.number,
disabled: PropTypes.bool,
};
export default InputChecker;

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import { generateHeaderSyms } from './HeaderReducer';
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;

View File

@ -9,8 +9,6 @@ const defaultState = {
],
};
/* */
/* Action constants */
const generateHeaderSyms = (prefix = 'API_HEADER') => {
// TODO: change this anti-pattern
@ -25,7 +23,6 @@ const generateHeaderSyms = (prefix = 'API_HEADER') => {
DELETE_HEADER: `${prefix}/DELETE_HEADER`,
};
};
/* */
const generateReducer = (eventPrefix, defaultHeaders) => {
/* Action constants */
@ -41,7 +38,6 @@ const generateReducer = (eventPrefix, defaultHeaders) => {
ADD_NEW_HEADER,
UPDATE_HEADERS,
} = generateHeaderSyms(eventPrefix);
/* */
/* Reducer */
const headerReducer = (state = defaultState, action) => {
@ -112,7 +108,6 @@ const generateReducer = (eventPrefix, defaultHeaders) => {
}
};
return headerReducer;
/* */
};
export { generateHeaderSyms };

View File

@ -1 +1,3 @@
export rightContainerConnector from './RightContainer/RightContainer';
import rightContainerConnector from './RightContainer/RightContainer';
export { rightContainerConnector };

View File

@ -38,7 +38,7 @@ class QueryBuilderJson extends React.Component {
const isCustomJsonObject = object => {
// check if it is an array
if (object instanceof Array) {
// if empty array
// check if is an empty array
if (object.length === 0) {
return false;
}
@ -46,7 +46,7 @@ class QueryBuilderJson extends React.Component {
for (let i = 0; i < object.length; i++) {
const objectElement = object[i];
if (!objectElement instanceof Object) {
if (!(objectElement instanceof Object)) {
return false;
}

View File

@ -47,7 +47,6 @@ class DragFoldTable extends Component {
header.ondrop = e => {
e.preventDefault();
const { target, dataTransfer } = e;
if (this.dragged) {
this.reorder.push({ a: i, b: this.dragged });
}

View File

@ -1,8 +1,6 @@
/**
* Export component modules
*/
import App from './App/App';
import Main from './Main/Main';
import PageNotFound from './Error/PageNotFound';
import Login from './Login/Login';
export App from './App/App';
export Main from './Main/Main';
export PageNotFound from './Error/PageNotFound';
export Login from './Login/Login';
export { App, Main, PageNotFound, Login };

View File

@ -15,8 +15,8 @@ const environment = {
module.exports = Object.assign(
{
host: host,
port: port,
host,
port,
},
environment
);

View File

@ -58,7 +58,7 @@ const sanitiseUrl = path => {
return dataHandler(path.slice(DATA_PATH.length));
}
if (path.indexOf(API_EXPLORER_PATH) === 0) {
return apiExplorerHandler(path.slice(API_EXPLORER_PATH.length));
return apiExplorerHandler();
}
if (path.indexOf(REMOTE_SCHEMAS_PATH) === 0) {
return remoteSchemasHandler(path.slice(REMOTE_SCHEMAS_PATH.length));