( propertyId: string, plugin: TaskNotesPlugin, propertyLabels?: Record<string, string> )
| 13 | } |
| 14 | |
| 15 | export function getTaskCardPropertyLabel( |
| 16 | propertyId: string, |
| 17 | plugin: TaskNotesPlugin, |
| 18 | propertyLabels?: Record<string, string> |
| 19 | ): string { |
| 20 | const directOverride = propertyLabels?.[propertyId]; |
| 21 | if (directOverride && directOverride.trim() !== "") { |
| 22 | return directOverride; |
| 23 | } |
| 24 | |
| 25 | const mappedOverride = getMappedPropertyLabel(propertyId, plugin, propertyLabels); |
| 26 | const fallbackLabels: Record<string, string> = { |
| 27 | due: tTaskCard(plugin, "labels.due"), |
| 28 | scheduled: tTaskCard(plugin, "labels.scheduled"), |
| 29 | recurrence: tTaskCard(plugin, "labels.recurrence"), |
| 30 | completedDate: tTaskCard(plugin, "labels.completed"), |
| 31 | dateCreated: tTaskCard(plugin, "labels.created"), |
| 32 | dateModified: tTaskCard(plugin, "labels.modified"), |
| 33 | blocked: tTaskCard(plugin, "labels.blocked"), |
| 34 | blocking: tTaskCard(plugin, "labels.blocking"), |
| 35 | }; |
| 36 | |
| 37 | return resolveTaskCardPropertyLabel( |
| 38 | propertyId, |
| 39 | { propertyLabels: mappedOverride ? { [propertyId]: mappedOverride } : propertyLabels }, |
| 40 | fallbackLabels[propertyId] |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | function getMappedPropertyLabel( |
| 45 | propertyId: string, |
no test coverage detected