open-vault/ui/app/templates/components/license-banners.hbs
Angel Garbarino 3003ff85ce
Disabling License Banners (#19116)
* work in progress: got the expired banner set with license check

* wip: got the logic for both banners, need to test and write tests

* add notes

* prep for test writing

* test coverage

* add changelog

* clean up

* clarify dismissTypes and conditionals

* updates

* update comment

* update comment

* address pr comments

* update test

* small naming change

* small naming changes

* clean localStorage

* comment clean up

* another comment clean up

* remove meep

* add test coverage for new method in localStorage
2023-02-14 17:00:24 +00:00

45 lines
1.9 KiB
Handlebars

{{#if (and this.licenseExpired (not this.expiredDismissed))}}
<div class="license-banner-wrapper" data-test-license-banner data-test-license-banner-expired>
<AlertBanner
@type="danger"
@title="License expired"
@message="Your Vault license expired on {{date-format
@expiry
'MMM d, yyyy'
}}. Add a new license to your configuration and restart Vault."
class="message-marginless"
>
<DocLink @path="/vault/tutorials/enterprise/hashicorp-enterprise-license">
<Icon @name="learn-link" />
Read documentation
</DocLink>
<button type="button" class="close-button" {{on "click" (fn this.dismissBanner "expired")}} data-test-dismiss-expired>
<Icon @name="x" aria-label="dismiss license expired warning" />
</button>
</AlertBanner>
</div>
{{else if (and (lte this.licenseExpiringInDays 30) (not this.warningDismissed))}}
<div class="license-banner-wrapper" data-test-license-banner data-test-license-banner-warning>
<AlertBanner
@type="warning"
@title="Vault license expiring"
@message="Your Vault license will expire in {{this.licenseExpiringInDays}} days at {{date-format
@expiry
'hh:mm:ss a'
}} on {{date-format @expiry 'MMM d, yyyy'}}. {{if
@autoloaded
'Add a new license to your configuration.'
'Keep in mind that your next license will need to be autoloaded'
}}"
class="message-marginless"
>
<DocLink @path="/vault/tutorials/enterprise/hashicorp-enterprise-license">
<Icon @name="learn-link" />
Read documentation
</DocLink>
<button type="button" class="close-button" {{on "click" (fn this.dismissBanner "warning")}} data-test-dismiss-warning>
<Icon @name="x" aria-label="dismiss license expire soon warning" />
</button>
</AlertBanner>
</div>
{{/if}}