From c9d0bd2c19c0c592ace101def27f76f37c64760e Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:42:58 -0800 Subject: [PATCH] Secrets Sync UI: Hide sync client data and add beta tags to feature work (#25170) * hide sync billing related details * add beta tags * add csv comments * remaining tests * a couple more tests! --- ui/app/components/clients/attribution.hbs | 8 ++++ ui/app/components/clients/attribution.js | 16 ++++---- ui/app/components/clients/running-total.hbs | 11 +++++- ui/app/components/clients/usage-stats.hbs | 2 + ui/app/components/sidebar/nav/cluster.hbs | 2 +- ui/app/router.js | 2 +- ui/app/templates/vault/cluster/clients.hbs | 2 + .../components/secrets/page/overview.hbs | 5 ++- ui/lib/sync/addon/components/sync-header.hbs | 3 ++ .../clients/counts/overview-test.js | 27 +++++++------ .../components/clients/running-total-test.js | 38 ++++++++++--------- .../components/clients/usage-stats-test.js | 9 +++-- .../components/sidebar/nav/cluster-test.js | 5 +++ .../sync/secrets/page/destinations-test.js | 2 +- .../sync/secrets/page/overview-test.js | 12 +++--- .../components/sync/sync-header-test.js | 4 +- 16 files changed, 95 insertions(+), 53 deletions(-) diff --git a/ui/app/components/clients/attribution.hbs b/ui/app/components/clients/attribution.hbs index a88f4f74fb..92425d9c65 100644 --- a/ui/app/components/clients/attribution.hbs +++ b/ui/app/components/clients/attribution.hbs @@ -88,6 +88,13 @@ Export attribution data +

+ This export will include the namespace path, authentication method path, and the associated total, entity, and + non-entity clients for the + {{if this.formattedEndDate "date range" "month"}} + below. +

+ {{!-- * SYNC BETA (1.16.0) - beta removal planned for 1.16.1 release, replace copy above with the following

This export will include the namespace path, mount path and associated total, entity, non-entity and secrets sync clients for the @@ -100,6 +107,7 @@ for secrets sync clients is the KV v2 engine path and for entity/non-entity clients is the corresponding authentication method path.

+ --}}

SELECTED DATE {{if this.formattedEndDate " RANGE"}}

{{this.formattedStartDate}} diff --git a/ui/app/components/clients/attribution.js b/ui/app/components/clients/attribution.js index 611679f8aa..b26e275965 100644 --- a/ui/app/components/clients/attribution.js +++ b/ui/app/components/clients/attribution.js @@ -48,7 +48,7 @@ export default class Attribution extends Component { attributionLegend = [ { key: 'entity_clients', label: 'entity clients' }, { key: 'non_entity_clients', label: 'non-entity clients' }, - { key: 'secret_syncs', label: 'secrets sync clients' }, + // { key: 'secret_syncs', label: 'secrets sync clients' }, * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release ]; get formattedStartDate() { @@ -125,11 +125,15 @@ export default class Attribution extends Component { } } + // secrets_syncs unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // the three necessary CSV changes to add sync data are commented below + destructureCountsToArray(object) { // destructure the namespace object {label: 'some-namespace', entity_clients: 171, non_entity_clients: 20, secret_syncs: 10, clients: 201} // to get integers for CSV file - const { clients, entity_clients, non_entity_clients, secret_syncs } = object; - return [clients, entity_clients, non_entity_clients, secret_syncs]; + // (1) SYNC BETA - add `secrets_syncs to destructured and returned object below + const { clients, entity_clients, non_entity_clients } = object; + return [clients, entity_clients, non_entity_clients]; } constructCsvRow(namespaceColumn, mountColumn = null, totalColumns, newColumns = null) { @@ -161,13 +165,11 @@ export default class Attribution extends Component { 'Total clients', 'Entity clients', 'Non-entity clients', - 'Secrets sync clients', + // 'Secrets sync clients', * (2) SYNC BETA - add 'Secrets sync clients' as the last element of csvHeader ]; if (newAttribution) { - csvHeader.push( - 'Total new clients, New entity clients, New non-entity clients, New secrets sync clients' - ); + csvHeader.push('Total new clients, New entity clients, New non-entity clients'); // * (3) add 'New secrets sync clients' as last string pushed here } totalAttribution.forEach((totalClientsObject) => { diff --git a/ui/app/components/clients/running-total.hbs b/ui/app/components/clients/running-total.hbs index 8f5a77c984..f73d6e9b41 100644 --- a/ui/app/components/clients/running-total.hbs +++ b/ui/app/components/clients/running-total.hbs @@ -6,7 +6,8 @@ {{#if (gt @byMonthActivityData.length 1)}} + {{!-- * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + /> + --}} + {{!-- * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release

+ --}}
@@ -96,9 +101,11 @@
+ {{!-- * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release
+ --}}
{{else}} diff --git a/ui/app/components/clients/usage-stats.hbs b/ui/app/components/clients/usage-stats.hbs index edfb473bfe..f9f7522707 100644 --- a/ui/app/components/clients/usage-stats.hbs +++ b/ui/app/components/clients/usage-stats.hbs @@ -47,6 +47,7 @@ data-test-stat-text="non-entity-clients" /> + {{!-- * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release {{#if (gte @totalUsageCounts.secret_syncs 0)}}
{{/if}} + --}} \ No newline at end of file diff --git a/ui/app/components/sidebar/nav/cluster.hbs b/ui/app/components/sidebar/nav/cluster.hbs index 9566215d52..bdf32e2c93 100644 --- a/ui/app/components/sidebar/nav/cluster.hbs +++ b/ui/app/components/sidebar/nav/cluster.hbs @@ -16,7 +16,7 @@ {{#if (has-permission "access")}} diff --git a/ui/app/router.js b/ui/app/router.js index b8c60245f5..af1ceca378 100644 --- a/ui/app/router.js +++ b/ui/app/router.js @@ -29,7 +29,7 @@ Router.map(function () { this.route('clients', function () { this.route('counts', function () { this.route('overview'); - this.route('sync'); + // this.route('sync'); * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release this.route('token'); }); this.route('config'); diff --git a/ui/app/templates/vault/cluster/clients.hbs b/ui/app/templates/vault/cluster/clients.hbs index 2a4942b6d5..3a3c503b5c 100644 --- a/ui/app/templates/vault/cluster/clients.hbs +++ b/ui/app/templates/vault/cluster/clients.hbs @@ -20,9 +20,11 @@ Entity/Non-entity clients + {{! * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release Secrets sync clients + }} {{#if (or @model.config.canRead @model.canRead)}}

{{/if}} + {{#if this.version.isEnterprise}} + + {{/if}}

diff --git a/ui/tests/acceptance/clients/counts/overview-test.js b/ui/tests/acceptance/clients/counts/overview-test.js index 10215a2270..65b7773ffd 100644 --- a/ui/tests/acceptance/clients/counts/overview-test.js +++ b/ui/tests/acceptance/clients/counts/overview-test.js @@ -184,9 +184,10 @@ module('Acceptance | clients | overview', function (hooks) { `${formatNumber([topNamespace.non_entity_clients])}`, 'total non-entity clients is accurate' ); - assert - .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) - .includesText(`${formatNumber([topNamespace.secret_syncs])}`, 'total sync clients is accurate'); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) + // .includesText(`${formatNumber([topNamespace.secret_syncs])}`, 'total sync clients is accurate'); assert .dom('[data-test-attribution-clients] p') .includesText(`${formatNumber([topMount.clients])}`, 'top attribution clients accurate'); @@ -204,9 +205,10 @@ module('Acceptance | clients | overview', function (hooks) { assert .dom(SELECTORS.charts.statTextValue('Non-entity clients')) .includesText(`${formatNumber([topMount.non_entity_clients])}`, 'total non-entity clients is accurate'); - assert - .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) - .includesText(`${formatNumber([topMount.secret_syncs])}`, 'total sync clients is accurate'); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) + // .includesText(`${formatNumber([topMount.secret_syncs])}`, 'total sync clients is accurate'); assert.dom(SELECTORS.attributionBlock).doesNotExist('Does not show attribution block'); await click('#namespace-search-select [data-test-selected-list-button="delete"]'); @@ -224,12 +226,13 @@ module('Acceptance | clients | overview', function (hooks) { `${formatNumber([formatNumber([response.total.non_entity_clients])])}`, 'total non-entity clients is back to unfiltered value' ); - assert - .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) - .hasTextContaining( - `${formatNumber([formatNumber([response.total.secret_syncs])])}`, - 'total sync clients is back to unfiltered value' - ); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom(SELECTORS.charts.statTextValue('Secrets sync clients')) + // .hasTextContaining( + // `${formatNumber([formatNumber([response.total.secret_syncs])])}`, + // 'total sync clients is back to unfiltered value' + // ); assert .dom('[data-test-attribution-clients]') .hasTextContaining( diff --git a/ui/tests/integration/components/clients/running-total-test.js b/ui/tests/integration/components/clients/running-total-test.js index 53a98eaf63..90cd5aafd1 100644 --- a/ui/tests/integration/components/clients/running-total-test.js +++ b/ui/tests/integration/components/clients/running-total-test.js @@ -57,7 +57,7 @@ module('Integration | Component | clients/running-total', function (hooks) { test('it renders with full monthly activity data', async function (assert) { const expectedTotalEntity = formatNumber([this.totalUsageCounts.entity_clients]); const expectedTotalNonEntity = formatNumber([this.totalUsageCounts.non_entity_clients]); - const expectedTotalSync = formatNumber([this.totalUsageCounts.secret_syncs]); + // const expectedTotalSync = formatNumber([this.totalUsageCounts.secret_syncs]); await render(hbs` { @@ -111,7 +112,7 @@ module('Integration | Component | clients/running-total', function (hooks) { ); const expectedTotalEntity = formatNumber([this.totalUsageCounts.entity_clients]); const expectedTotalNonEntity = formatNumber([this.totalUsageCounts.non_entity_clients]); - const expectedTotalSync = formatNumber([this.totalUsageCounts.secret_syncs]); + // const expectedTotalSync = formatNumber([this.totalUsageCounts.secret_syncs]); await render(hbs` `); assert.dom(ts.charts.lineChart).doesNotExist('line chart does not render'); - assert.dom(statTextValue()).exists({ count: 8 }, 'renders stat text containers'); + assert.dom(statTextValue()).exists({ count: 6 }, 'renders 6 stat text containers'); // after SYNC BETA update to 8 assert .dom(`[data-test-new] ${statTextValue('New clients')}`) .hasText(`${expectedNewClients}`, `renders correct total new clients: ${expectedNewClients}`); @@ -171,9 +173,10 @@ module('Integration | Component | clients/running-total', function (hooks) { assert .dom(`[data-test-new] ${statTextValue('Non-entity clients')}`) .hasText(`${expectedNewNonEntity}`, `renders correct total new non-entity: ${expectedNewNonEntity}`); - assert - .dom(`[data-test-new] ${statTextValue('Secrets sync clients')}`) - .hasText(`${expectedNewSyncs}`, `renders correct total new non-entity: ${expectedNewSyncs}`); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom(`[data-test-new] ${statTextValue('Secrets sync clients')}`) + // .hasText(`${expectedNewSyncs}`, `renders correct total new non-entity: ${expectedNewSyncs}`); assert .dom(`[data-test-total] ${statTextValue('Total monthly clients')}`) .hasText(`${expectedTotalClients}`, `renders correct total clients: ${expectedTotalClients}`); @@ -183,8 +186,9 @@ module('Integration | Component | clients/running-total', function (hooks) { assert .dom(`[data-test-total] ${statTextValue('Non-entity clients')}`) .hasText(`${expectedTotalNonEntity}`, `renders correct total non-entity: ${expectedTotalNonEntity}`); - assert - .dom(`[data-test-total] ${statTextValue('Secrets sync clients')}`) - .hasText(`${expectedTotalSync}`, `renders correct total sync: ${expectedTotalSync}`); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom(`[data-test-total] ${statTextValue('Secrets sync clients')}`) + // .hasText(`${expectedTotalSync}`, `renders correct total sync: ${expectedTotalSync}`); }); }); diff --git a/ui/tests/integration/components/clients/usage-stats-test.js b/ui/tests/integration/components/clients/usage-stats-test.js index 5f347c7afb..36dbc2ce68 100644 --- a/ui/tests/integration/components/clients/usage-stats-test.js +++ b/ui/tests/integration/components/clients/usage-stats-test.js @@ -60,7 +60,7 @@ module('Integration | Component | clients/usage-stats', function (hooks) { await render(hbs``); - assert.dom('[data-test-stat-text]').exists({ count: 4 }, 'Renders 4 Stat texts'); + assert.dom('[data-test-stat-text]').exists({ count: 3 }, 'Renders 3 Stat texts'); // after SYNC BETA update to 4 assert .dom('[data-test-stat-text="total-clients"] .stat-value') .hasText('22', 'Total clients shows passed value'); @@ -70,8 +70,9 @@ module('Integration | Component | clients/usage-stats', function (hooks) { assert .dom('[data-test-stat-text="non-entity-clients"] .stat-value') .hasText('10', 'non entity clients shows passed value'); - assert - .dom('[data-test-stat-text="secret-syncs"] .stat-value') - .hasText('5', 'secrets sync clients shows passed value'); + // * unavailable during SYNC BETA (1.16.0), planned for 1.16.1 release + // assert + // .dom('[data-test-stat-text="secret-syncs"] .stat-value') + // .hasText('5', 'secrets sync clients shows passed value'); }); }); diff --git a/ui/tests/integration/components/sidebar/nav/cluster-test.js b/ui/tests/integration/components/sidebar/nav/cluster-test.js index ed521ed959..079cf1a058 100644 --- a/ui/tests/integration/components/sidebar/nav/cluster-test.js +++ b/ui/tests/integration/components/sidebar/nav/cluster-test.js @@ -79,8 +79,13 @@ module('Integration | Component | sidebar-nav-cluster', function (hooks) { .dom('[data-test-sidebar-nav-link]') .exists({ count: links.length }, 'Correct number of links render'); links.forEach((link) => { + if (link === 'Secrets Sync') return; assert.dom(`[data-test-sidebar-nav-link="${link}"]`).hasText(link, `${link} link renders`); }); + // after SYNC BETA - remove assertion below and return on line 82 + assert + .dom('[data-test-sidebar-nav-link="Secrets Sync"]') + .hasText('Secrets Sync Beta', 'Secrets Sync nav link includes beta tag'); }); test('it should hide enterprise related links in child namespace', async function (assert) { diff --git a/ui/tests/integration/components/sync/secrets/page/destinations-test.js b/ui/tests/integration/components/sync/secrets/page/destinations-test.js index 4c1abbc6a3..e9f880af15 100644 --- a/ui/tests/integration/components/sync/secrets/page/destinations-test.js +++ b/ui/tests/integration/components/sync/secrets/page/destinations-test.js @@ -70,7 +70,7 @@ module('Integration | Component | sync | Page::Destinations', function (hooks) { test('it should render header and tabs', async function (assert) { await this.renderComponent(); assert.dom(breadcrumb).includesText('Secrets Sync', 'Breadcrumb renders'); - assert.dom(title).hasText('Secrets Sync', 'Page title renders'); + assert.dom(title).hasText('Secrets Sync Beta', 'Page title renders'); assert.dom(tab('Overview')).exists('Overview tab renders'); assert.dom(tab('Destinations')).exists('Destinations tab renders'); }); diff --git a/ui/tests/integration/components/sync/secrets/page/overview-test.js b/ui/tests/integration/components/sync/secrets/page/overview-test.js index 860a185a1c..5e22f3045c 100644 --- a/ui/tests/integration/components/sync/secrets/page/overview-test.js +++ b/ui/tests/integration/components/sync/secrets/page/overview-test.js @@ -60,13 +60,13 @@ module('Integration | Component | sync | Page::Overview', function (hooks) { test('it should render landing cta component for enterprise', async function (assert) { this.set('destinations', []); await settled(); - assert.dom(title).hasText('Secrets Sync', 'Page title renders'); + assert.dom(title).hasText('Secrets Sync Beta', 'Page title renders'); assert.dom(cta.button).hasText('Create first destination', 'CTA action renders'); assert.dom(cta.summary).exists('CTA renders'); }); test('it should render header, tabs and toolbar for overview state', async function (assert) { - assert.dom(title).hasText('Secrets Sync', 'Page title renders'); + assert.dom(title).hasText('Secrets Sync Beta', 'Page title renders'); assert.dom(breadcrumb).exists({ count: 1 }, 'Correct number of breadcrumbs render'); assert.dom(breadcrumb).includesText('Secrets Sync', 'Top level breadcrumb renders'); assert.dom(cta.button).doesNotExist('CTA does not render'); @@ -141,8 +141,9 @@ module('Integration | Component | sync | Page::Overview', function (hooks) { }, { cardTitle: 'Total sync associations', - subText: 'Total sync associations that count towards client count', - actionText: 'View billing', + subText: + 'The number of secrets with a configured sync destination. One secret synced to two unique destinations will count as two associations.', + // actionText: 'View billing', count: '7', }, ]; @@ -150,8 +151,9 @@ module('Integration | Component | sync | Page::Overview', function (hooks) { cardData.forEach(({ cardTitle, subText, actionText, count }) => { assert.dom(title(cardTitle)).hasText(cardTitle, 'Overview card title renders'); assert.dom(description(cardTitle)).hasText(subText, 'Destinations overview card description renders'); - assert.dom(action(cardTitle)).hasText(actionText, 'Card action renders'); assert.dom(content(cardTitle)).hasText(count, 'Total count renders'); + if (cardTitle === 'Total sync associations') return; // uncomment 'actionText' above and this return after SYNC BETA + assert.dom(action(cardTitle)).hasText(actionText, 'Card action renders'); }); }); }); diff --git a/ui/tests/integration/components/sync/sync-header-test.js b/ui/tests/integration/components/sync/sync-header-test.js index c845fec356..263ada0919 100644 --- a/ui/tests/integration/components/sync/sync-header-test.js +++ b/ui/tests/integration/components/sync/sync-header-test.js @@ -41,11 +41,11 @@ module('Integration | Component | sync | SyncHeader', function (hooks) { test('it should just render title for enterprise version', async function (assert) { await this.renderComponent(); - assert.dom(title).hasText('Secrets Sync'); + assert.dom(title).hasText('Secrets Sync Beta'); }); test('it should render title and promotional enterprise badge for community version', async function (assert) { - this.version.type = null; + this.version.type = 'community'; await this.renderComponent(); assert.dom(title).hasText('Secrets Sync Enterprise feature'); });