Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b8293c3
[Cases] Case templates configure api (#183231)
js-jankisalvi May 14, 2024
6322b02
Merge remote-tracking branch 'upstream' into feat/case_templates
js-jankisalvi May 16, 2024
5eb9e81
Merge remote-tracking branch 'upstream/main' into feat/case_templates
js-jankisalvi May 21, 2024
b7fec99
[ResponseOps][Cases] Add tags to template in configure api (#183743)
js-jankisalvi May 21, 2024
46d2bd8
Merge remote-tracking branch 'upstream/main' into feat/case_templates
js-jankisalvi May 30, 2024
5986cc9
Merge remote-tracking branch 'upstream/main' into feat/case_templates
js-jankisalvi Jun 7, 2024
c511009
[ResponseOps][Cases] Allow users to create templates (#184104)
js-jankisalvi Jun 7, 2024
7a86857
Merge branch 'main' into feat/case_templates
cnasikas Jun 10, 2024
f975c33
Merge branch 'main' into feat/case_templates
cnasikas Jun 17, 2024
c3b0759
[ResponseOps][Cases] Allow users to edit or delete template (#185877)
js-jankisalvi Jun 19, 2024
7e92302
Merge branch 'main' into feat/case_templates
cnasikas Jun 20, 2024
822d78c
[ResponseOps][Cases] Remove configuration's deleted custom field from…
js-jankisalvi Jun 25, 2024
eee6564
Merge branch 'main' into feat/case_templates
cnasikas Jun 27, 2024
9369d61
Merge branch 'main' into feat/case_templates
js-jankisalvi Jun 28, 2024
97dadf7
[Cases] Use templates when creating a case (#185880)
cnasikas Jun 28, 2024
9a8b629
Merge branch 'main' into feat/case_templates
js-jankisalvi Jun 28, 2024
db94f1c
add click outside input to fix tooltip blocking the searchbox
js-jankisalvi Jun 28, 2024
4632959
Merge branch 'main' into feat/case_templates
js-jankisalvi Jul 1, 2024
6319822
Fix tags style
js-jankisalvi Jul 1, 2024
daebf7f
Merge branch 'main' into feat/case_templates
js-jankisalvi Jul 1, 2024
5c9a65b
Merge branch 'main' into feat/case_templates
js-jankisalvi Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions x-pack/plugins/cases/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ export const MAX_CUSTOM_FIELDS_PER_CASE = 10 as const;
export const MAX_CUSTOM_FIELD_KEY_LENGTH = 36 as const; // uuidv4 length
export const MAX_CUSTOM_FIELD_LABEL_LENGTH = 50 as const;
export const MAX_CUSTOM_FIELD_TEXT_VALUE_LENGTH = 160 as const;
export const MAX_TEMPLATE_KEY_LENGTH = 36 as const; // uuidv4 length
export const MAX_TEMPLATE_NAME_LENGTH = 50 as const;
export const MAX_TEMPLATE_DESCRIPTION_LENGTH = 1000 as const;
export const MAX_TEMPLATES_LENGTH = 10 as const;
export const MAX_TEMPLATE_TAG_LENGTH = 50 as const;
export const MAX_TAGS_PER_TEMPLATE = 10 as const;

/**
* Cases features
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/common/constants/owners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export const OWNER_INFO: Record<Owner, RouteInfo> = {
[GENERAL_CASES_OWNER]: {
id: GENERAL_CASES_OWNER,
appId: 'management',
label: 'Stack',
iconType: 'casesApp',
label: 'Management',
iconType: 'managementApp',
appRoute: '/app/management/insightsAndAlerting',
validRuleConsumers: [AlertConsumers.ML, AlertConsumers.STACK_ALERTS, AlertConsumers.EXAMPLE],
},
Expand Down
141 changes: 76 additions & 65 deletions x-pack/plugins/cases/common/types/api/case/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,81 @@ export const CaseRequestCustomFieldsRt = limitedArraySchema({
max: MAX_CUSTOM_FIELDS_PER_CASE,
});

export const CaseBaseOptionalFieldsRequestRt = rt.exact(
rt.partial({
/**
* The description of the case
*/
description: limitedStringSchema({
fieldName: 'description',
min: 1,
max: MAX_DESCRIPTION_LENGTH,
}),
/**
* The identifying strings for filter a case
*/
tags: limitedArraySchema({
codec: limitedStringSchema({ fieldName: 'tag', min: 1, max: MAX_LENGTH_PER_TAG }),
min: 0,
max: MAX_TAGS_PER_CASE,
fieldName: 'tags',
}),
/**
* The title of a case
*/
title: limitedStringSchema({ fieldName: 'title', min: 1, max: MAX_TITLE_LENGTH }),
/**
* The external system that the case can be synced with
*/
connector: CaseConnectorRt,
/**
* The severity of the case
*/
severity: CaseSeverityRt,
/**
* The users assigned to this case
*/
assignees: limitedArraySchema({
codec: CaseUserProfileRt,
fieldName: 'assignees',
min: 0,
max: MAX_ASSIGNEES_PER_CASE,
}),
/**
* The category of the case.
*/
category: rt.union([
limitedStringSchema({ fieldName: 'category', min: 1, max: MAX_CATEGORY_LENGTH }),
rt.null,
]),
/**
* Custom fields of the case
*/
customFields: CaseRequestCustomFieldsRt,
/**
* The alert sync settings
*/
settings: CaseSettingsRt,
})
);

export const CaseRequestFieldsRt = rt.intersection([
CaseBaseOptionalFieldsRequestRt,
rt.exact(
rt.partial({
/**
* The current status of the case (open, closed, in-progress)
*/
status: CaseStatusRt,

/**
* The plugin owner of the case
*/
owner: rt.string,
})
),
]);

/**
* Create case
*/
Expand Down Expand Up @@ -356,71 +431,7 @@ export const CasesBulkGetResponseRt = rt.strict({
* Update cases
*/
export const CasePatchRequestRt = rt.intersection([
rt.exact(
rt.partial({
/**
* The description of the case
*/
description: limitedStringSchema({
fieldName: 'description',
min: 1,
max: MAX_DESCRIPTION_LENGTH,
}),
/**
* The current status of the case (open, closed, in-progress)
*/
status: CaseStatusRt,
/**
* The identifying strings for filter a case
*/
tags: limitedArraySchema({
codec: limitedStringSchema({ fieldName: 'tag', min: 1, max: MAX_LENGTH_PER_TAG }),
min: 0,
max: MAX_TAGS_PER_CASE,
fieldName: 'tags',
}),
/**
* The title of a case
*/
title: limitedStringSchema({ fieldName: 'title', min: 1, max: MAX_TITLE_LENGTH }),
/**
* The external system that the case can be synced with
*/
connector: CaseConnectorRt,
/**
* The alert sync settings
*/
settings: CaseSettingsRt,
/**
* The plugin owner of the case
*/
owner: rt.string,
/**
* The severity of the case
*/
severity: CaseSeverityRt,
/**
* The users assigned to this case
*/
assignees: limitedArraySchema({
codec: CaseUserProfileRt,
fieldName: 'assignees',
min: 0,
max: MAX_ASSIGNEES_PER_CASE,
}),
/**
* The category of the case.
*/
category: rt.union([
limitedStringSchema({ fieldName: 'category', min: 1, max: MAX_CATEGORY_LENGTH }),
rt.null,
]),
/**
* Custom fields of the case
*/
customFields: CaseRequestCustomFieldsRt,
})
),
CaseRequestFieldsRt,
/**
* The saved object ID and version
*/
Expand Down
Loading