Skip to content

Commit

Permalink
Remove loading state for import feature flags from old store
Browse files Browse the repository at this point in the history
  • Loading branch information
RidhamShah committed Nov 28, 2024
1 parent 3734005 commit 1fc99a0
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand All @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
selectSortKey,
selectSortAs,
selectAppContexts,
selectIsLoadingImportFeatureFlag,
selectFeatureFlagIds,
selectShouldShowWarningForSelectedFlag,
selectWarningStatusForAllFlags,
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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 }));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export const FLAG_ROOT_DISPLAYED_COLUMNS = Object.values(FLAG_ROOT_COLUMN_NAMES)

export interface FeatureFlagState extends EntityState<FeatureFlag> {
isLoadingUpsertFeatureFlag: boolean;
isLoadingImportFeatureFlag: boolean;
isLoadingSelectedFeatureFlag: boolean;
isLoadingFeatureFlags: boolean;
isLoadingUpdateFeatureFlagStatus: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 })),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class LocalStorageService {
ids: [],
entities: {},
isLoadingUpsertFeatureFlag: false,
isLoadingImportFeatureFlag: false,
isLoadingSelectedFeatureFlag: false,
isLoadingFeatureFlags: false,
isLoadingUpdateFeatureFlagStatus: false,
Expand Down

0 comments on commit 1fc99a0

Please sign in to comment.