Improve action and trigger types#58657
Merged
stacey-gammon merged 3 commits intoelastic:masterfrom Feb 28, 2020
Merged
Conversation
07cb374 to
081e246
Compare
stacey-gammon
commented
Feb 26, 2020
Author
There was a problem hiding this comment.
This is pretty weird, but, typescript complained if I didn't explicitly send over undefined.
081e246 to
bc3fd56
Compare
stacey-gammon
commented
Feb 26, 2020
bc3fd56 to
41af1fa
Compare
Contributor
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
8a5f8a0 to
e5ff89a
Compare
…using a trigger id that has not been added to the trigger context mapping.
e5ff89a to
d5b2c75
Compare
Dosant
reviewed
Feb 27, 2020
|
|
||
| public readonly attachAction = (triggerId: string, actionId: string): void => { | ||
| // TODO: make this | ||
| // <T extends TriggerId>(triggerId: T, action: Action<TriggerContextMapping[T]>): \ |
Contributor
There was a problem hiding this comment.
Interesting! Have you checked if it works? Or it will be not that simple?
Author
Dosant
approved these changes
Feb 27, 2020
mattkime
approved these changes
Feb 28, 2020
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
stacey-gammon
pushed a commit
to stacey-gammon/kibana
that referenced
this pull request
Feb 28, 2020
* Improve types so emitting the wrong context shape complains, as does using a trigger id that has not been added to the trigger context mapping. * remove unneccessary code
stacey-gammon
pushed a commit
that referenced
this pull request
Feb 28, 2020
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Mar 2, 2020
…dex-server-side * 'master' of github.com:elastic/kibana: (34 commits) [Upgrade Assistant] Remove "boom" from reindex service (elastic#58715) [data] Clean up QueryStringInput unit tests (elastic#58704) [SIEM] Detection Fix typo in Adobe Hijack Persistence rule (elastic#58804) Restores [SIEM][CASE] Init Configure Case Page (elastic#58121) (elastic#58924) Skips additional failing Ingest Manager integration tests Skips failing Ingest Manager integration tests Move dev tools styles to NP (elastic#58855) change to have kibana --ssl cli option use more recent certs (elastic#57933) disable failing suite (elastic#58942) Don't start pollEsNodesVersion unless someone subscribes (elastic#56923) Do not write UUID file during optimize process (elastic#58899) [Endpoint] Task/add nav bar (elastic#58604) [Metric Alerts] Add backend support for multiple expressions per alert (elastic#58672) [Metrics Alerts] Fix alerting on a rate aggregation (elastic#58789) disable flaky suite (elastic#55953) Revert "[SIEM] apollo@3 (elastic#51926)" and "[SIEM][CASE] Init Confi… (elastic#58806) [resubmit] Prep agg types for new platform (elastic#58893) [Lens] Allow number formatting within Lens (elastic#56253) [Autocomplete] Use settings from config rather than UI settings (elastic#58784) Improve action and trigger types (elastic#58657) ... # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

You will now get a warning if you try to use a trigger with an id that has not been added to the
TriggerContextMappingwith a context shape:This is good because before, if you didn't register your trigger id, you could pass it any context object and typescript wouldn't complain.
Small cleanups:
Step two will be attempting to get a warning if doing
uiActions.attachAction(triggerId, helloWorldActionId);if the expected context shapes are mismatched.