From 1fc99a02aa749d9e5f3979134b72e5d1dc183954 Mon Sep 17 00:00:00 2001 From: RidhamShah Date: Thu, 28 Nov 2024 20:21:59 +0530 Subject: [PATCH] Remove loading state for import feature flags from old store --- .../src/app/core/feature-flags/feature-flags.module.ts | 3 ++- .../src/app/core/feature-flags/feature-flags.service.ts | 6 ------ .../app/core/feature-flags/store/feature-flags.actions.ts | 5 ----- .../src/app/core/feature-flags/store/feature-flags.model.ts | 1 - .../app/core/feature-flags/store/feature-flags.reducer.ts | 5 ----- .../app/core/feature-flags/store/feature-flags.selectors.ts | 5 ----- .../src/app/core/local-storage/local-storage.service.ts | 1 - 7 files changed, 2 insertions(+), 24 deletions(-) diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.module.ts b/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.module.ts index 4f3f243f47..da705ef885 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.module.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.module.ts @@ -6,6 +6,7 @@ import { EffectsModule } from '@ngrx/effects'; import { StoreModule } from '@ngrx/store'; import { featureFlagsReducer } from './store/feature-flags.reducer'; import { FeatureFlagsEffects } from './store/feature-flags.effects'; +import { FeatureFlagsStore } from '../../features/dashboard/feature-flags/modals/import-feature-flag-modal/feature-flag.signal.store'; @NgModule({ declarations: [], @@ -14,6 +15,6 @@ import { FeatureFlagsEffects } from './store/feature-flags.effects'; EffectsModule.forFeature([FeatureFlagsEffects]), StoreModule.forFeature('featureFlags', featureFlagsReducer), ], - providers: [FeatureFlagsService, FeatureFlagsDataService], + providers: [FeatureFlagsService, FeatureFlagsDataService, FeatureFlagsStore], }) export class FeatureFlagsModule {} diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts b/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts index 2d85183a4b..1182948775 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts @@ -22,7 +22,6 @@ import { selectSortKey, selectSortAs, selectAppContexts, - selectIsLoadingImportFeatureFlag, selectFeatureFlagIds, selectShouldShowWarningForSelectedFlag, selectWarningStatusForAllFlags, @@ -56,7 +55,6 @@ export class FeatureFlagsService { isLoadingUpsertFeatureFlag$ = this.store$.pipe(select(selectIsLoadingUpsertFeatureFlag)); isDuplicateKeyFound$ = this.store$.pipe(select(selectDuplicateKeyFound)); isLoadingFeatureFlagDelete$ = this.store$.pipe(select(selectIsLoadingFeatureFlagDelete)); - isLoadingImportFeatureFlag$ = this.store$.pipe(select(selectIsLoadingImportFeatureFlag)); isLoadingUpdateFeatureFlagStatus$ = this.store$.pipe(select(selectIsLoadingUpdateFeatureFlagStatus)); isLoadingUpsertPrivateSegmentList$ = this.store$.pipe(select(selectIsLoadingUpsertFeatureFlag)); allFeatureFlags$ = this.store$.pipe(select(selectAllFeatureFlagsSortedByDate)); @@ -152,10 +150,6 @@ export class FeatureFlagsService { this.store$.dispatch(FeatureFlagsActions.actionDeleteFeatureFlag({ flagId })); } - setIsLoadingImportFeatureFlag(isLoadingImportFeatureFlag: boolean) { - this.store$.dispatch(FeatureFlagsActions.actionSetIsLoadingImportFeatureFlag({ isLoadingImportFeatureFlag })); - } - emailFeatureFlagData(featureFlagId: string) { this.store$.dispatch(FeatureFlagsActions.actionEmailFeatureFlagData({ featureFlagId })); } diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.actions.ts b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.actions.ts index 8eb5cc2bf2..25bb63fe10 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.actions.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.actions.ts @@ -71,11 +71,6 @@ export const actionUpdateFeatureFlagSuccess = createAction( export const actionUpdateFeatureFlagFailure = createAction('[Feature Flags] Update Feature Flag Failure'); -export const actionSetIsLoadingImportFeatureFlag = createAction( - '[Feature Flags] Set Is Loading for Flag Import', - props<{ isLoadingImportFeatureFlag: boolean }>() -); - export const actionEmailFeatureFlagData = createAction( '[Feature Flags] Email Feature Flag Data', props<{ featureFlagId: string }>() diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts index c04f82e479..a367cc31ae 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts @@ -181,7 +181,6 @@ export const FLAG_ROOT_DISPLAYED_COLUMNS = Object.values(FLAG_ROOT_COLUMN_NAMES) export interface FeatureFlagState extends EntityState { isLoadingUpsertFeatureFlag: boolean; - isLoadingImportFeatureFlag: boolean; isLoadingSelectedFeatureFlag: boolean; isLoadingFeatureFlags: boolean; isLoadingUpdateFeatureFlagStatus: boolean; diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.reducer.ts b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.reducer.ts index 4244219965..5c5f1983fa 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.reducer.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.reducer.ts @@ -12,7 +12,6 @@ export const { selectIds, selectEntities, selectAll, selectTotal } = adapter.get export const initialState: FeatureFlagState = adapter.getInitialState({ isLoadingUpsertFeatureFlag: false, - isLoadingImportFeatureFlag: false, isLoadingFeatureFlags: false, isLoadingUpdateFeatureFlagStatus: false, isLoadingFeatureFlagDetail: false, @@ -121,10 +120,6 @@ const reducer = createReducer( ...state, isLoadingFeatureFlags, })), - on(FeatureFlagsActions.actionSetIsLoadingImportFeatureFlag, (state, { isLoadingImportFeatureFlag }) => ({ - ...state, - isLoadingImportFeatureFlag, - })), on(FeatureFlagsActions.actionSetSkipFlags, (state, { skipFlags }) => ({ ...state, skipFlags })), on(FeatureFlagsActions.actionSetSearchKey, (state, { searchKey }) => ({ ...state, searchKey })), on(FeatureFlagsActions.actionSetSearchString, (state, { searchString }) => ({ ...state, searchValue: searchString })), diff --git a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts index 770cb9e0ed..bf4e431335 100644 --- a/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts +++ b/frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts @@ -118,11 +118,6 @@ export const selectFeatureFlagsListLength = createSelector( (featureFlags) => featureFlags.length ); -export const selectIsLoadingImportFeatureFlag = createSelector( - selectFeatureFlagsState, - (state) => state.isLoadingImportFeatureFlag -); - export const selectIsLoadingUpdateFeatureFlagStatus = createSelector( selectFeatureFlagsState, (state) => state.isLoadingUpdateFeatureFlagStatus diff --git a/frontend/projects/upgrade/src/app/core/local-storage/local-storage.service.ts b/frontend/projects/upgrade/src/app/core/local-storage/local-storage.service.ts index f5a26eea7b..dd7074c533 100755 --- a/frontend/projects/upgrade/src/app/core/local-storage/local-storage.service.ts +++ b/frontend/projects/upgrade/src/app/core/local-storage/local-storage.service.ts @@ -61,7 +61,6 @@ export class LocalStorageService { ids: [], entities: {}, isLoadingUpsertFeatureFlag: false, - isLoadingImportFeatureFlag: false, isLoadingSelectedFeatureFlag: false, isLoadingFeatureFlags: false, isLoadingUpdateFeatureFlagStatus: false,