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:
parent
76e3b7e6f1
commit
5cd4e93c65
|
@ -0,0 +1 @@
|
||||||
|
[Preview this branch](https://cosmos-explorer-preview.azurewebsites.net/pull/EDIT_THIS_NUMBER_IN_THE_PR_DESCRIPTION?feature.someFeatureFlagYouMightNeed=true)
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue