[ResponseOps][Connectors] Pager duty connector UI#171748
[ResponseOps][Connectors] Pager duty connector UI#171748adcoelho merged 9 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty_params.tsx
Outdated
Show resolved
Hide resolved
cnasikas
left a comment
There was a problem hiding this comment.
Nice work! I tested and I found that the URLs are not working. It seems that the text is set to the URL and vice-versa
Also when you press the "Add link" button the links show an error even if I do not interact with the fields. Errors are better to be shown after user interaction as they happen with the other fields of the form. Lastly, I think it is better to not disable the "Add link" button on errors. I found it a bit disruptive. Better to follow the same pattern with the summary.
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/links_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/links_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/links_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/links_list.tsx
Outdated
Show resolved
Hide resolved
| <TextFieldWithMessageVariables | ||
| index={index} | ||
| editAction={(key, value, i) => { | ||
| links[currentLinkIndex] = { ...links[currentLinkIndex], href: value }; |
There was a problem hiding this comment.
I think we should avoid mutating directly the prop. The editAction will do it for you.
There was a problem hiding this comment.
I think we should avoid mutating directly the prop.
Initially, I had something like
const newLinks = [...links]
newLinks[currentLinkIndex] = { ...links[currentLinkIndex], href: value };
editAction('links', newLinks, index)
but playing around with it made no difference in the rerenders 😬
There was a problem hiding this comment.
What do you mean by no difference?
There was a problem hiding this comment.
I thought changing the prop directly might affect the number of times the component was rerendered but in the end, they were the same. What exactly does it affect?
There was a problem hiding this comment.
I can see some issues with mutating the props:
- React is not aware of the change of state
- We mutate an object that the parent component may use after using the child component
- We mutate an object that the code in the component assumes is immutable
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/links_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx
Outdated
Show resolved
Hide resolved
Ah, I switched them by mistake when playing with the
I kinda did this on purpose. Isn't clicking "Add Link" an interaction with the links portion of the form?
Will do 👍 |
Hmm not for me but I would delegate this to @mdefazio 🙂. |
But I can change it slightly to not highlight the input fields though. |
|
Regarding the comment
I made a video to show the current behavior. Screen.Recording.2023-11-24.at.15.48.40.movWhat do you think? |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @adcoelho |
cnasikas
left a comment
There was a problem hiding this comment.
Tested and is working as expected 🚀



Fixes #170048
Summary
This PR adds support in the
UIfor thecustom_detailsand links attributes in the Pagerduty connector.Release Notes
PagerDuty connector now supports the links and custom_details attributes.