Skip to content

Commit

Permalink
Merge branch 'case-siem-ui-v2' of github.com:stephmilovic/kibana into…
Browse files Browse the repository at this point in the history
… case-siem-ui-v2
  • Loading branch information
stephmilovic committed Feb 13, 2020
2 parents 21dfccc + 4de5297 commit bb7ec0b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/siem/public/containers/case/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export interface NewCase extends FormData {
export interface Case {
case_id: string;
case_type: string;
created_at: number;
created_at: string;
created_by: ElasticUser;
description: string;
state: string;
tags: string[];
title: string;
updated_at: number;
updated_at: string;
}

export interface QueryParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ const dataFetchReducer = (state: CaseState, action: Action): CaseState => {
const initialData: Case = {
case_id: '',
case_type: '',
created_at: 0,
created_at: '',
created_by: {
username: '',
},
description: '',
state: '',
tags: [],
title: '',
updated_at: 0,
updated_at: '',
};

export const useGetCase = (caseId: string): [CaseState] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const mockCases = [
type: 'case-workflow',
id: 'mock-id-1',
attributes: {
created_at: 1574718888885,
created_at: '2019-11-25T21:54:48.952Z',
created_by: {
full_name: null,
username: 'elastic',
Expand All @@ -19,7 +19,7 @@ export const mockCases = [
state: 'open',
tags: ['defacement'],
case_type: 'security',
updated_at: 1574718888885,
updated_at: '2019-11-25T21:54:48.952Z',
},
references: [],
updated_at: '2019-11-25T21:54:48.952Z',
Expand All @@ -29,7 +29,7 @@ export const mockCases = [
type: 'case-workflow',
id: 'mock-id-2',
attributes: {
created_at: 1574721120834,
created_at: '2019-11-25T22:32:00.900Z',
created_by: {
full_name: null,
username: 'elastic',
Expand All @@ -39,7 +39,7 @@ export const mockCases = [
state: 'open',
tags: ['Data Destruction'],
case_type: 'security',
updated_at: 1574721130834,
updated_at: '2019-11-25T22:32:00.900Z',
},
references: [],
updated_at: '2019-11-25T22:32:00.900Z',
Expand All @@ -49,7 +49,7 @@ export const mockCases = [
type: 'case-workflow',
id: 'mock-id-3',
attributes: {
created_at: 1574721137881,
created_at: '2019-11-25T22:32:17.947Z',
created_by: {
full_name: null,
username: 'elastic',
Expand All @@ -59,7 +59,7 @@ export const mockCases = [
state: 'open',
tags: ['LOLBins'],
case_type: 'security',
updated_at: 1574721147881,
updated_at: '2019-11-25T22:32:17.947Z',
},
references: [],
updated_at: '2019-11-25T22:32:17.947Z',
Expand All @@ -82,12 +82,12 @@ export const mockCaseComments = [
id: 'mock-comment-1',
attributes: {
comment: 'Wow, good luck catching that bad meanie!',
created_at: 1574718900112,
created_at: '2019-11-25T21:55:00.177Z',
created_by: {
full_name: 'elastic',
username: 'elastic',
},
updated_at: 1574718900112,
updated_at: '2019-11-25T21:55:00.177Z',
},
references: [
{
Expand All @@ -104,12 +104,12 @@ export const mockCaseComments = [
id: 'mock-comment-2',
attributes: {
comment: 'Well I decided to update my comment. So what? Deal with it.',
created_at: 1574718902724,
created_at: '2019-11-25T21:55:14.633Z',
created_by: {
full_name: 'elastic',
username: 'elastic',
},
updated_at: 1574718902724,
updated_at: '2019-11-25T21:55:14.633Z',
},
references: [
{
Expand All @@ -126,12 +126,12 @@ export const mockCaseComments = [
id: 'mock-comment-3',
attributes: {
comment: 'Wow, good luck catching that bad meanie!',
created_at: 1574721150542,
created_at: '2019-11-25T22:32:30.608Z',
created_by: {
full_name: 'elastic',
username: 'elastic',
},
updated_at: 1574721150542,
updated_at: '2019-11-25T22:32:30.608Z',
},
references: [
{
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/case/server/routes/api/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export const NewCommentSchema = schema.object({

export const CommentSchema = schema.object({
comment: schema.string(),
created_at: schema.number(),
created_at: schema.string(),
created_by: UserSchema,
updated_at: schema.number(),
updated_at: schema.string(),
});

export const UpdatedCommentSchema = schema.object({
comment: schema.string(),
updated_at: schema.number(),
updated_at: schema.string(),
});

export const NewCaseSchema = schema.object({
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/case/server/routes/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export type UpdatedCommentType = TypeOf<typeof UpdatedCommentSchema>;
export type UserType = TypeOf<typeof UserSchema>;

export interface CaseAttributes extends NewCaseType, SavedObjectAttributes {
created_at: number;
created_at: string;
created_by: UserType;
updated_at: number;
updated_at: string;
}

export type FlattenedCaseSavedObject = CaseAttributes & {
Expand Down Expand Up @@ -68,5 +68,5 @@ export interface UpdatedCaseType {
state?: UpdatedCaseTyped['state'];
tags?: UpdatedCaseTyped['tags'];
title?: UpdatedCaseTyped['title'];
updated_at: number;
updated_at: string;
}
2 changes: 1 addition & 1 deletion x-pack/plugins/case/server/routes/api/update_case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function initUpdateCaseApi({ caseService, router }: RouteDeps) {
caseId: request.params.id,
updatedAttributes: {
...request.body,
updated_at: new Date().valueOf(),
updated_at: new Date().toISOString(),
},
});
return response.ok({ body: updatedCase.attributes });
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/case/server/routes/api/update_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function initUpdateCommentApi({ caseService, router }: RouteDeps) {
commentId: request.params.id,
updatedAttributes: {
...request.body,
updated_at: new Date().valueOf(),
updated_at: new Date().toISOString(),
},
});
return response.ok({ body: updatedComment.attributes });
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/case/server/routes/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const formatNewCase = (
newCase: NewCaseType,
{ full_name, username }: { full_name?: string; username: string }
): CaseAttributes => ({
created_at: new Date().valueOf(),
created_at: new Date().toISOString(),
created_by: { full_name, username },
updated_at: new Date().valueOf(),
updated_at: new Date().toISOString(),
...newCase,
});

Expand All @@ -44,9 +44,9 @@ export const formatNewComment = ({
username,
}: NewCommentArgs): CommentAttributes => ({
...newComment,
created_at: new Date().valueOf(),
created_at: new Date().toISOString(),
created_by: { full_name, username },
updated_at: new Date().valueOf(),
updated_at: new Date().toISOString(),
});

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

0 comments on commit bb7ec0b

Please sign in to comment.