chore(): Apply translation feature flag broaderly (#14319)
* chore(): Apply translation feature flag broaderly * chore(): Apply translation feature flag broaderly * Create rich-oranges-report.md
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
chore(): Apply translation feature flag broaderly
|
||||
@@ -1,9 +1,12 @@
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
defineFileConfig,
|
||||
FeatureFlag,
|
||||
MedusaError,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
import TranslationFeatureFlag from "../../../../feature-flags/translation"
|
||||
|
||||
/**
|
||||
* @since 2.12.3
|
||||
@@ -39,3 +42,7 @@ export const GET = async (
|
||||
|
||||
res.status(200).json({ locale })
|
||||
}
|
||||
|
||||
defineFileConfig({
|
||||
isDisabled: () => !FeatureFlag.isFeatureEnabled(TranslationFeatureFlag.key),
|
||||
})
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
defineFileConfig,
|
||||
FeatureFlag,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
import TranslationFeatureFlag from "../../../feature-flags/translation"
|
||||
|
||||
/**
|
||||
* @since 2.12.3
|
||||
@@ -31,3 +36,7 @@ export const GET = async (
|
||||
limit: metadata?.take ?? 0,
|
||||
})
|
||||
}
|
||||
|
||||
defineFileConfig({
|
||||
isDisabled: () => !FeatureFlag.isFeatureEnabled(TranslationFeatureFlag.key),
|
||||
})
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { FeatureFlag } from "@medusajs/framework/utils"
|
||||
import TranslationFeatureFlag from "../../../feature-flags/translation"
|
||||
|
||||
export const defaultAdminStoreFields = [
|
||||
"id",
|
||||
"name",
|
||||
"*supported_currencies",
|
||||
"*supported_currencies.currency",
|
||||
"*supported_locales",
|
||||
"*supported_locales.locale_code",
|
||||
...(FeatureFlag.isFeatureEnabled(TranslationFeatureFlag.key)
|
||||
? ["*supported_locales", "*supported_locales.locale"]
|
||||
: []),
|
||||
"default_sales_channel_id",
|
||||
"default_region_id",
|
||||
"default_location_id",
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
|
||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
defineFileConfig,
|
||||
FeatureFlag,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
import TranslationFeatureFlag from "../../../feature-flags/translation"
|
||||
|
||||
/**
|
||||
* @since 2.12.3
|
||||
* @featureFlag translation
|
||||
*/
|
||||
export const GET = async (
|
||||
req: MedusaRequest,
|
||||
req: MedusaRequest,
|
||||
res: MedusaResponse<HttpTypes.StoreLocaleListResponse>
|
||||
) => {
|
||||
const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)
|
||||
@@ -34,3 +39,7 @@ export const GET = async (
|
||||
locales,
|
||||
})
|
||||
}
|
||||
|
||||
defineFileConfig({
|
||||
isDisabled: () => !FeatureFlag.isFeatureEnabled(TranslationFeatureFlag.key),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user