-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tina/new student show #187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to lint your files, and the "Back" buttons on each submission form broke because of the URL changes.
<h5>{props.entries ? props.entries.length : 0}/{props.entryCap} submissions</h5> | ||
</div> | ||
<div> | ||
Submission Ends: <Moment format='YYYY/MM/DD'>{props.entryEnd}</Moment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this in a format that's more readable / glanceable (eg. March 5, 2018).
I'd also word it as "Accepting Submissions Until"
Also, we seem to have different wording between the backend and frontend: should we call them "Submissions" or "Entries"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they should be submissions as that's what Nanette usually uses, but @robmcl4 @Kayladavis opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't think react-moment would be valid anymore if we decided to go with the glance able format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with "submissions". At some point we just chose entries as types because it was slightly shorter of a word.
Also, I agree with Bill for the date format and wording.
judgingStart: PropTypes.string.isRequired, | ||
judgingEnd: PropTypes.string.isRequired | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change entries
to be required, and you should give it a defaultProp
:
defaultProps = {
entries: []
}
</Card> | ||
) | ||
|
||
ShowCard.propTypes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having all these props passed in shallowly, I would encapsulate them in a show
prop:
ShowCard.propTypes = {
show: PropTypes.shape({
id: PropTypes.string,
...
judgingEnd: PropTypes.string
}).isRequired
}
See comment about entries
below
import FaPlusCircle from 'babel-loader!react-icons/fa/plus-circle' | ||
import { Button, ButtonGroup, Row, Col } from 'reactstrap' | ||
|
||
const Card = styled.div` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visually, this feels too narrow. min-height: 250px
seems to work well. You'll have to recenter the "New Submission" button.
</Col> | ||
<Col className="text-right"> | ||
<div> | ||
<h5>{props.entries ? props.entries.length : 0}/{props.entryCap} submissions</h5> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the defaultProps
below, props.show.entries.length
will be zero when there are no submissions, so you could simplify this to just {props.show.entries.length}/{props.show.entryCap}
Also, see comment below about "Submissions" vs. "Entries"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh true, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Card> | ||
<Row> | ||
<Col> | ||
<h2>{props.name}</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would align this text so the baseline is the same as "Submission Ends"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want it centered with Accepting Submissions Until correct?
@@ -30,10 +30,6 @@ class OtherSubmissionForm extends Component { | |||
user: PropTypes.shape({ | |||
username: PropTypes.string | |||
}).isRequired, | |||
forShow: PropTypes.shape({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're removing this in each of these files, you need to add in the propTypes
for data
@@ -0,0 +1,6 @@ | |||
query Show($id: ID!) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird to me making a query just for the name, but I guess it works: if we're coming to this page from the chooser, apollo probably has the data cached. If we're loading this page new, we'll need to fetch the name.
Still getting used to GraphQL ¯\_(ツ)_/¯
) | ||
|
||
Shows.propTypes = { | ||
shows: PropTypes.array, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this required and add a defaultProp
of []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are no so associated with the student, would they be able to still log in?
frontend/src/Student/pages/Submit.js
Outdated
<Route exact path='/submit/photo' render={() => <PhotoSubmissionForm forShow={props.forShow} />} /> | ||
<Route exact path='/submit/video' render={() => <VideoSubmissionForm forShow={props.forShow} />} /> | ||
<Route exact path='/submit/other' render={() => <OtherMediaSubmissionForm forShow={props.forShow} />} /> | ||
<Route exact path='/submit/:id' component={SubmissionFormChooser} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of this URL format here.
Thoughts about doing:
/submit?to=<public_id>
/submit/photo?to=<public_id>
/submit/video?to=<public_id>
/submit/other?to=<public_id>
or
/submit?to=<public_id>
/submit?to=<public_id>&type=photo
/submit?to=<public_id>&type=video
/submit?to=<public_id>&type=other
Without the to
param or an invalid/non-authorized public_id
, you'd be redirected to your dashboard.
See #169 for my thoughts on using a public_id
. We could just use the show's id for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably going with /submit?to=<public_id>
/submit/photo?to=<public_id>
/submit/video?to=<public_id>
/submit/other?to=<public_id>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit and some questions. Bill covers a lot in his review.
previewImage: state.student.ui.submission.previewFile || {}, | ||
user: state.shared.auth.user | ||
user: state.shared.auth.user, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra comma
judgingEnd | ||
entryCap | ||
entries { | ||
id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we need more than just the id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so? Would the invited status be associated with the entries?
'baesline' is not a word
|
||
import SubmissionFormChooser from '../components/SubmissionFormChooser' | ||
import PhotoSubmissionForm from '../containers/PhotoSubmissionForm' | ||
import VideoSubmissionForm from '../containers/VideoSubmissionForm' | ||
import OtherMediaSubmissionForm from '../containers/OtherMediaSubmissionForm' | ||
|
||
const Submit = props => ( | ||
const addIdPropFromQueryParams = () => { | ||
return window.location.search.split('=')[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the most robust way to do this, as any additional query parameters will cause issues.
eg. /submit?foo=bar&to=1
causes the buttons to link to /submit/<type>?to=bar
Additionally, no check is done to make sure a show w/ the id exists, so you can view the chooser for any id and when you attempt to view the submission forms for that non-existent show, the app crashes.
Ideally, we would parse the query string specifically for the param to
and check if the id in the to
query param is a valid show which this student can submit to, otherwise, render a Not Found page.
For MVP purposes, this'll work, but I'm making a story for having more robust query string parsing.
Resolves #182
This does the graphql query for all of the student side for the status.
This includes the new prototype of what Rob made shown here: