Explore/Refactor: Simplify URL handling (#29173)

* Inline datasource actions into initialisation

* Simplify url handling

* Add comments

* Remove split property from state and split Explore.tsx to 2 components

* Add comments

* Simplify and fix splitOpen and splitClose actions

* Update public/app/features/explore/ExplorePaneContainer.tsx

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>

* Update public/app/features/explore/state/explorePane.test.ts

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>

* Update public/app/features/explore/Wrapper.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Fix test

* Fix lint

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
Andrej Ocenas
2021-02-12 21:33:26 +01:00
committed by GitHub
parent 9629dded42
commit b0bd242eda
25 changed files with 556 additions and 835 deletions

View File

@@ -5,7 +5,6 @@ import {
DataQuery,
DataQueryRequest,
DataSourceApi,
ExploreUrlState,
HistoryItem,
LogLevel,
LogsDedupStrategy,
@@ -26,10 +25,6 @@ export enum ExploreId {
* Global Explore state
*/
export interface ExploreState {
/**
* True if split view is active.
*/
split: boolean;
/**
* True if time interval for panels are synced. Only possible with split mode.
*/
@@ -41,7 +36,7 @@ export interface ExploreState {
/**
* Explore state of the right area in split view.
*/
right: ExploreItemState;
right?: ExploreItemState;
/**
* History of all queries
*/
@@ -134,17 +129,6 @@ export interface ExploreItemState {
*/
refreshInterval?: string;
/**
* Copy of the state of the URL which is in store.location.query. This is duplicated here so we can diff the two
* after a change to see if we need to sync url state back to redux store (like on clicking Back in browser).
*/
urlState: ExploreUrlState | null;
/**
* Map of what changed between real url and local urlState so we can partially update just the things that are needed.
*/
update: ExploreUpdateState;
latency: number;
/**
@@ -156,7 +140,6 @@ export interface ExploreItemState {
* If true, the live tailing view is paused.
*/
isPaused: boolean;
urlReplaced: boolean;
querySubscription?: Unsubscribable;