feat(xo-web/dashboard/overview): display 'Report' for admin only (#4126)

Fixes #4123
This commit is contained in:
Rajaa.BARHTAOUI 2019-04-09 17:13:28 +02:00 committed by Pierre Donias
parent 916ca5576a
commit 5edee4bae0
2 changed files with 32 additions and 29 deletions

View File

@ -6,6 +6,7 @@
- [Backup/Schedule] Add warning regarding DST when you add a schedule [#4042](https://github.com/vatesfr/xen-orchestra/issues/4042) (PR [#4056](https://github.com/vatesfr/xen-orchestra/pull/4056))
- [Import] Avoid blocking the UI when dropping a big OVA file on the UI (PR [#4018](https://github.com/vatesfr/xen-orchestra/pull/4018))
- [Backup NG/Overview] Make backup list title clearer [#4111](https://github.com/vatesfr/xen-orchestra/issues/4111) (PR [#4129](https://github.com/vatesfr/xen-orchestra/pull/4129))
- [Dashboard] Hide "Report" section for non-admins [#4123](https://github.com/vatesfr/xen-orchestra/issues/4123) (PR [#4126](https://github.com/vatesfr/xen-orchestra/pull/4126))
### Bug fixes

View File

@ -489,35 +489,37 @@ class DefaultCard extends Component {
</Card>
</Col>
</Row>
<Row>
<Col>
<Card>
<CardHeader>
<Icon icon='menu-dashboard-stats' /> {_('dashboardReport')}
</CardHeader>
<CardBlock className='text-xs-center'>
<ActionButton
btnStyle='primary'
disabled={!canSendTheReport}
handler={sendUsageReport}
icon=''
>
{_('dashboardSendReport')}
</ActionButton>
<br />
{!canSendTheReport && (
<span>
<Link to='/settings/plugins' className='text-info'>
<Icon icon='info' /> {_('dashboardSendReportInfo')}
</Link>
<br />
</span>
)}
{_('dashboardSendReportMessage')}
</CardBlock>
</Card>
</Col>
</Row>
{props.isAdmin && (
<Row>
<Col>
<Card>
<CardHeader>
<Icon icon='menu-dashboard-stats' /> {_('dashboardReport')}
</CardHeader>
<CardBlock className='text-xs-center'>
<ActionButton
btnStyle='primary'
disabled={!canSendTheReport}
handler={sendUsageReport}
icon=''
>
{_('dashboardSendReport')}
</ActionButton>
<br />
{!canSendTheReport && (
<span>
<Link to='/settings/plugins' className='text-info'>
<Icon icon='info' /> {_('dashboardSendReportInfo')}
</Link>
<br />
</span>
)}
{_('dashboardSendReportMessage')}
</CardBlock>
</Card>
</Col>
</Row>
)}
<Row>
<Col>
<PatchesCard hosts={this._getHosts()} />