Use <Operation> in callbacks
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
|
|
||||||
export default ({ callbacks, getComponent }) => {
|
export default (props) => {
|
||||||
|
let { callbacks, getComponent } = props
|
||||||
const Markdown = getComponent("Markdown")
|
const Markdown = getComponent("Markdown")
|
||||||
|
const Operation = getComponent("operation", true)
|
||||||
|
|
||||||
if(!callbacks) {
|
if(!callbacks) {
|
||||||
return <span>No callbacks</span>
|
return <span>No callbacks</span>
|
||||||
@@ -12,9 +14,14 @@ export default ({ callbacks, getComponent }) => {
|
|||||||
<h2>{callbackName}</h2>
|
<h2>{callbackName}</h2>
|
||||||
{ callback.map((pathItem, pathItemName) => {
|
{ callback.map((pathItem, pathItemName) => {
|
||||||
return <div>
|
return <div>
|
||||||
<h4>{pathItemName}</h4>
|
|
||||||
{ pathItem.map((operation, method) => {
|
{ pathItem.map((operation, method) => {
|
||||||
return <pre>{JSON.stringify(operation)}</pre>
|
return <Operation
|
||||||
|
operation={operation}
|
||||||
|
key={method}
|
||||||
|
method={method}
|
||||||
|
path={pathItemName}
|
||||||
|
{...props}></Operation>
|
||||||
|
// return <pre>{JSON.stringify(operation)}</pre>
|
||||||
}) }
|
}) }
|
||||||
</div>
|
</div>
|
||||||
}) }
|
}) }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component, PropTypes } from "react"
|
import React, { Component, PropTypes } from "react"
|
||||||
import Im, { OrderedMap } from "immutable"
|
import Im, { Map } from "immutable"
|
||||||
import ImPropTypes from "react-immutable-proptypes"
|
import ImPropTypes from "react-immutable-proptypes"
|
||||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class Parameters extends Component {
|
|||||||
</div> : "" }
|
</div> : "" }
|
||||||
|
|
||||||
{this.state.callbackVisible ? <div className="callbacks-container opblock-description-wrapper">
|
{this.state.callbackVisible ? <div className="callbacks-container opblock-description-wrapper">
|
||||||
<Callbacks callbacks={operation.get("callbacks")} />
|
<Callbacks callbacks={Map(operation.get("callbacks"))} />
|
||||||
</div> : "" }
|
</div> : "" }
|
||||||
{
|
{
|
||||||
requestBody && this.state.parametersVisible &&
|
requestBody && this.state.parametersVisible &&
|
||||||
|
|||||||
Reference in New Issue
Block a user