[ML] Improve expired license check (#191503)

When a trial license expires, the license falls into a state where it is
not seen as being a valid basic license, but rather an "expired"
license.
The license is still valid and our `isMinimumLicense` check needs to
return true in this situation to allow the ML app to redirect to the
expired license page.

Before (ML page fails to load):


![image](https://github.com/user-attachments/assets/0e73b2a5-0645-4253-9737-1393fe58f8a1)



After (we redirect to the license page):


![image](https://github.com/user-attachments/assets/3f579c1e-ee7f-45e8-87d3-258caa5d42c2)
This commit is contained in:
James Gowdy 2024-08-29 14:24:09 +01:00 committed by GitHub
parent 3a5747803b
commit 0a1be162fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,7 +135,7 @@ export function isTrialLicense(license: ILicense) {
}
export function isMinimumLicense(license: ILicense) {
return license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid';
return license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid' || license.isAvailable;
}
export function isMlEnabled(license: ILicense) {