Explore: Notify when compact URL is used (#58684)

* Add explore compact url notices

* Add error checking around data links urls

* Fix tests

* remove global flag, add test for warning in title

* Move feature tracking to initialization, add better error messaging

* Fix test

* Add compact url tests, fix styling bug, remove warning tooltip

* Fix broken check, move tests to util file
This commit is contained in:
Kristina
2022-11-21 08:03:50 -06:00
committed by GitHub
parent b1ffe18599
commit bdfa127ee5
13 changed files with 120 additions and 10 deletions

View File

@@ -219,7 +219,8 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState {
}
if (!Array.isArray(parsed)) {
return parsed;
const urlState = { ...parsed, isFromCompactUrl: false };
return urlState;
}
if (parsed.length <= ParseUrlStateIndex.SegmentsStart) {
@@ -236,7 +237,7 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState {
const queries = parsedSegments.filter((segment) => !isSegment(segment, 'ui', 'mode', '__panelsState'));
const panelsState = parsedSegments.find((segment) => isSegment(segment, '__panelsState'))?.__panelsState;
return { datasource, queries, range, panelsState };
return { datasource, queries, range, panelsState, isFromCompactUrl: true };
}
export function generateKey(index = 0): string {