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

Upload photo from device #133

Open
MikeTheCanuck opened this issue Jan 3, 2018 · 2 comments
Open

Upload photo from device #133

MikeTheCanuck opened this issue Jan 3, 2018 · 2 comments

Comments

@MikeTheCanuck
Copy link
Owner

MikeTheCanuck commented Jan 3, 2018

User will be able to select a Photo from their Photos library.

Acceptance Criteria

  1. Given I am creating a New Encounter
    When I open the New Encounter form
    Then the Image selector control is at the bottom of the form - at minimum, below the Name and Date input fields.
    (Assumption: top-to-bottom form-filling conventions should minimize the likelihood that the submitted image will lack Name and Date data).
  2. Given the user has one or more Photos in their Photo Library
    When they tap the Image selector control
    Then the app presents a warning to the user that the user is about to be asked for permission to access their Photos AND
    Then the app requests access to the user's Photo library.
  3. Given the Encounter record already has the Name field filled in AND
    Given the user selects an Image file (e.g. JPG, PNG, GIF)
    When the user taps the Save button
    Then the image file will be renamed to the Person's name (removing spaces) + the ISO-formatted date of the current Encounter (e.g. "MikeLonergan_2017-12-31.png") AND
    Then the image file will be submitted to the app's chosen Storage location AND
    Then the image file's location and name will be record as the Photo URL field of the Encounter.
  4. Given the user selects a Video rather than an Image file
    When the user selects the Video file
    Then the app throws an Error Message to the user "Please select an image file (e.g. JPG, PNG, GIF)" AND
    Then the app returns the Image selector to its default state.
  5. Given the current Encounter record has the same Name+Date as one of the existing Photos
    When the user taps the Save button
    Then the app throws an Error Message to the user "Already have a photo for that Person and Encounter date".
    (Assumption: this should be a very rare occasion for each user.)
  6. Given the Encounter record includes a Date but not a Name AND
    Given the user selects an Image file
    When the user taps the Save button
    Then the app uses a dummy value for the Name when constructing the image filename.
    (Question: will we know the current user's name, to be able to call this image "Mike's-new-friend-2017-12-31.jpg"?)
  7. Given the Encounter record includes a Name but not a Date AND
    Given the user selects an Image file
    When the user taps the Save button
    Then the app selects today's date for the Date portion when constructing the image filename.
  8. Given the user has not yet input a Name or Date for the Encounter record they're creating AND
    Given the user selects an Image file
    When the user taps the Save button
    Then the app throws an Error Message to the user "When uploading the image, we user the Name and Date for the Encounter - please fill these in to the best of your ability" AND
    Then the app returns the user to the input form with an active Save button.
    (Assumption: this should be a rare occasion for most users.)
@MikeTheCanuck
Copy link
Owner Author

MikeTheCanuck commented Jan 3, 2018

Hmm, it occurs to me that at some point soon the app is going to require Name and Date inputs (see #115), at which point many of the concerns about a missing Name or Date value should be nearly extinguished.

Need to review these criteria to eliminate redundant ones, both due to the required fields and because I think it's counter-productive to enable the user to upload a photo before they create the Encounter record (i.e. I don't want this to become some image-sharing platform for bad actors).

@MikeTheCanuck
Copy link
Owner Author

Consult this tutorial for any useable file upload capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant