(path: string, trigger?: HTMLElement)
| 75 | } |
| 76 | |
| 77 | function openWorkflowDetailsModal(path: string, trigger?: HTMLElement): void { |
| 78 | const item = workflowByPath.get(path); |
| 79 | if (!item) { |
| 80 | return; |
| 81 | } |
| 82 | |
| 83 | const metaParts: string[] = []; |
| 84 | if (item.lastUpdated) { |
| 85 | metaParts.push( |
| 86 | `<span class="last-updated">Updated ${escapeHtml( |
| 87 | formatRelativeTime(item.lastUpdated) |
| 88 | )}</span>` |
| 89 | ); |
| 90 | } |
| 91 | |
| 92 | const triggerTags = item.triggers |
| 93 | .map((triggerName) => `<span class="resource-tag tag-trigger">${escapeHtml(triggerName)}</span>`) |
| 94 | .join(''); |
| 95 | const actionsHtml = ` |
| 96 | <button id="workflow-details-copy-path" class="btn btn-secondary" type="button" data-workflow-path="${escapeHtml( |
| 97 | item.path |
| 98 | )}">Copy Path</button> |
| 99 | <button class="btn btn-secondary" type="button" data-open-file-path="${escapeHtml( |
| 100 | item.path |
| 101 | )}" data-open-file-type="workflow">Source</button> |
| 102 | `; |
| 103 | |
| 104 | openCardDetailsModal({ |
| 105 | title: item.title, |
| 106 | description: item.description || 'No description', |
| 107 | previewIcon: '⚡', |
| 108 | previewText: 'Workflow trigger details and source', |
| 109 | metaHtml: metaParts.join(''), |
| 110 | tagsHtml: triggerTags, |
| 111 | actionsHtml, |
| 112 | trigger, |
| 113 | }); |
| 114 | } |
| 115 | |
| 116 | function setupResourceListHandlers(list: HTMLElement | null): void { |
| 117 | if (!list || resourceListHandlersReady) return; |
no test coverage detected