Skip to content

General: Date pickers accept unparseable input and silently save an empty date #13471

Description

@WoH

Describe the bug

jhi-date-time-picker provides NG_VALUE_ACCESSOR but no NG_VALIDATORS. On unparseable or out-of-range input it writes undefined to the bound form control and renders its own red "is missing or not valid" message, but the control itself stays valid. Forms that gate their submit button on form validity therefore stay submittable, and the date the user typed is dropped without a word.

Competency creation is the reported case: the form gates submit on !form.invalid and softDueDate carries no validator, so nonsense in "Recommended date of completion" saves a competency with no soft due date.

Seven forms already work around this by hand, reading datePickerComponent()?.isValid() or dateInput.valid into their own validity computation: lecture attachments, text unit, online unit, attachment video unit, and the text / modeling / file upload exercise update forms. The forms without that workaround have the bug.

Found by @Pomodorka3 on TS3 while reviewing #13443.

To Reproduce

  1. Course Management > Competencies > Create
  2. Fill in a title
  3. Type asdasd into "Recommended date of completion"
  4. The field turns red and shows "... is missing or not valid", but the submit button stays enabled
  5. Submit
  6. The competency is created, with no soft due date

Expected behavior

While the field holds unparseable or out-of-range input, the bound form control is invalid, so the surrounding form cannot be submitted until the entry is corrected or cleared.

Which version of Artemis are you seeing the problem on?

9.9 (TS3, develop)

What browsers are you seeing the problem on?

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    accountPull requests that affect the corresponding moduleatlasPull requests that affect the corresponding modulebugclientPull requests that update TypeScript code. (Added Automatically!)communicationPull requests that affect the corresponding modulecourseexercisePull requests that affect the corresponding modulefileuploadPull requests that affect the corresponding modulelecturePull requests that affect the corresponding modulemodelingPull requests that affect the corresponding modulequizPull requests that affect the corresponding module

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions