Skip to content

Migrate feature removal to RTK #7091

@kyle-ssg

Description

@kyle-ssg

Replace removeFlag with RTK Query mutation

Description

Replace the legacy removeFlag flow (AppActions → Dispatcher → feature-list-store controller) with the existing RTK Query
removeProjectFlag mutation from common/services/useProjectFlag.ts.

Current state

Feature flag deletion uses two parallel paths:

  • RTK (new): FeaturesPage.tsx already uses useRemoveFeatureWithToast, which wraps useRemoveProjectFlagMutation. The
    removeProjectFlag mutation endpoint already exists in useProjectFlag.ts.
  • Flux (old): CompareFeatures.js, CompareEnvironments.js, and WidgetPage.tsx still go through FeatureListProvider.removeFlag
    AppActions.removeFlag → Dispatcher → feature-list-store.removeFlag controller, which manually calls the API, filters the store model,
    and triggers a 'removed' event.

Objectives

  • Add removeProjectFlag store dispatch helper to common/services/useProjectFlag.ts (follows existing
    createProjectFlag/updateProjectFlag pattern) for use in class components
  • Remove removeFlag controller method and REMOVE_FLAG case from common/stores/feature-list-store.ts
  • Remove removeFlag action from common/dispatcher/app-actions.js
  • Remove REMOVE_FLAG constant from common/dispatcher/action-constants.js
  • Remove removeFlag method, render prop exposure, and 'removed' event listener from common/providers/FeatureListProvider.js
  • Remove removeFlag from FeatureListProviderActions type in common/types/responses.ts
  • Update web/components/CompareFeatures.js to use removeProjectFlag helper
  • Update web/components/CompareEnvironments.js to use removeProjectFlag helper
  • Update web/components/pages/WidgetPage.tsx to remove unused removeFlag destructuring and prop passing

Metadata

Metadata

Assignees

Labels

front-endIssue related to the React Front End Dashboardtech-debtTechnical debt issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions