Don't show done ratio on WorkPackage#show if disabled

pull/423/head
Michael Frister 11 years ago
parent f36cc6a94a
commit 02dc2ecc03
  1. 2
      app/helpers/work_packages_helper.rb
  2. 2
      app/models/work_package.rb
  3. 7
      features/work_packages/work_package_show.feature

@ -371,6 +371,8 @@ module WorkPackagesHelper
end
def work_package_show_progress_attribute(work_package)
return if Setting.issue_done_ratio == 'disabled'
work_package_show_table_row(:progress, 'done-ratio') do
progress_bar work_package.done_ratio, :width => '80px', :legend => work_package.done_ratio.to_s
end

@ -22,7 +22,7 @@ class WorkPackage < ActiveRecord::Base
# >>> issues.rb >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include Redmine::SafeAttributes
DONE_RATIO_OPTIONS = %w(issue_field issue_status)
DONE_RATIO_OPTIONS = %w(issue_field issue_status disabled)
ATTRIBS_WITH_VALUES_FROM_CHILDREN = %w(priority_id start_date due_date estimated_hours done_ratio)
# <<< issues.rb <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@ -71,6 +71,13 @@ Feature: Viewing a work package
When I go to the page of the work package "issue1"
Then I should see "Bug #1: issue1"
Then I should see "Bug #2: issue2" within ".idnt-1"
And I should see "0 Total progress"
Scenario: View work package with issue done ratio disabled
Given the "issue_done_ratio" setting is set to disabled
When I go to the page of the work package "issue1"
Then I should see "Bug #1: issue1"
And I should not see "Total progress"
Scenario: View child work package of type issue
When I go to the page of the work package "issue1"

Loading…
Cancel
Save