Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Configure new feature chip and banner messaging for ACLP Linode Alerts and Metrics ([#13509](https://github.com/linode/manager/pull/13509))
28 changes: 16 additions & 12 deletions packages/manager/cypress/e2e/core/cloudpulse/aclp-support.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
import { randomLabel, randomNumber } from 'support/util/random';

import {
METRICS_BETA_AND_NEW_MODE_BUTTON_TEXT,
METRICS_BETA_MODE_BANNER_TEXT,
METRICS_BETA_MODE_BUTTON_TEXT,
METRICS_LEGACY_MODE_BANNER_TEXT,
METRICS_LEGACY_MODE_BUTTON_TEXT,
METRICS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT,
METRICS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT,
} from 'src/features/Linodes/constants';

import type { Stats } from '@linode/api-v4';
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user
});
// UI displays beta metrics, can switch to legacy view
it('user preference enables aclp', function () {
mockGetUserPreferences({ isAclpMetricsBeta: true }).as(
mockGetUserPreferences({ isAclpMetricsMode: true }).as(
'getUserPreferences'
);
cy.visitWithLogin(`/linodes/${this.mockLinodeId}/metrics`);
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user
cy.contains(METRICS_BETA_MODE_BANNER_TEXT).should('be.visible');

ui.button
.findByTitle(METRICS_BETA_MODE_BUTTON_TEXT)
.findByTitle(METRICS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled');
// UI displays mock error msg
Expand All @@ -107,7 +107,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user

// UI displays legacy metrics, can switch to beta view
it('user preference disables aclp', function () {
mockGetUserPreferences({ isAclpMetricsBeta: false }).as(
mockGetUserPreferences({ isAclpMetricsMode: false }).as(
'getUserPreferences'
);
const mockLegacyStats: Stats = generateMockLegacyStats();
Expand Down Expand Up @@ -137,19 +137,23 @@ describe('ACLP Components UI varies according to ACLP support by region and user
);
// expect legacy metrics view of LinodeSummary component to be displayed
cy.get('[data-testid="linode-summary"]').should('be.visible');
cy.contains(METRICS_LEGACY_MODE_BANNER_TEXT).should('be.visible');
cy.contains(METRICS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT).should(
'be.visible'
);
// switch to beta metrics
ui.button
.findByTitle(METRICS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(METRICS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
// wait for dashboard query to complete
cy.wait('@getDashboardError');
cy.contains(METRICS_BETA_MODE_BANNER_TEXT).should('be.visible');
cy.contains(METRICS_LEGACY_MODE_BANNER_TEXT).should('not.exist');
cy.contains(METRICS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT).should(
'not.exist'
);
ui.button
.findByTitle(METRICS_BETA_MODE_BUTTON_TEXT)
.findByTitle(METRICS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled');
});
Expand Down Expand Up @@ -182,7 +186,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user
});
// UI displays legacy metrics, no option to switch to beta view
it('user preference enables aclp', function () {
mockGetUserPreferences({ isAclpMetricsBeta: true }).as(
mockGetUserPreferences({ isAclpMetricsMode: true }).as(
'getUserPreferences'
);
cy.visitWithLogin(`/linodes/${this.mockLinodeId}/metrics`);
Expand All @@ -191,7 +195,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user

// UI displays legacy metrics, no option to switch to beta view
it('user preference disables aclp', function () {
mockGetUserPreferences({ isAclpMetricsBeta: false }).as(
mockGetUserPreferences({ isAclpMetricsMode: false }).as(
'getUserPreferences'
);
cy.visitWithLogin(`/linodes/${this.mockLinodeId}/metrics`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
firewallFactory,
} from 'src/factories';
import {
ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT,
ALERTS_BETA_MODE_BANNER_TEXT,
ALERTS_BETA_MODE_BUTTON_TEXT,
ALERTS_LEGACY_MODE_BANNER_TEXT,
ALERTS_LEGACY_MODE_BUTTON_TEXT,
ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT,
ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT,
} from 'src/features/Linodes/constants';

const mockFirewall = firewallFactory.build({
Expand Down Expand Up @@ -246,7 +246,7 @@ describe('Create flow when beta alerts enabled by region and feature flag', func
// switch to beta
// alerts are off/false but enabled, can switch to on/true
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand Down Expand Up @@ -402,7 +402,7 @@ describe('Create flow when beta alerts enabled by region and feature flag', func
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});
});
// legacy alert form, inputs are ON but readonly
Expand All @@ -420,7 +420,7 @@ describe('Create flow when beta alerts enabled by region and feature flag', func

// upgrade from legacy alerts to beta alerts
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand All @@ -435,7 +435,7 @@ describe('Create flow when beta alerts enabled by region and feature flag', func
});
// possible to downgrade from ACLP alerts to legacy alerts
ui.button
.findByTitle(ALERTS_BETA_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled');
});
Expand Down
42 changes: 23 additions & 19 deletions packages/manager/cypress/e2e/core/linodes/alerts-edit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { randomLabel } from 'support/util/random';

import { alertFactory } from 'src/factories';
import {
ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT,
ALERTS_BETA_MODE_BANNER_TEXT,
ALERTS_BETA_MODE_BUTTON_TEXT,
ALERTS_BETA_PROMPT,
ALERTS_LEGACY_MODE_BANNER_TEXT,
ALERTS_LEGACY_MODE_BUTTON_TEXT,
ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT,
ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT,
ALERTS_LEGACY_PROMPT,
} from 'src/features/Linodes/constants';

Expand Down Expand Up @@ -142,7 +142,7 @@ describe('region enables alerts', function () {
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});
// alerts are disabled so all toggles are off
ui.toggle.find().each(($toggle) => {
Expand All @@ -152,7 +152,7 @@ describe('region enables alerts', function () {

// upgrade from legacy alerts to ACLP alerts
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand All @@ -171,7 +171,7 @@ describe('region enables alerts', function () {
});
// possible to downgrade from ACLP alerts to legacy alerts
ui.button
.findByTitle(ALERTS_BETA_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled');

Expand Down Expand Up @@ -203,7 +203,7 @@ describe('region enables alerts', function () {
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});

// alerts are enabled so all toggles are on if val > 0
Expand All @@ -214,7 +214,7 @@ describe('region enables alerts', function () {

// upgrade from legacy alerts to ACLP alerts
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('region enables alerts', function () {

// downgrade from ACLP alerts to legacy alerts
ui.button
.findByTitle(ALERTS_BETA_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand All @@ -289,7 +289,7 @@ describe('region enables alerts', function () {
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});
// alerts are disabled so all toggles are off
ui.toggle.find().each(($toggle) => {
Expand All @@ -301,7 +301,7 @@ describe('region enables alerts', function () {
});
// possible to upgrade to beta
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled');

Expand Down Expand Up @@ -339,7 +339,7 @@ describe('region enables alerts', function () {
assertLinodeAlertsEnabled(this.alertDefinitions);
// downgrade from ACLP alerts to legacy alerts
ui.button
.findByTitle(ALERTS_BETA_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand All @@ -356,7 +356,7 @@ describe('region enables alerts', function () {
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});
// turn the toggles off
ui.toggle
Expand Down Expand Up @@ -444,13 +444,13 @@ describe('region enables alerts', function () {
cy.get('[data-testid="notice-info"]')
.should('be.visible')
.within(() => {
cy.contains(ALERTS_LEGACY_MODE_BANNER_TEXT);
cy.contains(ALERTS_LEGACY_MODE_BETA_PHASE_BANNER_TEXT);
});
});

// upgrade from legacy alerts to ACLP alerts
ui.button
.findByTitle(ALERTS_LEGACY_MODE_BUTTON_TEXT)
.findByTitle(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT)
.should('be.visible')
.should('be.enabled')
.click();
Expand Down Expand Up @@ -558,8 +558,10 @@ describe('region disables alerts. beta alerts not available regardless of linode
cy.contains('Alerts').should('be.visible');
cy.get('[data-testid="notice-info"]').should('not.exist');
// not possible to upgrade or downgrade
cy.findByText(ALERTS_LEGACY_MODE_BUTTON_TEXT).should('not.exist');
cy.findByText(ALERTS_BETA_MODE_BUTTON_TEXT).should('not.exist');
cy.findByText(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT).should(
'not.exist'
);
cy.findByText(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT).should('not.exist');
// alerts are disabled so all toggles are off but are not readonly
ui.toggle.find().each(($toggle) => {
cy.wrap($toggle)
Expand Down Expand Up @@ -591,8 +593,10 @@ describe('region disables alerts. beta alerts not available regardless of linode
cy.contains('Alerts').should('be.visible');
cy.get('[data-testid="notice-info"]').should('not.exist');
// not possible to upgrade or downgrade
cy.findByText(ALERTS_LEGACY_MODE_BUTTON_TEXT).should('not.exist');
cy.findByText(ALERTS_BETA_MODE_BUTTON_TEXT).should('not.exist');
cy.findByText(ALERTS_LEGACY_MODE_BETA_PHASE_BUTTON_TEXT).should(
'not.exist'
);
cy.findByText(ALERTS_BETA_AND_NEW_MODE_BUTTON_TEXT).should('not.exist');
// legacy alerts are enabled
ui.toggle.find().each(($toggle) => {
cy.wrap($toggle)
Expand Down
1 change: 1 addition & 0 deletions packages/manager/src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ interface AclpAlerting {
editDisabledStatuses?: AlertStatusType[];
maxDimensionFiltersValues?: number;
maxEmailChannelRecipients?: number;
new?: boolean;
notificationChannels: boolean;
recentActivity: boolean;
systemChannelSupportedServices?: CloudPulseServiceType[]; // linode, dbaas, etc.
Expand Down
Loading
Loading