mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Update ProductFlagMapping types and related references
This commit is contained in:
+2
-2
@@ -6,7 +6,7 @@ import { SidebarMenuItem } from '@/components/molecules/SidebarMenu';
|
|||||||
import { OptionType } from '@/components/input/SelectInput';
|
import { OptionType } from '@/components/input/SelectInput';
|
||||||
import {
|
import {
|
||||||
ConstantsApiResponse,
|
ConstantsApiResponse,
|
||||||
ProductFlagMappingUI,
|
ProductFlagMapping,
|
||||||
TransformedConstants,
|
TransformedConstants,
|
||||||
} from '@/types/api/constants/constants';
|
} from '@/types/api/constants/constants';
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ export function formatConstantLabel(value: string): string {
|
|||||||
*/
|
*/
|
||||||
export function transformProductFlagMapping(
|
export function transformProductFlagMapping(
|
||||||
mapping: ConstantsApiResponse['product_flag_mapping']
|
mapping: ConstantsApiResponse['product_flag_mapping']
|
||||||
): ProductFlagMappingUI {
|
): ProductFlagMapping {
|
||||||
return {
|
return {
|
||||||
flags: mapping.flags.map(toOption),
|
flags: mapping.flags.map(toOption),
|
||||||
options: mapping.options.map((opt) => ({
|
options: mapping.options.map((opt) => ({
|
||||||
|
|||||||
+6
-6
@@ -47,19 +47,19 @@ export type ConstantsApiResponse = {
|
|||||||
stock_log: StockLogConfig;
|
stock_log: StockLogConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ProductFlagMappingOptionUI = {
|
export type ProductFlagMappingItem = {
|
||||||
flag: OptionType;
|
flag: OptionType;
|
||||||
sub_flags: OptionType[];
|
sub_flags: OptionType[];
|
||||||
allow_without_sub_flag: boolean;
|
allow_without_sub_flag: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ProductFlagMappingUI = {
|
export type ProductFlagMapping = {
|
||||||
flags: OptionType[];
|
flags: OptionType[];
|
||||||
options: ProductFlagMappingOptionUI[];
|
options: ProductFlagMappingItem[];
|
||||||
sub_flag_to_flag: Record<string, string>;
|
sub_flag_to_flag: Record<string, string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ApprovalWorkflowUI = {
|
export type TransformedApprovalWorkflow = {
|
||||||
key: string;
|
key: string;
|
||||||
steps: OptionType[];
|
steps: OptionType[];
|
||||||
};
|
};
|
||||||
@@ -75,9 +75,9 @@ export type TransformedConstants = {
|
|||||||
PEMBELIAN: OptionType[];
|
PEMBELIAN: OptionType[];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
approval_workflows: ApprovalWorkflowUI[];
|
approval_workflows: TransformedApprovalWorkflow[];
|
||||||
flags: OptionType[];
|
flags: OptionType[];
|
||||||
product_flag_mapping: ProductFlagMappingUI;
|
product_flag_mapping: ProductFlagMapping;
|
||||||
legacy_flag_aliases: OptionType[];
|
legacy_flag_aliases: OptionType[];
|
||||||
stock_log: {
|
stock_log: {
|
||||||
log_types: OptionType[];
|
log_types: OptionType[];
|
||||||
|
|||||||
Reference in New Issue
Block a user