Support template variables in command menu item labels (#18707)
- Adds template variable interpolation (`${...}`) to command menu item
labels and short labels, enabling dynamic text like `Create new
${capitalize(objectMetadataItem.labelSingular)}` instead of static
`Create new record`.
- Supports `capitalize` and `lowercase` transform functions within
template expressions.
This commit is contained in:
+2
-4
@@ -1,5 +1,5 @@
|
||||
import { Command } from '@/command-menu-item/display/components/Command';
|
||||
import { CommandConfigContext } from '@/command-menu-item/contexts/CommandConfigContext';
|
||||
import { Command } from '@/command-menu-item/display/components/Command';
|
||||
import { computeProgressText } from '@/command-menu-item/utils/computeProgressText';
|
||||
import { getCommandMenuItemLabel } from '@/command-menu-item/utils/getCommandMenuItemLabel';
|
||||
import { contextStoreAnyFieldFilterValueComponentState } from '@/context-store/states/contextStoreAnyFieldFilterValueComponentState';
|
||||
@@ -78,9 +78,7 @@ export const DeleteMultipleRecordsCommand = () => {
|
||||
|
||||
const originalLabel = getCommandMenuItemLabel(actionConfig.label);
|
||||
|
||||
const originalShortLabel = getCommandMenuItemLabel(
|
||||
actionConfig.shortLabel ?? '',
|
||||
);
|
||||
const originalShortLabel = getCommandMenuItemLabel(actionConfig.shortLabel);
|
||||
|
||||
const progressText = computeProgressText(progress);
|
||||
|
||||
|
||||
+1
-3
@@ -85,9 +85,7 @@ export const DestroyMultipleRecordsCommand = () => {
|
||||
|
||||
const originalLabel = getCommandMenuItemLabel(actionConfig.label);
|
||||
|
||||
const originalShortLabel = getCommandMenuItemLabel(
|
||||
actionConfig.shortLabel ?? '',
|
||||
);
|
||||
const originalShortLabel = getCommandMenuItemLabel(actionConfig.shortLabel);
|
||||
|
||||
const progressText = computeProgressText(progress);
|
||||
|
||||
|
||||
+1
-3
@@ -49,9 +49,7 @@ export const ExportMultipleRecordsCommand = () => {
|
||||
|
||||
const originalLabel = getCommandMenuItemLabel(actionConfig.label);
|
||||
|
||||
const originalShortLabel = getCommandMenuItemLabel(
|
||||
actionConfig.shortLabel ?? '',
|
||||
);
|
||||
const originalShortLabel = getCommandMenuItemLabel(actionConfig.shortLabel);
|
||||
|
||||
const progressText = computeProgressText(exportProgress);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user