MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / getDependencyDisplayLink

Function getDependencyDisplayLink

src/ui/taskCardProperties.ts:102–131  ·  view source on GitHub ↗
(
	value: unknown,
	task: TaskInfo,
	plugin: TaskNotesPlugin
)

Source from the content-addressed store, hash-verified

100}
101
102function 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
133function attachDateClickHandler(
134 span: HTMLElement,

Callers 1

Calls 3

normalizeDependencyEntryFunction · 0.90
resolveDependencyEntryFunction · 0.90
getPathDisplayNameFunction · 0.85

Tested by

no test coverage detected