Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Seeding Input Log Submit Button Enabled When Data Panel Date Field is Empty #52

Open
1 task
braughtg opened this issue Aug 17, 2023 · 4 comments · May be fixed by #189
Open
1 task

Seeding Input Log Submit Button Enabled When Data Panel Date Field is Empty #52

braughtg opened this issue Aug 17, 2023 · 4 comments · May be fixed by #189
Labels
bug Something isn't working

Comments

@braughtg
Copy link
Member

The Seeding Input Log "Submit" Button remains enabled even when the date field in the Data panel is blank.

The details of the issue are illustrated below:
(Submit button is enabled when the date field in the data panel is empty)
image

Steps to resolve the issue:
Within the seedingInput.html, the formNotCompetedFunction() Boolean computed function determines whether the submit button is enabled. This function checks whether certain fields are populated by checking their values against null, however the selectedDate value in not checked. This is probably because upon pageload, the selectedDate is set to dayjs().format('YYYY-MM-DD').toString() specified by the Data Vue property:

data:{
                sessionToken: null,
                selectedDate: dayjs().format('YYYY-MM-DD').toString(),
                selectedCrop: null,
                selectedArea: null,

This was done to prompt the user with the correct date format, but it leaves the date populated.

The issue can be resolved by checking if the selectedDate can be converted from a Unix timestamp into a date using the day.js library. This seems like an unnecessary step, but is required as you can individually set Month, Day, or Year in the date selector as demonstrated below:
image

issue will be resolved when:

  • Date selection field is required to be populated for submission button enabled.

Original issue by RolandLocke
Sunday Apr 30, 2023 at 22:28 GMT

@braughtg braughtg added the bug Something isn't working label Aug 17, 2023
@aidanbennettjones
Copy link

Group 1 will work on this problem.

@Zivanovic8
Copy link

Instead of checking if selectedDate can be converted from a Unix timestamp into a date, as suggested by the author of this issue, have you considered directly checking if it's a valid date using the dayjs library?

@aidanbennettjones
Copy link

Yes, regarding this issue, we used the dayjs library. To be specific, we use the "isValid()" function from the dayjs library in order to check if the date is valid and we confirmed that the format of the date was also correct.

@Zivanovic8
Copy link

I am glad to see that checking validity approach worked well, also checking the format was a great addition.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants