-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Alerting UI] Fix console error when setting connector params #83333
Conversation
…le-error/pagerduty
…le-error/pagerduty
@@ -72,10 +72,8 @@ export const ConnectorAddFlyout = ({ | |||
const [isSaving, setIsSaving] = useState<boolean>(false); | |||
|
|||
const closeFlyout = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the following lines because I was seeing another console error when saving a connector. With this PR #82126, the connector flyouts are destroyed when closed instead of hidden, so setting these states on closing was causing a Warning: Can't perform a React state update on an unmounted component.
browser error.
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally and it works like a magic 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, tested locally 👍
…c#83333) * Fixing console errors * Setting defaults for undefined inputs in text area/field with message variables * Cleanup * Cleanup * Fixing pagerduty timestamp validation * Fixing test * Pagerduty params * Reverting unnecessary changes
#83537) * Fixing console errors * Setting defaults for undefined inputs in text area/field with message variables * Cleanup * Cleanup * Fixing pagerduty timestamp validation * Fixing test * Pagerduty params * Reverting unnecessary changes
* master: (51 commits) [ML] Persisted URL state for the Data frame analytics jobs and models pages (elastic#83439) adds xpack.security.authc.selector.enabled setting (elastic#83551) skip flaky suite (elastic#77279) [ML] Improve support for script and aggregation fields in anomaly detection jobs (elastic#81923) [Workplace Search] Migrate SourcesLogic from ent-search (elastic#83544) [ML] Add UI test for feature importance features (elastic#82677) [Maps] Improve icons for all layer types (elastic#83503) Replace experimental badge with Beta (elastic#83468) [Fleet][EPM] Unified install and archive (elastic#83384) Move src/legacy/server/keystore to src/cli (elastic#83483) Used SO for saving the API key IDs that should be deleted (elastic#82211) [Uptime] Mock implementation to account for math flakiness test (elastic#83535) [Workplace Search] Enable check for org context based on URL (elastic#83487) [App Search] Added all Document related routes and logic (elastic#83324) [Alerting UI] Fix console error when setting connector params (elastic#83333) [Discover] Allow custom name for fields via index pattern field management (elastic#70039) [Uptime] Fix monitor list down histogram (elastic#83411) remove headers timeout hack, rely on nodejs timeouts (elastic#83419) [ML] Update console autocomplete for ML data frame evaluate API (elastic#83151) [Lens] Color in dimension trigger (elastic#76871) ...
Resolves #83078
Summary
This is fixed by setting a default to an empty string in the
TextAreaWithMessageVariables
andTextFieldWithMessageVariables
components when the input is undefined. If the initial input is undefined, the form control is uncontrolled, then setting a value changes the input to controlled, causing the console error seen in the issue. The issue specifically called out the PagerDuty connector but I also saw this behavior in other connector param forms.To verify: