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,19 @@
import { Container, Heading } from "@medusajs/ui"
import { useTranslation } from "react-i18next"
export const ConfigurableOrderListTable = () => {
const { t } = useTranslation()
return (
<Container className="divide-y p-0">
<div className="flex items-center justify-between px-6 py-4">
<Heading>{t("orders.domain")}</Heading>
</div>
<div className="px-6 py-4">
<p className="text-ui-fg-muted">
View configurations feature is enabled. Full implementation coming soon.
</p>
</div>
</Container>
)
}
@@ -8,6 +8,8 @@ import { useOrderTableColumns } from "../../../../../hooks/table/columns/use-ord
import { useOrderTableFilters } from "../../../../../hooks/table/filters/use-order-table-filters"
import { useOrderTableQuery } from "../../../../../hooks/table/query/use-order-table-query"
import { useDataTable } from "../../../../../hooks/use-data-table"
import { useFeatureFlag } from "../../../../../providers/feature-flag-provider"
import { ConfigurableOrderListTable } from "./configurable-order-list-table"
import { DEFAULT_FIELDS } from "../../const"
@@ -15,6 +17,13 @@ const PAGE_SIZE = 20
export const OrderListTable = () => {
const { t } = useTranslation()
const isViewConfigEnabled = useFeatureFlag("view_configurations")
// If feature flag is enabled, use the new configurable table
if (isViewConfigEnabled) {
return <ConfigurableOrderListTable />
}
const { searchParams, raw } = useOrderTableQuery({
pageSize: PAGE_SIZE,
})