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() {
const { isSecretsSyncActivated } = this.args;
const prefix = 'This export will include the namespace path, mount path and associated total, entity';
const mid = isSecretsSyncActivated ? ', non-entity and secrets sync clients' : ' and non-entity clients';
const suffix = ` for the
${this.formattedEndDate ? 'date range' : 'month'}
below.`;
return `${prefix}${mid}${suffix}`;
return `This export will include the namespace path, mount path and associated total entity, non-entity${
isSecretsSyncActivated ? ', ACME and secrets sync clients' : ' and ACME clients'
} for the ${this.formattedEndDate ? 'date range' : 'month'} below.`;
}
@action

View File

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

View File

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

View File

@@ -237,7 +237,7 @@ export default function (server) {
return {
request_id: 'version-history-request-id',
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: {
// entity/non-entity breakdown added
'1.9.0': {
@@ -269,6 +269,12 @@ export default function (server) {
previous_version: '1.14.4',
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) {
assert.expect(4);
assert.expect(5);
this.versionHistory = await this.store.findAll('clients/version-history').then((resp) => {
return resp.map(({ version, previousVersion, timestampInstalled }) => {
return {
@@ -215,7 +215,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
assert
.dom(CLIENT_COUNT.upgradeWarning)
.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'
);
assert
@@ -224,7 +224,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
'1.9.1',
'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
.dom(first)
.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.`,
'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) {