opencti icon indicating copy to clipboard operation
opencti copied to clipboard

[frontend] Fix Add height / weight do not work (#7118)

Open SarahBocognano opened this issue 1 year ago • 4 comments

Proposed changes

  • Add a validator check to help the user knowing the field is mandatory
  • On edit form, when pushes a new height or weight line, put a value instead of null to avoid errors

Related issues

  • https://github.com/OpenCTI-Platform/opencti/issues/7118

Checklist

  • [ ] I consider the submitted work as finished
  • [ ] I tested the code for its functionality
  • [ ] I wrote test cases for the relevant uses case (coverage and e2e)
  • [ ] I added/update the relevant documentation (either on github or on notion)
  • [ ] Where necessary I refactored code to improve the overall quality

Further comments

SarahBocognano avatar May 29 '24 08:05 SarahBocognano

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.54%. Comparing base (e9dbebf) to head (e677fc3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7165      +/-   ##
==========================================
- Coverage   67.54%   67.54%   -0.01%     
==========================================
  Files         561      561              
  Lines       68727    68727              
  Branches     5835     5835              
==========================================
- Hits        46425    46420       -5     
- Misses      22302    22307       +5     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 29 '24 08:05 codecov[bot]

If we enter something else than a date for the height/weight, the error is not well formatted: image

You can include this part of code in your dateSeenValidator: image

Archidoit avatar May 29 '24 08:05 Archidoit

What is the meaning for the (') unit (simple curiosity)? (I know 'lb' for weight but I don't know (') )

image

@SarahBocognano : this is how we define height in America everytime you'll see a height, I will be like: 5'7" (172cm)

Archidoit avatar May 29 '24 08:05 Archidoit

Usually when a required field is not specified, there is only a red message in the form : image

But for height/weight date or measure, a second message appears at the top of the screen "Validation against the schema... " :

image

image

Archidoit avatar May 31 '24 12:05 Archidoit

When adding a height, after delete the previous date, this date is reinitialized automatically.

@SarahBocognano : Yes I did that on purpose to avoid any error for the user and to show that this field is indeed mandatory and has no sense of use without the date

CelineSebe avatar Jun 04 '24 07:06 CelineSebe