UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: русификация значений rich-filters во внутреннем контуре
This commit is contained in:
@@ -18,7 +18,11 @@ import { createFilterConfig, getMultiSelectConfig, createOperatorConfigEntry } f
|
||||
/**
|
||||
* Priority filter specific params
|
||||
*/
|
||||
export type TCreatePriorityFilterParams = TCreateFilterConfigParams & IFilterIconConfig<TIssuePriorities>;
|
||||
export type TCreatePriorityFilterParams = TCreateFilterConfigParams &
|
||||
IFilterIconConfig<TIssuePriorities> & {
|
||||
filterLabel?: string;
|
||||
getItemLabel?: (priorityKey: TIssuePriorities) => string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper to get the priority multi select config
|
||||
@@ -33,7 +37,7 @@ export const getPriorityMultiSelectConfig = (
|
||||
{
|
||||
items: ISSUE_PRIORITIES,
|
||||
getId: (priority) => priority.key,
|
||||
getLabel: (priority) => priority.title,
|
||||
getLabel: (priority) => params.getItemLabel?.(priority.key) ?? priority.title,
|
||||
getValue: (priority) => priority.key,
|
||||
getIconData: (priority) => priority.key,
|
||||
},
|
||||
@@ -57,7 +61,7 @@ export const getPriorityFilterConfig =
|
||||
(params: TCreatePriorityFilterParams) =>
|
||||
createFilterConfig<P>({
|
||||
id: key,
|
||||
label: "Priority",
|
||||
label: params.filterLabel ?? "Priority",
|
||||
...params,
|
||||
icon: params.filterIcon,
|
||||
supportedOperatorConfigsMap: new Map([
|
||||
|
||||
@@ -17,7 +17,11 @@ import { createFilterConfig, getMultiSelectConfig, createOperatorConfigEntry } f
|
||||
/**
|
||||
* State group filter specific params
|
||||
*/
|
||||
export type TCreateStateGroupFilterParams = TCreateFilterConfigParams & IFilterIconConfig<TStateGroups>;
|
||||
export type TCreateStateGroupFilterParams = TCreateFilterConfigParams &
|
||||
IFilterIconConfig<TStateGroups> & {
|
||||
filterLabel?: string;
|
||||
getItemLabel?: (stateGroupKey: TStateGroups) => string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper to get the state group multi select config
|
||||
@@ -32,7 +36,7 @@ export const getStateGroupMultiSelectConfig = (
|
||||
{
|
||||
items: Object.values(STATE_GROUPS),
|
||||
getId: (state) => state.key,
|
||||
getLabel: (state) => state.label,
|
||||
getLabel: (state) => params.getItemLabel?.(state.key) ?? state.label,
|
||||
getValue: (state) => state.key,
|
||||
getIconData: (state) => state.key,
|
||||
},
|
||||
@@ -56,7 +60,7 @@ export const getStateGroupFilterConfig =
|
||||
(params: TCreateStateGroupFilterParams) =>
|
||||
createFilterConfig<P>({
|
||||
id: key,
|
||||
label: "State Group",
|
||||
label: params.filterLabel ?? "State Group",
|
||||
...params,
|
||||
icon: params.filterIcon,
|
||||
supportedOperatorConfigsMap: new Map([
|
||||
|
||||
Reference in New Issue
Block a user