Rearrange isShownKey to make more sense
Tag then ID is closer to representing the underlying data structure
This commit is contained in:
@@ -152,7 +152,7 @@ export default class Operation extends PureComponent {
|
|||||||
let onChangeKey = [ path, method ] // Used to add values to _this_ operation ( indexed by path and method )
|
let onChangeKey = [ path, method ] // Used to add values to _this_ operation ( indexed by path and method )
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={deprecated ? "opblock opblock-deprecated" : shown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`} id={isShownKey} >
|
<div className={deprecated ? "opblock opblock-deprecated" : shown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`} id={isShownKey.join("-")} >
|
||||||
<div className={`opblock-summary opblock-summary-${method}`} onClick={this.toggleShown} >
|
<div className={`opblock-summary opblock-summary-${method}`} onClick={this.toggleShown} >
|
||||||
<span className="opblock-summary-method">{method.toUpperCase()}</span>
|
<span className="opblock-summary-method">{method.toUpperCase()}</span>
|
||||||
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
|
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default class Operations extends React.Component {
|
|||||||
operations.map( op => {
|
operations.map( op => {
|
||||||
const operationId =
|
const operationId =
|
||||||
op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || op.get("id")
|
op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || op.get("id")
|
||||||
const isShownKey = ["operations", operationId, tag]
|
const isShownKey = ["operations", tag, operationId]
|
||||||
const path = op.get("path", "")
|
const path = op.get("path", "")
|
||||||
const method = op.get("method", "")
|
const method = op.get("method", "")
|
||||||
const jumpToKey = `paths.${path}.${method}`
|
const jumpToKey = `paths.${path}.${method}`
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const show = (ori, system) => (...args) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(type === "operations") {
|
if(type === "operations") {
|
||||||
let [, operationId, tag] = thing
|
let [, tag, operationId] = thing
|
||||||
setHash(`/${tag}/${operationId}`)
|
setHash(`/${tag}/${operationId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user