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] Update custom field error toast message #175197

Conversation

adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Jan 22, 2024

Summary

Merging into a feature branch.

Custom field error messages in the case configuration page now list the custom field labels instead of keys.

The message was updated for the following errors:

  1. Custom field type error (trying to change a custom field type)
  2. Missing default value from required custom field
  3. Trying to define a default value for an optional custom field

Additionally, the error message for custom field type errors in the cases API was also updated.

This PR fixes a bug discussed in a previous comment.

For another PR, should we change the IDs in the toaster to the labels to make it easier to understand which field needs fixing?

Screenshot Screenshot 2024-01-22 at 12 03 30

@adcoelho adcoelho added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.13.0 labels Jan 22, 2024
@adcoelho adcoelho requested a review from a team as a code owner January 22, 2024 11:08
@adcoelho adcoelho self-assigned this Jan 22, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@adcoelho adcoelho force-pushed the error-toast-custom-field-label branch from 77512f4 to 22763ee Compare January 22, 2024 12:49
@kibana-ci
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [3c87fce]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @adcoelho

@adcoelho adcoelho merged commit b7aab12 into elastic:custom-fields-default-values Jan 23, 2024
18 of 19 checks passed
adcoelho added a commit that referenced this pull request Feb 6, 2024
Closes #171747

Fixes #174285
Fixes #174286
Fixes #174287
Fixes #174288
Fixes #174289

## Summary

This feature branch introduces default values to the custom fields in
Cases.

Changes:
- The case configuration API now supports defining default values **for
required custom fields**.
  - The default value field is optional.
  - The default value field must have the same type as the custom field.
- Default values for required custom fields can be configured in the
cases settings page.
- The Create and Update Case pages now prefill required custom fields
with their default value(if it exists).
- Create and Update case API
  - required custom field missing from the request:
- if the default value exists -> set the custom field to the default
value
- if the default value is missing from the configuration -> throws an
error
- creating required custom fields with `value: null` -> always throws an
error

### Previous PRs

#174043 #174845 #174628
#175197 #175978 #175795

## Testing

I'll leave here a couple of important use cases to test:

- Migration scenario
  1. Create **multiple** required custom fields in 8.12.
  2. Migrate to the feature branch (future 8.13).
3. Defining default values in the settings page should work as expected.

- Update case UI
  1. Create an optional custom field
  2. Create a case and leave the custom field empty
  3. Edit the custom field to now be required
  4. Go to the case detail page and edit the custom field
  5. Is the form populated automatically with the default value?

## Release notes

Required custom fields now support default values. These default values
will be used to populate automatically the custom fields if they are not
defined when creating and updating cases.

---------

Co-authored-by: Kibana Machine <[email protected]>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
Closes elastic#171747

Fixes elastic#174285
Fixes elastic#174286
Fixes elastic#174287
Fixes elastic#174288
Fixes elastic#174289

## Summary

This feature branch introduces default values to the custom fields in
Cases.

Changes:
- The case configuration API now supports defining default values **for
required custom fields**.
  - The default value field is optional.
  - The default value field must have the same type as the custom field.
- Default values for required custom fields can be configured in the
cases settings page.
- The Create and Update Case pages now prefill required custom fields
with their default value(if it exists).
- Create and Update case API
  - required custom field missing from the request:
- if the default value exists -> set the custom field to the default
value
- if the default value is missing from the configuration -> throws an
error
- creating required custom fields with `value: null` -> always throws an
error

### Previous PRs

elastic#174043 elastic#174845 elastic#174628
elastic#175197 elastic#175978 elastic#175795

## Testing

I'll leave here a couple of important use cases to test:

- Migration scenario
  1. Create **multiple** required custom fields in 8.12.
  2. Migrate to the feature branch (future 8.13).
3. Defining default values in the settings page should work as expected.

- Update case UI
  1. Create an optional custom field
  2. Create a case and leave the custom field empty
  3. Edit the custom field to now be required
  4. Go to the case detail page and edit the custom field
  5. Is the form populated automatically with the default value?

## Release notes

Required custom fields now support default values. These default values
will be used to populate automatically the custom fields if they are not
defined when creating and updating cases.

---------

Co-authored-by: Kibana Machine <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
Closes elastic#171747

Fixes elastic#174285
Fixes elastic#174286
Fixes elastic#174287
Fixes elastic#174288
Fixes elastic#174289

## Summary

This feature branch introduces default values to the custom fields in
Cases.

Changes:
- The case configuration API now supports defining default values **for
required custom fields**.
  - The default value field is optional.
  - The default value field must have the same type as the custom field.
- Default values for required custom fields can be configured in the
cases settings page.
- The Create and Update Case pages now prefill required custom fields
with their default value(if it exists).
- Create and Update case API
  - required custom field missing from the request:
- if the default value exists -> set the custom field to the default
value
- if the default value is missing from the configuration -> throws an
error
- creating required custom fields with `value: null` -> always throws an
error

### Previous PRs

elastic#174043 elastic#174845 elastic#174628
elastic#175197 elastic#175978 elastic#175795

## Testing

I'll leave here a couple of important use cases to test:

- Migration scenario
  1. Create **multiple** required custom fields in 8.12.
  2. Migrate to the feature branch (future 8.13).
3. Defining default values in the settings page should work as expected.

- Update case UI
  1. Create an optional custom field
  2. Create a case and leave the custom field empty
  3. Edit the custom field to now be required
  4. Go to the case detail page and edit the custom field
  5. Is the form populated automatically with the default value?

## Release notes

Required custom fields now support default values. These default values
will be used to populate automatically the custom fields if they are not
defined when creating and updating cases.

---------

Co-authored-by: Kibana Machine <[email protected]>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
Closes elastic#171747

Fixes elastic#174285
Fixes elastic#174286
Fixes elastic#174287
Fixes elastic#174288
Fixes elastic#174289

## Summary

This feature branch introduces default values to the custom fields in
Cases.

Changes:
- The case configuration API now supports defining default values **for
required custom fields**.
  - The default value field is optional.
  - The default value field must have the same type as the custom field.
- Default values for required custom fields can be configured in the
cases settings page.
- The Create and Update Case pages now prefill required custom fields
with their default value(if it exists).
- Create and Update case API
  - required custom field missing from the request:
- if the default value exists -> set the custom field to the default
value
- if the default value is missing from the configuration -> throws an
error
- creating required custom fields with `value: null` -> always throws an
error

### Previous PRs

elastic#174043 elastic#174845 elastic#174628
elastic#175197 elastic#175978 elastic#175795

## Testing

I'll leave here a couple of important use cases to test:

- Migration scenario
  1. Create **multiple** required custom fields in 8.12.
  2. Migrate to the feature branch (future 8.13).
3. Defining default values in the settings page should work as expected.

- Update case UI
  1. Create an optional custom field
  2. Create a case and leave the custom field empty
  3. Edit the custom field to now be required
  4. Go to the case detail page and edit the custom field
  5. Is the form populated automatically with the default value?

## Release notes

Required custom fields now support default values. These default values
will be used to populate automatically the custom fields if they are not
defined when creating and updating cases.

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants