Skip to content

Commit

Permalink
Complete Readme with latest feature and cleanup code and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Apr 18, 2024
1 parent 5601bfb commit d9a918e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/master.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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Here is a complete list of the features:
* Include the 'notes' field in workflows, providing the capability to **require notes** when updating an issue
* Issues filter: **sort group-by options alphabetically**
* PDF exports: add **links to attached files in generated PDF**"
* Projects overview: add an option to **hide members section**

## Test status

Expand Down
16 changes: 8 additions & 8 deletions app/overrides/projects/show.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Deface::Override.new :virtual_path => 'projects/show',
:name => 'hide-members-on-project-overview',
:surround => "erb[loud]:contains('members_box')",
:text => <<-EOS
<% if !Setting["plugin_redmine_tiny_features"]["hide_members_section_in_overview_project"].present? %>
<%= render_original %>
<% end %>
EOS
Deface::Override.new :virtual_path => 'projects/show',
:name => 'hide-members-on-project-overview',
:surround => "erb[loud]:contains('members_box')",
:text => <<-EOS
<% if !Setting["plugin_redmine_tiny_features"]["hide_members_section_on_project_overview"].present? %>
<%= render_original %>
<% end %>
EOS
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@
<%= l("setting_load_issue_edit_form_asynchronously") %>
<% end %>
</p>

<p>
<%= label_tag '', { style: 'width: auto;' } do %>
<%= check_box_tag "settings[hide_members_section_in_overview_project]", '1', Setting["plugin_redmine_tiny_features"]["hide_members_section_in_overview_project"] %>
<%= l("enable_members_in_overview_project") %>
<%= check_box_tag "settings[hide_members_section_on_project_overview]", '1', Setting["plugin_redmine_tiny_features"]["hide_members_section_on_project_overview"] %>
<%= l("hide_members_on_project_overview") %>
<% end %>
</p>

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ en:
label_issue_display_by_priority: "Colorization According to priority"
label_issue_display_by_status: "Colorization According to status"
field_show_pagination_at_top_results: "Show pagination links at the top of issues results"
enable_members_in_overview_project: "Hides members section on project overview page"
hide_members_on_project_overview: "Hide members section on project overview page"
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ fr:
label_issue_display_by_priority: "Colorisation par priorité"
label_issue_display_by_status: "Colorisation par statut"
field_show_pagination_at_top_results: "Afficher les liens de pagination en haut des résultats des demandes"
enable_members_in_overview_project: "Masquer la section des membres sur la page d'apercu d'un projet"
hide_members_on_project_overview: "Masquer la section des membres sur la page d'aperçu des projets"
8 changes: 4 additions & 4 deletions spec/system/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
describe "Option to hide/show the members section on the overview page of each project" do
let(:project_test) { Project.find(1) }

it "Should hide members section when the option is activated" do
it "hides members section when the option is activated" do

Setting.send "plugin_redmine_tiny_features=", {
"hide_members_section_in_overview_project" => "1",
"hide_members_section_on_project_overview" => "1",
}

visit "/projects/#{project_test.identifier}"
expect(page).to_not have_selector('div.members')

end

it "Should display members section when the option is deactivated" do
it "displays members section when the option is deactivated" do

Setting.send "plugin_redmine_tiny_features=", {
"hide_members_section_in_overview_project" => "",
"hide_members_section_on_project_overview" => "",
}

visit "/projects/#{project_test.identifier}"
Expand Down
8 changes: 4 additions & 4 deletions spec/system/settings_redmine_tiny_features_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
}
end

it "activates the option hide_members_section_in_overview_project" do
it "activates the option hide_members_section_on_project_overview" do
log_user('admin', 'admin')

visit 'settings/plugin/redmine_tiny_features'

find("input[name='settings[hide_members_section_in_overview_project]']").click
find("input[name='settings[hide_members_section_on_project_overview]']").click
find("input[name='commit']").click

expect(Setting["plugin_redmine_tiny_features"]["hide_members_section_in_overview_project"]).to eq '1'
expect(Setting["plugin_redmine_tiny_features"]["hide_members_section_on_project_overview"]).to eq '1'
Setting.send "plugin_redmine_tiny_features=", {
"warning_message_on_closed_issues" => "1",
"default_open_status" => "2",
"default_project" => "1",
"hide_members_section_in_overview_project" => "0",
"hide_members_section_on_project_overview" => "0",
}
end
end

0 comments on commit d9a918e

Please sign in to comment.