Use non-normalized operationId for layout management, if it is available (#4410)

* test(e2e): modify e2e hot server to peacefully coexist with dev server

* tests: add failing e2e test case

* fix: use originalOperationId for layout targeting, if available
This commit is contained in:
kyle
2018-04-04 18:55:10 -07:00
committed by GitHub
parent 2c4327bfd8
commit 4480db0390
16 changed files with 81 additions and 26 deletions

View File

@@ -72,6 +72,7 @@ export default class Operation extends PureComponent {
tag,
showSummary,
operationId,
originalOperationId,
allowTryItOut,
displayOperationId,
displayRequestDuration,
@@ -140,7 +141,7 @@ export default class Operation extends PureComponent {
</div>
}
{ displayOperationId && operationId ? <span className="opblock-summary-operation-id">{operationId}</span> : null }
{ displayOperationId && (originalOperationId || operationId) ? <span className="opblock-summary-operation-id">{originalOperationId || operationId}</span> : null }
{
(!security || !security.count()) ? null :

View File

@@ -58,7 +58,7 @@ export default class OperationContainer extends PureComponent {
const { op, layoutSelectors, getConfigs } = props
const { docExpansion, deepLinking, displayOperationId, displayRequestDuration, supportedSubmitMethods } = getConfigs()
const showSummary = layoutSelectors.showSummary()
const operationId = op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), props.path, props.method) || op.get("id")
const operationId = op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || opId(op.get("operation"), props.path, props.method) || op.get("id")
const isShownKey = ["operations", props.tag, operationId]
const isDeepLinkingEnabled = deepLinking && deepLinking !== "false"
const allowTryItOut = supportedSubmitMethods.indexOf(props.method) >= 0 && (typeof props.allowTryItOut === "undefined" ?
@@ -204,6 +204,7 @@ export default class OperationContainer extends PureComponent {
security,
isAuthorized,
operationId,
originalOperationId: resolvedSubtree.getIn(["operation", "__originalOperationId"]),
showSummary,
isShown,
jumpToKey,