Skip to content

Commit

Permalink
fix(page/title): check if the container exists before displaying its …
Browse files Browse the repository at this point in the history
…name in the title
  • Loading branch information
Pierre Donias authored and olivierlambert committed Jul 13, 2016
1 parent 4c28b57 commit 539d136
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xo-app/host/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class Host extends Component {
installPatch: this._installPatch
}
)
return <Page header={this.header()} title={`${host.name_label} (${pool.name_label})`}>
return <Page header={this.header()} title={`${host.name_label}${pool ? ` (${pool.name_label})` : ''}`}>
{cloneElement(this.props.children, childProps)}
</Page>
}
Expand Down
2 changes: 1 addition & 1 deletion src/xo-app/sr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default class Sr extends Component {
'vdisToVmIds'
])
)
return <Page header={this.header()} title={`${sr.name_label} (${container.name_label})`}>
return <Page header={this.header()} title={`${sr.name_label}${container ? ` (${container.name_label})` : ''}`}>
{cloneElement(this.props.children, childProps)}
</Page>
}
Expand Down
2 changes: 1 addition & 1 deletion src/xo-app/vm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class Vm extends Component {
]), pick(this.state, [
'statsOverview'
]))
return <Page header={this.header()} title={`${vm.name_label} (${container.name_label})`}>
return <Page header={this.header()} title={`${vm.name_label}${container ? ` (${container.name_label})` : ''}`}>
{cloneElement(this.props.children, childProps)}
</Page>
}
Expand Down

0 comments on commit 539d136

Please sign in to comment.