(config: StatusIndicatorConfig)
| 155 | } |
| 156 | |
| 157 | export function updateStatusIndicator(config: StatusIndicatorConfig): HTMLElement | null { |
| 158 | const { mainRow, card, plugin, effectiveStatus, visibleProperties, hideStatusIndicator } = |
| 159 | config; |
| 160 | const statusDot = card.querySelector<HTMLElement>(".task-card__status-dot"); |
| 161 | |
| 162 | applyTaskCardStatusColors(card, effectiveStatus, plugin); |
| 163 | |
| 164 | if (!shouldShowStatusIndicator(visibleProperties, plugin, hideStatusIndicator)) { |
| 165 | statusDot?.remove(); |
| 166 | return null; |
| 167 | } |
| 168 | |
| 169 | if (statusDot) { |
| 170 | configureStatusIndicator(statusDot, plugin.statusManager.getStatusConfig(effectiveStatus)); |
| 171 | return statusDot; |
| 172 | } |
| 173 | if (!mainRow) { |
| 174 | return null; |
| 175 | } |
| 176 | |
| 177 | const newStatusDot = createStatusIndicator(config); |
| 178 | if (newStatusDot) { |
| 179 | insertPrimaryIndicator(mainRow, newStatusDot, ".task-card__checkbox"); |
| 180 | } |
| 181 | return newStatusDot; |
| 182 | } |
| 183 | |
| 184 | export function configurePriorityIndicator( |
| 185 | priorityDot: HTMLElement, |
no test coverage detected