|
1 | 1 | import { PathInfo } from '../components/path.js';
|
| 2 | +import { DefaultBrowserNames } from '../components/product-info.js'; |
2 | 3 | import '../components/test-runs-query-builder.js';
|
3 | 4 | import { TestRunsUIBase } from '../components/test-runs.js';
|
4 | 5 | import '../components/test-search.js';
|
@@ -130,6 +131,9 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
|
130 | 131 | <template is="dom-if" if="[[!editable]]">
|
131 | 132 | <a href="javascript:window.location.search='';"> (switch to the default product set instead)</a>
|
132 | 133 | </template>
|
| 134 | + <template is="dom-if" if="[[showAddEdgeBackLink(queryParams)]]"> |
| 135 | + <a href='#' on-click="addEdgeBack"> (add Microsoft Edge back)</a> |
| 136 | + </template> |
133 | 137 | <wpt-permalinks path="[[path]]"
|
134 | 138 | path-prefix="/[[page]]/"
|
135 | 139 | query-params="[[queryParams]]"
|
@@ -386,6 +390,21 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
|
386 | 390 | return true;
|
387 | 391 | }
|
388 | 392 |
|
| 393 | + showAddEdgeBackLink(queryParams) { |
| 394 | + // We only show the 'add edge' link when the user has originally gone to |
| 395 | + // the main page (e.g. just https://wpt.fyi/results). We can detect that by |
| 396 | + // checking that no products were specified. |
| 397 | + return queryParams.product === undefined; |
| 398 | + } |
| 399 | + |
| 400 | + addEdgeBack() { |
| 401 | + // Attempt to put Edge back in the place it used to go (next to Chrome), |
| 402 | + // but also allow for some change in the default browser set. |
| 403 | + const newProducts = [DefaultBrowserNames[0], 'edge', ...DefaultBrowserNames.slice(1)]; |
| 404 | + this.queryParams.product = newProducts; |
| 405 | + this.updateQueryParams(this.queryParams); |
| 406 | + } |
| 407 | + |
389 | 408 | computeResultsTotalsRangeMessage(page, path, searchResults, shas, productSpecs, from, to, maxCount, labels, master, runIds) {
|
390 | 409 | const msg = super.computeResultsRangeMessage(shas, productSpecs, from, to, maxCount, labels, master, runIds);
|
391 | 410 | if (page === 'results' && searchResults) {
|
|
0 commit comments