[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector#198314
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
| expect(await screen.findByTestId('webhookCreateCommentJson')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('Add comment to case section is rendered only when the toggle button is on', async () => { |
There was a problem hiding this comment.
Maybe add a test that guarantees that webhookAddCommentToggle is active when those fields have data.
There was a problem hiding this comment.
done, thanks :)
x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/validator.ts
Show resolved
Hide resolved
| ); | ||
| {isAddCommentToggled && ( | ||
| <> | ||
| <EuiSpacer size="s" /> |
There was a problem hiding this comment.
This spacer felt too small imo.
| <EuiSpacer size="s" /> | |
| <EuiSpacer size="m" /> |
But let's see how things look like when you add the missing text I mentioned in the other comment
| <EuiSpacer size="m" /> | ||
| <EuiSwitch | ||
| label={i18n.STEP_4B} | ||
| showLabel={true} |
There was a problem hiding this comment.
nit:
| showLabel={true} | |
| showLabel |
| showButtonTitle: true, | ||
| }} | ||
| export const UpdateStep: FunctionComponent<Props> = ({ display, readOnly }) => { | ||
| const [isAddCommentToggled, setIsAddCommentToggled] = useState(false); |
There was a problem hiding this comment.
The default value here should depend on whether or not the form fields are populated(instead of being false)
There was a problem hiding this comment.
done, thanks :)
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
|
Starting backport for target branches: 8.x |
…ok connector (elastic#198314) Closes elastic#191915 ## Summary When editing an existing Webhook - Case Management connector clicking Save will fail if the optional step 4 "Add a comment in case" is not populated - added extra checks for null, undefined or empty string: returns "undefined" immediately, skipping any further validation - this ensures that the "comment url" and "comment object" fields can remain empty without triggering a validation error (previously, if the fields were empty, the value passed was null). - the header of the add comment section was changed to a toggle element, when it's on, all the elements in the add comment section are visible https://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit d278387)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… Webhook connector (#198314) (#200724) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector (#198314)](#198314) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Georgiana-Andreea Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2024-11-19T12:46:39Z","message":"[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector (#198314)\n\nCloses https://github.com/elastic/kibana/issues/191915\r\n\r\n## Summary\r\n\r\nWhen editing an existing Webhook - Case Management connector clicking\r\nSave will fail if the optional step 4 \"Add a comment in case\" is not\r\npopulated\r\n- added extra checks for null, undefined or empty string: returns\r\n\"undefined\" immediately, skipping any further validation - this ensures\r\nthat the \"comment url\" and \"comment object\" fields can remain empty\r\nwithout triggering a validation error (previously, if the fields were\r\nempty, the value passed was null).\r\n- the header of the add comment section was changed to a toggle element,\r\nwhen it's on, all the elements in the add comment section are visible\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"d27838795681817657508c78422732f0dbe8dd3a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.17.0"],"title":"[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector","number":198314,"url":"https://github.com/elastic/kibana/pull/198314","mergeCommit":{"message":"[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector (#198314)\n\nCloses https://github.com/elastic/kibana/issues/191915\r\n\r\n## Summary\r\n\r\nWhen editing an existing Webhook - Case Management connector clicking\r\nSave will fail if the optional step 4 \"Add a comment in case\" is not\r\npopulated\r\n- added extra checks for null, undefined or empty string: returns\r\n\"undefined\" immediately, skipping any further validation - this ensures\r\nthat the \"comment url\" and \"comment object\" fields can remain empty\r\nwithout triggering a validation error (previously, if the fields were\r\nempty, the value passed was null).\r\n- the header of the add comment section was changed to a toggle element,\r\nwhen it's on, all the elements in the add comment section are visible\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"d27838795681817657508c78422732f0dbe8dd3a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198314","number":198314,"mergeCommit":{"message":"[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector (#198314)\n\nCloses https://github.com/elastic/kibana/issues/191915\r\n\r\n## Summary\r\n\r\nWhen editing an existing Webhook - Case Management connector clicking\r\nSave will fail if the optional step 4 \"Add a comment in case\" is not\r\npopulated\r\n- added extra checks for null, undefined or empty string: returns\r\n\"undefined\" immediately, skipping any further validation - this ensures\r\nthat the \"comment url\" and \"comment object\" fields can remain empty\r\nwithout triggering a validation error (previously, if the fields were\r\nempty, the value passed was null).\r\n- the header of the add comment section was changed to a toggle element,\r\nwhen it's on, all the elements in the add comment section are visible\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"d27838795681817657508c78422732f0dbe8dd3a"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
…ok connector (elastic#198314) Closes elastic#191915 ## Summary When editing an existing Webhook - Case Management connector clicking Save will fail if the optional step 4 "Add a comment in case" is not populated - added extra checks for null, undefined or empty string: returns "undefined" immediately, skipping any further validation - this ensures that the "comment url" and "comment object" fields can remain empty without triggering a validation error (previously, if the fields were empty, the value passed was null). - the header of the add comment section was changed to a toggle element, when it's on, all the elements in the add comment section are visible https://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ok connector (elastic#198314) Closes elastic#191915 ## Summary When editing an existing Webhook - Case Management connector clicking Save will fail if the optional step 4 "Add a comment in case" is not populated - added extra checks for null, undefined or empty string: returns "undefined" immediately, skipping any further validation - this ensures that the "comment url" and "comment object" fields can remain empty without triggering a validation error (previously, if the fields were empty, the value passed was null). - the header of the add comment section was changed to a toggle element, when it's on, all the elements in the add comment section are visible https://github.com/user-attachments/assets/49839173-e99b-4ee8-be6d-b682ad0b8a80 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>



Closes #191915
Summary
When editing an existing Webhook - Case Management connector clicking Save will fail if the optional step 4 "Add a comment in case" is not populated
Screen.Recording.2024-10-31.at.13.22.37.mov