mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] [Exceptions] Fix edit the exception while adding new comment. (#145575)](https://github.com/elastic/kibana/pull/145575) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Wafaa Nasr","email":"wafaa.nasr@elastic.co"},"sourceCommit":{"committedDate":"2022-11-18T13:35:03Z","message":"[Security Solution] [Exceptions] Fix edit the exception while adding new comment. (#145575)\n\n## Summary\r\n\r\nAddress https://github.com/elastic/kibana/issues/144523\r\n\r\n1. Fix type schema check to use `updateExceptionListItemSchema` instead\r\nof `exceptionListItemSchema` as the comments array could be empty when\r\nthe user adds the Exceptions and in Editing with adding a new comment(s)\r\nit will contain only (comment and id) in the newly created comment\r\n\r\n2. Add `removeCreatedAtCreatedByFromCommentsOnUpdate` to remove the\r\n`createdAt`, and `createdBy` from the updated exception Item if a\r\ncomment was added before to fix the `400 Schema validations` as per the\r\nbelow Schema\r\n\r\nThe\r\n`packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts`\r\n \r\n ```\r\n export const updateComment = t.intersection([\r\n t.exact(\r\n t.type({\r\n comment: NonEmptyString,\r\n })\r\n ),\r\n t.exact(\r\n t.partial({\r\n id,\r\n })\r\n ),\r\n ]);\r\n ```\r\n3. Moving tests and mocks to the `hooks` package as well add new tests\r\nfor the new `removeCreatedAtCreatedByFromCommentsOnUpdate`\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"2bd2226cb259312b90ad32b1cd5618a0cc2e8b49","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: SecuritySolution","Team:Security Solution Platform","v8.6.0","v8.7.0"],"number":145575,"url":"https://github.com/elastic/kibana/pull/145575","mergeCommit":{"message":"[Security Solution] [Exceptions] Fix edit the exception while adding new comment. (#145575)\n\n## Summary\r\n\r\nAddress https://github.com/elastic/kibana/issues/144523\r\n\r\n1. Fix type schema check to use `updateExceptionListItemSchema` instead\r\nof `exceptionListItemSchema` as the comments array could be empty when\r\nthe user adds the Exceptions and in Editing with adding a new comment(s)\r\nit will contain only (comment and id) in the newly created comment\r\n\r\n2. Add `removeCreatedAtCreatedByFromCommentsOnUpdate` to remove the\r\n`createdAt`, and `createdBy` from the updated exception Item if a\r\ncomment was added before to fix the `400 Schema validations` as per the\r\nbelow Schema\r\n\r\nThe\r\n`packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts`\r\n \r\n ```\r\n export const updateComment = t.intersection([\r\n t.exact(\r\n t.type({\r\n comment: NonEmptyString,\r\n })\r\n ),\r\n t.exact(\r\n t.partial({\r\n id,\r\n })\r\n ),\r\n ]);\r\n ```\r\n3. Moving tests and mocks to the `hooks` package as well add new tests\r\nfor the new `removeCreatedAtCreatedByFromCommentsOnUpdate`\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"2bd2226cb259312b90ad32b1cd5618a0cc2e8b49"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145575","number":145575,"mergeCommit":{"message":"[Security Solution] [Exceptions] Fix edit the exception while adding new comment. (#145575)\n\n## Summary\r\n\r\nAddress https://github.com/elastic/kibana/issues/144523\r\n\r\n1. Fix type schema check to use `updateExceptionListItemSchema` instead\r\nof `exceptionListItemSchema` as the comments array could be empty when\r\nthe user adds the Exceptions and in Editing with adding a new comment(s)\r\nit will contain only (comment and id) in the newly created comment\r\n\r\n2. Add `removeCreatedAtCreatedByFromCommentsOnUpdate` to remove the\r\n`createdAt`, and `createdBy` from the updated exception Item if a\r\ncomment was added before to fix the `400 Schema validations` as per the\r\nbelow Schema\r\n\r\nThe\r\n`packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts`\r\n \r\n ```\r\n export const updateComment = t.intersection([\r\n t.exact(\r\n t.type({\r\n comment: NonEmptyString,\r\n })\r\n ),\r\n t.exact(\r\n t.partial({\r\n id,\r\n })\r\n ),\r\n ]);\r\n ```\r\n3. Moving tests and mocks to the `hooks` package as well add new tests\r\nfor the new `removeCreatedAtCreatedByFromCommentsOnUpdate`\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"2bd2226cb259312b90ad32b1cd5618a0cc2e8b49"}}]}] BACKPORT--> Co-authored-by: Wafaa Nasr <wafaa.nasr@elastic.co> |
||
---|---|---|
.. | ||
src | ||
BUILD.bazel | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
kbn-securitysolution-list-hooks
This is where shared constants for security solution should go that are going to be shared among plugins. This was originally created to remove the dependencies between security_solution and other projects such as lists.