Vote #79455
完了Time entry creation: preserve 'spent on' value when using 'Create and Continue'
0%
説明
When creating a time entry and using the 'Create and continue' button to save and return to the form, the previously entered date is replaced with the current date while issue id and activity are preserved. This patch changes that so the previously entered date is preserved as well.
journals
I think it is very natural to preserve date and there is no reason not to do so. Probably most users expect the proposed behavior. Setting target version to 3.3.9.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> I think it is very natural to preserve date and there is no reason not to do so. Probably most users expect the proposed behavior. Setting target version to 3.3.9.
Indeed.
+1
--------------------------------------------------------------------------------
The patch breaks some tests. Would you update the tests?
{{collapse
<pre>
Failure:
TimelogControllerTest#test_create_and_continue_at_project_level [test/functional/timelog_controller_test.rb:273]:
Expected response to be a redirect to <http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1> but was a redirect to <http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14>.
Expected "http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1" to be === "http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14".
bin/rails test test/functional/timelog_controller_test.rb:271
..............................................F
Failure:
TimelogControllerTest#test_create_and_continue_with_issue_id [test/functional/timelog_controller_test.rb:324]:
Expected response to be a redirect to <http://test.host/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=> but was a redirect to <http://test.host/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14>.
Expected "http://test.host/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=" to be === "http://test.host/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14".
bin/rails test test/functional/timelog_controller_test.rb:322
...............F
Failure:
TimelogControllerTest#test_create_and_continue_at_issue_level [test/functional/timelog_controller_test.rb:290]:
Expected response to be a redirect to <http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=> but was a redirect to <http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14>.
Expected "http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=" to be === "http://test.host/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14".
bin/rails test test/functional/timelog_controller_test.rb:288
.....F
Failure:
TimelogControllerTest#test_create_and_continue_with_project_id [test/functional/timelog_controller_test.rb:307]:
Expected response to be a redirect to <http://test.host/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=> but was a redirect to <http://test.host/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14>.
Expected "http://test.host/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=" to be === "http://test.host/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14".
bin/rails test test/functional/timelog_controller_test.rb:305
</pre>
}}
--------------------------------------------------------------------------------
my bad, please find attached a second patch that fixes those.
--------------------------------------------------------------------------------
Great, everything is fine now. Thanks.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Committed. Thank you for sharing the improvement.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
duplicates,Closed,28081,Option to keep last spent-time date on "create and continue"