From 278f467edb040b04ccb11ca3c89e5a6663c3facf Mon Sep 17 00:00:00 2001 From: Rosie Highsmith Date: Mon, 26 Jun 2023 08:32:50 -0700 Subject: [PATCH 1/5] 10064: remove order and opinion search checks in featureFlagHelper and tsx --- .../FeatureFlags/featureFlagHelper.ts | 29 ------------- .../views/AdvancedSearch/AdvancedSearch.tsx | 42 ++----------------- web-client/src/views/Public/PublicSearch.tsx | 27 +----------- 3 files changed, 6 insertions(+), 92 deletions(-) diff --git a/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.ts b/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.ts index 3d3938023ed..c853738c59c 100644 --- a/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.ts +++ b/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.ts @@ -6,44 +6,15 @@ export const featureFlagHelper = ( get: Get, applicationContext: ClientApplicationContext, ) => { - const { role } = get(state.user); const { ALLOWLIST_FEATURE_FLAGS } = applicationContext.getConstants(); - const isUserInternal = applicationContext.getUtilities().isInternalUser(role); - const areMultiDocketablePaperFilingsEnabled = get( state.featureFlags[ ALLOWLIST_FEATURE_FLAGS.MULTI_DOCKETABLE_PAPER_FILINGS.key ], ); - let isOrderSearchEnabledForRole = false; - if (role && isUserInternal) { - const isInternalOrderSearchEnabled = get( - state.featureFlags[ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key], - ); - isOrderSearchEnabledForRole = isInternalOrderSearchEnabled; - } else { - isOrderSearchEnabledForRole = get( - state.featureFlags[ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key], - ); - } - - let isOpinionSearchEnabledForRole = false; - if (role && isUserInternal) { - const isInternalOpinionSearchEnabled = get( - state.featureFlags[ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key], - ); - isOpinionSearchEnabledForRole = isInternalOpinionSearchEnabled; - } else { - isOpinionSearchEnabledForRole = get( - state.featureFlags[ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key], - ); - } - return { areMultiDocketablePaperFilingsEnabled, - isOpinionSearchEnabledForRole, - isOrderSearchEnabledForRole, }; }; diff --git a/web-client/src/views/AdvancedSearch/AdvancedSearch.tsx b/web-client/src/views/AdvancedSearch/AdvancedSearch.tsx index b32a808df51..9f46bae3d46 100644 --- a/web-client/src/views/AdvancedSearch/AdvancedSearch.tsx +++ b/web-client/src/views/AdvancedSearch/AdvancedSearch.tsx @@ -24,7 +24,6 @@ export const AdvancedSearch = connect( advancedSearchTabChangeSequence: sequences.advancedSearchTabChangeSequence, cerebralBindSimpleSetStateSequence: sequences.cerebralBindSimpleSetStateSequence, - featureFlagHelper: state.featureFlagHelper, searchTabs: state.constants.ADVANCED_SEARCH_TABS, submitCaseAdvancedSearchSequence: sequences.submitCaseAdvancedSearchSequence, @@ -44,7 +43,6 @@ export const AdvancedSearch = connect( advancedSearchTab, advancedSearchTabChangeSequence, cerebralBindSimpleSetStateSequence, - featureFlagHelper, searchTabs, submitCaseAdvancedSearchSequence, submitCaseDocketNumberSearchSequence, @@ -82,17 +80,7 @@ export const AdvancedSearch = connect( /> - + - - + + diff --git a/web-client/src/views/Public/PublicSearch.tsx b/web-client/src/views/Public/PublicSearch.tsx index e0a22219488..bb6ff4ceb2d 100644 --- a/web-client/src/views/Public/PublicSearch.tsx +++ b/web-client/src/views/Public/PublicSearch.tsx @@ -11,13 +11,11 @@ import { Tab, Tabs } from '../../ustc-ui/Tabs/Tabs'; import { WarningNotification } from '../WarningNotification'; import { connect } from '@cerebral/react'; import { sequences } from '@web-client/presenter/app.cerebral'; -import { state } from '@web-client/presenter/app.cerebral'; import React from 'react'; export const PublicSearch = connect( { advancedSearchTabChangeSequence: sequences.advancedSearchTabChangeSequence, - featureFlagHelper: state.featureFlagHelper, submitPublicCaseAdvancedSearchSequence: sequences.submitPublicCaseAdvancedSearchSequence, submitPublicCaseDocketNumberSearchSequence: @@ -29,7 +27,6 @@ export const PublicSearch = connect( }, function PublicSearch({ advancedSearchTabChangeSequence, - featureFlagHelper, submitPublicCaseAdvancedSearchSequence, submitPublicCaseDocketNumberSearchSequence, submitPublicOpinionAdvancedSearchSequence, @@ -64,17 +61,7 @@ export const PublicSearch = connect( /> - + - + Date: Mon, 26 Jun 2023 14:56:29 -0700 Subject: [PATCH 2/5] 10064: WIP removing feature flags --- .../src/business/entities/EntityConstants.ts | 20 -- .../integration-tests/opinionSearch.test.ts | 38 ++++ .../opinionSearchFeatureFlag.test.ts | 98 -------- .../integration-tests/orderSearch.test.ts | 38 ++++ .../orderSearchFeatureFlag.test.ts | 98 -------- .../FeatureFlags/featureFlagHelper.test.ts | 210 +----------------- .../Public/gotoPublicSearchSequence.ts | 15 -- ...bmitPublicOpinionAdvancedSearchSequence.ts | 44 +--- ...submitPublicOrderAdvancedSearchSequence.ts | 44 +--- .../sequences/gotoAdvancedSearchSequence.ts | 41 ---- .../submitOpinionAdvancedSearchSequence.ts | 72 +----- .../submitOrderAdvancedSearchSequence.ts | 50 +---- 12 files changed, 120 insertions(+), 648 deletions(-) create mode 100644 web-client/integration-tests/opinionSearch.test.ts delete mode 100644 web-client/integration-tests/opinionSearchFeatureFlag.test.ts create mode 100644 web-client/integration-tests/orderSearch.test.ts delete mode 100644 web-client/integration-tests/orderSearchFeatureFlag.test.ts diff --git a/shared/src/business/entities/EntityConstants.ts b/shared/src/business/entities/EntityConstants.ts index 5845ebba575..86de344d0e4 100644 --- a/shared/src/business/entities/EntityConstants.ts +++ b/shared/src/business/entities/EntityConstants.ts @@ -83,26 +83,6 @@ export const ALLOWLIST_FEATURE_FLAGS = { E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG: { key: 'e-consent-fields-enabled-feature-flag', }, - EXTERNAL_OPINION_SEARCH: { - disabledMessage: - 'Opinion search has been temporarily disabled. Please try again later.', - key: 'external-opinion-search-enabled', - }, - EXTERNAL_ORDER_SEARCH: { - disabledMessage: - 'Order search has been temporarily disabled. Please try again later.', - key: 'external-order-search-enabled', - }, - INTERNAL_OPINION_SEARCH: { - disabledMessage: - 'Opinion search has been temporarily disabled. Please try again later.', - key: 'internal-opinion-search-enabled', - }, - INTERNAL_ORDER_SEARCH: { - disabledMessage: - 'Order search has been temporarily disabled. Please try again later.', - key: 'internal-order-search-enabled', - }, MULTI_DOCKETABLE_PAPER_FILINGS: { disabledMessage: 'Paper filed docket entries are not being duplicated across consolidated cases temporarily.', diff --git a/web-client/integration-tests/opinionSearch.test.ts b/web-client/integration-tests/opinionSearch.test.ts new file mode 100644 index 00000000000..3d6bcea3c9a --- /dev/null +++ b/web-client/integration-tests/opinionSearch.test.ts @@ -0,0 +1,38 @@ +import { ADVANCED_SEARCH_TABS } from '../../shared/src/business/entities/EntityConstants'; +import { loginAs, setOpinionSearchEnabled, setupTest } from './helpers'; + +describe('Opinion search', () => { + const cerebralTest = setupTest(); + + afterAll(async () => { + cerebralTest.closeSocket(); + await setOpinionSearchEnabled(true, 'internal'); + await setOpinionSearchEnabled(true, 'external'); + }); + + describe('internal', () => { + loginAs(cerebralTest, 'docketclerk1@example.com'); + + it('should preserve the warning message when the user routes back to search from their dashboard', async () => { + await cerebralTest.runSequence('gotoDashboardSequence'); + await cerebralTest.runSequence('gotoAdvancedSearchSequence'); + + const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); + + expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); + }); + }); + + describe('external', () => { + loginAs(cerebralTest, 'privatepractitioner1@example.com'); + + it('should preserve the warning message when the user routes back to search from their dashboard', async () => { + await cerebralTest.runSequence('gotoDashboardSequence'); + await cerebralTest.runSequence('gotoAdvancedSearchSequence'); + + const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); + + expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); + }); + }); +}); diff --git a/web-client/integration-tests/opinionSearchFeatureFlag.test.ts b/web-client/integration-tests/opinionSearchFeatureFlag.test.ts deleted file mode 100644 index a7e0790be9b..00000000000 --- a/web-client/integration-tests/opinionSearchFeatureFlag.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { - ADVANCED_SEARCH_TABS, - ALLOWLIST_FEATURE_FLAGS, -} from '../../shared/src/business/entities/EntityConstants'; -import { - getFeatureFlagHelper, - loginAs, - setOpinionSearchEnabled, - setupTest, -} from '../integration-tests/helpers'; - -describe('Opinion search feature flags', () => { - const cerebralTest = setupTest(); - - afterAll(async () => { - cerebralTest.closeSocket(); - await setOpinionSearchEnabled(true, 'internal'); - await setOpinionSearchEnabled(true, 'external'); - }); - - describe('internal', () => { - loginAs(cerebralTest, 'docketclerk1@example.com'); - - it('should display a warning message when the feature is disabled', async () => { - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - cerebralTest.setState('advancedSearchTab', ADVANCED_SEARCH_TABS.OPINION); - - await setOpinionSearchEnabled(false, 'internal'); - - await cerebralTest.runSequence('submitOpinionAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.disabledMessage, - ); - }); - - it('should preserve the warning message when the user routes back to search from their dashboard', async () => { - await cerebralTest.runSequence('gotoDashboardSequence'); - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.disabledMessage, - ); - - const { isOpinionSearchEnabledForRole } = - getFeatureFlagHelper(cerebralTest); - - expect(isOpinionSearchEnabledForRole).toEqual(false); - }); - }); - - describe('external', () => { - loginAs(cerebralTest, 'privatepractitioner1@example.com'); - - it('should display a warning message when the feature is disabled', async () => { - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - cerebralTest.setState('advancedSearchTab', ADVANCED_SEARCH_TABS.OPINION); - - await setOpinionSearchEnabled(false, 'external'); - - await cerebralTest.runSequence('submitOpinionAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.disabledMessage, - ); - }); - - it('should preserve the warning message when the user routes back to search from their dashboard', async () => { - await cerebralTest.runSequence('gotoDashboardSequence'); - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.disabledMessage, - ); - - const { isOpinionSearchEnabledForRole } = - getFeatureFlagHelper(cerebralTest); - - expect(isOpinionSearchEnabledForRole).toEqual(false); - }); - }); -}); diff --git a/web-client/integration-tests/orderSearch.test.ts b/web-client/integration-tests/orderSearch.test.ts new file mode 100644 index 00000000000..ecac7eb6032 --- /dev/null +++ b/web-client/integration-tests/orderSearch.test.ts @@ -0,0 +1,38 @@ +import { ADVANCED_SEARCH_TABS } from '../../shared/src/business/entities/EntityConstants'; +import { loginAs, setOrderSearchEnabled, setupTest } from './helpers'; + +describe('Order search', () => { + const cerebralTest = setupTest(); + + afterAll(async () => { + cerebralTest.closeSocket(); + await setOrderSearchEnabled(true, 'internal'); + await setOrderSearchEnabled(true, 'external'); + }); + + describe('internal', () => { + loginAs(cerebralTest, 'docketclerk1@example.com'); + + it('should preserve the warning message when the user routes back to search from their dashboard', async () => { + await cerebralTest.runSequence('gotoDashboardSequence'); + await cerebralTest.runSequence('gotoAdvancedSearchSequence'); + + const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); + + expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); + }); + }); + + describe('external', () => { + loginAs(cerebralTest, 'privatepractitioner1@example.com'); + + it('should preserve the warning message when the user routes back to search from their dashboard', async () => { + await cerebralTest.runSequence('gotoDashboardSequence'); + await cerebralTest.runSequence('gotoAdvancedSearchSequence'); + + const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); + + expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); + }); + }); +}); diff --git a/web-client/integration-tests/orderSearchFeatureFlag.test.ts b/web-client/integration-tests/orderSearchFeatureFlag.test.ts deleted file mode 100644 index 5e35e28564a..00000000000 --- a/web-client/integration-tests/orderSearchFeatureFlag.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { - ADVANCED_SEARCH_TABS, - ALLOWLIST_FEATURE_FLAGS, -} from '../../shared/src/business/entities/EntityConstants'; -import { - getFeatureFlagHelper, - loginAs, - setOrderSearchEnabled, - setupTest, -} from './helpers'; - -describe('Order search feature flags', () => { - const cerebralTest = setupTest(); - - afterAll(async () => { - cerebralTest.closeSocket(); - await setOrderSearchEnabled(true, 'internal'); - await setOrderSearchEnabled(true, 'external'); - }); - - describe('internal', () => { - loginAs(cerebralTest, 'docketclerk1@example.com'); - - it('should display a warning message when the feature is disabled', async () => { - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - cerebralTest.setState('advancedSearchTab', ADVANCED_SEARCH_TABS.ORDER); - - await setOrderSearchEnabled(false, 'internal'); - - await cerebralTest.runSequence('submitOrderAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.disabledMessage, - ); - }); - - it('should preserve the warning message when the user routes back to search from their dashboard', async () => { - await cerebralTest.runSequence('gotoDashboardSequence'); - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.disabledMessage, - ); - - const { isOrderSearchEnabledForRole } = - getFeatureFlagHelper(cerebralTest); - - expect(isOrderSearchEnabledForRole).toEqual(false); - }); - }); - - describe('external', () => { - loginAs(cerebralTest, 'privatepractitioner1@example.com'); - - it('should display a warning message when the feature is disabled', async () => { - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - cerebralTest.setState('advancedSearchTab', ADVANCED_SEARCH_TABS.ORDER); - - await setOrderSearchEnabled(false, 'external'); - - await cerebralTest.runSequence('submitOrderAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.disabledMessage, - ); - }); - - it('should preserve the warning message when the user routes back to search from their dashboard', async () => { - await cerebralTest.runSequence('gotoDashboardSequence'); - await cerebralTest.runSequence('gotoAdvancedSearchSequence'); - - const stateOfAdvancedSearch = cerebralTest.getState('advancedSearchTab'); - const stateOfAlertWarning = cerebralTest.getState('alertWarning'); - - expect(stateOfAdvancedSearch).toEqual(ADVANCED_SEARCH_TABS.CASE); - expect(stateOfAlertWarning.message).toEqual( - ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.disabledMessage, - ); - - const { isOrderSearchEnabledForRole } = - getFeatureFlagHelper(cerebralTest); - - expect(isOrderSearchEnabledForRole).toEqual(false); - }); - }); -}); diff --git a/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.test.ts b/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.test.ts index 1876b7d3556..8bbdfa52932 100644 --- a/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.test.ts +++ b/web-client/src/presenter/computeds/FeatureFlags/featureFlagHelper.test.ts @@ -8,14 +8,11 @@ describe('featureFlagHelper', () => { const mockInternalUser = { role: ROLES.petitionsClerk, }; - const mockExternalUser = { - role: ROLES.petitioner, - }; const { ALLOWLIST_FEATURE_FLAGS } = applicationContext.getConstants(); - describe('isOrderSearchEnabledForRole', () => { - it('should be true when the user is internal and internal order search is enabled', () => { + describe('areMultiDocketablePaperFilingsEnabled', () => { + it('should be true when the feature flag is enabled', () => { applicationContext.isFeatureEnabled.mockReturnValue(true); const featureFlagHelper = withAppContextDecorator( @@ -28,93 +25,18 @@ describe('featureFlagHelper', () => { const result = runCompute(featureFlagHelper, { state: { featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key]: true, + [ALLOWLIST_FEATURE_FLAGS.MULTI_DOCKETABLE_PAPER_FILINGS.key]: true, }, user: mockInternalUser, }, }); expect(result).toMatchObject({ - isOrderSearchEnabledForRole: true, - }); - }); - - it('should be true when the user is external and external order search is enabled', () => { - applicationContext.isFeatureEnabled.mockReturnValue(false); - - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key]: true, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOrderSearchEnabledForRole: true, - }); - }); - - it('should be true when the user is public and external order search is enabled', () => { - applicationContext.isFeatureEnabled.mockReturnValue(false); - - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key]: true, - }, - user: {}, - }, - }); - - expect(result).toMatchObject({ - isOrderSearchEnabledForRole: true, - }); - }); - - it('should be false when the user is external, internal order search is enabled, and external order search is disabled', () => { - applicationContext.isFeatureEnabled.mockReturnValue(false); - - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key]: true, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key]: false, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOrderSearchEnabledForRole: false, + areMultiDocketablePaperFilingsEnabled: true, }); }); - it('should be false when the user is internal, internal order search is disabled, and external order search is disabled', () => { + it('should be false when the feature flag is not enabled', () => { applicationContext.isFeatureEnabled.mockReturnValue(false); const featureFlagHelper = withAppContextDecorator( @@ -127,132 +49,14 @@ describe('featureFlagHelper', () => { const result = runCompute(featureFlagHelper, { state: { featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key]: false, + [ALLOWLIST_FEATURE_FLAGS.MULTI_DOCKETABLE_PAPER_FILINGS.key]: false, }, user: mockInternalUser, }, }); expect(result).toMatchObject({ - isOrderSearchEnabledForRole: false, - }); - }); - }); - - describe('isOpinionSearchEnabledForRole', () => { - it('should be true when the user is internal and internal opinion search is enabled', () => { - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key]: true, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key]: true, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOpinionSearchEnabledForRole: true, - }); - }); - - it('should be true when the user is external and external opinion search is enabled', () => { - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key]: true, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOpinionSearchEnabledForRole: true, - }); - }); - - it('should be true when the user is public and external opinion search is enabled', () => { - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key]: true, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOpinionSearchEnabledForRole: true, - }); - }); - - it('should be false when the user is external, internal opinion search is enabled, and external opinion search is disabled', () => { - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key]: true, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key]: false, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOpinionSearchEnabledForRole: false, - }); - }); - - it('should be false when the user is internal, internal opinion search is disabled, and external opinion search is disabled', () => { - const featureFlagHelper = withAppContextDecorator( - featureFlagHelperComputed, - { - ...applicationContext, - }, - ); - - const result = runCompute(featureFlagHelper, { - state: { - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key]: false, - [ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key]: false, - }, - user: mockExternalUser, - }, - }); - - expect(result).toMatchObject({ - isOpinionSearchEnabledForRole: false, + areMultiDocketablePaperFilingsEnabled: false, }); }); }); diff --git a/web-client/src/presenter/sequences/Public/gotoPublicSearchSequence.ts b/web-client/src/presenter/sequences/Public/gotoPublicSearchSequence.ts index f5830c3e6b2..b284606bb47 100644 --- a/web-client/src/presenter/sequences/Public/gotoPublicSearchSequence.ts +++ b/web-client/src/presenter/sequences/Public/gotoPublicSearchSequence.ts @@ -1,12 +1,9 @@ import { clearAlertsAction } from '../../actions/clearAlertsAction'; import { defaultAdvancedSearchFormAction } from '../../actions/AdvancedSearch/defaultAdvancedSearchFormAction'; -import { getConstants } from '../../../getConstants'; -import { getFeatureFlagFactoryAction } from '../../actions/getFeatureFlagFactoryAction'; import { getOpinionTypesAction } from '../../actions/getOpinionTypesAction'; import { getPublicJudgesAction } from '../../actions/Public/getPublicJudgesAction'; import { setAllAndCurrentJudgesAction } from '../../actions/setAllAndCurrentJudgesAction'; import { setCurrentPageAction } from '../../actions/setCurrentPageAction'; -import { setFeatureFlagFactoryAction } from '../../actions/setFeatureFlagFactoryAction'; import { setOpinionTypesAction } from '../../actions/setOpinionTypesAction'; export const gotoPublicSearchSequence = [ @@ -18,16 +15,4 @@ export const gotoPublicSearchSequence = [ getOpinionTypesAction, setOpinionTypesAction, setCurrentPageAction('PublicSearch'), - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), ]; diff --git a/web-client/src/presenter/sequences/Public/submitPublicOpinionAdvancedSearchSequence.ts b/web-client/src/presenter/sequences/Public/submitPublicOpinionAdvancedSearchSequence.ts index ccf217becb0..373f8b0b565 100644 --- a/web-client/src/presenter/sequences/Public/submitPublicOpinionAdvancedSearchSequence.ts +++ b/web-client/src/presenter/sequences/Public/submitPublicOpinionAdvancedSearchSequence.ts @@ -1,14 +1,8 @@ import { clearAlertsAction } from '../../actions/clearAlertsAction'; import { clearSearchResultsAction } from '../../actions/AdvancedSearch/clearSearchResultsAction'; import { clearSearchTermAction } from '../../actions/clearSearchTermAction'; -import { getConstants } from '../../../getConstants'; -import { getFeatureFlagFactoryAction } from '../../actions/getFeatureFlagFactoryAction'; -import { isFeatureFlagEnabledFactoryAction } from '../../actions/isFeatureFlagEnabledFactoryAction'; import { setAdvancedSearchResultsAction } from '../../actions/AdvancedSearch/setAdvancedSearchResultsAction'; import { setAlertErrorAction } from '../../actions/setAlertErrorAction'; -import { setAlertWarningAction } from '../../actions/setAlertWarningAction'; -import { setDefaultAdvancedSearchTabAction } from '../../actions/setDefaultAdvancedSearchTabAction'; -import { setFeatureFlagFactoryAction } from '../../actions/setFeatureFlagFactoryAction'; import { setValidationErrorsAction } from '../../actions/setValidationErrorsAction'; import { showProgressSequenceDecorator } from '../../utilities/showProgressSequenceDecorator'; import { startShowValidationAction } from '../../actions/startShowValidationAction'; @@ -16,33 +10,19 @@ import { submitPublicOpinionAdvancedSearchAction } from '../../actions/Public/su import { validateOpinionAdvancedSearchAction } from '../../actions/AdvancedSearch/validateOpinionAdvancedSearchAction'; export const submitPublicOpinionAdvancedSearchSequence = [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH, - ), + clearSearchTermAction, + validateOpinionAdvancedSearchAction, { - no: [setAlertWarningAction, setDefaultAdvancedSearchTabAction], - yes: [ - clearSearchTermAction, - validateOpinionAdvancedSearchAction, - { - error: [ - setAlertErrorAction, - setValidationErrorsAction, - clearSearchResultsAction, - startShowValidationAction, - ], - success: showProgressSequenceDecorator([ - clearAlertsAction, - submitPublicOpinionAdvancedSearchAction, - setAdvancedSearchResultsAction, - ]), - }, + error: [ + setAlertErrorAction, + setValidationErrorsAction, + clearSearchResultsAction, + startShowValidationAction, ], + success: showProgressSequenceDecorator([ + clearAlertsAction, + submitPublicOpinionAdvancedSearchAction, + setAdvancedSearchResultsAction, + ]), }, ]; diff --git a/web-client/src/presenter/sequences/Public/submitPublicOrderAdvancedSearchSequence.ts b/web-client/src/presenter/sequences/Public/submitPublicOrderAdvancedSearchSequence.ts index bf669846b1c..63bfa24cab7 100644 --- a/web-client/src/presenter/sequences/Public/submitPublicOrderAdvancedSearchSequence.ts +++ b/web-client/src/presenter/sequences/Public/submitPublicOrderAdvancedSearchSequence.ts @@ -1,14 +1,8 @@ import { clearAlertsAction } from '../../actions/clearAlertsAction'; import { clearSearchResultsAction } from '../../actions/AdvancedSearch/clearSearchResultsAction'; import { clearSearchTermAction } from '../../actions/clearSearchTermAction'; -import { getConstants } from '../../../getConstants'; -import { getFeatureFlagFactoryAction } from '../../actions/getFeatureFlagFactoryAction'; -import { isFeatureFlagEnabledFactoryAction } from '../../actions/isFeatureFlagEnabledFactoryAction'; import { setAdvancedSearchResultsAction } from '../../actions/AdvancedSearch/setAdvancedSearchResultsAction'; import { setAlertErrorAction } from '../../actions/setAlertErrorAction'; -import { setAlertWarningAction } from '../../actions/setAlertWarningAction'; -import { setDefaultAdvancedSearchTabAction } from '../../actions/setDefaultAdvancedSearchTabAction'; -import { setFeatureFlagFactoryAction } from '../../actions/setFeatureFlagFactoryAction'; import { setValidationErrorsAction } from '../../actions/setValidationErrorsAction'; import { showProgressSequenceDecorator } from '../../utilities/showProgressSequenceDecorator'; import { startShowValidationAction } from '../../actions/startShowValidationAction'; @@ -16,33 +10,19 @@ import { submitPublicOrderAdvancedSearchAction } from '../../actions/Public/subm import { validateOrderAdvancedSearchAction } from '../../actions/AdvancedSearch/validateOrderAdvancedSearchAction'; export const submitPublicOrderAdvancedSearchSequence = [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH, - ), + clearSearchTermAction, + validateOrderAdvancedSearchAction, { - no: [setAlertWarningAction, setDefaultAdvancedSearchTabAction], - yes: [ - clearSearchTermAction, - validateOrderAdvancedSearchAction, - { - error: [ - setAlertErrorAction, - setValidationErrorsAction, - clearSearchResultsAction, - startShowValidationAction, - ], - success: showProgressSequenceDecorator([ - clearAlertsAction, - submitPublicOrderAdvancedSearchAction, - setAdvancedSearchResultsAction, - ]), - }, + error: [ + setAlertErrorAction, + setValidationErrorsAction, + clearSearchResultsAction, + startShowValidationAction, ], + success: showProgressSequenceDecorator([ + clearAlertsAction, + submitPublicOrderAdvancedSearchAction, + setAdvancedSearchResultsAction, + ]), }, ]; diff --git a/web-client/src/presenter/sequences/gotoAdvancedSearchSequence.ts b/web-client/src/presenter/sequences/gotoAdvancedSearchSequence.ts index 440dfa77bfe..e138cd1cc01 100644 --- a/web-client/src/presenter/sequences/gotoAdvancedSearchSequence.ts +++ b/web-client/src/presenter/sequences/gotoAdvancedSearchSequence.ts @@ -1,38 +1,14 @@ import { clearScreenMetadataAction } from '../actions/clearScreenMetadataAction'; import { closeMobileMenuAction } from '../actions/closeMobileMenuAction'; import { defaultAdvancedSearchFormAction } from '../actions/AdvancedSearch/defaultAdvancedSearchFormAction'; -import { getConstants } from '../../getConstants'; -import { getFeatureFlagFactoryAction } from '../actions/getFeatureFlagFactoryAction'; import { getOpinionTypesAction } from '../actions/getOpinionTypesAction'; import { getUsersInSectionAction } from '../actions/getUsersInSectionAction'; -import { isFeatureFlagEnabledFactoryAction } from '../actions/isFeatureFlagEnabledFactoryAction'; -import { isInternalUserAction } from '../actions/isInternalUserAction'; import { parallel } from 'cerebral'; -import { setAlertWarningAction } from '../actions/setAlertWarningAction'; import { setAllAndCurrentJudgesAction } from '../actions/setAllAndCurrentJudgesAction'; import { setCurrentPageAction } from '../actions/setCurrentPageAction'; -import { setFeatureFlagFactoryAction } from '../actions/setFeatureFlagFactoryAction'; import { setOpinionTypesAction } from '../actions/setOpinionTypesAction'; import { startWebSocketConnectionSequenceDecorator } from '../utilities/startWebSocketConnectionSequenceDecorator'; -const fetchFeatureFlagAndSetAlert = flagName => { - return [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS[flagName].key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS[flagName].key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS[flagName], - ), - { - no: [setAlertWarningAction], - yes: [], - }, - ]; -}; - export const gotoAdvancedSearchSequence = startWebSocketConnectionSequenceDecorator([ setCurrentPageAction('Interstitial'), @@ -45,23 +21,6 @@ export const gotoAdvancedSearchSequence = setAllAndCurrentJudgesAction, ], [getOpinionTypesAction, setOpinionTypesAction], - [ - isInternalUserAction, - { - no: [ - parallel([ - fetchFeatureFlagAndSetAlert('EXTERNAL_ORDER_SEARCH'), - fetchFeatureFlagAndSetAlert('EXTERNAL_OPINION_SEARCH'), - ]), - ], - yes: [ - parallel([ - fetchFeatureFlagAndSetAlert('INTERNAL_ORDER_SEARCH'), - fetchFeatureFlagAndSetAlert('INTERNAL_OPINION_SEARCH'), - ]), - ], - }, - ], ]), setCurrentPageAction('AdvancedSearch'), ]); diff --git a/web-client/src/presenter/sequences/submitOpinionAdvancedSearchSequence.ts b/web-client/src/presenter/sequences/submitOpinionAdvancedSearchSequence.ts index 73089dae70b..c1252090886 100644 --- a/web-client/src/presenter/sequences/submitOpinionAdvancedSearchSequence.ts +++ b/web-client/src/presenter/sequences/submitOpinionAdvancedSearchSequence.ts @@ -1,77 +1,29 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; import { clearSearchResultsAction } from '../actions/AdvancedSearch/clearSearchResultsAction'; import { clearSearchTermAction } from '../actions/clearSearchTermAction'; -import { getConstants } from '../../getConstants'; -import { getFeatureFlagFactoryAction } from '../actions/getFeatureFlagFactoryAction'; -import { isFeatureFlagEnabledFactoryAction } from '../actions/isFeatureFlagEnabledFactoryAction'; -import { isInternalUserAction } from '../actions/isInternalUserAction'; import { setAdvancedSearchResultsAction } from '../actions/AdvancedSearch/setAdvancedSearchResultsAction'; import { setAlertErrorAction } from '../actions/setAlertErrorAction'; -import { setAlertWarningAction } from '../actions/setAlertWarningAction'; -import { setDefaultAdvancedSearchTabAction } from '../actions/setDefaultAdvancedSearchTabAction'; -import { setFeatureFlagFactoryAction } from '../actions/setFeatureFlagFactoryAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { showProgressSequenceDecorator } from '../utilities/showProgressSequenceDecorator'; import { startShowValidationAction } from '../actions/startShowValidationAction'; import { submitOpinionAdvancedSearchAction } from '../actions/AdvancedSearch/submitOpinionAdvancedSearchAction'; import { validateOpinionAdvancedSearchAction } from '../actions/AdvancedSearch/validateOpinionAdvancedSearchAction'; -const opinionSearchDisabled = [ - setAlertWarningAction, - setDefaultAdvancedSearchTabAction, -]; - -const opinionsSearchEnabled = [ - clearSearchTermAction, - validateOpinionAdvancedSearchAction, - { - error: [ - setAlertErrorAction, - setValidationErrorsAction, - clearSearchResultsAction, - startShowValidationAction, - ], - success: showProgressSequenceDecorator([ - clearAlertsAction, - submitOpinionAdvancedSearchAction, - setAdvancedSearchResultsAction, - ]), - }, -]; - export const submitOpinionAdvancedSearchSequence = showProgressSequenceDecorator([ - isInternalUserAction, + clearSearchTermAction, + validateOpinionAdvancedSearchAction, { - no: [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_OPINION_SEARCH, - ), - { - no: opinionSearchDisabled, - yes: opinionsSearchEnabled, - }, - ], - yes: [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_OPINION_SEARCH, - ), - { - no: opinionSearchDisabled, - yes: opinionsSearchEnabled, - }, + error: [ + setAlertErrorAction, + setValidationErrorsAction, + clearSearchResultsAction, + startShowValidationAction, ], + success: showProgressSequenceDecorator([ + clearAlertsAction, + submitOpinionAdvancedSearchAction, + setAdvancedSearchResultsAction, + ]), }, ]); diff --git a/web-client/src/presenter/sequences/submitOrderAdvancedSearchSequence.ts b/web-client/src/presenter/sequences/submitOrderAdvancedSearchSequence.ts index cc80b9cb9c7..2bfdb4ea0c6 100644 --- a/web-client/src/presenter/sequences/submitOrderAdvancedSearchSequence.ts +++ b/web-client/src/presenter/sequences/submitOrderAdvancedSearchSequence.ts @@ -1,27 +1,15 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; import { clearSearchResultsAction } from '../actions/AdvancedSearch/clearSearchResultsAction'; import { clearSearchTermAction } from '../actions/clearSearchTermAction'; -import { getConstants } from '../../getConstants'; -import { getFeatureFlagFactoryAction } from '../actions/getFeatureFlagFactoryAction'; -import { isFeatureFlagEnabledFactoryAction } from '../actions/isFeatureFlagEnabledFactoryAction'; -import { isInternalUserAction } from '../actions/isInternalUserAction'; import { setAdvancedSearchResultsAction } from '../actions/AdvancedSearch/setAdvancedSearchResultsAction'; import { setAlertErrorAction } from '../actions/setAlertErrorAction'; -import { setAlertWarningAction } from '../actions/setAlertWarningAction'; -import { setDefaultAdvancedSearchTabAction } from '../actions/setDefaultAdvancedSearchTabAction'; -import { setFeatureFlagFactoryAction } from '../actions/setFeatureFlagFactoryAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { showProgressSequenceDecorator } from '../utilities/showProgressSequenceDecorator'; import { startShowValidationAction } from '../actions/startShowValidationAction'; import { submitOrderAdvancedSearchAction } from '../actions/AdvancedSearch/submitOrderAdvancedSearchAction'; import { validateOrderAdvancedSearchAction } from '../actions/AdvancedSearch/validateOrderAdvancedSearchAction'; -const orderSearchDisabled = [ - setAlertWarningAction, - setDefaultAdvancedSearchTabAction, -]; - -const orderSearchEnabled = [ +export const submitOrderAdvancedSearchSequence = showProgressSequenceDecorator([ clearSearchTermAction, validateOrderAdvancedSearchAction, { @@ -37,40 +25,4 @@ const orderSearchEnabled = [ setAdvancedSearchResultsAction, ], }, -]; - -export const submitOrderAdvancedSearchSequence = showProgressSequenceDecorator([ - isInternalUserAction, - { - no: [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH, - ), - { - no: orderSearchDisabled, - yes: orderSearchEnabled, - }, - ], - yes: [ - getFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key, - ), - setFeatureFlagFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH.key, - ), - isFeatureFlagEnabledFactoryAction( - getConstants().ALLOWLIST_FEATURE_FLAGS.INTERNAL_ORDER_SEARCH, - ), - { - no: orderSearchDisabled, - yes: orderSearchEnabled, - }, - ], - }, ]); From 5d4be42aa60e8fa185b503aec7361b18c5981bd9 Mon Sep 17 00:00:00 2001 From: Rosie Highsmith Date: Tue, 27 Jun 2023 08:50:58 -0700 Subject: [PATCH 3/5] 10064: cleanup test, remove setup scripts for FFs, add remove FFs script --- ...-order-and-opinion-search-feature-flags.sh | 17 ++++++++++ ...setup-add-docket-numbers-to-orders-flag.sh | 2 +- .../setup-external-opinion-search-flag.sh | 32 ------------------- .../setup-external-order-search-flag.sh | 14 -------- .../setup-internal-opinion-search-flag.sh | 32 ------------------- .../setup-internal-order-search-flag.sh | 13 -------- scripts/setup-all-env-configuration.sh | 4 --- .../getFeatureFlagValueInteractor.test.ts | 4 +-- 8 files changed, 20 insertions(+), 98 deletions(-) create mode 100755 scripts/dynamo/delete-order-and-opinion-search-feature-flags.sh delete mode 100755 scripts/dynamo/setup-external-opinion-search-flag.sh delete mode 100755 scripts/dynamo/setup-external-order-search-flag.sh delete mode 100755 scripts/dynamo/setup-internal-opinion-search-flag.sh delete mode 100755 scripts/dynamo/setup-internal-order-search-flag.sh diff --git a/scripts/dynamo/delete-order-and-opinion-search-feature-flags.sh b/scripts/dynamo/delete-order-and-opinion-search-feature-flags.sh new file mode 100755 index 00000000000..8530ee70d61 --- /dev/null +++ b/scripts/dynamo/delete-order-and-opinion-search-feature-flags.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Deletes the external and internal advanced search (order and opinion) flags in the dynamo deploy table + +# Usage +# ENV=exp1 ./delete-order-and-opinion-search-feature-flags.sh + +./check-env-variables.sh \ + "ENV" \ + "AWS_SECRET_ACCESS_KEY" \ + "AWS_ACCESS_KEY_ID" + +aws dynamodb delete-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --key '{"pk":{"S":"external-opinion-search-enabled"},"sk":{"S":"external-opinion-search-enabled"}}' +aws dynamodb delete-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --key '{"pk":{"S":"external-order-search-enabled"},"sk":{"S":"external-order-search-enabled"}}' +aws dynamodb delete-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --key '{"pk":{"S":"internal-opinion-search-enabled"},"sk":{"S":"internal-opinion-search-enabled"}}' +aws dynamodb delete-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --key '{"pk":{"S":"internal-order-search-enabled"},"sk":{"S":"internal-order-search-enabled"}}' + diff --git a/scripts/dynamo/setup-add-docket-numbers-to-orders-flag.sh b/scripts/dynamo/setup-add-docket-numbers-to-orders-flag.sh index 42a21028365..77026d21ab4 100755 --- a/scripts/dynamo/setup-add-docket-numbers-to-orders-flag.sh +++ b/scripts/dynamo/setup-add-docket-numbers-to-orders-flag.sh @@ -3,7 +3,7 @@ # Sets the external opinion search enabled flag to "true" in the dynamo deploy table # Usage -# ENV=dev ./setup-external-opinion-search-flag.sh +# ENV=dev ./setup-add-docket-numbers-to-orders-flag.sh ./check-env-variables.sh \ "ENV" \ diff --git a/scripts/dynamo/setup-external-opinion-search-flag.sh b/scripts/dynamo/setup-external-opinion-search-flag.sh deleted file mode 100755 index d23e75cb5b0..00000000000 --- a/scripts/dynamo/setup-external-opinion-search-flag.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Sets the external opinion search enabled flag to "true" in the dynamo deploy table - -# Usage -# ENV=dev ./setup-external-opinion-search-flag.sh - -./check-env-variables.sh \ - "ENV" \ - "AWS_SECRET_ACCESS_KEY" \ - "AWS_ACCESS_KEY_ID" - -ITEM=$(cat <<-END -{ - "pk": { - "S": "external-opinion-search-enabled" - }, - "sk":{ - "S": "external-opinion-search-enabled" - }, - "current": { - "BOOL":false - } -} -END -) - -aws dynamodb put-item \ - --region us-east-1 \ - --table-name "efcms-deploy-${ENV}" \ - --item "${ITEM}" - diff --git a/scripts/dynamo/setup-external-order-search-flag.sh b/scripts/dynamo/setup-external-order-search-flag.sh deleted file mode 100755 index b922109387c..00000000000 --- a/scripts/dynamo/setup-external-order-search-flag.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Sets the external order search enabled flag to "true" in the dynamo deploy table - -# Usage -# ENV=dev ./setup-external-order-search-flag.sh - -./check-env-variables.sh \ - "ENV" \ - "AWS_SECRET_ACCESS_KEY" \ - "AWS_ACCESS_KEY_ID" - -aws dynamodb put-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --item '{"pk":{"S":"external-order-search-enabled"},"sk":{"S":"external-order-search-enabled"},"current":{"BOOL":true}}' - diff --git a/scripts/dynamo/setup-internal-opinion-search-flag.sh b/scripts/dynamo/setup-internal-opinion-search-flag.sh deleted file mode 100755 index 3465871f0fa..00000000000 --- a/scripts/dynamo/setup-internal-opinion-search-flag.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Sets the internal opinion search enabled flag to "true" in the dynamo deploy table - -# Usage -# ENV=dev ./setup-internal-opinion-search-flag.sh - -./check-env-variables.sh \ - "ENV" \ - "AWS_SECRET_ACCESS_KEY" \ - "AWS_ACCESS_KEY_ID" - -ITEM=$(cat <<-END -{ - "pk": { - "S": "internal-opinion-search-enabled" - }, - "sk":{ - "S": "internal-opinion-search-enabled" - }, - "current": { - "BOOL":true - } -} -END -) - -aws dynamodb put-item \ - --region us-east-1 \ - --table-name "efcms-deploy-${ENV}" \ - --item "${ITEM}" - diff --git a/scripts/dynamo/setup-internal-order-search-flag.sh b/scripts/dynamo/setup-internal-order-search-flag.sh deleted file mode 100755 index 33b8d0f435d..00000000000 --- a/scripts/dynamo/setup-internal-order-search-flag.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -# Sets the internal order search enabled flag to "true" in the dynamo deploy table - -# Usage -# ENV=dev ./setup-internal-order-search-flag.sh - -./check-env-variables.sh \ - "ENV" \ - "AWS_SECRET_ACCESS_KEY" \ - "AWS_ACCESS_KEY_ID" - -aws dynamodb put-item --region us-east-1 --table-name "efcms-deploy-${ENV}" --item '{"pk":{"S":"internal-order-search-enabled"},"sk":{"S":"internal-order-search-enabled"},"current":{"BOOL":true}}' diff --git a/scripts/setup-all-env-configuration.sh b/scripts/setup-all-env-configuration.sh index 7fab47c79cf..5195d5ff82a 100755 --- a/scripts/setup-all-env-configuration.sh +++ b/scripts/setup-all-env-configuration.sh @@ -10,10 +10,6 @@ "AWS_SECRET_ACCESS_KEY" \ "AWS_ACCESS_KEY_ID" -./scripts/dynamo/setup-internal-order-search-flag.sh -./scripts/dynamo/setup-external-order-search-flag.sh -./scripts/dynamo/setup-internal-opinion-search-flag.sh -./scripts/dynamo/setup-external-opinion-search-flag.sh ./scripts/dynamo/setup-document-search-limiter-limits.sh ./scripts/dynamo/setup-terminal-ip-allowlist.sh ./scripts/dynamo/setup-maintenance-mode-flag.sh diff --git a/shared/src/business/useCases/featureFlag/getFeatureFlagValueInteractor.test.ts b/shared/src/business/useCases/featureFlag/getFeatureFlagValueInteractor.test.ts index befa95486ee..f784474b4f1 100644 --- a/shared/src/business/useCases/featureFlag/getFeatureFlagValueInteractor.test.ts +++ b/shared/src/business/useCases/featureFlag/getFeatureFlagValueInteractor.test.ts @@ -12,7 +12,7 @@ describe('getFeatureFlagValueInteractor', () => { .getFeatureFlagValue.mockResolvedValue(mockFeatureFlagValue); const result = await getFeatureFlagValueInteractor(applicationContext, { - featureFlag: ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, + featureFlag: ALLOWLIST_FEATURE_FLAGS.USE_EXTERNAL_PDF_GENERATION.key, }); expect( @@ -28,7 +28,7 @@ describe('getFeatureFlagValueInteractor', () => { .getFeatureFlagValue.mockResolvedValue(mockFeatureFlagValue); const result = await getFeatureFlagValueInteractor(applicationContext, { - featureFlag: ALLOWLIST_FEATURE_FLAGS.EXTERNAL_ORDER_SEARCH.key, + featureFlag: ALLOWLIST_FEATURE_FLAGS.USE_EXTERNAL_PDF_GENERATION.key, }); expect( From c942bdf3a3507be9d09bfb36ab0a80cc59e818a2 Mon Sep 17 00:00:00 2001 From: Rosie Highsmith Date: Tue, 27 Jun 2023 08:58:42 -0700 Subject: [PATCH 4/5] 10064: remove FFs from efcms-local --- .../storage/fixtures/seed/efcms-local.json | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/web-api/storage/fixtures/seed/efcms-local.json b/web-api/storage/fixtures/seed/efcms-local.json index 3c95ba72abe..47630832f55 100644 --- a/web-api/storage/fixtures/seed/efcms-local.json +++ b/web-api/storage/fixtures/seed/efcms-local.json @@ -24601,16 +24601,6 @@ "template": "{\"emailContent\":\"

United States Tax Court

Washington, DC 20217
September 30, 2020


Dear IRS,

A document has been served on your Tax Court case:

Docket Number: 124-20
Case Title: Stacy Russold, Natalya Chaouche, Tax Matters Partner

Document Type: This is a legacy judge's order
Docket Entry No.: 3
Filed by: N/A
Served: 09/30/20 4:25 pm ET

To view this document, please log in to the U.S. Tax Court.

Certain documents may require your action.

---- COMPUTER-READABLE DATA ----
docketNumber: 124-20
docketEntryNo: 3
docketEntryId: c611ee2e-a270-4dcd-a7bd-b8b9062db630
eventCode: O

Please do not reply to this message. This e-mail is an automated notification from an account which is unable to receive replies.

\"}", "pk": "email-undefined" }, - { - "sk": "external-opinion-search-enabled", - "current": true, - "pk": "external-opinion-search-enabled" - }, - { - "sk": "external-order-search-enabled", - "current": true, - "pk": "external-order-search-enabled" - }, { "sk": "user|c0daa0a7-a66b-4eae-949b-9ae0f8a32e46", "pk": "inactivePractitioner|IP1111" @@ -24623,16 +24613,6 @@ "sk": "user|c0daa0a7-a66b-4eae-949b-9ae0f8a32e46", "pk": "inactivePractitioner|TEST INACTIVE PRACTITIONER" }, - { - "sk": "internal-opinion-search-enabled", - "current": true, - "pk": "internal-opinion-search-enabled" - }, - { - "sk": "internal-order-search-enabled", - "current": true, - "pk": "internal-order-search-enabled" - }, { "sk": "ip-limiter-document-search-ip-limiter|localhost", "id": 1, From ab44ff21e8d2c7e26453841862c8f5cca4598ca4 Mon Sep 17 00:00:00 2001 From: Rosie Highsmith Date: Tue, 27 Jun 2023 09:30:56 -0700 Subject: [PATCH 5/5] 10064: add waitUntilSettled to help with intermittency of check-seamless-deploy.cy test --- .../cypress-integration/support/pages/public/advanced-search.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/cypress-integration/support/pages/public/advanced-search.ts b/cypress/cypress-integration/support/pages/public/advanced-search.ts index d1447bbf5a3..a96dbcc8035 100644 --- a/cypress/cypress-integration/support/pages/public/advanced-search.ts +++ b/cypress/cypress-integration/support/pages/public/advanced-search.ts @@ -14,6 +14,7 @@ export const searchForCaseByDocketNumber = docketNumber => { }; export const enterPetitionerName = name => { + cy.waitUntilSettled(); cy.get('input#petitioner-name').type(name); }; @@ -38,6 +39,7 @@ export const getKeywordInput = () => { }; export const enterDocumentDocketNumber = docketNumber => { + cy.waitUntilSettled(); cy.get('input#docket-number').type(docketNumber); };