Remove reference to stored license (#15513)

* Remove reference to stored license

- Stored license was deprecated in 1.8 and from 1.11 all licenses will be
auto loaded.

* Added changelog

* Remove test for stored license

* Add defensive check in serializer
This commit is contained in:
Arnav Palnitkar 2022-05-20 09:33:50 -07:00 committed by GitHub
parent 59ccb9cc05
commit 7a5a63d0e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 49 deletions

3
changelog/15513.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:improvement
ui: Remove stored license references
```

View file

@ -8,11 +8,6 @@ export default ApplicationSerializer.extend({
...transformedPayload, ...transformedPayload,
...payload.data.autoloaded, ...payload.data.autoloaded,
}; };
} else if (payload.data.stored) {
transformedPayload = {
...transformedPayload,
...payload.data.stored,
};
} }
transformedPayload.id = transformedPayload.license_id; transformedPayload.id = transformedPayload.license_id;
return this._super(store, primaryModelClass, transformedPayload, id, requestType); return this._super(store, primaryModelClass, transformedPayload, id, requestType);

View file

@ -13,18 +13,7 @@
to to
{{date-format @expirationTime "MMM dd, yyyy hh:mm:ss a"}} {{date-format @expirationTime "MMM dd, yyyy hh:mm:ss a"}}
</InfoTableRow> </InfoTableRow>
<InfoTableRow @label="License state" @value={{if @autoloaded "Autoloaded" "Stored"}} data-test-detail-row> <InfoTableRow @label="License state" @value={{"Autoloaded"}} data-test-detail-row />
{{#if @autoloaded}}
Autoloaded
{{else}}
Stored
<Icon @name="alert-triangle-fill" class="has-text-highlight" />
<span class="is-size-8">
Stored licenses will be deprecated in a future version of Vault. We recommend autoloading your license. Read more
<a href="https://www.vaultproject.io/docs/enterprise/license" rel="noreferrer noopener" target="_blank">here</a>.
</span>
{{/if}}
</InfoTableRow>
</div> </div>
</section> </section>

View file

@ -35,13 +35,6 @@ export default function (server) {
return { return {
data: { data: {
autoloading_used: false, autoloading_used: false,
stored: {
expiration_time: EXPIRY_DATE,
features: ['DR Replication', 'Namespaces', 'Lease Count Quotas', 'Automated Snapshots'],
license_id: '0eca7ef8-ebc0-f875-315e-3cc94a7870cf',
performance_standby_count: 0,
start_time: '2020-04-28T00:00:00Z',
},
persisted_autoload: { persisted_autoload: {
expiration_time: EXPIRY_DATE, expiration_time: EXPIRY_DATE,
features: ['DR Replication', 'Namespaces', 'Lease Count Quotas', 'Automated Snapshots'], features: ['DR Replication', 'Namespaces', 'Lease Count Quotas', 'Automated Snapshots'],

View file

@ -49,31 +49,6 @@ module('Integration | Component | license info', function (hooks) {
assert.equal(row.rowValue, 'Autoloaded', 'Shows autoloaded status'); assert.equal(row.rowValue, 'Autoloaded', 'Shows autoloaded status');
}); });
test('it renders properly for stored license', async function (assert) {
const now = Date.now();
this.set('licenseId', 'test');
this.set('expirationTime', addMinutes(now, 30));
this.set('autoloaded', false);
this.set('startTime', now);
this.set('features', ['HSM', 'Namespaces']);
await render(
hbs`<LicenseInfo
@licenseId={{this.licenseId}}
@expirationTime={{this.expirationTime}}
@startTime={{this.startTime}}
@features={{this.features}}
@autoloaded={{false}}
/>`
);
let row = component.detailRows.filterBy('rowName', 'License state')[0];
assert.ok(
row.rowValue.includes(
'Stored licenses will be deprecated in a future version of Vault. We recommend autoloading your license.'
),
'Stored license includes recommendation to autoload'
);
});
test('it renders Performance Standby as inactive if count is 0', async function (assert) { test('it renders Performance Standby as inactive if count is 0', async function (assert) {
const now = Date.now(); const now = Date.now();
this.set('licenseId', 'temporary'); this.set('licenseId', 'temporary');