Update Operations component to call OperationContainer instead of Operation.jsx
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
import { helpers } from "swagger-client"
|
|
||||||
|
|
||||||
const { opId } = helpers
|
|
||||||
|
|
||||||
export default class Operations extends React.Component {
|
export default class Operations extends React.Component {
|
||||||
|
|
||||||
@@ -32,7 +29,7 @@ export default class Operations extends React.Component {
|
|||||||
|
|
||||||
let taggedOps = specSelectors.taggedOperations()
|
let taggedOps = specSelectors.taggedOperations()
|
||||||
|
|
||||||
const Operation = getComponent("operation")
|
const Operation = getComponent("OperationContainer", true)
|
||||||
const Collapse = getComponent("Collapse")
|
const Collapse = getComponent("Collapse")
|
||||||
|
|
||||||
let showSummary = layoutSelectors.showSummary()
|
let showSummary = layoutSelectors.showSummary()
|
||||||
@@ -117,42 +114,20 @@ export default class Operations extends React.Component {
|
|||||||
<Collapse isOpened={showTag}>
|
<Collapse isOpened={showTag}>
|
||||||
{
|
{
|
||||||
operations.map( op => {
|
operations.map( op => {
|
||||||
|
|
||||||
const path = op.get("path", "")
|
|
||||||
const method = op.get("method", "")
|
|
||||||
const jumpToKey = `paths.${path}.${method}`
|
|
||||||
|
|
||||||
const operationId =
|
|
||||||
op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), path, method) || op.get("id")
|
|
||||||
const isShownKey = ["operations", tag, operationId]
|
|
||||||
|
|
||||||
const allowTryItOut = specSelectors.allowTryItOutFor(op.get("path"), op.get("method"))
|
|
||||||
const response = specSelectors.responseFor(op.get("path"), op.get("method"))
|
|
||||||
const request = specSelectors.requestFor(op.get("path"), op.get("method"))
|
|
||||||
|
|
||||||
return <Operation
|
return <Operation
|
||||||
{...op.toObject()}
|
key={`${op.get("path")}-${op.get("method")}`}
|
||||||
|
op={op}
|
||||||
isShownKey={isShownKey}
|
tag={tag}
|
||||||
jumpToKey={jumpToKey}
|
|
||||||
showSummary={showSummary}
|
showSummary={showSummary}
|
||||||
key={isShownKey}
|
|
||||||
response={ response }
|
|
||||||
request={ request }
|
|
||||||
allowTryItOut={allowTryItOut}
|
|
||||||
|
|
||||||
displayOperationId={displayOperationId}
|
displayOperationId={displayOperationId}
|
||||||
displayRequestDuration={displayRequestDuration}
|
displayRequestDuration={displayRequestDuration}
|
||||||
|
|
||||||
specActions={ specActions }
|
specActions={ specActions }
|
||||||
specSelectors={ specSelectors }
|
specSelectors={ specSelectors }
|
||||||
|
|
||||||
layoutActions={ layoutActions }
|
layoutActions={ layoutActions }
|
||||||
layoutSelectors={ layoutSelectors }
|
layoutSelectors={ layoutSelectors }
|
||||||
|
|
||||||
authActions={ authActions }
|
authActions={ authActions }
|
||||||
authSelectors={ authSelectors }
|
authSelectors={ authSelectors }
|
||||||
|
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
fn={fn}
|
fn={fn}
|
||||||
getConfigs={ getConfigs }
|
getConfigs={ getConfigs }
|
||||||
|
|||||||
Reference in New Issue
Block a user