From 64fc24ba181357b5cd84b6e88b5fe81f74520471 Mon Sep 17 00:00:00 2001 From: Mihai <103061463+mihai-peteu@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:46:41 -0700 Subject: [PATCH] chore(analytics): remove feature flag [MA-2027] (#238) --- .../e2e/specs/contextual-analytics.spec.ts | 38 ++----------------- src/constants/feature-flags.ts | 2 +- .../Applications/ApplicationDashboard.vue | 7 +--- src/views/MyApps.vue | 9 +---- 4 files changed, 6 insertions(+), 50 deletions(-) diff --git a/cypress/e2e/specs/contextual-analytics.spec.ts b/cypress/e2e/specs/contextual-analytics.spec.ts index cd58a9d3..01453d62 100644 --- a/cypress/e2e/specs/contextual-analytics.spec.ts +++ b/cypress/e2e/specs/contextual-analytics.spec.ts @@ -1,4 +1,4 @@ -import { apps, productRegistration, productRegistrations, versions } from '../fixtures/consts' +import { apps, productRegistrations, versions } from '../fixtures/consts' describe('Contextual Developer Analytics', () => { beforeEach(() => { @@ -21,9 +21,7 @@ describe('Contextual Developer Analytics', () => { viewAnalyticsButton: '[data-testid="application-dashboard-button"]' } - it('My Apps – displays displays metric cards if the feature flag is on', () => { - cy.mockLaunchDarklyFlags([{ name: 'ma-1002-dev-portal-contextual-analytics', value: true }]) - + it('My Apps – displays displays metric cards', () => { cy.mockApplications(apps, 4) cy.visit('/', { useOriginalFn: true }) @@ -36,38 +34,8 @@ describe('Contextual Developer Analytics', () => { cy.get(selectors.dashboardDropdownLink).should('exist') }) - it('My Apps – does not display metric cards or the analytics dropdown link if the feature flag is off', () => { - cy.mockLaunchDarklyFlags([{ name: 'ma-1002-dev-portal-contextual-analytics', value: false }]) - - cy.mockApplications(apps, 5) - cy.visit('/my-apps') - - cy.get(selectors.metricCardsParent).should('not.exist') - cy.get('[data-testid="applications-table"]').find('.actions-badge').first().click() - cy.get(selectors.dashboardDropdownLink).should('not.exist') - }) - - it('My App details page – does not display Metrics Card, View Analytics button if the feature flag is off', () => { - cy.mockLaunchDarklyFlags([{ name: 'ma-1002-dev-portal-contextual-analytics', value: true }]) - cy.mockApplications(apps, 4) - - cy.intercept( - 'GET', - `**/api/v2/applications/${apps[0].id}`, { - statusCode: 200, - body: { ...apps[0] } - } - ).as('getSingleApplication') - - cy.mockApplicationWithCredAndReg(apps[0]) - - cy.visit(`/application/${apps[0].id}`) - cy.get('[data-testid="analytics-metric-cards"]').should('not.exist') - cy.get('[data-testid="application-dashboard-button"]').should('not.exist') - }) - it('App Dashboard - vitals elements load when contextual analytics feature flag is on', () => { - cy.mockLaunchDarklyFlags([{ name: 'ma-1002-dev-portal-contextual-analytics', value: true }]) + it('App Dashboard - vitals elements load', () => { cy.mockApplications(apps, 4) cy.intercept('GET', `**/api/v2/applications/${apps[0].id}`, { diff --git a/src/constants/feature-flags.ts b/src/constants/feature-flags.ts index 811115af..2183694c 100644 --- a/src/constants/feature-flags.ts +++ b/src/constants/feature-flags.ts @@ -1,3 +1,3 @@ export enum FeatureFlags { - PortalContextualAnalytics = 'ma-1002-dev-portal-contextual-analytics' + // } diff --git a/src/views/Applications/ApplicationDashboard.vue b/src/views/Applications/ApplicationDashboard.vue index b91c3455..c818bda5 100644 --- a/src/views/Applications/ApplicationDashboard.vue +++ b/src/views/Applications/ApplicationDashboard.vue @@ -17,7 +17,7 @@ class="mb-5" :title="helpText.analytics.dashboard" /> -
+
@@ -112,8 +112,6 @@ import getMessageFromError from '@/helpers/getMessageFromError' import usePortalApi from '@/hooks/usePortalApi' import useToaster from '@/composables/useToaster' import useAllowedTimeframes from '@/composables/useAllowedTimeframes' -import { FeatureFlags } from '@/constants/feature-flags' -import useLDFeatureFlag from '@/hooks/useLDFeatureFlag' import { datePickerSelectionToTimeframe, Timeframe, @@ -131,9 +129,6 @@ import { useAppStore, useI18nStore } from '@/stores' import cloneDeep from 'lodash.clonedeep' import { PortalTimeframeKeys } from '@/types/vitals' -// @ts-ignore -const contextualAnalytics = useLDFeatureFlag(FeatureFlags.PortalContextualAnalytics, false) - const { notify } = useToaster() const errorMessage = ref('') const application = ref(null) diff --git a/src/views/MyApps.vue b/src/views/MyApps.vue index b1fdbd6b..daa81646 100644 --- a/src/views/MyApps.vue +++ b/src/views/MyApps.vue @@ -32,7 +32,7 @@