diff --git a/ui/app/components/clients/config.js b/ui/app/components/clients/config.js index 6b7419144..b84494b41 100644 --- a/ui/app/components/clients/config.js +++ b/ui/app/components/clients/config.js @@ -34,11 +34,6 @@ export default class ConfigComponent extends Component { helperText: 'The number of months of activity logs to maintain for client tracking.', valueKey: 'retentionMonths', }, - { - label: 'Default display', - helperText: 'The number of months we’ll display in the Vault usage dashboard by default.', - valueKey: 'defaultReportMonths', - }, ]; } diff --git a/ui/app/controllers/vault/cluster/clients/config.js b/ui/app/controllers/vault/cluster/clients/config.js deleted file mode 100644 index 2d566a95a..000000000 --- a/ui/app/controllers/vault/cluster/clients/config.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class ConfigController extends Controller {} diff --git a/ui/app/controllers/vault/cluster/clients/current.js b/ui/app/controllers/vault/cluster/clients/current.js deleted file mode 100644 index 5d260801b..000000000 --- a/ui/app/controllers/vault/cluster/clients/current.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class CurrentController extends Controller {} diff --git a/ui/app/controllers/vault/cluster/clients/history.js b/ui/app/controllers/vault/cluster/clients/history.js deleted file mode 100644 index cfc2bfe9e..000000000 --- a/ui/app/controllers/vault/cluster/clients/history.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class HistoryController extends Controller {} diff --git a/ui/app/controllers/vault/cluster/clients/index.js b/ui/app/controllers/vault/cluster/clients/index.js deleted file mode 100644 index 7892c9356..000000000 --- a/ui/app/controllers/vault/cluster/clients/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class ClientsController extends Controller {} diff --git a/ui/app/models/clients/config.js b/ui/app/models/clients/config.js index 919c0f2cf..49c83a359 100644 --- a/ui/app/models/clients/config.js +++ b/ui/app/models/clients/config.js @@ -6,10 +6,6 @@ import { apiPath } from 'vault/macros/lazy-capabilities'; const M = Model.extend({ queriesAvailable: attr('boolean'), - defaultReportMonths: attr('number', { - label: 'Default display', - subText: 'The number of months we’ll display in the Vault usage dashboard by default.', - }), retentionMonths: attr('number', { label: 'Retention period', subText: 'The number of months of activity logs to maintain for client tracking.', @@ -24,7 +20,7 @@ const M = Model.extend({ }), configAttrs: computed(function () { - let keys = ['enabled', 'defaultReportMonths', 'retentionMonths']; + let keys = ['enabled', 'retentionMonths']; return expandAttributeMeta(this, keys); }), }); diff --git a/ui/app/serializers/clients/config.js b/ui/app/serializers/clients/config.js index 08d6701a7..c39ac69f4 100644 --- a/ui/app/serializers/clients/config.js +++ b/ui/app/serializers/clients/config.js @@ -22,9 +22,8 @@ export default ApplicationSerializer.extend({ const oldEnabled = json.enabled; json.enabled = oldEnabled === 'On' ? 'enable' : 'disable'; } - json.default_report_months = parseInt(json.default_report_months, 10); json.retention_months = parseInt(json.retention_months, 10); - if (isNaN(json.default_report_months) || isNaN(json.retention_months)) { + if (isNaN(json.retention_months)) { throw new Error('Invalid number value'); } delete json.queries_available; diff --git a/ui/app/templates/components/clients/config.hbs b/ui/app/templates/components/clients/config.hbs index a79cfb333..c0736a263 100644 --- a/ui/app/templates/components/clients/config.hbs +++ b/ui/app/templates/components/clients/config.hbs @@ -1,16 +1,47 @@ -{{#if @isLoading}} - -{{else}} - {{#if (eq @mode "edit")}} -
-
- - {{#each @model.configAttrs as |attr|}} - {{#if (and (eq attr.type "string") (eq attr.options.editType "boolean"))}} - - {{#if attr.options.helpText}} +{{#if (eq @mode "edit")}} + +
+ + {{#each @model.configAttrs as |attr|}} + {{#if (and (eq attr.type "string") (eq attr.options.editType "boolean"))}} + + {{#if attr.options.helpText}} +

+ {{attr.options.helpText}} + {{#if attr.options.docLink}} + + See our documentation + + for help. + {{/if}} +

+ {{/if}} +
+ + +
+ {{else if (eq attr.type "number")}} +
+ + {{#if attr.options.subText}}

- {{attr.options.helpText}} + {{attr.options.subText}} {{#if attr.options.docLink}} See our documentation @@ -19,117 +50,82 @@ {{/if}}

{{/if}} - -
-
- - - Cancel - -
-
- - -
{{/if}} - -
- - -
- - {{else}} -
- {{#each this.infoRows as |item|}} - {{/each}}
- {{/if}} +
+
+ + + Cancel + +
+
+ + + +
+ + +
+
+{{else}} +
+ {{#each this.infoRows as |item|}} + + {{/each}} +
{{/if}} \ No newline at end of file diff --git a/ui/app/templates/components/clients/current.hbs b/ui/app/templates/components/clients/current.hbs index 3626d08be..9fc006746 100644 --- a/ui/app/templates/components/clients/current.hbs +++ b/ui/app/templates/components/clients/current.hbs @@ -45,25 +45,21 @@ {{/if}} - {{#if @isLoading}} - - {{else}} - {{#if this.totalUsageCounts}} - + {{#if this.hasAttributionData}} + - {{#if this.hasAttributionData}} - - {{/if}} {{/if}} {{/if}} {{/if}} diff --git a/ui/app/templates/vault/cluster/clients/edit.hbs b/ui/app/templates/vault/cluster/clients/edit.hbs index b071bd18b..f837fd732 100644 --- a/ui/app/templates/vault/cluster/clients/edit.hbs +++ b/ui/app/templates/vault/cluster/clients/edit.hbs @@ -1,9 +1 @@ - - -

- Configure usage tracking -

-
-
- \ No newline at end of file diff --git a/ui/tests/integration/components/clients-config-test.js b/ui/tests/integration/components/clients-config-test.js index 559604215..0fc4abfac 100644 --- a/ui/tests/integration/components/clients-config-test.js +++ b/ui/tests/integration/components/clients-config-test.js @@ -34,7 +34,6 @@ module('Integration | Component | client count config', function (hooks) { configAttrs: [ createAttr('enabled', 'string', { editType: 'boolean' }), createAttr('retentionMonths', 'number'), - createAttr('defaultReportMonths', 'number'), ], changedAttributes: () => ({}), save: () => {}, @@ -54,7 +53,7 @@ module('Integration | Component | client count config', function (hooks) { assert.dom('[data-test-pricing-metrics-config-table]').exists('Pricing metrics config table exists'); const rows = document.querySelectorAll('.info-table-row'); - assert.equal(rows.length, 3, 'renders 3 infotable rows'); + assert.equal(rows.length, 2, 'renders 2 infotable rows'); assert.ok( find('[data-test-row-value="Usage data collection"]').textContent.includes('On'), 'Enabled value matches model' @@ -63,10 +62,6 @@ module('Integration | Component | client count config', function (hooks) { find('[data-test-row-value="Retention period"]').textContent.includes('24'), 'Retention period value matches model' ); - assert.ok( - find('[data-test-row-value="Default display"]').textContent.includes('12'), - 'Default display value matches model' - ); }); test('TODO: it shows the config edit form when mode = edit', async function (assert) { @@ -77,7 +72,7 @@ module('Integration | Component | client count config', function (hooks) { assert.dom('[data-test-pricing-metrics-config-form]').exists('Pricing metrics config form exists'); const fields = document.querySelectorAll('[data-test-field]'); - assert.equal(fields.length, 3, 'renders 3 fields'); + assert.equal(fields.length, 2, 'renders 2 fields'); }); test('it shows a modal with correct messaging when disabling', async function (assert) { @@ -126,7 +121,7 @@ module('Integration | Component | client count config', function (hooks) { test('it does not show a modal on save if enable left unchanged', async function (assert) { // Simulates the model when something other than enabled changed const simModel = generateModel({ - changedAttributes: () => ({ defaultReportMonths: [24, '48'] }), + changedAttributes: () => ({ retentionMonths: [24, '48'] }), }); this.set('model', simModel); await render(hbs`