Merge branch 'dev' into dev-angular

pull/1290/merge
Alex Coles 11 years ago
commit d5daa17f0b
  1. 2
      app/assets/javascripts/angular/models/timelines/mixins/ui.js
  2. 7
      app/controllers/statuses_controller.rb
  3. 9
      app/views/my/page_layout.html.erb
  4. 1
      config/locales/de.yml
  5. 1
      config/locales/en.yml
  6. 5
      doc/CHANGELOG.md
  7. 2
      features/project_types/project_creation_with_type.feature
  8. 11
      features/session/user_session.feature
  9. 11
      features/step_definitions/my_page_steps.rb
  10. 4
      features/step_definitions/web_steps.rb
  11. 2
      lib/redmine/menu_manager/top_menu_helper.rb
  12. 6
      public/templates/timelines/toolbar.html
  13. 17
      spec/controllers/statuses_controller_spec.rb
  14. 40
      spec/views/layouts/base.html.erb_spec.rb

@ -819,7 +819,7 @@ angular.module('openproject.timelines.models')
}) })
).attr({ ).attr({
'stroke': 'red', 'stroke': 'red',
'stroke-dasharray': '- ' 'stroke-dasharray': '3,3'
}); });
var setDateTime = 5 * 60 * 1000; var setDateTime = 5 * 60 * 1000;

@ -76,7 +76,12 @@ class StatusesController < ApplicationController
verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed } verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed }
def destroy def destroy
Status.find(params[:id]).destroy status = Status.find(params[:id])
if status.is_default?
flash[:error] = l(:error_unable_delete_default_status)
else
status.destroy
end
redirect_to :action => 'index' redirect_to :action => 'index'
rescue rescue
flash[:error] = l(:error_unable_delete_status) flash[:error] = l(:error_unable_delete_status)

@ -42,9 +42,11 @@ function recreateSortables() {
function updateSelect() { function updateSelect() {
s = $('block-select') s = $('block-select')
for (var i = 0; i < s.options.length; i++) { for (var i = 0; i < s.options.length; i++) {
if ($('block_' + s.options[i].value)) { var block = $('block_' + s.options[i].value);
if (block && block.visible()) {
s.options[i].disabled = true; s.options[i].disabled = true;
} else { } else {
if (block) { block.remove(); }
s.options[i].disabled = false; s.options[i].disabled = false;
} }
} }
@ -57,8 +59,9 @@ function afterAddBlock() {
} }
function removeBlock(block) { function removeBlock(block) {
Effect.DropOut(block); Effect.DropOut(block,{ 'afterFinish':function(){
updateSelect(); updateSelect();
}});
} }
//]]> //]]>
</script> </script>

@ -535,6 +535,7 @@ de:
error_scm_command_failed: "Beim Zugriff auf das Projektarchiv ist ein Fehler aufgetreten: %{value}" error_scm_command_failed: "Beim Zugriff auf das Projektarchiv ist ein Fehler aufgetreten: %{value}"
error_scm_not_found: "Eintrag und/oder Revision existiert nicht im Projektarchiv." error_scm_not_found: "Eintrag und/oder Revision existiert nicht im Projektarchiv."
error_unable_delete_status: "Der Ticket-Status konnte nicht gelöscht werden." error_unable_delete_status: "Der Ticket-Status konnte nicht gelöscht werden."
error_unable_delete_default_status: "Der Arbeitspaket-Status konnte nicht gelöscht werden, da dieser als Standard-Status markiert ist. Wählen Sie bitte zunächst einen anderen Arbeitspaket-Status als Standard-Status."
error_unable_to_connect: "Fehler beim Verbinden (%{value})" error_unable_to_connect: "Fehler beim Verbinden (%{value})"
error_workflow_copy_source: "Bitte wählen Sie einen Quell-Typ und eine Quell-Rolle." error_workflow_copy_source: "Bitte wählen Sie einen Quell-Typ und eine Quell-Rolle."
error_workflow_copy_target: "Bitte wählen Sie die Ziel-Typ und -Rollen." error_workflow_copy_target: "Bitte wählen Sie die Ziel-Typ und -Rollen."

@ -532,6 +532,7 @@ en:
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}" error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
error_scm_not_found: "The entry or revision was not found in the repository." error_scm_not_found: "The entry or revision was not found in the repository."
error_unable_delete_status: "Unable to delete work package status" error_unable_delete_status: "Unable to delete work package status"
error_unable_delete_default_status: "Unable to delete default work package status. Please select another default work package status before deleting the current one."
error_unable_to_connect: "Unable to connect (%{value})" error_unable_to_connect: "Unable to connect (%{value})"
error_workflow_copy_source: "Please select a source type or role" error_workflow_copy_source: "Please select a source type or role"
error_workflow_copy_target: "Please select target type(s) and role(s)" error_workflow_copy_target: "Please select target type(s) and role(s)"

@ -70,8 +70,13 @@ See doc/COPYRIGHT.rdoc for more details.
* `#7149` Fix: Wrong success message when login is already in use * `#7149` Fix: Wrong success message when login is already in use
* `#7177` Fix: Journal not created in connection with deleted note * `#7177` Fix: Journal not created in connection with deleted note
* `#7384` Headlines in wiki table of content are broken * `#7384` Headlines in wiki table of content are broken
* `#7499` No default work package status possible
* `#7504` Timeline "Today" line not displayed properly
* `#7531` Projects menu not visible if there are no projects
* `#7533` Fixes: Deleted block not addable
* `#7562` Regression: creating ticket via API fails with HTTP 422 * `#7562` Regression: creating ticket via API fails with HTTP 422
* `#7608` Make highlight buttons styleable * `#7608` Make highlight buttons styleable
* `#7609` Fix: Blue icons in Telekom theme
* Allowed sending of mails with only cc: or bcc: fields * Allowed sending of mails with only cc: or bcc: fields
* Allow adding attachments to created work packages via planning elements controller * Allow adding attachments to created work packages via planning elements controller
* Remove unused rmagick dependency * Remove unused rmagick dependency

@ -46,7 +46,7 @@ Feature: Project creation with support for project type
Scenario: The admin may create a project with a project type Scenario: The admin may create a project with a project type
Given I am already admin Given I am already admin
When I go to the admin page When I go to the admin page
And I follow "Projects" And I follow the first link matching "Projects"
And I follow "New project" And I follow "New project"
Then I fill in "Fancy Pants" for "Name" Then I fill in "Fancy Pants" for "Name"
And I fill in "fancy-pants" for "Identifier" And I fill in "fancy-pants" for "Identifier"

@ -100,3 +100,14 @@ Feature: User session
When I login as blocked_user with password iamblocked When I login as blocked_user with password iamblocked
Then there should be a flash error message Then there should be a flash error message
And the flash message should contain "Invalid user or password" And the flash message should contain "Invalid user or password"
@javascript
Scenario: A deleted block is always visible in My page block list
Given I am already admin
When I go to the My page personalization page
And I select "Calendar" from the available widgets drop down
And I click on "Add"
Then the "Calendar" widget should be in the top block
And "Calendar" should be disabled in the my page available widgets drop down
When I click the first delete block link
Then "Calendar" should not be disabled in the my page available widgets drop down

@ -43,10 +43,19 @@ Then(/^I should see the widget "([^"]*)"$/) do |arg|
page.find("#widget_#{arg}").should_not be_nil page.find("#widget_#{arg}").should_not be_nil
end end
Then /^"(.+)" should be disabled in the my page available widgets drop down$/ do |widget_name| Then /^"(.+)" should( not)? be disabled in the my page available widgets drop down$/ do |widget_name , neg|
option_name = MyController.available_blocks.detect{|k, v| I18n.t(v) == widget_name}.first.dasherize option_name = MyController.available_blocks.detect{|k, v| I18n.t(v) == widget_name}.first.dasherize
unless neg
steps %Q{Then the "block-select" drop-down should have the following options disabled: steps %Q{Then the "block-select" drop-down should have the following options disabled:
| #{option_name} |} | #{option_name} |}
else
steps %Q{Then the "block-select" drop-down should have the following options enabled:
| #{option_name} |}
end
end end
When(/^I click the first delete block link$/) do
all(:xpath, "//a[@title='Remove widget']")[0].click
end

@ -444,6 +444,10 @@ When /^(?:|I )click on the first button matching "([^"]*)"$/ do |button|
first(:button, button).click first(:button, button).click
end end
When /^(?:|I )follow the first link matching "([^"]*)"$/ do |link|
first(:link, link).click
end
def find_lowest_containing_element text, selector def find_lowest_containing_element text, selector
elements = [] elements = []

@ -48,7 +48,7 @@ module Redmine::MenuManager::TopMenuHelper
def render_projects_top_menu_node def render_projects_top_menu_node
return "" if User.current.anonymous? and Setting.login_required? return "" if User.current.anonymous? and Setting.login_required?
return "" if User.current.number_of_known_projects.zero? return "" if User.current.anonymous? and User.current.number_of_known_projects.zero?
heading = link_to l(:label_project_plural), heading = link_to l(:label_project_plural),
{ :controller => '/projects', { :controller => '/projects',

@ -8,7 +8,7 @@
<div class="tl-toolbar-container" style="width: 1px; height: 20px; background-color: rgb(0, 0, 0);"></div> <div class="tl-toolbar-container" style="width: 1px; height: 20px; background-color: rgb(0, 0, 0);"></div>
<div class="tl-toolbar-container"> <div class="tl-toolbar-container">
<a href="javascript://" title="Zoom out" class="icon tl-icon-zoomout" ng-click="decreaseZoom()"></a> <a href="javascript://" title="Zoom out" class="icon icon-zoom-out" ng-click="decreaseZoom()"></a>
</div> </div>
<div class="tl-toolbar-container" style="width: 100px; height: 20px;"> <div class="tl-toolbar-container" style="width: 100px; height: 20px;">
@ -16,7 +16,7 @@
</div> </div>
<div class="tl-toolbar-container"> <div class="tl-toolbar-container">
<a href="javascript://" title="Zoom in" class="icon tl-icon-zoomin" ng-click="increaseZoom()"></a> <a href="javascript://" title="Zoom in" class="icon icon-zoom-in" ng-click="increaseZoom()"></a>
</div> </div>
@ -31,7 +31,7 @@
<div class="tl-toolbar-container" style="width: 1px; height: 20px; background-color: rgb(0, 0, 0);"></div> <div class="tl-toolbar-container" style="width: 1px; height: 20px; background-color: rgb(0, 0, 0);"></div>
<div class="tl-toolbar-container"> <div class="tl-toolbar-container">
<a href="javascript://" title="Reset Outline" class="icon tl-icon-outline" ng-click="resetOutline()"></a> <a href="javascript://" title="Reset Outline" class="icon icon-outline" ng-click="resetOutline()"></a>
</div> </div>
<div class="tl-toolbar-container"> <div class="tl-toolbar-container">

@ -175,6 +175,23 @@ describe StatusesController do
it_behaves_like :redirect it_behaves_like :redirect
end end
context "default" do
let!(:status_default) { FactoryGirl.create(:status,
is_default: true) }
before do
delete :destroy, id: status_default.id
end
it_behaves_like :statuses
it_behaves_like :redirect
it "shows the right flash message" do
expect(flash[:error]).to eq(I18n.t('error_unable_delete_default_status'))
end
end
end end
describe :update_work_package_done_ratio do describe :update_work_package_done_ratio do

@ -0,0 +1,40 @@
require 'spec_helper'
describe "layouts/base" do
include Redmine::MenuManager::MenuHelper
helper Redmine::MenuManager::MenuHelper
let!(:user) { FactoryGirl.create :user }
let!(:anonymous) { FactoryGirl.create(:anonymous) }
before do
view.stub(:current_menu_item).and_return("overview")
view.stub(:default_breadcrumb)
controller.stub(:default_search_scope)
end
describe "projects menu visibility" do
context "when the user is not logged in" do
before do
User.stub(:current).and_return anonymous
view.stub(:current_user).and_return anonymous
render
end
it "the projects menu should not be displayed" do
expect(response).to_not have_text("Projects")
end
end
context "when the user is logged in" do
before do
User.stub(:current).and_return user
view.stub(:current_user).and_return user
render
end
it "the projects menu should be displayed" do
expect(response).to have_text("Projects")
end
end
end
end
Loading…
Cancel
Save