Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Renaming comment type #156086

Merged

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Apr 27, 2023

This PR:

  • Renames CommentResponseRt to CommentRt
  • Create CommentUI for the UI based on the snake to camel case version of Comment
  • Introduces a AttachmentTransformedAttributes type that should be used when returning CommentAttributes from the service layer

@jonathan-buttner jonathan-buttner added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.9.0 labels Apr 27, 2023
@jonathan-buttner jonathan-buttner marked this pull request as ready for review May 1, 2023 20:08
@jonathan-buttner jonathan-buttner requested a review from a team as a code owner May 1, 2023 20:08
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@@ -233,7 +233,7 @@ export const CommentResponseTypePersistableStateRt = rt.intersection([
}),
]);

export const AllCommentsResponseRT = rt.array(CommentResponseRt);
export const AllCommentsResponseRT = rt.array(CommentRt);
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be CommentsRt and the CommentsRt should be CommentsFindResponseRt. We can do it on another PR as we have the same issue for Cases.

Copy link
Member

@cnasikas cnasikas May 2, 2023

Choose a reason for hiding this comment

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

Also, this seems like a duplicate of AllCommentsResponseRt. They differ in the last letter (capital T).

@@ -185,7 +185,7 @@ export const CommentRequestRt = rt.union([
PersistableStateAttachmentRt,
]);

export const CommentResponseRt = rt.intersection([
export const CommentRt = rt.intersection([
Copy link
Member

Choose a reason for hiding this comment

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

Should we use the new terminology and rename it to AttachmentRt? I am not sure 🙂.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea, we'll do those renames on a separate PR.

@@ -142,14 +142,14 @@ export const transformComments = (

export const flattenCommentSavedObjects = (
savedObjects: Array<SavedObject<CommentAttributes>>
Copy link
Member

Choose a reason for hiding this comment

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

We can create the type type CommentSavedObjectTransformed = SavedObject<AttachmentTransformedAttributes> and use it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These utilities are used by the client, I'll create the type you recommended and use it within the service layer 👍

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 166.4KB 166.4KB -11.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 398 401 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 478 481 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jonathan-buttner jonathan-buttner merged commit b80b4c2 into elastic:main May 3, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 3, 2023
@jonathan-buttner jonathan-buttner deleted the cases-attachment-type-rename branch May 3, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants