Skip to content

Commit

Permalink
fix(pool): added tooltip for no support icon (#6505)
Browse files Browse the repository at this point in the history
See zammad#10716
  • Loading branch information
MathieuRA committed Nov 4, 2022
1 parent ff0307b commit c830a0b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

> 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

> When modifying a package, add it here with its release type.
Expand All @@ -27,6 +29,7 @@
<!--packages-start-->

- xo-web patch
- xo-server patch

<!--packages-end-->
1 change: 1 addition & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ const messages = {

// ----- Pool general -----
earliestExpirationDate: 'Earliest expiration: {dateString}',
poolNoSupport: 'No XCP-ng Pro support enabled on this pool',
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.',
poolTitleRamUsage: 'Pool RAM usage:',
Expand Down
22 changes: 17 additions & 5 deletions packages/xo-web/src/xo-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,30 @@ const BODY_STYLE = {
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 = {
total: tooltip => (
<Tooltip content={tooltip}>
<WrapperIconPoolLicense tooltip={tooltip}>
<Icon icon='pro-support' className='text-success' />
</Tooltip>
</WrapperIconPoolLicense>
),
partial: tooltip => (
<Tooltip content={tooltip}>
<WrapperIconPoolLicense tooltip={tooltip}>
<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', {
Expand Down

0 comments on commit c830a0b

Please sign in to comment.