mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 16:20:12 +01:00
also update default_project_name
New actions are created with the project as defined in default_project_name. This value needs to be updated as shown in #1789.
This commit is contained in:
parent
ae4ce272ff
commit
f8f7762b94
5 changed files with 14 additions and 8 deletions
|
|
@ -13,9 +13,6 @@ var TracksForm = {
|
||||||
}
|
}
|
||||||
toggleLink.parent().toggleClass('hide_form');
|
toggleLink.parent().toggleClass('hide_form');
|
||||||
},
|
},
|
||||||
set_project_name: function (name) {
|
|
||||||
$('input#todo_project_name').val(name);
|
|
||||||
},
|
|
||||||
set_project_name_for_multi_add: function (name) {
|
set_project_name_for_multi_add: function (name) {
|
||||||
$('#multi_todo_project_name').val(name);
|
$('#multi_todo_project_name').val(name);
|
||||||
},
|
},
|
||||||
|
|
@ -30,9 +27,8 @@ var TracksForm = {
|
||||||
$('input[name=default_context_name]').val(name);
|
$('input[name=default_context_name]').val(name);
|
||||||
},
|
},
|
||||||
set_project_name_and_default_project_name: function (name) {
|
set_project_name_and_default_project_name: function (name) {
|
||||||
TracksForm.set_project_name('');
|
$('input#todo_project_name').val(name);
|
||||||
$('#default_project_name_id').val(name);
|
$('#default_project_name_id').val(name);
|
||||||
$('#project_name').html(name);
|
|
||||||
},
|
},
|
||||||
set_tag_list_and_default_tag_list: function (name) {
|
set_tag_list_and_default_tag_list: function (name) {
|
||||||
$('input#tag_list').val(name);
|
$('input#tag_list').val(name);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ var <%=object_name%> = {
|
||||||
update_project_page: function() {
|
update_project_page: function() {
|
||||||
<%=object_name%>.remove_project_edit_form();
|
<%=object_name%>.remove_project_edit_form();
|
||||||
<%=object_name%>.update_and_show_project_settings();
|
<%=object_name%>.update_and_show_project_settings();
|
||||||
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>");
|
||||||
$("h2 span#project_name").html("<%= escape_javascript(@project.name)%>");
|
$("h2 span#project_name").html("<%= escape_javascript(@project.name)%>");
|
||||||
<% if @project.default_context %>
|
<% if @project.default_context %>
|
||||||
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>");
|
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>");
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<% if @saved -%>
|
<% if @saved -%>
|
||||||
TracksPages.page_inform('<%=t('projects.status_project_name_changed')%>');
|
TracksPages.page_inform('<%=t('projects.status_project_name_changed')%>');
|
||||||
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
$('#todo-form-new-action').clearForm();
|
$('#todo-form-new-action').clearForm();
|
||||||
$('#todo-form-new-action').clearDeps();
|
$('#todo-form-new-action').clearDeps();
|
||||||
TracksForm.set_context_name('<%=escape_javascript @initial_context_name%>');
|
TracksForm.set_context_name('<%=escape_javascript @initial_context_name%>');
|
||||||
TracksForm.set_project_name('<%=escape_javascript @initial_project_name%>');
|
TracksForm.set_project_name_and_default_project_name('<%=escape_javascript @initial_project_name%>');
|
||||||
TracksForm.set_tag_list_and_default_tag_list('<%=escape_javascript @initial_tags%>');
|
TracksForm.set_tag_list_and_default_tag_list('<%=escape_javascript @initial_tags%>');
|
||||||
$('#todo-form-new-action input:text:first').focus();
|
$('#todo-form-new-action input:text:first').focus();
|
||||||
$('#new_todo_starred_link .todo_star').removeClass('starred');
|
$('#new_todo_starred_link .todo_star').removeClass('starred');
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,16 @@ Feature: Edit a project
|
||||||
Then the project title should be "cherries"
|
Then the project title should be "cherries"
|
||||||
And the project field of the new todo form should contain "cherries"
|
And the project field of the new todo form should contain "cherries"
|
||||||
|
|
||||||
|
# Ticket #1789
|
||||||
|
@javascript
|
||||||
|
Scenario: I can change the name of the project and it should still allow me to add new actions
|
||||||
|
Given I have a project "bananas"
|
||||||
|
When I go to the "bananas" project
|
||||||
|
And I edit the project name to "cherries"
|
||||||
|
And I edit the default context to "@pc"
|
||||||
|
And I submit a new action with description "a new next action"
|
||||||
|
Then I should see the todo "a new next action"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I can change the default context of the project and it should update the new todo form
|
Scenario: I can change the default context of the project and it should update the new todo form
|
||||||
Given I have a project "bananas" with 1 todos
|
Given I have a project "bananas" with 1 todos
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue