forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dataset Quality]Migrate telemetry tests and remove flyout code (elas…
…tic#190584) ## Summary closes elastic#184572 After the merge of the 1st [PR](elastic#189532) around Flyout migration, this PR covers the remaining bits. - [x] Adding same telemetry to the page which was present in the flyout - [x] Create a Locator and use it in the Table to connect the main page with Details page - [x] Update locator in Unified Doc Viewer - [x] Migrate all kind of tests which were present for flyout to the page - [x] Remove everything which was once called Dataset Quality Flyout. - [x] Make build green - Yellow is also acceptable --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
32dd373
commit 8431033
Showing
83 changed files
with
1,176 additions
and
4,291 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
43 changes: 43 additions & 0 deletions
43
packages/deeplinks/observability/locators/dataset_quality_details.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,43 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { SerializableRecord } from '@kbn/utility-types'; | ||
|
||
export const DATA_QUALITY_DETAILS_LOCATOR_ID = 'DATA_QUALITY_DETAILS_LOCATOR'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | ||
type RefreshInterval = { | ||
pause: boolean; | ||
value: number; | ||
}; | ||
|
||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | ||
type TimeRangeConfig = { | ||
from: string; | ||
to: string; | ||
refresh: RefreshInterval; | ||
}; | ||
|
||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | ||
type DegradedFieldsTable = { | ||
page?: number; | ||
rowsPerPage?: number; | ||
sort?: { | ||
field: string; | ||
direction: 'asc' | 'desc'; | ||
}; | ||
}; | ||
|
||
export interface DataQualityDetailsLocatorParams extends SerializableRecord { | ||
dataStream: string; | ||
timeRange?: TimeRangeConfig; | ||
breakdownField?: string; | ||
degradedFields?: { | ||
table?: DegradedFieldsTable; | ||
}; | ||
} |
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
50 changes: 50 additions & 0 deletions
50
...ck/plugins/data_quality/common/locators/construct_dataset_quality_details_locator_path.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,50 @@ | ||
/* | ||
* 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 { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/common'; | ||
import { ManagementAppLocatorParams } from '@kbn/management-plugin/common/locator'; | ||
import { LocatorPublic } from '@kbn/share-plugin/common'; | ||
import { DataQualityDetailsLocatorParams } from '@kbn/deeplinks-observability'; | ||
import { datasetQualityDetailsUrlSchemaV1, DATA_QUALITY_URL_STATE_KEY } from '../url_schema'; | ||
import { deepCompactObject } from '../utils/deep_compact_object'; | ||
|
||
interface LocatorPathConstructionParams { | ||
locatorParams: DataQualityDetailsLocatorParams; | ||
useHash: boolean; | ||
managementLocator: LocatorPublic<ManagementAppLocatorParams>; | ||
} | ||
|
||
export const constructDatasetQualityDetailsLocatorPath = async ( | ||
params: LocatorPathConstructionParams | ||
) => { | ||
const { locatorParams, useHash, managementLocator } = params; | ||
|
||
const pageState = datasetQualityDetailsUrlSchemaV1.urlSchemaRT.encode( | ||
deepCompactObject({ | ||
v: 1, | ||
...locatorParams, | ||
}) | ||
); | ||
|
||
const managementPath = await managementLocator.getLocation({ | ||
sectionId: 'data', | ||
appId: 'data_quality/details', | ||
}); | ||
|
||
const path = setStateToKbnUrl( | ||
DATA_QUALITY_URL_STATE_KEY, | ||
pageState, | ||
{ useHash, storeInHashQuery: false }, | ||
`${managementPath.app}${managementPath.path}` | ||
); | ||
|
||
return { | ||
app: '', | ||
path, | ||
state: {}, | ||
}; | ||
}; |
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
31 changes: 31 additions & 0 deletions
31
x-pack/plugins/data_quality/common/locators/dataset_quality_details_locator.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,31 @@ | ||
/* | ||
* 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 type { LocatorDefinition } from '@kbn/share-plugin/public'; | ||
import { | ||
DataQualityDetailsLocatorParams, | ||
DATA_QUALITY_DETAILS_LOCATOR_ID, | ||
} from '@kbn/deeplinks-observability'; | ||
import { DataQualityLocatorDependencies } from './types'; | ||
import { constructDatasetQualityDetailsLocatorPath } from './construct_dataset_quality_details_locator_path'; | ||
|
||
export class DatasetQualityDetailsLocatorDefinition | ||
implements LocatorDefinition<DataQualityDetailsLocatorParams> | ||
{ | ||
public readonly id = DATA_QUALITY_DETAILS_LOCATOR_ID; | ||
|
||
constructor(protected readonly deps: DataQualityLocatorDependencies) {} | ||
|
||
public readonly getLocation = async (params: DataQualityDetailsLocatorParams) => { | ||
const { useHash, managementLocator } = this.deps; | ||
return await constructDatasetQualityDetailsLocatorPath({ | ||
useHash, | ||
managementLocator, | ||
locatorParams: params, | ||
}); | ||
}; | ||
} |
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
File renamed without changes.
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.