(input: TaskEditChangeInput)
| 219 | } |
| 220 | |
| 221 | function buildBlockingUpdates(input: TaskEditChangeInput): { |
| 222 | blockingUpdates: BlockingUpdates; |
| 223 | unresolvedBlockingEntries: string[]; |
| 224 | } { |
| 225 | const resolvedBlocking = new Map<string, TaskDependency>(); |
| 226 | const unresolvedBlockingEntries: string[] = []; |
| 227 | |
| 228 | input.blockingItems.forEach((item) => { |
| 229 | if (item.path) { |
| 230 | resolvedBlocking.set(item.path, { ...item.dependency }); |
| 231 | } else { |
| 232 | unresolvedBlockingEntries.push(item.dependency.uid); |
| 233 | } |
| 234 | }); |
| 235 | |
| 236 | const newBlockingPaths = Array.from(resolvedBlocking.keys()); |
| 237 | const originalPaths = new Set(input.initialBlockingPaths); |
| 238 | const newPathSet = new Set(newBlockingPaths); |
| 239 | const added = newBlockingPaths.filter((path) => !originalPaths.has(path)); |
| 240 | const removed = input.initialBlockingPaths.filter((path) => !newPathSet.has(path)); |
| 241 | const raw: Record<string, TaskDependency> = {}; |
| 242 | |
| 243 | for (const path of added) { |
| 244 | const dependency = resolvedBlocking.get(path); |
| 245 | if (dependency) { |
| 246 | raw[path] = { ...dependency }; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | return { |
| 251 | blockingUpdates: { added, removed, raw }, |
| 252 | unresolvedBlockingEntries, |
| 253 | }; |
| 254 | } |
| 255 | |
| 256 | function applyRecurringInstanceChanges( |
| 257 | input: TaskEditChangeInput, |
no test coverage detected