Don't place fragment links if deep linking is disabled

This commit is contained in:
Kyle Shockey
2017-07-14 01:50:49 -07:00
parent 73845907a3
commit 556e40e6d4
2 changed files with 17 additions and 4 deletions

View File

@@ -116,7 +116,8 @@ export default class Operation extends PureComponent {
specActions, specActions,
specSelectors, specSelectors,
authActions, authActions,
authSelectors authSelectors,
getConfigs
} = this.props } = this.props
let summary = operation.get("summary") let summary = operation.get("summary")
@@ -141,6 +142,10 @@ export default class Operation extends PureComponent {
const Markdown = getComponent( "Markdown" ) const Markdown = getComponent( "Markdown" )
const Schemes = getComponent( "schemes" ) const Schemes = getComponent( "schemes" )
const { deepLinking } = getConfigs()
const isDeepLinkingEnabled = deepLinking && deepLinking !== "false"
// Merge in Live Response // Merge in Live Response
if(response && response.size > 0) { if(response && response.size > 0) {
let notDocumented = !responses.get(String(response.get("status"))) let notDocumented = !responses.get(String(response.get("status")))
@@ -159,7 +164,7 @@ export default class Operation extends PureComponent {
<a <a
className="nostyle" className="nostyle"
onClick={(e) => e.preventDefault()} onClick={(e) => e.preventDefault()}
href={`#/${isShownKey[1]}/${isShownKey[2]}`} > href={ isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : ""} >
<span>{path}</span> <span>{path}</span>
</a> </a>
<JumpToPath path={jumpToKey} /> <JumpToPath path={jumpToKey} />

View File

@@ -33,7 +33,15 @@ export default class Operations extends React.Component {
const Collapse = getComponent("Collapse") const Collapse = getComponent("Collapse")
let showSummary = layoutSelectors.showSummary() let showSummary = layoutSelectors.showSummary()
let { docExpansion, displayOperationId, displayRequestDuration, maxDisplayedTags } = getConfigs() let {
docExpansion,
displayOperationId,
displayRequestDuration,
maxDisplayedTags,
deepLinking
} = getConfigs()
const isDeepLinkingEnabled = deepLinking && deepLinking !== "false"
let filter = layoutSelectors.currentFilter() let filter = layoutSelectors.currentFilter()
@@ -69,7 +77,7 @@ export default class Operations extends React.Component {
<a <a
className="nostyle" className="nostyle"
onClick={(e) => e.preventDefault()} onClick={(e) => e.preventDefault()}
href={`#/${tag}`}> href={ isDeepLinkingEnabled ? `#/${tag}` : ""}>
<span>{tag}</span> <span>{tag}</span>
</a> </a>
{ !tagDescription ? null : { !tagDescription ? null :