Skip to content

[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector#198314

Merged
georgianaonoleata1904 merged 17 commits intoelastic:mainfrom
georgianaonoleata1904:edit-case-blocked-by-field
Nov 19, 2024
Merged

[ResponseOps][Connectors] Optional field blocks editing of case Webhook connector#198314
georgianaonoleata1904 merged 17 commits intoelastic:mainfrom
georgianaonoleata1904:edit-case-blocked-by-field

Conversation

@georgianaonoleata1904
Copy link
Copy Markdown
Contributor

@georgianaonoleata1904 georgianaonoleata1904 commented Oct 30, 2024

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

  • 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
Screen.Recording.2024-10-31.at.13.22.37.mov

@georgianaonoleata1904 georgianaonoleata1904 self-assigned this Oct 30, 2024
@georgianaonoleata1904 georgianaonoleata1904 added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.0.0 backport:prev-minor v8.17.0 labels Oct 30, 2024
@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review October 30, 2024 12:27
@georgianaonoleata1904 georgianaonoleata1904 requested a review from a team as a code owner October 30, 2024 12:27
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as draft October 30, 2024 15:24
@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review October 31, 2024 11:27
@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as draft October 31, 2024 12:06
@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review November 1, 2024 10:05
@adcoelho
Copy link
Copy Markdown
Contributor

adcoelho commented Nov 7, 2024

I tested the PR and found a couple of bugs.

  1. If I am editing an existing connector and the add comment section is already populated the checkbox should be on not off. (See video)
Screen.Recording.2024-11-07.at.11.56.20.mov
  1. The instruction text that was below the title Add comment to a case is now missing.
Screenshot 2024-11-07 at 12 04 01 Screenshot 2024-11-07 at 12 02 27
  1. (This only happens when I am editing an existing connector.) I can save the form even if the method select box is not visibly populated.
Screenshot 2024-11-07 at 12 08 21

expect(await screen.findByTestId('webhookCreateCommentJson')).toBeInTheDocument();
});

it('Add comment to case section is rendered only when the toggle button is on', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a test that guarantees that webhookAddCommentToggle is active when those fields have data.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks :)

);
{isAddCommentToggled && (
<>
<EuiSpacer size="s" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spacer felt too small imo.

Suggested change
<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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
showLabel={true}
showLabel

showButtonTitle: true,
}}
export const UpdateStep: FunctionComponent<Props> = ({ display, readOnly }) => {
const [isAddCommentToggled, setIsAddCommentToggled] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value here should depend on whether or not the form fields are populated(instead of being false)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks :)

@cnasikas
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
stackConnectors 662.0KB 664.3KB +2.3KB

History

cc @georgianaonoleata1904

@georgianaonoleata1904 georgianaonoleata1904 merged commit d278387 into elastic:main Nov 19, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11913358789

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2024
…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)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 19, 2024
… 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>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…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>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ResponseOps][Connectors] Optional field blocks editing of Case Webhook connector

5 participants