Skip to content

Fix deeplink to operation under tag with space #4544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/components/operation.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PureComponent } from "react"
import PropTypes from "prop-types"
import { getList } from "core/utils"
import { getExtensions, sanitizeUrl } from "core/utils"
import { getExtensions, createDeepLinkPath, sanitizeUrl } from "core/utils"
import { Iterable, List } from "immutable"
import ImPropTypes from "react-immutable-proptypes"

Expand Down Expand Up @@ -94,7 +94,7 @@ export default class Operation extends PureComponent {
let produces = operation.get("produces")
let parameters = getList(operation, ["parameters"])
let operationScheme = specSelectors.operationScheme(path, method)
let isShownKey = ["operations", tag, operationId]
let isShownKey = ["operations", createDeepLinkPath(tag), operationId]
let extensions = getExtensions(operation)

const Responses = getComponent("responses")
Expand Down
5 changes: 3 additions & 2 deletions src/core/containers/OperationContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes"
import { helpers } from "swagger-client"
import { Iterable, fromJS, Map } from "immutable"
import { createDeepLinkPath } from "core/utils"

const { opId } = helpers

Expand Down Expand Up @@ -59,7 +60,7 @@ export default class OperationContainer extends PureComponent {
const { docExpansion, deepLinking, displayOperationId, displayRequestDuration, supportedSubmitMethods } = getConfigs()
const showSummary = layoutSelectors.showSummary()
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 isShownKey = ["operations", createDeepLinkPath(props.tag), operationId]
const isDeepLinkingEnabled = deepLinking && deepLinking !== "false"
const allowTryItOut = supportedSubmitMethods.indexOf(props.method) >= 0 && (typeof props.allowTryItOut === "undefined" ?
props.specSelectors.allowTryItOutFor(props.path, props.method) : props.allowTryItOut)
Expand Down Expand Up @@ -110,7 +111,7 @@ export default class OperationContainer extends PureComponent {
// transitioning from collapsed to expanded
this.requestResolvedSubtree()
}
layoutActions.show(["operations", tag, operationId], !isShown)
layoutActions.show(["operations", createDeepLinkPath(tag), operationId], !isShown)
}

onTryoutClick =() => {
Expand Down