cznethub / dsp

CZNet Hub Data Submission Portal
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Registration of external dataset allows temporal coverage with end date before start date #106

Closed horsburgh closed 4 months ago

horsburgh commented 1 year ago

Description of the bug

The submit external dataset form allows the user to enter an end date for the temporal coverage that is before the begin date of the temporal coverage.

Steps to reproduce the bug:

  1. Go to Submit Data
  2. Click on Register Dataset
  3. Select OTHER to register a dataset from an external repository
  4. Set the temporal coverage by entering an end date that comes before the start date
  5. Save the submission
  6. The submission is saved successfully without validating that the end date must come after the start date.

Expected behavior

Need a validation to make sure that the end date comes after the start date. Best would be if this happens when the end date is set and not waiting until the whole form is submitted for saving.

Additional information

This may be an issue on other submission forms.

Maurier commented 1 year ago

This has been implemented in new renderers and will be included as part of https://github.com/cznethub/dsp/issues/46 integrations.

pkdash commented 1 year ago

@Maurier I assume this issue has been fixed. Can we close it?

Maurier commented 1 year ago

The JSON Schema driven solution that I wanted involved using $data option (https://ajv.js.org/guide/combining-schemas.html#data-reference), but so far I haven't been able to get it to work correctly when Ajv is transpilled as a dependency of an NPM package (in our cznet-vue-core package).

For now, we have added backend validation that displays an error when the form is submitted. We should keep this issue open until a workaround for my proposed solution is found.