diff --git a/app/src/Processors/RecentMergedPrsProcessor.php b/app/src/Processors/RecentMergedPrsProcessor.php index 8cb4d56..b310cef 100644 --- a/app/src/Processors/RecentMergedPrsProcessor.php +++ b/app/src/Processors/RecentMergedPrsProcessor.php @@ -42,6 +42,30 @@ public function getHtmlTableScript(): string } } }, 250); + + // Find the column index of the "action" column + let actionColIndex = 0; + const tableHeaders = document.querySelectorAll('thead th'); + for (let i = 0; i < tableHeaders.length; i++) { + if (tableHeaders[i].innerText === 'action') { + actionColIndex = i + 1; + break; + } + } + // Loop through all the rows and convert the action cell to a "Copy MD" button + var tds = document.querySelectorAll(`tbody td:nth-child(\${actionColIndex})`); + for (let i = 0; i < tds.length; i++) { + const td = tds[i]; + const md = td.innerHTML; + td.innerHTML = ''; + const btn = document.createElement('button'); + btn.addEventListener('click', function() { + navigator.clipboard.writeText(md); + btn.innerHTML = 'Copied'; + }); + btn.innerHTML = 'Copy'; + td.appendChild(btn); + } })(); EOT; } @@ -153,6 +177,8 @@ private function deriveMergedPrDataRow(stdClass $pr, string $account, string $re $prStats = $this->prStats($pr->files->nodes); + $markdownLink = "[{$pr->title}]({$pr->url}) by [{$authorName}](https://github.com/$author)"; + $row = [ 'account' => $account, 'repo' => $repo, @@ -175,6 +201,7 @@ private function deriveMergedPrDataRow(stdClass $pr, string $account, string $re 'unit' => $prStats['unit'], 'behat' => $prStats['behat'], 'jest' => $prStats['jest'], + 'action' => $markdownLink, ]; return $row; } diff --git a/public/assets/web.config b/public/assets/web.config deleted file mode 100644 index 65b4b2d..0000000 --- a/public/assets/web.config +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/themes/rhino/css/style.css b/themes/rhino/css/style.css index 11bf679..c0c436c 100644 --- a/themes/rhino/css/style.css +++ b/themes/rhino/css/style.css @@ -64,12 +64,12 @@ td, th { padding: 3px; } -.odd { - background-color: #fcf6ef !important; +#mytable .odd { + background-color: #fcf6ef; } -.even { - background-color: #fffdfb !important; +#mytable .even { + background-color: #fffdfb; } thead tr:first-of-type {