Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk finalization #5714

Closed
5 tasks done
seadowg opened this issue Aug 28, 2023 · 4 comments
Closed
5 tasks done

Bulk finalization #5714

seadowg opened this issue Aug 28, 2023 · 4 comments
Assignees
Milestone

Comments

@seadowg
Copy link
Member

seadowg commented Aug 28, 2023

Original proposal: https://docs.google.com/document/d/1u16s0dN7wO7XMhlK8rKFDEfZCtYkK5kyFgccQ6ATOM8/edit#heading=h.4url4222egph

Acceptance

  • Given I've saved at least one form as a draft
    And I'm on the Drafts screen
    When I click the options menu
    And I click "Finalize all forms"
    Then I see a snackbar saying "Success! <number of forms> forms finalized."
    And the forms no longer appear in Drafts
    And the forms are now finalized (and in "Ready to send")

  • Given I've saved at least one form as a draft
    And I'm on the Drafts screen
    When I click the options menu
    And I click "Finalize all forms"
    Then I see a progress dialog while forms are finalized
    And I am unable to do anything else in the app

  • Given I've saved at least one form as a draft
    And I'm on the Drafts screen
    When I click the options menu
    And I click "Finalize all forms"
    And one or more forms has constraint violations
    Then I see a snackbar informing me that "<number of forms finalized> forms finalized. <number of forms with errors> forms have errors. Address issues before finalizing all forms."
    And the forms with errors have the status "Saved with errors on <timestamp>"
    And the other forms have been successfully finalized

  • Handle bulk finalisation for partial submission forms (with a ref in their submission element)

  • Instance name should be updated (in UI) if validation or finalization updates it (like it would if the name involved now() or random())

Design questions

  • How discoverable should this be? Should it be part of the options menu or something clearer like a FAB?
    • Options menu. Should be available, but not a primary action.
  • Should finalising block the user from doing other things, or should it happen in the background?
    • This is a critical action and it's unlikely the user is doing anything else in Collect so a blocking progress dialog is fine.
    • We should consider using something like WorkManager if that's better for making sure the job runs if the app isn't in the foreground.
  • How should we inform the user of constraint violations or errors?
    • Show a dialog and also put forms in a new "saved with errors" state
  • Should finalising "fail fast" after the first form with constraint violations/errors, or try and finalise everything?
    • Keep validating after a fail

Follow on work

@seadowg seadowg added this to the v2023.3 milestone Aug 28, 2023
@seadowg seadowg assigned seadowg and unassigned seadowg Aug 28, 2023
@seadowg seadowg moved this from not ready to backlog in ODK Collect Sep 1, 2023
@seadowg seadowg self-assigned this Sep 1, 2023
@seadowg seadowg moved this from backlog to in progress in ODK Collect Sep 5, 2023
@seadowg
Copy link
Member Author

seadowg commented Sep 6, 2023

@alyblenkin I've just updated the issue so that we show a snackbar instead of dialog for the success and failure states as per the mockup.

@alyblenkin
Copy link
Collaborator

@seadowg Do you think we should have acceptance criteria for the scenario when a number of forms are sent and some have errors?

Show something like "number of forms successfully finalized. number of forms had errors. Address issues before finalizing your forms"

For the progress dialog, do we think it's possible to show "number of forms/total"? Or is that a future iteration?

@seadowg
Copy link
Member Author

seadowg commented Sep 7, 2023

Do you think we should have acceptance criteria for the scenario when a number of forms are sent and some have errors?

Show something like "number of forms successfully finalized. number of forms had errors. Address issues before finalizing your forms"

We do already:

Given I've saved at least one form as a draft
And I'm on the Drafts screen
When I click the options menu
And I click "Finalize all forms"
And one or more forms has constraint violations
Then I see a snackbar informing me that " forms have errors. Address issues before finalizing all forms."
And the forms with errors have the status "Saved with errors on "
And the other forms have been successfully finalized

I'll update this with text you're suggesting, as that's definitely better!

@seadowg
Copy link
Member Author

seadowg commented Sep 7, 2023

For the progress dialog, do we think it's possible to show "number of forms/total"? Or is that a future iteration?

Let's leave that for the moment. Definitely possible at some point.

@seadowg seadowg closed this as completed Oct 2, 2023
@github-project-automation github-project-automation bot moved this from in progress to done in ODK Collect Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

No branches or pull requests

2 participants