-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dataset Quality] Refactor integrations in DQ Flyout to not depend on…
… main DQ Page page (#187450) ## Summary This PR is a prerequisite to the Locator Implementation for Logs Explorer - #186287 ## Problem Statement - Integrations were fetched when the main DQ page loads and stored in the State Machine. This means when the Flyout Opens, it was referencing already fetched data from the main page, updating the URL and then that was used to render certain sections on the Flyout. This causes issues as when a Locator is used to directly open the Flyout from some other page. In that case everything happen asynchronously causing the data to be not present when the flyout open thus those integration sections were not present. ## Solution - Now when the flyout is opened or is already open, it reads the basic params from the URL like `DataStream`. With this information, it make API call to fetch Integration information and thus making it independent. - Does this means you duplicated the Logic to fetch Integrations ? Yes and No. Logic has to be duplicated as Flyout is moving to its own page very soon. This means it would anyhow not be able to re-use that Integration Information available. Secondly the duplication is not one to one, its more catered towards Flyout logic - Split the state machine to make Integration Calls only when the opened Dataset is actually an integration. This is done by chaining the respective states after the `DataStreamSettings` state confirms presence of Integration. ## What else has been done - Type cleaning: A lot of types has to be refactored to make this change. Also simplified some duplicate types. We were using - Runtime types - Types Derived from Runtime Types - Inferred Types from API Responses We don't need the 3rd one. 1 and 2 and sufficient.
- Loading branch information
1 parent
358dece
commit c483701
Showing
30 changed files
with
466 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/observability_solution/dataset_quality/common/data_stream_details/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { DataStreamType } from '../types'; | ||
|
||
export interface GetDataStreamIntegrationParams { | ||
type: DataStreamType; | ||
integrationName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.