Skip to content

Commit

Permalink
Faire apparaitre le champ "modèle de demande utilisé" sur les demande…
Browse files Browse the repository at this point in the history
…s pour les gestionnaires d'instances
  • Loading branch information
Yalaeddin committed Apr 16, 2024
1 parent e20380c commit 3abbaf9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/4_2_11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
- name: Prepare Redmine source
working-directory: redmine
run: |
# TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed
sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0
sed -i '/rubocop/d' Gemfile
rm -f .rubocop*
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/5_1_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
- name: Prepare Redmine source
working-directory: redmine
run: |
# TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed
sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0
sed -i -e 's/.*puma.*/ gem "puma", "< 6"/' Gemfile
sed -i '/rubocop/d' Gemfile
rm -f .rubocop*
Expand Down
3 changes: 2 additions & 1 deletion app/overrides/issues/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
:original => '8f374ec2439b27545906aae44228462dfe14d196',
:insert_bottom => 'div.attributes',
:text => %{
<% instance_manager = Redmine::Plugin.installed?(:redmine_scn) ? User.current.instance_manager? : false %>
<%= issue_fields_rows do |rows|
if User.current.admin?
if User.current.admin? || instance_manager
rows.left l(:label_issue_template), link_to_issue_template(@issue.issue_template), :class => 'template'
end
end %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ 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"
25 changes: 25 additions & 0 deletions spec/system/issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,29 @@ 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
user = User.find(2)
user.instance_manager = true
user.save
visit "issues/1"

expect(page).to have_selector("div", text: "Issue template:")
end
end
it "Should display the field when the user is an admin" do
user = User.find(2)
user.admin = true
user.save
visit "issues/1"

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
visit "issues/1"
expect(page).not_to have_selector("div", text: "Issue template:")
end
end
end

0 comments on commit 3abbaf9

Please sign in to comment.