feat(admin-ui, medusa): Remove feature flag (#4267)
This commit is contained in:
6
.changeset/weak-dots-live.md
Normal file
6
.changeset/weak-dots-live.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
feat(medusa, admin-ui): remove reservations feature flag
|
||||
@@ -1,9 +1,5 @@
|
||||
import TableViewHeader from "../../components/organisms/custom-table-header"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
import {
|
||||
FeatureFlag,
|
||||
useFeatureFlag,
|
||||
} from "../../providers/feature-flag-provider"
|
||||
|
||||
type P = {
|
||||
activeView: "inventory" | "locations" | "reservations"
|
||||
@@ -15,16 +11,8 @@ type P = {
|
||||
|
||||
function InventoryPageTableHeader(props: P) {
|
||||
const navigate = useNavigate()
|
||||
const { isFeatureEnabled } = useFeatureFlag()
|
||||
const isReservationsEnabled =
|
||||
isFeatureEnabled(FeatureFlag.RESERVATIONS) &&
|
||||
isFeatureEnabled(FeatureFlag.INVENTORY)
|
||||
|
||||
const views = ["inventory", "locations"]
|
||||
|
||||
if (isReservationsEnabled) {
|
||||
views.push("reservations")
|
||||
}
|
||||
const views = ["inventory", "locations", "reservations"]
|
||||
|
||||
return (
|
||||
<TableViewHeader
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
import { Route, Routes } from "react-router-dom"
|
||||
|
||||
import InventoryView from "./inventory"
|
||||
import Locations from "./locations"
|
||||
import Reservations from "./reservations"
|
||||
import {
|
||||
FeatureFlag,
|
||||
useFeatureFlag,
|
||||
} from "../../providers/feature-flag-provider"
|
||||
|
||||
const Inventory = () => {
|
||||
const { isFeatureEnabled } = useFeatureFlag()
|
||||
const isReservationsEnabled =
|
||||
isFeatureEnabled(FeatureFlag.RESERVATIONS) &&
|
||||
isFeatureEnabled(FeatureFlag.INVENTORY)
|
||||
|
||||
return (
|
||||
<Routes>
|
||||
<Route index element={<InventoryView />} />
|
||||
<Route path="/locations/*" element={<Locations />} />
|
||||
{isReservationsEnabled && (
|
||||
<Route path="/reservations/*" element={<Reservations />} />
|
||||
)}
|
||||
<Route path="/reservations/*" element={<Reservations />} />
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import { useAdminGetSession, useAdminStore } from "medusa-react"
|
||||
|
||||
export enum FeatureFlag {
|
||||
PRODUCT_CATEGORIES = "product_categories",
|
||||
RESERVATIONS = "reservations",
|
||||
INVENTORY = "inventoryService",
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { FlagSettings } from "../../types/feature-flags"
|
||||
|
||||
const ReservationsFeatureFlag: FlagSettings = {
|
||||
key: "reservations",
|
||||
default_val: false,
|
||||
env_key: "MEDUSA_FF_RESERVATIONS",
|
||||
description: "[WIP] Enable the reservations feature from the Inventory Module",
|
||||
}
|
||||
|
||||
export default ReservationsFeatureFlag
|
||||
Reference in New Issue
Block a user