Skip to content

Commit

Permalink
Remove reference to stored license (#15513)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
arnav28 committed May 20, 2022
1 parent 2857bf6 commit b8f449a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 49 deletions.
3 changes: 3 additions & 0 deletions changelog/15513.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Remove stored license references
```
5 changes: 0 additions & 5 deletions ui/app/serializers/license.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ export default ApplicationSerializer.extend({
...transformedPayload,
...payload.data.autoloaded,
};
} else if (payload.data.stored) {
transformedPayload = {
...transformedPayload,
...payload.data.stored,
};
}
transformedPayload.id = transformedPayload.license_id;
return this._super(store, primaryModelClass, transformedPayload, id, requestType);
Expand Down
13 changes: 1 addition & 12 deletions ui/app/templates/components/license-info.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,7 @@
to
{{date-format @expirationTime "MMM dd, yyyy hh:mm:ss a"}}
</InfoTableRow>
<InfoTableRow @label="License state" @value={{if @autoloaded "Autoloaded" "Stored"}} 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>
<InfoTableRow @label="License state" @value={{"Autoloaded"}} data-test-detail-row />
</div>
</section>

Expand Down
7 changes: 0 additions & 7 deletions ui/mirage/handlers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ export default function (server) {
return {
data: {
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: {
expiration_time: EXPIRY_DATE,
features: ['DR Replication', 'Namespaces', 'Lease Count Quotas', 'Automated Snapshots'],
Expand Down
25 changes: 0 additions & 25 deletions ui/tests/integration/components/license-info-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,6 @@ module('Integration | Component | license info', function (hooks) {
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) {
const now = Date.now();
this.set('licenseId', 'temporary');
Expand Down

0 comments on commit b8f449a

Please sign in to comment.