bcgov / digital-journeys

PSA Forms System
https://bcgov.github.io/digital-journeys/
Apache License 2.0
8 stars 7 forks source link

Cold/Flu: Submitted Forms View and Form Functions (FE&BE) #1007

Closed ca-liu closed 1 year ago

ca-liu commented 1 year ago

User Story A user should be able to edit their response to the form. There should be a page showing the user their submitted form.

Once an edit is submitted, the site Admin(s) should be notified via email. User changes should be captured in the email notification.

Tasks

Acceptance Criteria

MeghanStothers commented 1 year ago

Bhumin researched this and found the history: available for enterprise edition not the open-source version. May interfere with existing workflow.

ca-liu commented 1 year ago

Hi @bhumin-fw, @EduardoRamirezBC,

I have updated the ticket to remove the history log requirement on the form. Instead, the changes will be captured in the email, change history does not need to be stored in the database.

Changes can be triggered by form onChange event triggers or when the form is submitted and a value audit is conducted (=== match).

Thank you for looking into this issue!

MeghanStothers commented 1 year ago

@ca-liu Thanks! I have looped Stella into this thread so she's aware. Can you confirm that, simply put, the updated requirement is the program area will get notified of changes (such as the # of clinic attendees) by email? Does the requirement/email notification change when when the form is "open" or "closed"?

ca-liu commented 1 year ago

Hi @MeghanStothers ,

Thanks for checking! Correct, the updated requirement is to:

Please let me know if that makes sense; happy to provide additional information if required.

EduardoRamirezBC commented 1 year ago

Emai; notification only happens when its closed

bhumin-fw commented 1 year ago

@ca-liu I have edit this ticket description. attached one ticket to handle delete form #1025.

bhumin-fw commented 1 year ago

@ca-liu

Thanks for checking! Correct, the updated requirement is to:

I have a favor to ask you, You did mention "onChange" to identify changes. In core javascript, we are using it to identify update values in the form. In the FormIo that handles on FormIo repo/CDK. I need to explore the FormIo document to identify how to collect changed form data in an execution context where I can modify code. If you have any idea or document link handly, Could you please share it with me?

ca-liu commented 1 year ago

Hey @bhumin-fw

Great questions! Please see clarification points below:

  • Notify the site admins of any changes submitted by the registrant via email Does this email contain predefine template, Like User XXX made change to Worksite xxx?

Correct. Please see email template below.

  • Email notification will be enabled after the registration window closes (3 weeks after intake form opens) From where we will fetch this details, Is it pre-defined dates? or we have to calculate any duration at the time of form submission?

Good point. We will make the form dynamic and not static to 3 weeks as things may change. Created ticket #1023 to allow Site Admin to open/close the registration form. The open/close will only trigger email notifications, the form will remain open.

The email notification should outline what was changed on the form. This can be captured using JavaScript (onChange) event trigger or form value audit onFormSubmit. If we are sending what was changed on the form in the email. Do we still need to send separate email as mentioned on first point? or first and this(3rd) point to the same email.

You got it, please see email template below. I hope this helps clarify for what we are looking in an email template.

Email Template for changes when the intake is CLOSED Subject: Cold/Flu: {contacts.fName} has made a change to their clinic registration Body: {contacts.fName} {contacts.lName} has made the following changes to their clinic registration form on {lastModifiedDateTime}:

Click here (link to the registrations.registrationId) to view the revised submission.

Email Template for new registrations when the intake is CLOSED Subject: Cold/Flu: {user} has submitted a new clinic registration Body: {contacts.fName} {contacts.lName} has submitted a new clinic registration on {submittedDateTime}.

Click here (link to the registrations.registrationId) to view the submission.

ca-liu commented 1 year ago

@bhumin-fw please see notification email template above.

bhumin-fw commented 1 year ago

@ca-liu This looks good. Thank you.

Stella-Archer commented 1 year ago

waiting for API/ endpoints

bhumin-fw commented 1 year ago

To test please check below points only, other detail will be test in different tickets:

  1. you should be able to submit form.
  2. you should be able to edit submitted form.
  3. you should be able to see submitted forms in "Submitted form" tab along with "Edit" an "Delete" button. (delete functionality will be test separately in 1025 ticket)
ayushdamani commented 1 year ago

Thank you for the instructions @bhumin-fw !

Acceptance criteria met:

Screenshot 2023-05-03 113305.png

Stella-Archer commented 1 year ago

worked perfectly - PO approved & tix closed