Fix preview URL branch display, include link in new PRs (#644)

* Make it easy to include preview links

* Fix display of currently previewed branch
This commit is contained in:
Jordi Bunster 2021-04-12 15:07:37 -07:00 committed by GitHub
parent 76e3b7e6f1
commit 5cd4e93c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1 @@
[Preview this branch](https://cosmos-explorer-preview.azurewebsites.net/pull/EDIT_THIS_NUMBER_IN_THE_PR_DESCRIPTION?feature.someFeatureFlagYouMightNeed=true)

View File

@ -24,7 +24,7 @@ export type Features = {
readonly ttl90Days: boolean; readonly ttl90Days: boolean;
}; };
export function extractFeatures(given = new URLSearchParams()): Features { export function extractFeatures(given = new URLSearchParams(window.location.search)): Features {
const downcased = new URLSearchParams(); const downcased = new URLSearchParams();
const set = (value: string, key: string) => downcased.set(key.toLowerCase(), value); const set = (value: string, key: string) => downcased.set(key.toLowerCase(), value);
const get = (key: string) => downcased.get("feature." + key) ?? undefined; const get = (key: string) => downcased.get("feature." + key) ?? undefined;