From d22132fa570cb2697440baffca05526f34dc9171 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Fri, 2 Feb 2024 00:26:00 +0000 Subject: [PATCH 1/3] routing for surrounding doc should work without ? Signed-off-by: abbyhu2000 --- src/plugins/discover/public/migrate_state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/discover/public/migrate_state.ts b/src/plugins/discover/public/migrate_state.ts index 2a3cd77d26bc..0fd153b6e191 100644 --- a/src/plugins/discover/public/migrate_state.ts +++ b/src/plugins/discover/public/migrate_state.ts @@ -66,7 +66,7 @@ export function migrateUrlState(oldPath: string, newPath = '/'): string { let path = newPath; const pathPatterns = [ { - pattern: '#/context/:indexPattern/:id\\?:appState?', + pattern: '#/context/:indexPattern/:id?:appState?', extraState: { docView: 'context' }, path: `context`, }, From ec36fd8562ef4017b115ff61fcc80015a6eb63b9 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Fri, 2 Feb 2024 21:27:29 +0000 Subject: [PATCH 2/3] change path to not include appstate Signed-off-by: abbyhu2000 --- src/plugins/discover/public/migrate_state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/discover/public/migrate_state.ts b/src/plugins/discover/public/migrate_state.ts index 0fd153b6e191..03100d9560bf 100644 --- a/src/plugins/discover/public/migrate_state.ts +++ b/src/plugins/discover/public/migrate_state.ts @@ -66,7 +66,7 @@ export function migrateUrlState(oldPath: string, newPath = '/'): string { let path = newPath; const pathPatterns = [ { - pattern: '#/context/:indexPattern/:id?:appState?', + pattern: '#/context/:indexPattern/:id', extraState: { docView: 'context' }, path: `context`, }, From 07ec40080d61ddc28f8d81ce44f290f73eb4b9de Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Sat, 3 Feb 2024 00:47:20 +0000 Subject: [PATCH 3/3] delete optional app state for single doc link too Signed-off-by: abbyhu2000 --- src/plugins/discover/public/migrate_state.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/discover/public/migrate_state.ts b/src/plugins/discover/public/migrate_state.ts index 03100d9560bf..b0ec5af810aa 100644 --- a/src/plugins/discover/public/migrate_state.ts +++ b/src/plugins/discover/public/migrate_state.ts @@ -71,7 +71,7 @@ export function migrateUrlState(oldPath: string, newPath = '/'): string { path: `context`, }, { - pattern: '#/doc/:indexPattern/:index\\?:appState?', + pattern: '#/doc/:indexPattern/:id', extraState: { docView: 'doc' }, path: `doc`, }, @@ -99,6 +99,7 @@ export function migrateUrlState(oldPath: string, newPath = '/'): string { case `doc`: case `context`: path = oldPath; + break; case `discover`: case `savedSearch`: const params = matchPath(oldPath, {