fix(pool): added tooltip for no support icon (#6505)

See zammad#10716
This commit is contained in:
Mathieu
2022-11-04 10:46:17 +01:00
committed by GitHub
parent ff0307b68f
commit c830a0b208
3 changed files with 21 additions and 5 deletions

View File

@@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed” > Users must be able to say: “I had this issue, happy to know it's fixed”
- [Pool] Add tooltip on "no XCP-ng Pro support" warning icon (PR [#6505](https://github.com/vatesfr/xen-orchestra/pull/6505))
### Packages to release ### Packages to release
> When modifying a package, add it here with its release type. > When modifying a package, add it here with its release type.
@@ -27,6 +29,7 @@
<!--packages-start--> <!--packages-start-->
- xo-web patch
- xo-server patch - xo-server patch
<!--packages-end--> <!--packages-end-->

View File

@@ -812,6 +812,7 @@ const messages = {
// ----- Pool general ----- // ----- Pool general -----
earliestExpirationDate: 'Earliest expiration: {dateString}', earliestExpirationDate: 'Earliest expiration: {dateString}',
poolNoSupport: 'No XCP-ng Pro support enabled on this pool',
poolPartialSupport: poolPartialSupport:
'Only {nHostsLicense, number} host{nHostsLicense, plural, one {} other {s}} under license on {nHosts, number} host{nHosts, plural, one {} other {s}}. This means this pool is not supported at all until you license all its hosts.', 'Only {nHostsLicense, number} host{nHostsLicense, plural, one {} other {s}} under license on {nHosts, number} host{nHosts, plural, one {} other {s}}. This means this pool is not supported at all until you license all its hosts.',
poolTitleRamUsage: 'Pool RAM usage:', poolTitleRamUsage: 'Pool RAM usage:',

View File

@@ -82,18 +82,30 @@ const BODY_STYLE = {
width: '100%', width: '100%',
} }
const WrapperIconPoolLicense = ({ children, tooltip }) => (
<Tooltip content={tooltip}>
<a href='https://xcp-ng.com' rel='noreferrer noopener' target='_blank'>
{children}
</a>
</Tooltip>
)
export const ICON_POOL_LICENSE = { export const ICON_POOL_LICENSE = {
total: tooltip => ( total: tooltip => (
<Tooltip content={tooltip}> <WrapperIconPoolLicense tooltip={tooltip}>
<Icon icon='pro-support' className='text-success' /> <Icon icon='pro-support' className='text-success' />
</Tooltip> </WrapperIconPoolLicense>
), ),
partial: tooltip => ( partial: tooltip => (
<Tooltip content={tooltip}> <WrapperIconPoolLicense tooltip={tooltip}>
<Icon icon='alarm' className='text-warning' /> <Icon icon='alarm' className='text-warning' />
</Tooltip> </WrapperIconPoolLicense>
),
any: () => (
<WrapperIconPoolLicense tooltip={_('poolNoSupport')}>
<Icon icon='alarm' className='text-danger' />
</WrapperIconPoolLicense>
), ),
any: () => <Icon icon='alarm' className='text-danger' />,
} }
@routes('home', { @routes('home', {