Skip to content

Commit

Permalink
[Ingest Manager] Replace AgentAssetType enum with new approach (#82387)
Browse files Browse the repository at this point in the history
## Summary

Expands on pattern added in #82188

`AgentAssetType` `enum` is only used as part of a single type definition
  • Loading branch information
John Schulz authored Nov 3, 2020
1 parent d8c37fe commit a49473b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/ingest_manager/common/constants/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export const requiredPackages = {
Endpoint: 'endpoint',
} as const;

export const agentAssetTypes = {
Input: 'input',
} as const;

export const dataTypes = {
Logs: 'logs',
Metrics: 'metrics',
Expand Down
10 changes: 4 additions & 6 deletions x-pack/plugins/ingest_manager/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
// Follow pattern from https://github.com/elastic/kibana/pull/52447
// TODO: Update when https://github.com/elastic/kibana/issues/53021 is closed
import { SavedObject, SavedObjectAttributes, SavedObjectReference } from 'src/core/public';
import { dataTypes, requiredPackages } from '../../constants';
import { agentAssetTypes, dataTypes, requiredPackages } from '../../constants';
import { ValueOf } from '../../types';

export enum InstallationStatus {
installed = 'installed',
Expand All @@ -27,7 +28,8 @@ export type EpmPackageInstallStatus = 'installed' | 'installing';

export type DetailViewPanelName = 'overview' | 'usages' | 'settings';
export type ServiceName = 'kibana' | 'elasticsearch';
export type AssetType = KibanaAssetType | ElasticsearchAssetType | AgentAssetType;
export type AgentAssetType = typeof agentAssetTypes;
export type AssetType = KibanaAssetType | ElasticsearchAssetType | ValueOf<AgentAssetType>;

export enum KibanaAssetType {
dashboard = 'dashboard',
Expand All @@ -47,10 +49,6 @@ export enum ElasticsearchAssetType {

export type DataType = typeof dataTypes;

export enum AgentAssetType {
input = 'input',
}

export type RegistryRelease = 'ga' | 'beta' | 'experimental';

// Fields common to packages that come from direct upload and the registry
Expand Down

0 comments on commit a49473b

Please sign in to comment.