( value: unknown, task: TaskInfo, plugin: TaskNotesPlugin )
| 100 | } |
| 101 | |
| 102 | function getDependencyDisplayLink( |
| 103 | value: unknown, |
| 104 | task: TaskInfo, |
| 105 | plugin: TaskNotesPlugin |
| 106 | ): DependencyDisplayLink | null { |
| 107 | const normalized = normalizeDependencyEntry(value); |
| 108 | if (normalized) { |
| 109 | const resolved = resolveDependencyEntry(plugin.app, task.path, normalized); |
| 110 | const path = resolved?.path || normalized.uid; |
| 111 | if (!path) { |
| 112 | return null; |
| 113 | } |
| 114 | return { |
| 115 | path, |
| 116 | displayText: resolved?.file.basename || getPathDisplayName(path), |
| 117 | }; |
| 118 | } |
| 119 | |
| 120 | if (typeof value === "object" && value !== null) { |
| 121 | const path = (value as Record<string, unknown>).path; |
| 122 | if (typeof path === "string" && path.trim() !== "") { |
| 123 | return { |
| 124 | path: path.trim(), |
| 125 | displayText: getPathDisplayName(path), |
| 126 | }; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | return null; |
| 131 | } |
| 132 | |
| 133 | function attachDateClickHandler( |
| 134 | span: HTMLElement, |
no test coverage detected