feat: view config feature flag (#13171)

* feat: add view_configurations feature flag

  - Add feature flag provider and hooks to admin dashboard
  - Add backend API endpoint for feature flags
  - Create view_configurations feature flag (disabled by default)
  - Update order list table to use legacy version when flag is disabled
  - Can be enabled with MEDUSA_FF_VIEW_CONFIGURATIONS=true env var

* fix: naming

* fix: feature flags unauthenticated

* fix: add test
This commit is contained in:
Sebastian Rindom
2025-08-15 08:56:40 +02:00
committed by GitHub
parent 4b3c43fe92
commit ab795bb0a2
8 changed files with 178 additions and 3 deletions
@@ -0,0 +1,26 @@
import {
MedusaRequest,
MedusaResponse,
} from "@medusajs/framework/http"
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
export const AUTHENTICATE = false
export const GET = async (
req: MedusaRequest,
res: MedusaResponse<{ feature_flags: Record<string, boolean> }>
) => {
const featureFlagRouter = req.scope.resolve(
ContainerRegistrationKeys.FEATURE_FLAG_ROUTER
) as any
const flags = featureFlagRouter.listFlags()
// Convert array of flags to a simple key-value object
const featureFlags: Record<string, boolean> = {}
flags.forEach(flag => {
featureFlags[flag.key] = flag.value
})
res.json({ feature_flags: featureFlags })
}