Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Remove duplication between two files #103282

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,4 @@
* 2.0.
*/

import type { IconType } from '@elastic/eui';

import type { ServiceName } from '../../types';
import { ElasticsearchAssetType, KibanaAssetType } from '../../types';

export * from '../../constants';

// only allow Kibana assets for the kibana key, ES asssets for elasticsearch, etc
type ServiceNameToAssetTypes = Record<Extract<ServiceName, 'kibana'>, KibanaAssetType[]> &
Record<Extract<ServiceName, 'elasticsearch'>, ElasticsearchAssetType[]>;

export const DisplayedAssets: ServiceNameToAssetTypes = {
kibana: Object.values(KibanaAssetType),
elasticsearch: Object.values(ElasticsearchAssetType),
};
export type DisplayedAssetType = KibanaAssetType | ElasticsearchAssetType;

export const AssetTitleMap: Record<DisplayedAssetType, string> = {
dashboard: 'Dashboard',
ilm_policy: 'ILM Policy',
ingest_pipeline: 'Ingest Pipeline',
transform: 'Transform',
index_pattern: 'Index Pattern',
index_template: 'Index Template',
component_template: 'Component Template',
search: 'Saved Search',
visualization: 'Visualization',
map: 'Map',
data_stream_ilm_policy: 'Data Stream ILM Policy',
lens: 'Lens',
security_rule: 'Security Rule',
ml_module: 'ML Module',
};

export const ServiceTitleMap: Record<ServiceName, string> = {
kibana: 'Kibana',
elasticsearch: 'Elasticsearch',
};

export const AssetIcons: Record<KibanaAssetType, IconType> = {
dashboard: 'dashboardApp',
index_pattern: 'indexPatternApp',
search: 'searchProfilerApp',
visualization: 'visualizeApp',
map: 'emsApp',
lens: 'lensApp',
security_rule: 'securityApp',
ml_module: 'mlApp',
};

export const ServiceIcons: Record<ServiceName, IconType> = {
elasticsearch: 'logoElasticsearch',
kibana: 'logoKibana',
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
EuiNotificationBadge,
} from '@elastic/eui';

import { AssetTitleMap } from '../../../../../constants';
import { AssetTitleMap } from '../../../constants';

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

Expand Down