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] Custom fields MVP #167016

Merged
merged 50 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2d2cf07
Cases mapping changes.
adcoelho Aug 21, 2023
6cd8969
Merge remote-tracking branch 'upstream/main' into cases-custom-fields…
adcoelho Aug 23, 2023
a410657
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Aug 23, 2023
e792a0f
Merge remote-tracking branch 'upstream/main' into cases-custom-fields…
adcoelho Sep 5, 2023
a5eaad9
[Cases] Custom fields types (#165671)
adcoelho Sep 12, 2023
f204d72
[Cases] Custom Fields API documentation (#166353)
adcoelho Sep 14, 2023
e933759
[Cases] Add customFields to cases configuration (#166439)
adcoelho Sep 18, 2023
d1debc5
[Cases] added UI to add custom field on configuration page (text and …
js-jankisalvi Sep 20, 2023
2d06aee
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 20, 2023
7d6d1a2
Merge branch 'cases-custom-fields-feature-branch' of github.com:elast…
cnasikas Sep 20, 2023
92e9406
[Cases] Model version the Cases SO for custom fields (#166940)
cnasikas Sep 21, 2023
62d71d4
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 22, 2023
2e1d3e3
[Cases] Edit custom fields in the case view page (#166815)
cnasikas Sep 22, 2023
2ca044e
[Cases] Backend validation custom fields (#166962)
adcoelho Sep 22, 2023
04fc134
Merge branch 'main' into cases-custom-fields-feature-branch
js-jankisalvi Sep 22, 2023
661a856
[Cases] Validate length of text custom fields. (#167029)
adcoelho Sep 22, 2023
90f1613
[Cases] Validate custom field keys (#166975)
adcoelho Sep 25, 2023
e5cd8ed
[Cases] Adds the experimental badge to custom fields (#167105)
cnasikas Sep 25, 2023
fc26d2c
[Cases] Create case form with custom fields (#166969)
js-jankisalvi Sep 25, 2023
29d4b9a
[Cases] Limit number of custom fields in UI (#167047)
js-jankisalvi Sep 25, 2023
71b177f
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 25, 2023
7307c06
[Cases] Required custom fields in the create case API (#167131)
adcoelho Sep 25, 2023
608038d
[Cases] Delete custom field (#167167)
js-jankisalvi Sep 26, 2023
122a80e
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 26, 2023
f4eb0fd
[Cases] Validate types custom fields (#167166)
adcoelho Sep 26, 2023
445dae3
[Cases] Custom fields user actions (#167144)
cnasikas Sep 27, 2023
34d1978
[Cases] Edit custom field configuration (#167386)
js-jankisalvi Sep 28, 2023
3d90a5a
[Cases] Custom fields schema changes (#167310)
cnasikas Sep 28, 2023
83b313b
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 28, 2023
531c874
[Cases] Change max custom fields per case (#167481)
adcoelho Sep 28, 2023
6e783d5
[Cases] Prevent patching custom field types (#167495)
adcoelho Sep 28, 2023
31c21e1
[Cases] Settings UI License Limitations (#167398)
jcger Sep 29, 2023
24a4e4b
Merge branch 'main' into cases-custom-fields-feature-branch
cnasikas Sep 29, 2023
764bb51
Fix core test
cnasikas Sep 29, 2023
60cdab5
[Cases] Custom fields feature fix tests (#167472)
js-jankisalvi Sep 29, 2023
787c040
fix UI bugs
js-jankisalvi Sep 29, 2023
2531c5d
Merge branch 'cases-custom-fields-feature-branch' of https://github.c…
js-jankisalvi Sep 29, 2023
6ff9d7b
Fix test dependencies
cnasikas Sep 29, 2023
274f28d
Fix current_mappings.json
cnasikas Sep 29, 2023
98ca086
throw if request is sending an unknown custom field
jcger Sep 29, 2023
51d221e
helper function for custom field value conversion
js-jankisalvi Sep 29, 2023
99fe2a1
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Sep 29, 2023
26e1984
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Sep 30, 2023
e0ed5fb
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Oct 1, 2023
af0df9e
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Oct 2, 2023
d1c8bb8
remove notRegisteredCustomFields - duplicated
jcger Oct 2, 2023
0447625
Fix cypress cases connectors tests
cnasikas Oct 2, 2023
4f164aa
Merge branch 'cases-custom-fields-feature-branch' of github.com:elast…
cnasikas Oct 2, 2023
c56cc31
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Oct 2, 2023
4122735
Merge branch 'main' into cases-custom-fields-feature-branch
kibanamachine Oct 2, 2023
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
35 changes: 35 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,41 @@
},
"category": {
"type": "keyword"
},
"customFields": {
"type": "nested",
"properties": {
"key": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"value": {
"type": "keyword",
"fields": {
"number": {
"type": "long",
"ignore_malformed": true
},
"boolean": {
"type": "boolean",
"ignore_malformed": true
},
"string": {
"type": "text"
},
"date": {
"type": "date",
"ignore_malformed": true
},
"ip": {
"type": "ip",
"ignore_malformed": true
}
}
}
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"canvas-element": "cdedc2123eb8a1506b87a56b0bcce60f4ec08bc8",
"canvas-workpad": "9d82aafb19586b119e5c9382f938abe28c26ca5c",
"canvas-workpad-template": "c077b0087346776bb3542b51e1385d172cb24179",
"cases": "b43a8ce985c406167e1d115381805a48cb3b0e61",
"cases": "2392189ed338857d4815a4cef6051f9ad124d39d",
"cases-comments": "5cb0a421588831c2a950e50f486048b8aabbae25",
"cases-configure": "44ed7b8e0f44df39516b8870589b89e32224d2bf",
"cases-connector-mappings": "f9d1ac57e484e69506c36a8051e4d61f4a8cfd25",
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugins/cases/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ export const MAX_CASES_TO_UPDATE = 100 as const;
export const MAX_BULK_CREATE_ATTACHMENTS = 100 as const;
export const MAX_USER_ACTIONS_PER_CASE = 10000 as const;
export const MAX_PERSISTABLE_STATE_AND_EXTERNAL_REFERENCES = 100 as const;
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_CUSTOM_FIELD_TEXT_VALUE_ITEMS = 10 as const;

/**
* Cases features
Expand Down
23 changes: 23 additions & 0 deletions x-pack/plugins/cases/common/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,26 @@ export const limitedNumberSchema = ({ fieldName, min, max }: LimitedSchemaType)
}),
rt.identity
);

export interface RegexStringSchemaType {
codec: rt.Type<string, string, unknown>;
pattern: string;
message: string;
}

export const regexStringRt = ({ codec, pattern, message }: RegexStringSchemaType) =>
new rt.Type<string, string, unknown>(
'RegexString',
codec.is,
(input, context) =>
either.chain(codec.validate(input, context), (value) => {
const regex = new RegExp(pattern, 'g');

if (!regex.test(value)) {
return rt.failure(input, context, message);
}

return rt.success(value);
}),
rt.identity
);
Loading
Loading