(anchor: HTMLElement, ciCommit: string | undefined)
| 110 | } |
| 111 | |
| 112 | function addCiStatus(anchor: HTMLElement, ciCommit: string | undefined): void { |
| 113 | if (!ciCommit) { |
| 114 | return; |
| 115 | } |
| 116 | |
| 117 | prepareForAddition(anchor); |
| 118 | |
| 119 | const endpoint = buildRepoUrl('commits/checks-statuses-rollups'); |
| 120 | anchor.parentElement!.append( |
| 121 | // Hide in small viewports |
| 122 | <span |
| 123 | className="rgh-ci-link d-none d-sm-flex flex-items-center flex-justify-center p-1 tmp-p-1 Button Button--invisible" |
| 124 | title="CI status of latest commit" |
| 125 | > |
| 126 | <batch-deferred-content hidden data-url={endpoint}> |
| 127 | <input |
| 128 | name="oid" |
| 129 | value={ciCommit} |
| 130 | data-targets="batch-deferred-content.inputs" |
| 131 | /> |
| 132 | </batch-deferred-content> |
| 133 | </span>, |
| 134 | ); |
| 135 | |
| 136 | // A parent is clipping the popup |
| 137 | closestElementOptional('.AppHeader-context-full', anchor)?.style.setProperty('overflow', 'visible'); |
| 138 | } |
| 139 | |
| 140 | async function add(repoLink: HTMLElement): Promise<void> { |
| 141 | const info = await getRepositoryInfo(); |
no test coverage detected