fix(xo-web/proxies): remove "Bind license" for proxies without VM UUID (#6472)

This commit is contained in:
rajaa-b 2022-10-28 11:19:45 +02:00 committed by GitHub
parent 7ede6bdbce
commit afd47f5522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Licenses] Remove "Bind license" button for proxies whose corresponding VM cannot be found (PR [#6472](https://github.com/vatesfr/xen-orchestra/pull/6472))
### Packages to release
> When modifying a package, add it here with its release type.

View File

@ -2448,6 +2448,7 @@ const messages = {
premiumLicense: 'Premium license',
trialLicenseInfo: 'You are currently in a {edition} trial period that will end on {date, date, medium}',
proxyMultipleLicenses: 'This proxy has more than 1 license!',
proxyUnknownVm: 'Unknown proxy VM.',
// ----- proxies -----
deployProxyDisabled: 'Only available to XOA users',

View File

@ -145,6 +145,14 @@ const COLUMNS = [
{
name: _('license'),
itemRenderer: (proxy, { isAdmin, licensesByVmUuid }) => {
if (proxy.vmUuid === undefined) {
return (
<span className='text-danger'>
{_('proxyUnknownVm')} <a href='https://xen-orchestra.com/'>{_('contactUs')}</a>
</span>
)
}
const licenses = licensesByVmUuid[proxy.vmUuid]
// Proxy bound to multiple licenses

View File

@ -32,6 +32,14 @@ class ProxyLicensesForm extends Component {
const { licenseId } = this.state
const licenses = userData.licensesByVmUuid[item.vmUuid]
if (item.vmUuid === undefined) {
return (
<span className='text-danger'>
{_('proxyUnknownVm')} <a href='https://xen-orchestra.com/'>{_('contactUs')}</a>
</span>
)
}
// Proxy bound to multiple licenses
if (licenses?.length > 1) {
return (