feat: add settings module (#13175)
* 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 * feat: add settings module * fix: deps * fix: cleanup * fix: add more tetsts * fix: rm changelog * fix: deps * fix: add settings module to default modules list * fix: pr comments * fix: deps,build * fix: alias * fix: tests * fix: update snapshots
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
export { ViewConfiguration } from "./view-configuration"
|
||||
export { UserPreference } from "./user-preference"
|
||||
@@ -0,0 +1,18 @@
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
|
||||
export const UserPreference = model
|
||||
.define("user_preference", {
|
||||
id: model.id({ prefix: "usrpref" }).primaryKey(),
|
||||
user_id: model.text(),
|
||||
key: model.text().searchable(),
|
||||
value: model.json(),
|
||||
})
|
||||
.indexes([
|
||||
{
|
||||
on: ["user_id", "key"],
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
on: ["user_id"],
|
||||
},
|
||||
])
|
||||
@@ -0,0 +1,22 @@
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
|
||||
export const ViewConfiguration = model
|
||||
.define("view_configuration", {
|
||||
id: model.id({ prefix: "vconf" }).primaryKey(),
|
||||
entity: model.text().searchable(),
|
||||
name: model.text().searchable().nullable(),
|
||||
user_id: model.text().nullable(),
|
||||
is_system_default: model.boolean().default(false),
|
||||
configuration: model.json(),
|
||||
})
|
||||
.indexes([
|
||||
{
|
||||
on: ["entity", "user_id"],
|
||||
},
|
||||
{
|
||||
on: ["entity", "is_system_default"],
|
||||
},
|
||||
{
|
||||
on: ["user_id"],
|
||||
},
|
||||
])
|
||||
Reference in New Issue
Block a user