Autofix ESLint problems
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { PropTypes } from "react"
|
||||
import ImPropTypes from "react-immutable-proptypes"
|
||||
import { fromJS } from 'immutable'
|
||||
import { fromJS } from "immutable"
|
||||
|
||||
const noop = ()=>{}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export default class Models extends Component {
|
||||
render(){
|
||||
let { specSelectors, getComponent, layoutSelectors, layoutActions } = this.props
|
||||
let definitions = specSelectors.definitions()
|
||||
let showModels = layoutSelectors.isShown('models', true)
|
||||
let showModels = layoutSelectors.isShown("models", true)
|
||||
|
||||
const Model = getComponent("model")
|
||||
const Collapse = getComponent("Collapse")
|
||||
@@ -18,7 +18,7 @@ export default class Models extends Component {
|
||||
if (!definitions.size) return null
|
||||
|
||||
return <section className={ showModels ? "models is-open" : "models"}>
|
||||
<h4 onClick={() => layoutActions.show('models', !showModels)}>
|
||||
<h4 onClick={() => layoutActions.show("models", !showModels)}>
|
||||
<span>Models</span>
|
||||
<svg width="20" height="20">
|
||||
<use xlinkHref="#large-arrow" />
|
||||
|
||||
@@ -31,7 +31,7 @@ export default class OnlineValidatorBadge extends React.Component {
|
||||
return null
|
||||
}
|
||||
|
||||
return (<span style={{ float: "right"}}>
|
||||
return (<span style={{ float: "right"}}>
|
||||
<a target="_blank" href={`${ this.state.validatorUrl }/debug?url=${ this.state.url }`}>
|
||||
<img alt="Online validator badge" src={`${ this.state.validatorUrl }?url=${ this.state.url }`} />
|
||||
</a>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { PropTypes } from "react"
|
||||
import { fromJS } from 'immutable'
|
||||
import { fromJS } from "immutable"
|
||||
import { getSampleSchema } from "core/utils"
|
||||
|
||||
const getExampleComponent = ( sampleResponse, examples, HighlightCode ) => {
|
||||
|
||||
@@ -79,7 +79,7 @@ module.exports = function SwaggerUI(opts) {
|
||||
|
||||
if(!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) {
|
||||
system.specActions.updateUrl("")
|
||||
system.specActions.updateLoadingStatus("success");
|
||||
system.specActions.updateLoadingStatus("success")
|
||||
system.specActions.updateSpec(JSON.stringify(mergedConfig.spec))
|
||||
} else if(system.specActions.download && mergedConfig.url) {
|
||||
system.specActions.updateUrl(mergedConfig.url)
|
||||
|
||||
@@ -57,14 +57,14 @@ export default class SplitPaneMode extends React.Component {
|
||||
const mode = layoutSelectors.whatMode(MODE_KEY)
|
||||
const left = mode === MODE_RIGHT ? <noscript/> : children[0]
|
||||
const right = mode === MODE_LEFT ? <noscript/> : children[1]
|
||||
const size = this.sizeFromMode(mode, '50%')
|
||||
const size = this.sizeFromMode(mode, "50%")
|
||||
|
||||
return (
|
||||
<SplitPane
|
||||
disabledClass={''}
|
||||
ref={'splitPane'}
|
||||
disabledClass={""}
|
||||
ref={"splitPane"}
|
||||
split='vertical'
|
||||
defaultSize={'50%'}
|
||||
defaultSize={"50%"}
|
||||
primary="second"
|
||||
minSize={0}
|
||||
size={size}
|
||||
|
||||
@@ -539,7 +539,7 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
|
||||
let match = schema.$$ref.match(/\S*\/(\S+)$/)
|
||||
schema.xml.name = match[1]
|
||||
} else if (schema.type || schema.items || schema.properties || schema.additionalProperties) {
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>\n<!-- XML example cannot be generated -->'
|
||||
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- XML example cannot be generated -->"
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
@@ -555,13 +555,13 @@ export const parseSeach = () => {
|
||||
let search = window.location.search
|
||||
|
||||
if ( search != "" ) {
|
||||
let params = search.substr(1).split("&");
|
||||
let params = search.substr(1).split("&")
|
||||
|
||||
for (let i in params) {
|
||||
i = params[i].split("=");
|
||||
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1]);
|
||||
i = params[i].split("=")
|
||||
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1])
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
return map
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import Topbar from './topbar.jsx'
|
||||
import Topbar from "./topbar.jsx"
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import StandaloneLayout from './layout'
|
||||
import '../style/main.scss'
|
||||
import StandaloneLayout from "./layout"
|
||||
import "../style/main.scss"
|
||||
|
||||
import TopbarPlugin from "plugins/topbar"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React, { PropTypes } from "react"
|
||||
|
||||
export default class StandaloneLayout extends React.Component {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://example.com -H "Accept: application/json" -H "content-type: application/json" -d {"id":0,"name":"doggie","status":"available"}')
|
||||
expect(curlified).toEqual("curl -X POST http://example.com -H \"Accept: application/json\" -H \"content-type: application/json\" -d {\"id\":0,\"name\":\"doggie\",\"status\":\"available\"}")
|
||||
})
|
||||
|
||||
it("does not change the case of header in curl", function() {
|
||||
@@ -35,7 +35,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://example.com -H "conTenT Type: application/Moar"')
|
||||
expect(curlified).toEqual("curl -X POST http://example.com -H \"conTenT Type: application/Moar\"")
|
||||
})
|
||||
|
||||
it("prints a curl statement with an array of query params", function() {
|
||||
@@ -46,7 +46,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith')
|
||||
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith")
|
||||
})
|
||||
|
||||
it("prints a curl statement with an array of query params and auth", function() {
|
||||
@@ -60,7 +60,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "authorization: Basic Zm9vOmJhcg=="')
|
||||
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"authorization: Basic Zm9vOmJhcg==\"")
|
||||
})
|
||||
|
||||
it("prints a curl statement with html", function() {
|
||||
@@ -71,13 +71,13 @@ describe("curlify", function() {
|
||||
accept: "application/json"
|
||||
},
|
||||
body: {
|
||||
description: '<b>Test</b>'
|
||||
description: "<b>Test</b>"
|
||||
}
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
|
||||
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
|
||||
})
|
||||
|
||||
it("handles post body with html", function() {
|
||||
@@ -88,13 +88,13 @@ describe("curlify", function() {
|
||||
accept: "application/json"
|
||||
},
|
||||
body: {
|
||||
description: '<b>Test</b>'
|
||||
description: "<b>Test</b>"
|
||||
}
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
|
||||
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
|
||||
})
|
||||
|
||||
it("handles post body with special chars", function() {
|
||||
@@ -102,14 +102,14 @@ describe("curlify", function() {
|
||||
url: "http://swaggerhub.com/v1/one?name=john|smith",
|
||||
method: "POST",
|
||||
body: {
|
||||
description: '@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n' +
|
||||
'@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .'
|
||||
description: "@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n" +
|
||||
"@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."
|
||||
}
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {"description":"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."}')
|
||||
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {\"description\":\"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .\"}")
|
||||
})
|
||||
|
||||
it("handles delete form with parameters", function() {
|
||||
@@ -123,7 +123,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X DELETE http://example.com -H "accept: application/x-www-form-urlencoded"')
|
||||
expect(curlified).toEqual("curl -X DELETE http://example.com -H \"accept: application/x-www-form-urlencoded\"")
|
||||
})
|
||||
|
||||
it("should print a curl with formData", function() {
|
||||
@@ -136,7 +136,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://example.com -H "content-type: multipart/form-data" -F id=123 -F name=Sahar')
|
||||
expect(curlified).toEqual("curl -X POST http://example.com -H \"content-type: multipart/form-data\" -F id=123 -F name=Sahar")
|
||||
})
|
||||
|
||||
it("prints a curl post statement from an object", function() {
|
||||
@@ -153,7 +153,7 @@ describe("curlify", function() {
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d {"id":10101}')
|
||||
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d {\"id\":10101}")
|
||||
})
|
||||
|
||||
it("prints a curl post statement from a string containing a single quote", function() {
|
||||
@@ -163,12 +163,12 @@ describe("curlify", function() {
|
||||
headers: {
|
||||
accept: "application/json"
|
||||
},
|
||||
body: '{"id":"foo\'bar"}'
|
||||
body: "{\"id\":\"foo'bar\"}"
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d "{\\"id\\":\\"foo\'bar\\"}"')
|
||||
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d \"{\\\"id\\\":\\\"foo'bar\\\"}\"")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user