Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Fix Bug 1014435 - [admin] Show the duration (time taken) by the user for a task to complete #245

Merged
merged 1 commit into from Feb 2, 2015

Conversation

tessie
Copy link
Contributor

@tessie tessie commented Jan 12, 2015

No description provided.

@@ -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)
Copy link
Contributor Author

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.

@tessie
Copy link
Contributor Author

tessie commented Jan 12, 2015

@bobsilverberg .please review

@@ -166,7 +166,7 @@ footer {
}
.feedback-form {
width: 95%;
text-align: right;
text-align: left;
Copy link
Contributor

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.

@bobsilverberg
Copy link
Contributor

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.

@tessie tessie force-pushed the featureBug1014435 branch 2 times, most recently from c3571b2 to 2ba1568 Compare January 18, 2015 14:17
@@ -176,6 +176,9 @@ footer {
.no-feedback {
margin-right: 1rem;
}
.right {
Copy link
Contributor Author

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

@tessie
Copy link
Contributor Author

tessie commented Jan 18, 2015

@bobsilverberg .Ready to review
Changed the model name
Added validator which now removed the exception for me

@@ -0,0 +1,183 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

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.

@bobsilverberg
Copy link
Contributor

Good work, @tessie. I added a couple of comments to be addressed, but other than that it looks really good.

@tessie
Copy link
Contributor Author

tessie commented Jan 20, 2015

@bobsilverberg .time spent in minutes

@bobsilverberg
Copy link
Contributor

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!

@tessie tessie force-pushed the featureBug1014435 branch 2 times, most recently from dfb0389 to 63ccb51 Compare January 24, 2015 18:29
@tessie
Copy link
Contributor Author

tessie commented Jan 26, 2015

@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>
Copy link
Contributor

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.

@bobsilverberg
Copy link
Contributor

Great work @tessie. I have added a few comments for you to address.

@tessie
Copy link
Contributor Author

tessie commented Jan 26, 2015

@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 %}
Copy link
Contributor

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.

@bobsilverberg
Copy link
Contributor

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?

@tessie
Copy link
Contributor Author

tessie commented Jan 27, 2015

@bobsilverberg .thanks for review.updated the pr

@bobsilverberg
Copy link
Contributor

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.

@tessie tessie force-pushed the featureBug1014435 branch 6 times, most recently from 96a4364 to fd9f946 Compare January 28, 2015 15:26
@tessie
Copy link
Contributor Author

tessie commented Jan 28, 2015

@bobsilverberg .hopefully now it is fixed

@bobsilverberg
Copy link
Contributor

Perfect! Thanks @tessie. Merging now!

bobsilverberg added a commit that referenced this pull request Feb 2, 2015
Fix Bug 1014435 - [admin] Show the duration (time taken) by the user for a task to complete
@bobsilverberg bobsilverberg merged commit 39a0084 into mozilla:master Feb 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants