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

Student Submission Forms #142

Merged
merged 23 commits into from
Feb 13, 2018
Merged

Student Submission Forms #142

merged 23 commits into from
Feb 13, 2018

Conversation

billdybas
Copy link
Member

@billdybas billdybas commented Feb 1, 2018

Adds Student Submission Forms to the Student app.

Still To Do:

  • Add a 'Success!' Modal after the submission is made and is successful
  • ~~~If there is an issue w/ the form, display an error and don't clear the form (this is primarily for the Video Submission – letting the backend validate the URL is from YouTube or Vimeo)~~~ => See Add Contextual Error Messages for Students #148
  • Making the submission for a particular show (and updating routes and page title (eg. "You are submitting to Honors Show 2018"))
  • Adding in the Group workflow
  • Determine if we need moreCopies on Video and Other Media submissions
  • Make mediaType on Photo Submission a react-select Creatable
  • ~~~Better style the Dropzone previews~~~ => See As a developer, I want better styled Dropzone previews #160
  • UX on 'Back' buttons + 'Cancel' submission
  • ~~~Convert the other forms using redux-form to formik (Probably a separate PR)~~~ => See Tech Debt: Finish Converting Forms to Formik #156
  • Fix wording of forms based on Nanette's feedback (Artist Comment => optional, Physical Art")
  • If there's an uploaded image and someone goes to another page, clear the preview

Additionally, we should determine if we need to have some way to delete uploads, as you can upload something to the Dropzone, click on it and upload again, causing the first upload to not ever be associated w/ a submission and forever take up disk space. => See #159

setFieldValue(name, this.props.previewFile.path)
})
break
default:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are we doing about the video case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Students who want to submit a YouTube or Vimeo video will choose the "Video" Submission Form – this is the "Other Media" form where students can submit an image or PDF of something like a book or physical object.

We don't need to worry about videos on this form, as students cannot upload video files.

@billdybas billdybas changed the title [WIP] Student Submission Forms Student Submission Forms Feb 10, 2018
Also use correct mutation for Other Media Submission
Copy link
Member

@robmcl4 robmcl4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Massive amount of redundancy here, I smell refactoring in our future.

Can you either fix or file a ticket for submitting to shows other than ID 1?

})
break
default:
console.error(`Unknown File Type: ${file.type}`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a // TODO handle error here, or somehow respond to errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this code should technically never be reached. We only accept='application/pdf,image/jpeg', so there would need to be issues w/ the Dropzone or someone would have to be modifying our internals through dev tools.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember I also added this case because in react-dropzone's docs, they mention that MIME type determination isn't reliable across platforms – if and end user is having issues uploading a file, someone would be able to diagnose the issue by having the end user open their console and see what the error message is.

See the accept prop: https://react-dropzone.js.org/

</Container>
)

export default Submit
const mapStateToProps = (state) => ({
forShow: { id: 1, name: 'Honors Show 2017' } // TODO: Get from Redux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional? It's a pretty big TODO, we should at least open an issue for that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is intentional – not really a big issue. When @chtinahow has the Student dashboard complete, when you click "Make Submission" on a particular show, we'll either pass that show's id and name as props or access them through Redux. Since she'll have already queried for the show to display it on the dashboard, we'll just need to pass that data along.

If you want to make an Issue for integrating our two features together, feel free.

Copy link
Member

@robmcl4 robmcl4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved w/ caveat of fixing slightly unexpected behavior in future work.


const SuccessModal = (props) => (
<Modal
isOpen={props.isOpen}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this wold be for cleanliness sake, but why not break the styles out into their own divs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, this was a bit hacky just to get the styles to work like I wanted. I couldn't use reacstrap's <ModalHeader /> component because the HTML it generates made it impossible to center the check icon.

If by "break[ing] the styles out into their own divs" you mean make them styled-components, I don't see any benefit over how the styles are right now – there's no component re-use. If we need more modals like this in the future, I could see making this a generic component and passing in props like the background color, icon, and body copy.

@kaylaerdmann
Copy link
Contributor

I think overall this is solid. The others covered any concern I have. So lgtm.

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

Successfully merging this pull request may close these issues.

None yet

4 participants