(config: StatusIndicatorConfig)
| 107 | } |
| 108 | |
| 109 | export function createStatusIndicator(config: StatusIndicatorConfig): HTMLElement | null { |
| 110 | const { |
| 111 | mainRow, |
| 112 | card, |
| 113 | task, |
| 114 | plugin, |
| 115 | effectiveStatus, |
| 116 | visibleProperties, |
| 117 | hideStatusIndicator, |
| 118 | onClick, |
| 119 | } = config; |
| 120 | |
| 121 | if (!shouldShowStatusIndicator(visibleProperties, plugin, hideStatusIndicator)) { |
| 122 | return null; |
| 123 | } |
| 124 | if (!mainRow) { |
| 125 | return null; |
| 126 | } |
| 127 | |
| 128 | const statusDot = mainRow.createEl("span", { cls: "task-card__status-dot" }); |
| 129 | configureStatusIndicator(statusDot, plugin.statusManager.getStatusConfig(effectiveStatus)); |
| 130 | prepareInteractiveControl(statusDot); |
| 131 | statusDot.addEventListener("click", onClick); |
| 132 | statusDot.dataset.taskPath = task.path; |
| 133 | applyTaskCardStatusColors(card, effectiveStatus, plugin); |
| 134 | return statusDot; |
| 135 | } |
| 136 | |
| 137 | function insertPrimaryIndicator( |
| 138 | mainRow: HTMLElement, |
no test coverage detected