|
1 | 1 | import React from "react" |
2 | 2 | import PropTypes from "prop-types" |
3 | 3 | import { helpers } from "swagger-client" |
4 | | - |
| 4 | +import { replaceSpacesWithUnderscores } from "core/utils" |
5 | 5 | const { opId } = helpers |
6 | 6 |
|
7 | 7 | export default class Operations extends React.Component { |
@@ -69,7 +69,7 @@ export default class Operations extends React.Component { |
69 | 69 | let tagExternalDocsDescription = tagObj.getIn(["tagDetails", "externalDocs", "description"]) |
70 | 70 | let tagExternalDocsUrl = tagObj.getIn(["tagDetails", "externalDocs", "url"]) |
71 | 71 |
|
72 | | - let isShownKey = ["operations-tag", tag] |
| 72 | + let isShownKey = ["operations-tag", replaceSpacesWithUnderscores(tag)] |
73 | 73 | let showTag = layoutSelectors.isShown(isShownKey, docExpansion === "full" || docExpansion === "list") |
74 | 74 |
|
75 | 75 | return ( |
@@ -124,7 +124,7 @@ export default class Operations extends React.Component { |
124 | 124 |
|
125 | 125 | const operationId = |
126 | 126 | op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), path, method) || op.get("id") |
127 | | - const isShownKey = ["operations", tag, operationId] |
| 127 | + const isShownKey = ["operations", replaceSpacesWithUnderscores(tag), replaceSpacesWithUnderscores(operationId)] |
128 | 128 |
|
129 | 129 | const allowTryItOut = specSelectors.allowTryItOutFor(op.get("path"), op.get("method")) |
130 | 130 | const response = specSelectors.responseFor(op.get("path"), op.get("method")) |
|
0 commit comments