ESLint fixes
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
export default (props) => {
|
||||
const Callbacks = (props) => {
|
||||
let { callbacks, getComponent } = props
|
||||
const Markdown = getComponent("Markdown")
|
||||
// const Markdown = getComponent("Markdown")
|
||||
const Operation = getComponent("operation", true)
|
||||
|
||||
if(!callbacks) {
|
||||
@@ -10,10 +11,10 @@ export default (props) => {
|
||||
}
|
||||
|
||||
let callbackElements = callbacks.map((callback, callbackName) => {
|
||||
return <div>
|
||||
return <div key={callbackName}>
|
||||
<h2>{callbackName}</h2>
|
||||
{ callback.map((pathItem, pathItemName) => {
|
||||
return <div>
|
||||
return <div key={pathItemName}>
|
||||
{ pathItem.map((operation, method) => {
|
||||
return <Operation
|
||||
operation={operation}
|
||||
@@ -38,3 +39,11 @@ export default (props) => {
|
||||
{callbackElements}
|
||||
</div>
|
||||
}
|
||||
|
||||
Callbacks.propTypes = {
|
||||
getComponent: PropTypes.function.isRequired,
|
||||
callbacks: PropTypes.array.isRequired
|
||||
|
||||
}
|
||||
|
||||
export default Callbacks
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import React, { Component } from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import ImPropTypes from "react-immutable-proptypes"
|
||||
|
||||
export default class OperationLink extends Component {
|
||||
class OperationLink extends Component {
|
||||
render() {
|
||||
const { link, name } = this.props
|
||||
|
||||
@@ -26,3 +28,10 @@ function padString(n, string) {
|
||||
.map((line, i) => i > 0 ? Array(n + 1).join(" ") + line : line)
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
OperationLink.propTypes = {
|
||||
link: ImPropTypes.orderedMap.isRequired,
|
||||
name: PropTypes.String
|
||||
}
|
||||
|
||||
export default OperationLink
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import ImPropTypes from "react-immutable-proptypes"
|
||||
import { OrderedMap } from "immutable"
|
||||
import { getSampleSchema } from "core/utils"
|
||||
|
||||
|
||||
export default ({ requestBody, getComponent, specSelectors, contentType }) => {
|
||||
const RequestBody = ({ requestBody, getComponent, specSelectors, contentType }) => {
|
||||
const Markdown = getComponent("Markdown")
|
||||
const ModelExample = getComponent("modelExample")
|
||||
const HighlightCode = getComponent("highlightCode")
|
||||
@@ -29,3 +31,12 @@ export default ({ requestBody, getComponent, specSelectors, contentType }) => {
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
RequestBody.propTypes = {
|
||||
requestBody: ImPropTypes.orderedMap.isRequired,
|
||||
getComponent: PropTypes.function.isRequired,
|
||||
specSelectors: PropTypes.object.isRequired,
|
||||
contentType: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
export default RequestBody
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { Component, PropTypes } from "react"
|
||||
import React, { Component } from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
import { Model } from "core/components/model"
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from "react"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
|
||||
// We're disabling the Online Validator Badge until the online validator
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import React, { Component, PropTypes } from "react"
|
||||
import React, { Component } from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import Im, { Map } from "immutable"
|
||||
import ImPropTypes from "react-immutable-proptypes"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
|
||||
const mapRequestBody = (iterable, fn) => iterable.entries().filter(Im.Map.isMap).map((val) => {
|
||||
return fn(val.get(0), val.get(1))
|
||||
})
|
||||
|
||||
// More readable, just iterate over maps, only
|
||||
const eachMap = (iterable, fn) => iterable.valueSeq().filter(Im.Map.isMap).map(fn)
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from "react"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
|
||||
export default OAS3ComponentWrapFactory(() => {
|
||||
|
||||
Reference in New Issue
Block a user