Compare commits

...

4 Commits

Author SHA1 Message Date
Mohamedox
a4b966aa96 adapt PR to comments 2019-10-02 17:05:47 +02:00
Mohamedox
7459c9e2cf show description only when it exists 2019-10-02 16:16:58 +02:00
Mohamedox
4edaf67f0a update changelog 2019-10-02 16:15:47 +02:00
Mohamedox
876c1130e1 feat(xo-web/hub): display template description on Hub 2019-10-02 16:10:21 +02:00
2 changed files with 29 additions and 3 deletions

View File

@@ -7,6 +7,8 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [HUB] Display template description (PR [#4575](https://github.com/vatesfr/xen-orchestra/pull/4575))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”

View File

@@ -1,7 +1,9 @@
import _ from 'intl'
import ActionButton from 'action-button'
import Button from 'button'
import decorate from 'apply-decorators'
import Icon from 'icon'
import marked from 'marked'
import React from 'react'
import { Card, CardBlock, CardHeader } from 'card'
import { Col, Row } from 'grid'
@@ -157,6 +159,16 @@ export default decorate([
redirectToTaskPage() {
this.props.router.push('/tasks')
},
showDescription() {
alert(
this.props.name,
<div
dangerouslySetInnerHTML={{
__html: marked(this.props.description),
}}
/>
)
},
},
computed: {
installedTemplates: (_, { id, templates }) =>
@@ -178,6 +190,7 @@ export default decorate([
}),
injectState,
({
description,
effects,
hubInstallingResources,
id,
@@ -205,9 +218,20 @@ export default decorate([
<br />
</CardHeader>
<CardBlock className='text-center'>
<div>
<span className='text-muted'>{_('os')}</span> <strong>{os}</strong>
</div>
<Row>
<Col mediumSize={6}>
<span className='text-muted'>{_('os')}</span> <strong>{os}</strong>
</Col>
<Col mediumSize={6}>
{description !== undefined && (
<div className='pull-right'>
<Button onClick={effects.showDescription}>
<Icon icon='info' /> {_('vmNameDescription')}
</Button>
</div>
)}
</Col>
</Row>
<div>
<span className='text-muted'>{_('version')}</span>
{' '}