Skip to content

Commit

Permalink
Remove unused locale
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Apr 19, 2024
1 parent ee1feb9 commit 1be412f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/overrides/issues/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:original => '8f374ec2439b27545906aae44228462dfe14d196',
:insert_bottom => 'div.attributes',
:text => %{
<% instance_manager = Redmine::Plugin.installed?(:redmine_scn) ? User.current.instance_manager? : false %>
<% instance_manager = Redmine::Plugin.installed?(:redmine_scn) ? User.current.try(:instance_manager?) : false %>
<%= issue_fields_rows do |rows|
if User.current.admin? || instance_manager
rows.left l(:label_issue_template), link_to_issue_template(@issue.issue_template), :class => 'template'
Expand Down
3 changes: 1 addition & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ en:
label_other_issue: "Other issue"
disabled_tracker_for_this_project: Disabled tracker for this project
comment: Comment
template: "Issue template"
label_issue_template: "Issue template"
default_template_visibility: "Default template visibility"
field_autocomplete_subject: "Autocomplete subject"
field_issue_templates: "Issue templates"
Expand Down Expand Up @@ -79,4 +79,3 @@ en:
field_buttons_with_icons_field: Buttons with icons
label_value_at_index: "%{title} : value at index %{key} is empty"
label_copy: Copy of
label_issue_template: "Issue template"
8 changes: 5 additions & 3 deletions spec/system/issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,10 @@ def log_user(login, password)
end

end

describe "Field used issue template" do
if Redmine::Plugin.installed?(:redmine_scn)
it "Should display the field when the user is an instance manager" do
it "displays the field issue-template when the user is an instance manager" do
user = User.find(2)
user.instance_manager = true
user.save
Expand All @@ -265,7 +266,8 @@ def log_user(login, password)
expect(page).to have_selector("div", text: "Issue template:")
end
end
it "Should display the field when the user is an admin" do

it "displays the field issue-template when the user is an admin" do
user = User.find(2)
user.admin = true
user.save
Expand All @@ -274,7 +276,7 @@ def log_user(login, password)
expect(page).to have_selector("div", text: "Issue template:")
end

it "Should not display the field when the user is neither an admin nor a manager" do
it "does not display the field issue-template when the user is neither an admin nor a manager" do
visit "issues/1"
expect(page).not_to have_selector("div", text: "Issue template:")
end
Expand Down

0 comments on commit 1be412f

Please sign in to comment.