[ResponseOps][Cases] Allow users to edit or delete template#185877
[ResponseOps][Cases] Allow users to edit or delete template#185877js-jankisalvi merged 13 commits intoelastic:feat/case_templatesfrom
Conversation
|
/ci |
|
/ci |
|
Pinging @elastic/response-ops (Team:ResponseOps) |
|
Pinging @elastic/response-ops-cases (Feature:Cases) |
| (allIncidentTypes ?? []).find((type) => incidentType === type.id.toString())?.name ?? | ||
| '', | ||
| })); | ||
| const selectedOptions = |
Flaky Test Runner Stats🟠 Some tests failed. - kibana-flaky-test-suite-runner#6331[✅] x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts: 25/25 tests passed. |
doakalexi
left a comment
There was a problem hiding this comment.
I tested locally and works expected. I was able to edit and delete templates. LGTM!
cnasikas
left a comment
There was a problem hiding this comment.
LGTM! I tested and I found the following bugs
- I cannot remove the parent from Jira
Screen.Recording.2024-06-18.at.3.21.42.PM.mov
- The first category on SecOps is selected but the subcategories are not shown
Screen.Recording.2024-06-18.at.3.46.59.PM.mov
- When changing connectors the fields are not resetted
Screen.Recording.2024-06-18.at.3.23.10.PM.mov
Also, the size of the component in x-pack/plugins/cases/public/components/configure_cases/index.tsx it grows a lot and I get the following warning. Maybe we can fix it on another PR.
In my PR I change the way the connectors are being handled. Bugs 2 and 3 will be fixed there.
x-pack/plugins/cases/public/components/connectors/jira/use_get_issue.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/templates/translations.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/templates/translations.ts
Outdated
Show resolved
Hide resolved
| return await testSubjects.exists('templates-list'); | ||
| }); | ||
|
|
||
| expect(await testSubjects.getVisibleText('templates-list')).to.be( |
There was a problem hiding this comment.
nit: Should we verify the rest of the updated fields?
There was a problem hiding this comment.
I will create a separate PR to create connector and custom field utils for e2e tests.
x-pack/plugins/cases/public/components/templates/templates_list.tsx
Outdated
Show resolved
Hide resolved
Fixed here |
|
@elasticmachine merge upstream |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Flaky Test Runner Stats🟠 Some tests failed. - kibana-flaky-test-suite-runner#6360[❌] x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts: 11/25 tests passed. |
## Summary This PR adds the ability for users to select a template when creating a case. When a user selects a template the cases form fields are populated with the values from the template. The solution picker in the flyout changed as: <img width="1281" alt="Screenshot 2024-06-20 at 1 26 14 PM" src="https://github.com/elastic/kibana/assets/7871006/30859c61-94e7-4f0a-97d1-cb081bd72c36"> ## Bug fixes 1. Changing the solution through the solution picket in the flyout would not respect the connector's configuration. 2. Bug where the lazy loading of connectors' icons was causing the flyout to open and close when you selected a solution picket. This bug appeared when the first bug was fixed. ## Testing 1. Go to all solutions and create cases setting all fields (including all fields of all supported connectors) without using templates. Verify that everything is working as expected. 2. Go to all solutions, create different templates on each solution, and verify that when creating a case you can use templates and everything is working as expected. 3. Go to the alerts table of o11y and security and attach alerts to a new case. Verify that in the flyout the templates are working as expected. 4. Go to ML and try to attach an ML visualization to a new case. Verify that the solution picker is working as expected and it resets the form when changing solutions. Fixes: #181871 Depends on: #185877 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com> Co-authored-by: adcoelho <antonio.coelho@elastic.co>

Summary
Merging into feature branch.
Implements edit and delete functionality #181864
Edit or delete template from case settings page.
Screen.Recording.2024-06-17.at.14.21.44.mov
How to test
Go to Cases > Settings
Add a template
Click on edit template icon
Update the fields
Click save
Click on delete template icon
Click on confirm modal
Click save
Scenarios:
Flaky Test here
Checklist