Skip to content

Commit bb7ec0b

Browse files
committed
Merge branch 'case-siem-ui-v2' of github.com:stephmilovic/kibana into case-siem-ui-v2
2 parents 21dfccc + 4de5297 commit bb7ec0b

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

x-pack/legacy/plugins/siem/public/containers/case/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export interface NewCase extends FormData {
1919
export interface Case {
2020
case_id: string;
2121
case_type: string;
22-
created_at: number;
22+
created_at: string;
2323
created_by: ElasticUser;
2424
description: string;
2525
state: string;
2626
tags: string[];
2727
title: string;
28-
updated_at: number;
28+
updated_at: string;
2929
}
3030

3131
export interface QueryParams {

x-pack/legacy/plugins/siem/public/containers/case/use_get_case.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ const dataFetchReducer = (state: CaseState, action: Action): CaseState => {
5252
const initialData: Case = {
5353
case_id: '',
5454
case_type: '',
55-
created_at: 0,
55+
created_at: '',
5656
created_by: {
5757
username: '',
5858
},
5959
description: '',
6060
state: '',
6161
tags: [],
6262
title: '',
63-
updated_at: 0,
63+
updated_at: '',
6464
};
6565

6666
export const useGetCase = (caseId: string): [CaseState] => {

x-pack/plugins/case/server/routes/api/__fixtures__/mock_saved_objects.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const mockCases = [
99
type: 'case-workflow',
1010
id: 'mock-id-1',
1111
attributes: {
12-
created_at: 1574718888885,
12+
created_at: '2019-11-25T21:54:48.952Z',
1313
created_by: {
1414
full_name: null,
1515
username: 'elastic',
@@ -19,7 +19,7 @@ export const mockCases = [
1919
state: 'open',
2020
tags: ['defacement'],
2121
case_type: 'security',
22-
updated_at: 1574718888885,
22+
updated_at: '2019-11-25T21:54:48.952Z',
2323
},
2424
references: [],
2525
updated_at: '2019-11-25T21:54:48.952Z',
@@ -29,7 +29,7 @@ export const mockCases = [
2929
type: 'case-workflow',
3030
id: 'mock-id-2',
3131
attributes: {
32-
created_at: 1574721120834,
32+
created_at: '2019-11-25T22:32:00.900Z',
3333
created_by: {
3434
full_name: null,
3535
username: 'elastic',
@@ -39,7 +39,7 @@ export const mockCases = [
3939
state: 'open',
4040
tags: ['Data Destruction'],
4141
case_type: 'security',
42-
updated_at: 1574721130834,
42+
updated_at: '2019-11-25T22:32:00.900Z',
4343
},
4444
references: [],
4545
updated_at: '2019-11-25T22:32:00.900Z',
@@ -49,7 +49,7 @@ export const mockCases = [
4949
type: 'case-workflow',
5050
id: 'mock-id-3',
5151
attributes: {
52-
created_at: 1574721137881,
52+
created_at: '2019-11-25T22:32:17.947Z',
5353
created_by: {
5454
full_name: null,
5555
username: 'elastic',
@@ -59,7 +59,7 @@ export const mockCases = [
5959
state: 'open',
6060
tags: ['LOLBins'],
6161
case_type: 'security',
62-
updated_at: 1574721147881,
62+
updated_at: '2019-11-25T22:32:17.947Z',
6363
},
6464
references: [],
6565
updated_at: '2019-11-25T22:32:17.947Z',
@@ -82,12 +82,12 @@ export const mockCaseComments = [
8282
id: 'mock-comment-1',
8383
attributes: {
8484
comment: 'Wow, good luck catching that bad meanie!',
85-
created_at: 1574718900112,
85+
created_at: '2019-11-25T21:55:00.177Z',
8686
created_by: {
8787
full_name: 'elastic',
8888
username: 'elastic',
8989
},
90-
updated_at: 1574718900112,
90+
updated_at: '2019-11-25T21:55:00.177Z',
9191
},
9292
references: [
9393
{
@@ -104,12 +104,12 @@ export const mockCaseComments = [
104104
id: 'mock-comment-2',
105105
attributes: {
106106
comment: 'Well I decided to update my comment. So what? Deal with it.',
107-
created_at: 1574718902724,
107+
created_at: '2019-11-25T21:55:14.633Z',
108108
created_by: {
109109
full_name: 'elastic',
110110
username: 'elastic',
111111
},
112-
updated_at: 1574718902724,
112+
updated_at: '2019-11-25T21:55:14.633Z',
113113
},
114114
references: [
115115
{
@@ -126,12 +126,12 @@ export const mockCaseComments = [
126126
id: 'mock-comment-3',
127127
attributes: {
128128
comment: 'Wow, good luck catching that bad meanie!',
129-
created_at: 1574721150542,
129+
created_at: '2019-11-25T22:32:30.608Z',
130130
created_by: {
131131
full_name: 'elastic',
132132
username: 'elastic',
133133
},
134-
updated_at: 1574721150542,
134+
updated_at: '2019-11-25T22:32:30.608Z',
135135
},
136136
references: [
137137
{

x-pack/plugins/case/server/routes/api/schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export const NewCommentSchema = schema.object({
1717

1818
export const CommentSchema = schema.object({
1919
comment: schema.string(),
20-
created_at: schema.number(),
20+
created_at: schema.string(),
2121
created_by: UserSchema,
22-
updated_at: schema.number(),
22+
updated_at: schema.string(),
2323
});
2424

2525
export const UpdatedCommentSchema = schema.object({
2626
comment: schema.string(),
27-
updated_at: schema.number(),
27+
updated_at: schema.string(),
2828
});
2929

3030
export const NewCaseSchema = schema.object({

x-pack/plugins/case/server/routes/api/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export type UpdatedCommentType = TypeOf<typeof UpdatedCommentSchema>;
2525
export type UserType = TypeOf<typeof UserSchema>;
2626

2727
export interface CaseAttributes extends NewCaseType, SavedObjectAttributes {
28-
created_at: number;
28+
created_at: string;
2929
created_by: UserType;
30-
updated_at: number;
30+
updated_at: string;
3131
}
3232

3333
export type FlattenedCaseSavedObject = CaseAttributes & {
@@ -68,5 +68,5 @@ export interface UpdatedCaseType {
6868
state?: UpdatedCaseTyped['state'];
6969
tags?: UpdatedCaseTyped['tags'];
7070
title?: UpdatedCaseTyped['title'];
71-
updated_at: number;
71+
updated_at: string;
7272
}

x-pack/plugins/case/server/routes/api/update_case.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function initUpdateCaseApi({ caseService, router }: RouteDeps) {
2727
caseId: request.params.id,
2828
updatedAttributes: {
2929
...request.body,
30-
updated_at: new Date().valueOf(),
30+
updated_at: new Date().toISOString(),
3131
},
3232
});
3333
return response.ok({ body: updatedCase.attributes });

x-pack/plugins/case/server/routes/api/update_comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function initUpdateCommentApi({ caseService, router }: RouteDeps) {
2727
commentId: request.params.id,
2828
updatedAttributes: {
2929
...request.body,
30-
updated_at: new Date().valueOf(),
30+
updated_at: new Date().toISOString(),
3131
},
3232
});
3333
return response.ok({ body: updatedComment.attributes });

x-pack/plugins/case/server/routes/api/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export const formatNewCase = (
2727
newCase: NewCaseType,
2828
{ full_name, username }: { full_name?: string; username: string }
2929
): CaseAttributes => ({
30-
created_at: new Date().valueOf(),
30+
created_at: new Date().toISOString(),
3131
created_by: { full_name, username },
32-
updated_at: new Date().valueOf(),
32+
updated_at: new Date().toISOString(),
3333
...newCase,
3434
});
3535

@@ -44,9 +44,9 @@ export const formatNewComment = ({
4444
username,
4545
}: NewCommentArgs): CommentAttributes => ({
4646
...newComment,
47-
created_at: new Date().valueOf(),
47+
created_at: new Date().toISOString(),
4848
created_by: { full_name, username },
49-
updated_at: new Date().valueOf(),
49+
updated_at: new Date().toISOString(),
5050
});
5151

5252
export function wrapError(error: any): CustomHttpResponseOptions<ResponseError> {

0 commit comments

Comments
 (0)