Skip to content

Commit 08b6fc4

Browse files
John Schulzkibanamachine
authored andcommitted
[Fleet] Remove duplication between two files #103282
## Summary `public/applications/integrations/constants.tsx` and `public/applications/integrations/sections/epm/constants.tsx` are identical except for this line in `public/applications/integrations/constants.tsx` ```ts export * from '../../constants'; ``` This PR removes all the duplication from the "upper" file (`public/applications/integrations/constants.tsx`) and leaves the other code "down" in `/sections/epm/` closer to where it's used. Initially, I deleted `public/applications/integrations/constants.tsx` entirely but several files do `import` the constants it exports, so I left it.
1 parent 669839c commit 08b6fc4

2 files changed

Lines changed: 1 addition & 54 deletions

File tree

x-pack/plugins/fleet/public/applications/integrations/constants.tsx

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,4 @@
55
* 2.0.
66
*/
77

8-
import type { IconType } from '@elastic/eui';
9-
10-
import type { ServiceName } from '../../types';
11-
import { ElasticsearchAssetType, KibanaAssetType } from '../../types';
12-
138
export * from '../../constants';
14-
15-
// only allow Kibana assets for the kibana key, ES asssets for elasticsearch, etc
16-
type ServiceNameToAssetTypes = Record<Extract<ServiceName, 'kibana'>, KibanaAssetType[]> &
17-
Record<Extract<ServiceName, 'elasticsearch'>, ElasticsearchAssetType[]>;
18-
19-
export const DisplayedAssets: ServiceNameToAssetTypes = {
20-
kibana: Object.values(KibanaAssetType),
21-
elasticsearch: Object.values(ElasticsearchAssetType),
22-
};
23-
export type DisplayedAssetType = KibanaAssetType | ElasticsearchAssetType;
24-
25-
export const AssetTitleMap: Record<DisplayedAssetType, string> = {
26-
dashboard: 'Dashboard',
27-
ilm_policy: 'ILM Policy',
28-
ingest_pipeline: 'Ingest Pipeline',
29-
transform: 'Transform',
30-
index_pattern: 'Index Pattern',
31-
index_template: 'Index Template',
32-
component_template: 'Component Template',
33-
search: 'Saved Search',
34-
visualization: 'Visualization',
35-
map: 'Map',
36-
data_stream_ilm_policy: 'Data Stream ILM Policy',
37-
lens: 'Lens',
38-
security_rule: 'Security Rule',
39-
ml_module: 'ML Module',
40-
};
41-
42-
export const ServiceTitleMap: Record<ServiceName, string> = {
43-
kibana: 'Kibana',
44-
elasticsearch: 'Elasticsearch',
45-
};
46-
47-
export const AssetIcons: Record<KibanaAssetType, IconType> = {
48-
dashboard: 'dashboardApp',
49-
index_pattern: 'indexPatternApp',
50-
search: 'searchProfilerApp',
51-
visualization: 'visualizeApp',
52-
map: 'emsApp',
53-
lens: 'lensApp',
54-
security_rule: 'securityApp',
55-
ml_module: 'mlApp',
56-
};
57-
58-
export const ServiceIcons: Record<ServiceName, IconType> = {
59-
elasticsearch: 'logoElasticsearch',
60-
kibana: 'logoKibana',
61-
};

x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets_accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
EuiNotificationBadge,
2121
} from '@elastic/eui';
2222

23-
import { AssetTitleMap } from '../../../../../constants';
23+
import { AssetTitleMap } from '../../../constants';
2424

2525
import { getHrefToObjectInKibanaApp, useStartServices } from '../../../../../hooks';
2626

0 commit comments

Comments
 (0)