Skip to content

Commit

Permalink
Fix latest config tab (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 authored Dec 23, 2020
1 parent d66e868 commit 26ab052
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mwdb/web/src/components/ShowConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export class ConfigTable extends Component {
}

render() {
let indentLevel = this.props.indent || 0
const indentLevel = this.props.indent || 0
const currentPath = this.props.path || []

function TopLevel(props) {
return !indentLevel ? props.children : []
Expand All @@ -138,11 +139,11 @@ export class ConfigTable extends Component {
Array.isArray(this.props.cfg)
// If Array: add the asterisk to the last element
? [
...this.props.path.slice(0, -1),
this.props.path[this.props.path.length - 1] + "*"
...currentPath.slice(0, -1),
currentPath[currentPath.length - 1] + "*"
]
// Else: just add next key to the path
: this.props.path.concat([configKey])
: currentPath.concat([configKey])
)
return <ConfigRow name={configKey} key={configKey}
value={this.props.cfg[configKey]}
Expand Down Expand Up @@ -177,7 +178,7 @@ class ConfigPresenter extends ShowObjectPresenter {
get presenters() {
return {
...super.presenters,
details: (props => <ConfigTable {...props} path={[]} />),
details: (props => <ConfigTable {...props} />),
preview: (props => <HexView content={JSON.stringify(props.cfg, null, 4)} mode="raw" json/>)
}
}
Expand Down

0 comments on commit 26ab052

Please sign in to comment.