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 user action type #156113

Merged

Conversation

jonathan-buttner
Copy link
Contributor

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

This PR creates a proper UserAction type and various attributes types to be used in the service layer of the backend.

There shouldn't be any functionality changes here just type name changes.

@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:57
@jonathan-buttner jonathan-buttner requested a review from a team as a code owner May 1, 2023 20:57
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

export type CaseUserActionsDeprecatedResponse = rt.TypeOf<
typeof CaseUserActionsDeprecatedResponseRt
>;
export type CaseUserActionDeprecatedResponse = rt.TypeOf<typeof CaseUserActionDeprecatedResponseRt>;
export type CaseUserActionInjectedAttributes = rt.TypeOf<typeof CaseUserActionInjectedAttributesRt>;
export type UserActionAttributesWithInjectedId = rt.TypeOf<
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should rename it to UserActionAttributes as we did with CaseAttributes.

@@ -120,7 +120,7 @@ describe('lifespan', () => {
[
{
attributes: { payload: { hello: 1, status: CaseStatuses.closed }, type: 'status' },
} as unknown as SavedObject<CaseUserActionInjectedAttributes>,
} as unknown as SavedObject<UserActionAttributesWithInjectedId>,
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.

Maybe we can create a type export type UserActionSavedObjectTransformed = SavedObject<UserActionTransformedAttributes>;.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to leave these as is for now since they're in the client.

@@ -138,7 +138,7 @@ export function getStatusInfo(
}

function isValidStatusChangeUserAction(
attributes: CaseUserActionInjectedAttributes,
attributes: UserActionAttributesWithInjectedId,
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 we should use UserActionTransformedAttributes.

Copy link
Contributor Author

@jonathan-buttner jonathan-buttner May 2, 2023

Choose a reason for hiding this comment

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

We talked about this offline, this will be UserActionAttributes

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 479 482 +3
total +5

History

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

@jonathan-buttner jonathan-buttner merged commit f0b75b3 into elastic:main May 2, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 2, 2023
@jonathan-buttner jonathan-buttner deleted the cases-ua-type-rename branch May 2, 2023 20:02
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