UI: Add 1.17 changes to upgrade alert (#26843)

* add upgrade alert for 1.17

* add acme clients to modal export text

* add to mirage for tests

* add test
This commit is contained in:
claire bontempo
2024-05-06 18:56:37 +01:00
committed by GitHub
parent f298ef763a
commit 843270df7c
5 changed files with 25 additions and 13 deletions

View File

@@ -234,14 +234,9 @@ export default class Attribution extends Component {
get modalExportText() { get modalExportText() {
const { isSecretsSyncActivated } = this.args; const { isSecretsSyncActivated } = this.args;
return `This export will include the namespace path, mount path and associated total entity, non-entity${
const prefix = 'This export will include the namespace path, mount path and associated total, entity'; isSecretsSyncActivated ? ', ACME and secrets sync clients' : ' and ACME clients'
const mid = isSecretsSyncActivated ? ', non-entity and secrets sync clients' : ' and non-entity clients'; } for the ${this.formattedEndDate ? 'date range' : 'month'} below.`;
const suffix = ` for the
${this.formattedEndDate ? 'date range' : 'month'}
below.`;
return `${prefix}${mid}${suffix}`;
} }
@action @action

View File

@@ -76,6 +76,9 @@ export default class ClientsCountsPageComponent extends Component<Args> {
case version.includes('1.10'): case version.includes('1.10'):
explanation = '- We added monthly breakdowns and mount level attribution starting in 1.10.'; explanation = '- We added monthly breakdowns and mount level attribution starting in 1.10.';
break; break;
case version.includes('1.17'):
explanation = '- We separated ACME clients from non-entity clients starting in 1.17.';
break;
default: default:
explanation = ''; explanation = '';
break; break;

View File

@@ -35,12 +35,13 @@ export const filterVersionHistory = (
end: string end: string
) => { ) => {
if (versionHistory) { if (versionHistory) {
const notableUpgrades = ['1.9', '1.10', '1.17'];
const upgrades = versionHistory.reduce((array: ClientsVersionHistoryModel[], upgradeData) => { const upgrades = versionHistory.reduce((array: ClientsVersionHistoryModel[], upgradeData) => {
const includesVersion = (v: string) => const includesVersion = (v: string) =>
// only add first match, disregard subsequent patch releases of the same version // only add first match, disregard subsequent patch releases of the same version
upgradeData.version.match(v) && !array.some((d: ClientsVersionHistoryModel) => d.version.match(v)); upgradeData.version.match(v) && !array.some((d: ClientsVersionHistoryModel) => d.version.match(v));
['1.9', '1.10'].forEach((v) => { notableUpgrades.forEach((v) => {
if (includesVersion(v)) array.push(upgradeData); if (includesVersion(v)) array.push(upgradeData);
}); });

View File

@@ -237,7 +237,7 @@ export default function (server) {
return { return {
request_id: 'version-history-request-id', request_id: 'version-history-request-id',
data: { data: {
keys: ['1.9.0', '1.9.1', '1.10.1', '1.14.4', '1.16.0'], keys: ['1.9.0', '1.9.1', '1.10.1', '1.14.4', '1.16.0', '1.17.0'],
key_info: { key_info: {
// entity/non-entity breakdown added // entity/non-entity breakdown added
'1.9.0': { '1.9.0': {
@@ -269,6 +269,12 @@ export default function (server) {
previous_version: '1.14.4', previous_version: '1.14.4',
timestamp_installed: addMonths(LICENSE_START, 4).toISOString(), timestamp_installed: addMonths(LICENSE_START, 4).toISOString(),
}, },
// acme_clients separated from non-entity clients
'1.17.0': {
build_date: addMonths(LICENSE_START, 5).toISOString(),
previous_version: '1.16.0',
timestamp_installed: addMonths(LICENSE_START, 5).toISOString(),
},
}, },
}, },
}; };

View File

@@ -199,7 +199,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
}); });
test('it renders alert if upgrade happened within queried activity', async function (assert) { test('it renders alert if upgrade happened within queried activity', async function (assert) {
assert.expect(4); assert.expect(5);
this.versionHistory = await this.store.findAll('clients/version-history').then((resp) => { this.versionHistory = await this.store.findAll('clients/version-history').then((resp) => {
return resp.map(({ version, previousVersion, timestampInstalled }) => { return resp.map(({ version, previousVersion, timestampInstalled }) => {
return { return {
@@ -215,7 +215,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
assert assert
.dom(CLIENT_COUNT.upgradeWarning) .dom(CLIENT_COUNT.upgradeWarning)
.hasTextContaining( .hasTextContaining(
`Client count data contains 2 upgrades Vault was upgraded during this time period. Keep this in mind while looking at the data. Visit our Client count FAQ for more information.`, `Client count data contains 3 upgrades Vault was upgraded during this time period. Keep this in mind while looking at the data. Visit our Client count FAQ for more information.`,
'it renders title and subtext' 'it renders title and subtext'
); );
assert assert
@@ -224,7 +224,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
'1.9.1', '1.9.1',
'Warning does not include subsequent patch releases (e.g. 1.9.1) of the same notable upgrade.' 'Warning does not include subsequent patch releases (e.g. 1.9.1) of the same notable upgrade.'
); );
const [first, second] = findAll(`${CLIENT_COUNT.upgradeWarning} li`); const [first, second, third] = findAll(`${CLIENT_COUNT.upgradeWarning} li`);
assert assert
.dom(first) .dom(first)
.hasText( .hasText(
@@ -238,6 +238,13 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
`1.10.1 (upgraded on Sep 2, 2023) - We added monthly breakdowns and mount level attribution starting in 1.10.`, `1.10.1 (upgraded on Sep 2, 2023) - We added monthly breakdowns and mount level attribution starting in 1.10.`,
'alert includes 1.10.1 upgrade' 'alert includes 1.10.1 upgrade'
); );
assert
.dom(third)
.hasTextContaining(
`1.17.0 (upgraded on Dec 2, 2023) - We separated ACME clients from non-entity clients starting in 1.17.`,
'alert includes 1.17.0 upgrade'
);
}); });
test('it should render empty state for no start or license start time', async function (assert) { test('it should render empty state for no start or license start time', async function (assert) {