Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[179] View Evaluator's Submissions #258
base: dev
Are you sure you want to change the base?
[179] View Evaluator's Submissions #258
Changes from all commits
7abaa15
2093119
6771cf4
ef02ade
23e5701
27f35d0
e64fa23
1d36e0d
d576fa0
a91e88a
a4a9298
742af61
44c2db5
145886a
16866fb
4295f4d
3f803d3
8775c82
a68e0cb
5c5ad7e
e86b23e
fbe433a
3ff0089
e7882bf
9c89936
01b132f
6c32c1d
1a6531e
3da992d
e541c13
25f0d6d
8e207e1
f0013f6
6602fb3
9f44ad8
d029c20
c890db4
01209a4
ec365f9
575eda4
f824247
d99a8b4
28e77ea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 the
flash.now[:success]
should beflash[:success]
since you are redirecting to the next pageThere 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.
yeah I tested this and I don't see the message unless it used
flase[:success]
, unfortunately there is some rubocop linter warning about this but you should disable that cop for these line.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.
same here, use
flash[:error]
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 tried modifying this value to send some unknown, invalid status to the backend to trigger an error but it caused a 500 exception instead in the model update. You can remedy this by validating the status param in the rails controller before trying to update the model with an invalid value. if the client sends an invalid status, reject the request with
:unprocessable_entity
status.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.
.. alternatively you could rescue errors from the
@assignment.update
call in the controller to return falseThere 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 essentially doing
location.reload()
right? I have a different idea, what if you redirect to the path provided in the response data. you could render the url in the response JSNO asdata.redirect_to
or something and then reuse that same redirect path for both success and error since the backend will determine where to send the user. I think this will also display the flash message that was stored after the browser redirects, so you may not need thealert()
either. if you want you can still log a console.error() for developer debugging help messages.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.
how are
assigned
andnot_started
statuses different? I left a comment here about the status of the assignment/evaluation progress WRTnot_started
,in_progress
andcompleted
. here are some examples of queries that filter on those statuses (that PR isn't merged yet).I think I'd prefer to stick with that approach for now because it is easier than keeping the status updated in all cases of progress. let me know if it doesn't make sense here.
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.
did you try using the uswds tag here (with color)?
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 a little nitpicky, but can we rename this _assignments_stats.html.erb just for consistency with the other stats component on #280?
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.
evaluations are due by the form's
closing_date
. there are a few other stats collection examples on #280, although there are subtle differences in the two components.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.
that's a cool use of layout 👍