-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Renaming comment type #156086
Changes from 3 commits
de5a659
15ac201
d271d41
f340554
82e6df2
9d018cf
3466893
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,7 +185,7 @@ export const CommentRequestRt = rt.union([ | |
PersistableStateAttachmentRt, | ||
]); | ||
|
||
export const CommentResponseRt = rt.intersection([ | ||
export const CommentRt = rt.intersection([ | ||
CommentAttributesRt, | ||
rt.type({ | ||
id: rt.string, | ||
|
@@ -233,7 +233,7 @@ export const CommentResponseTypePersistableStateRt = rt.intersection([ | |
}), | ||
]); | ||
|
||
export const AllCommentsResponseRT = rt.array(CommentResponseRt); | ||
export const AllCommentsResponseRT = rt.array(CommentRt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this seems like a duplicate of |
||
|
||
export const CommentPatchRequestRt = rt.intersection([ | ||
/** | ||
|
@@ -266,14 +266,14 @@ export const CommentPatchAttributesRt = rt.intersection([ | |
rt.partial(CommentAttributesBasicRt.props), | ||
]); | ||
|
||
export const CommentsResponseRt = rt.type({ | ||
comments: rt.array(CommentResponseRt), | ||
export const CommentsRt = rt.type({ | ||
comments: rt.array(CommentRt), | ||
page: rt.number, | ||
per_page: rt.number, | ||
total: rt.number, | ||
}); | ||
|
||
export const AllCommentsResponseRt = rt.array(CommentResponseRt); | ||
export const AllCommentsResponseRt = rt.array(CommentRt); | ||
|
||
export const FindQueryParamsRt = rt.partial({ | ||
...SavedObjectFindOptionsRt.props, | ||
|
@@ -314,7 +314,7 @@ export type CommentAttributesNoSO = rt.TypeOf<typeof CommentAttributesNoSORt>; | |
export type CommentAttributesWithoutRefs = rt.TypeOf<typeof CommentAttributesWithoutRefsRt>; | ||
export type CommentRequest = rt.TypeOf<typeof CommentRequestRt>; | ||
export type BulkCreateCommentRequest = rt.TypeOf<typeof BulkCreateCommentRequestRt>; | ||
export type CommentResponse = rt.TypeOf<typeof CommentResponseRt>; | ||
export type Comment = rt.TypeOf<typeof CommentRt>; | ||
export type CommentResponseUserType = rt.TypeOf<typeof CommentResponseTypeUserRt>; | ||
export type CommentResponseAlertsType = rt.TypeOf<typeof CommentResponseTypeAlertsRt>; | ||
export type CommentResponseTypePersistableState = rt.TypeOf< | ||
|
@@ -325,7 +325,7 @@ export type CommentResponseExternalReferenceType = rt.TypeOf< | |
>; | ||
export type CommentResponseActionsType = rt.TypeOf<typeof CommentResponseTypeActionsRt>; | ||
export type AllCommentsResponse = rt.TypeOf<typeof AllCommentsResponseRt>; | ||
export type CommentsResponse = rt.TypeOf<typeof CommentsResponseRt>; | ||
export type Comments = rt.TypeOf<typeof CommentsRt>; | ||
export type CommentPatchRequest = rt.TypeOf<typeof CommentPatchRequestRt>; | ||
export type CommentPatchAttributes = rt.TypeOf<typeof CommentPatchAttributesRt>; | ||
export type CommentRequestUserType = rt.TypeOf<typeof ContextTypeUserRt>; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import type { | |
CaseUI, | ||
CasesStatus, | ||
CaseUserActions, | ||
Comment, | ||
CommentUI, | ||
} from './types'; | ||
|
||
import type { | ||
|
@@ -35,7 +35,7 @@ import type { | |
CasesStatusResponse, | ||
CaseUserActionResponse, | ||
CaseUserActionsResponse, | ||
CommentResponse, | ||
Comment, | ||
UserAction, | ||
UserActionTypes, | ||
UserActionWithResponse, | ||
|
@@ -80,7 +80,7 @@ export const elasticUser = { | |
|
||
export const tags: string[] = ['coke', 'pepsi']; | ||
|
||
export const basicComment: Comment = { | ||
export const basicComment: CommentUI = { | ||
comment: 'Solve this fast!', | ||
type: CommentType.user, | ||
id: basicCommentId, | ||
|
@@ -132,7 +132,7 @@ export const alertCommentWithIndices: AlertComment = { | |
version: 'WzQ3LDFc', | ||
}; | ||
|
||
export const hostIsolationComment = (overrides?: Record<string, unknown>): Comment => { | ||
export const hostIsolationComment = (overrides?: Record<string, unknown>): CommentUI => { | ||
return { | ||
type: CommentType.actions, | ||
comment: 'I just isolated the host!', | ||
|
@@ -158,7 +158,7 @@ export const hostIsolationComment = (overrides?: Record<string, unknown>): Comme | |
}; | ||
}; | ||
|
||
export const hostReleaseComment: () => Comment = () => { | ||
export const hostReleaseComment: () => CommentUI = () => { | ||
return { | ||
type: CommentType.actions, | ||
comment: 'I just released the host!', | ||
|
@@ -370,7 +370,7 @@ export const basicCasePost: CaseUI = { | |
updatedBy: null, | ||
}; | ||
|
||
export const basicCommentPatch: Comment = { | ||
export const basicCommentPatch: CommentUI = { | ||
...basicComment, | ||
updatedAt: basicUpdatedAt, | ||
updatedBy: { | ||
|
@@ -476,7 +476,7 @@ export const elasticUserSnake = { | |
email: '[email protected]', | ||
}; | ||
|
||
export const basicCommentSnake: CommentResponse = { | ||
export const basicCommentSnake: Comment = { | ||
comment: 'Solve this fast!', | ||
type: CommentType.user, | ||
id: basicCommentId, | ||
|
@@ -490,7 +490,7 @@ export const basicCommentSnake: CommentResponse = { | |
version: 'WzQ3LDFc', | ||
}; | ||
|
||
export const externalReferenceAttachmentSnake: CommentResponse = { | ||
export const externalReferenceAttachmentSnake: Comment = { | ||
type: CommentType.externalReference, | ||
id: 'external-reference-comment-id', | ||
externalReferenceId: 'my-id', | ||
|
@@ -507,7 +507,7 @@ export const externalReferenceAttachmentSnake: CommentResponse = { | |
version: 'WzQ3LDFc', | ||
}; | ||
|
||
export const persistableStateAttachmentSnake: CommentResponse = { | ||
export const persistableStateAttachmentSnake: Comment = { | ||
type: CommentType.persistableState, | ||
id: 'persistable-state-comment-id', | ||
persistableStateAttachmentState: { test_foo: 'foo' }, | ||
|
There was a problem hiding this comment.
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 🙂.There was a problem hiding this comment.
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.