Rewire Callbacks usage of Operation to match new interface

This commit is contained in:
Kyle Shockey
2017-11-17 14:43:14 -08:00
parent c28b128fe3
commit 84db66eb94

View File

@@ -1,10 +1,11 @@
import React from "react"
import PropTypes from "prop-types"
import { fromJS } from "immutable"
const Callbacks = (props) => {
let { callbacks, getComponent } = props
let { callbacks, getComponent, layoutSelectors } = props
// const Markdown = getComponent("Markdown")
const Operation = getComponent("operation", true)
const OperationContainer = getComponent("OperationContainer", true)
if(!callbacks) {
return <span>No callbacks</span>
@@ -16,24 +17,21 @@ const Callbacks = (props) => {
{ callback.map((pathItem, pathItemName) => {
return <div key={pathItemName}>
{ pathItem.map((operation, method) => {
return <Operation
operation={operation}
let op = fromJS({
operation
})
return <OperationContainer
{...props}
op={op}
key={method}
method={method}
isShownKey={["callbacks", operation.get("id"), callbackName]}
path={pathItemName}
allowTryItOut={false}
{...props}></Operation>
// return <pre>{JSON.stringify(operation)}</pre>
/>
}) }
</div>
}) }
</div>
// return <div>
// <h2>{name}</h2>
// {callback.description && <Markdown source={callback.description}/>}
// <pre>{JSON.stringify(callback)}</pre>
// </div>
})
return <div>
{callbackElements}