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

[7.x] Replace DataType enum with type & add runtime dataTypes (#82231) #82656

Merged
merged 2 commits into from
Nov 4, 2020

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Nov 4, 2020

Backports the following commits to 7.x:

## Summary

Expands on pattern added in elastic#82188

Replace `enum DataType` with TS type `DataType` & runtime JS `dataTypes`
```diff
- export enum DataType {
-  logs = 'logs',
-  metrics = 'metrics',
-}
+ export const dataTypes = {
+  Logs: 'logs',
+  Metrics: 'metrics',
+ } as const;
+ export type DataType = typeof dataTypes;
```

<img width="513" alt="Screen Shot 2020-11-02 at 5 13 56 PM" src="https://user-images.githubusercontent.com/57655/97926339-f5898c00-1d30-11eb-8935-92aad936aeea.png">
<img width="774" alt="Screen Shot 2020-11-02 at 5 14 05 PM" src="https://user-images.githubusercontent.com/57655/97926341-f5898c00-1d30-11eb-8d68-b39e2904cf85.png">
<img width="780" alt="Screen Shot 2020-11-02 at 5 19 50 PM" src="https://user-images.githubusercontent.com/57655/97926342-f5898c00-1d30-11eb-9799-95d77bfc1757.png">

# Conflicts:
#	x-pack/plugins/ingest_manager/common/constants/epm.ts
#	x-pack/plugins/ingest_manager/common/types/models/epm.ts
@jfsiii jfsiii added the backport label Nov 4, 2020
@jfsiii
Copy link
Contributor Author

jfsiii commented Nov 4, 2020

@jfsiii elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

page load bundle size

id before after diff
ingestManager 385.8KB 385.7KB -68.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jfsiii jfsiii merged commit cb7ce2d into elastic:7.x Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants