Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket 272997,Ne pas appliquer le filtre par tracker s'ils sont tous sélectionnés #40

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions app/views/issue_templates/_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</div>
</label>
<% end %>
<%= check_box_tag 'tracker_ids[]', 0, 1, :id => nil, :style => 'display:none;' %>
</fieldset>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/issue_templates/_list_template.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%>

<tr class="issue_template issue"
data-tracker-id="<%= issue_template.tracker_id %>"
data-tracker-id="<%= (issue_template.tracker_id.present? ? issue_template.tracker_id : 0) %>"
data-template-id="<%= issue_template.id %>"
data-template-enabled="<%= issue_template.template_enabled? ? '1' : '0' %>">
<% link_to_edition = Proc.new do |label, title|
Expand Down
23 changes: 22 additions & 1 deletion spec/system/issue_templates_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,26 @@ def find_closest_label(labels ,target_element)
end
end
end


describe "Template index" do

before do
log_user('admin', 'admin')
end

it "Should not apply the filter by tracker if all trackers are selected" do
# Removing a tracker to simulate the absence of a tracker
tracker_to_remove = Tracker.find(3)
tracker_to_remove.destroy

# Retrieving the issue template without a tracker
template_without_tracker = IssueTemplate.last

# Verifying that the issue template has a tracker_id equal to 0
expect(template_without_tracker.tracker_id).to eq(0)

visit "/issue_templates"
expect(page.body).to have_selector("a", text: "#{template_without_tracker.template_title}")
end
end
end
Loading