Merge branch 'master' into ft/deeplinking-link-component

This commit is contained in:
Greg Thompson
2017-12-08 09:54:58 -06:00
43 changed files with 1219 additions and 266 deletions

View File

@@ -6,6 +6,7 @@ import { Iterable } from "immutable"
export default class Operation extends PureComponent {
static propTypes = {
specPath: PropTypes.array.isRequired,
operation: PropTypes.instanceOf(Iterable).isRequired,
response: PropTypes.instanceOf(Iterable),
request: PropTypes.instanceOf(Iterable),
@@ -36,6 +37,7 @@ export default class Operation extends PureComponent {
render() {
let {
specPath,
response,
request,
toggleShown,
@@ -57,7 +59,6 @@ export default class Operation extends PureComponent {
let {
isShown,
isAuthorized,
jumpToKey,
path,
method,
op,
@@ -113,8 +114,10 @@ export default class Operation extends PureComponent {
let onChangeKey = [ path, method ] // Used to add values to _this_ operation ( indexed by path and method )
return (
<div className={`opblock-summary opblock-summary-${method}`} onClick={toggleShown} >
{/*TODO: convert this into a component, that can be wrapped
and pulled in with getComponent */}
<div className={deprecated ? "opblock opblock-deprecated" : isShown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`} id={isShownKey.join("-")} >
<div className={`opblock-summary opblock-summary-${method}`} onClick={toggleShown} >
<span className="opblock-summary-method">{method.toUpperCase()}</span>
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
<DeepLinkingLink
@@ -122,7 +125,7 @@ export default class Operation extends PureComponent {
isShown={isShown}
path={`${isShownKey.join("/")}`}
text={path} />
<JumpToPath path={jumpToKey} />
<JumpToPath path={specPath} /> {/*TODO: use wrapComponents here, swagger-ui doesn't care about jumpToPath */}
</span>
{ !showSummary ? null :
@@ -170,6 +173,7 @@ export default class Operation extends PureComponent {
<Parameters
parameters={parameters}
specPath={[...specPath, "parameters"]}
operation={operation}
onChangeKey={onChangeKey}
onTryoutClick = { onTryoutClick }
@@ -243,6 +247,7 @@ export default class Operation extends PureComponent {
specActions={ specActions }
produces={ produces }
producesValue={ operation.get("produces_value") }
specPath={[...specPath, "responses"]}
path={ path }
method={ method }
displayRequestDuration={ displayRequestDuration }