Fix Bug 1014435 - [admin] Show the duration (time taken) by the user for a task to complete #245
Conversation
@@ -34,6 +34,7 @@ def __unicode__(self): | |||
class Feedback(CachedModel, CreatedModifiedModel): | |||
attempt = models.OneToOneField('TaskAttempt') | |||
text = models.TextField() | |||
completion_time_in_minutes = models.IntegerField(max_length=5,blank=True,null=True) |
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.
Added a new field.to save the time taken to complete.
@bobsilverberg .please review |
@@ -166,7 +166,7 @@ footer { | |||
} | |||
.feedback-form { | |||
width: 95%; | |||
text-align: right; | |||
text-align: left; |
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.
While this makes the new text input appear properly aligned, it also causes the "No Thanks" and "Submit Feedback" buttons to now appear in the lower left of the form, as opposed to the lower right, which is where they are on the current site, and where they need to stay, so this is not correct.
I would suggest that any time you are changing existing css (such as here, where you are changing an existing property from right
to left
), you need to be very careful and review the impact of the change on the site. This is something you could have noticed if you would have compared the feedback form currently on the site and the new feedback form produced with this change.
This is great work! Thanks @tessie. I have added a few comments to address, but overall this is very good. 👍 One other thing I would suggest adding would be to update the email that gets sent out to the task owner when feedback is submitted to include this new field. Let me know when this is ready for another review by me. |
c3571b2
to
2ba1568
Compare
@@ -176,6 +176,9 @@ footer { | |||
.no-feedback { | |||
margin-right: 1rem; | |||
} | |||
.right { |
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.
Now the feedback and no thanks buttons are moved to right
@bobsilverberg .Ready to review |
2ba1568
to
2959963
Compare
@@ -0,0 +1,183 @@ | |||
# -*- coding: utf-8 -*- |
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 one needs to be prefixed with 0024
as I mentioned in my last comment. The PR that I just merged added migrations for 0022 and 0023.
Good work, @tessie. I added a couple of comments to be addressed, but other than that it looks really good. |
@bobsilverberg .time spent in minutes |
This is perfect now, thanks @tessie! I realized that there is one other place where we should add this: to the Task Activity screen. I suggest adding a field below the date that the task was finished/abandoned/etc, indicating the amount of time spent on the task. Please only display this field if there is a value for that field, as many records will not have a value. Please squash the commits now, as I know that everything so far in this PR is good, and then add a new commit with the changes for the Task Activity screen. Thanks! |
dfb0389
to
63ccb51
Compare
@bobsilverberg .ready for review |
@@ -24,6 +24,12 @@ | |||
<div>{{ _("Team: {team}")|fe(team=attempt.task.team.name) }}</div> | |||
<div>{{ _('Date {state}: {modified}')|fe(state=attempt.get_state_display(), | |||
modified=attempt.modified.strftime('%Y-%m-%d: %I:%M:%S %p').lower()) }}</div> | |||
<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.
I suggest moving the <div>
inside the {% if
so that if we do not have a time_spent_in_minutes
we do not even output the <div>
to the page.
Great work @tessie. I have added a few comments for you to address. |
63ccb51
to
d9eb780
Compare
@bobsilverberg .Thanks updated the pr |
@@ -24,6 +24,15 @@ | |||
<div>{{ _("Team: {team}")|fe(team=attempt.task.team.name) }}</div> | |||
<div>{{ _('Date {state}: {modified}')|fe(state=attempt.get_state_display(), | |||
modified=attempt.modified.strftime('%Y-%m-%d: %I:%M:%S %p').lower()) }}</div> | |||
{% if attempt.has_feedback %} |
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 believe that the code you wrote above for attempt.time_spent_in_minutes
will return None
if attempt.has_feedback
is False
, so I think you could just use {% if attempt.time_spent_in_minutes %}
and not even bother checking if attempt.has_feedback
.
This looks good, @tessie. I added one comment to address. Also, I think you misunderstood what I meant about squashing. Because this PR has gone on for a long time and there are lots of old commits, I wanted you to squash all the old commits, but then to start adding new commits after that. I didn't want you to just start squashing every time you added a commit. I want to be able to see the exact changes that were just made, so if you squash everything I cannot see that. I did explicitly say above "Please squash the commits now, as I know that everything so far in this PR is good, and then add a new commit with the changes for the Task Activity screen", but it seems like you misunderstood. Does this make sense now? |
fcd561a
to
97f0376
Compare
@bobsilverberg .thanks for review.updated the pr |
This is great, thanks @tessie! I notice that there are now some merge conflicts because of other PRs that have been merged. Can you squash the commits and try to resolve the merge conflicts? If you have trouble doing that let me know and I can help. |
96a4364
to
fd9f946
Compare
…for a task to complete
fd9f946
to
17455bc
Compare
@bobsilverberg .hopefully now it is fixed |
Perfect! Thanks @tessie. Merging now! |
Fix Bug 1014435 - [admin] Show the duration (time taken) by the user for a task to complete
No description provided.