Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

obey rubocop

as-opcc4e60ba7323
diff --git a/app/components/work_packages/exports/generate/modal_dialog_component.rb b/app/components/work_packages/exports/generate/modal_dialog_component.rb
index bcd5c17e9f3..8e89623387f 100644
--- a/app/components/work_packages/exports/generate/modal_dialog_component.rb
+++ b/app/components/work_packages/exports/generate/modal_dialog_component.rb
@@ -51,52 +51,52 @@ module WorkPackages
[
{
name: "hyphenation",
- label:'Hyphenation',
- caption: 'Break words between lines to improve text justification and readability.',
+ label: "Hyphenation",
+ caption: "Break words between lines to improve text justification and readability.",
options: hyphenation_options
},
{
name: "paper_size",
label: I18n.t("export.dialog.pdf.paper_size.label"),
- caption: 'The size of the paper to use for the PDF.',
+ caption: "The size of the paper to use for the PDF.",
options: paper_size_options
}
]
end
def hyphenation_options
- # This is a list of languages that are supported by the hyphenation library
- # https://rubygems.org/gems/text-hyphen
- [
- { value: "", label: 'Off', default: true },
- { value: "ca", label: 'Catalan' },
- { value: "cs", label: 'Czech' },
- { value: "da", label: 'Danish' },
- { value: "de", label: 'German' },
- { value: "en_uk", label: 'English (UK)' },
- { value: "en_us", label: 'English (USA)' },
- { value: "es", label: 'Spanish' },
- { value: "et", label: 'Estonian' },
- { value: "eu", label: 'Basque' },
- { value: "fi", label: 'Finnish' },
- { value: "fr", label: 'French' },
- { value: "ga", label: 'Irish' },
- { value: "hr", label: 'Croatian' },
- { value: "hu", label: 'Hungarian' },
- { value: "ia", label: 'Interlingua' },
- { value: "id", label: 'Indonesian' },
- { value: "is", label: 'Icelandic' },
- { value: "it", label: 'Italian' },
- { value: "mn", label: 'Mongolian' },
- { value: "ms", label: 'Malay' },
- { value: "nl", label: 'Dutch' },
- { value: "no", label: 'Norwegian' },
- { value: "pl", label: 'Polish' },
- { value: "pt", label: 'Portuguese' },
- { value: "ru", label: 'Russian' },
- { value: "sk", label: 'Slovak' },
- { value: "sv", label: 'Swedish' }
- ]
+ # This is a list of languages that are supported by the hyphenation library
+ # https://rubygems.org/gems/text-hyphen
+ [
+ { value: "", label: "Off", default: true },
+ { value: "ca", label: "Catalan" },
+ { value: "cs", label: "Czech" },
+ { value: "da", label: "Danish" },
+ { value: "de", label: "German" },
+ { value: "en_uk", label: "English (UK)" },
+ { value: "en_us", label: "English (USA)" },
+ { value: "es", label: "Spanish" },
+ { value: "et", label: "Estonian" },
+ { value: "eu", label: "Basque" },
+ { value: "fi", label: "Finnish" },
+ { value: "fr", label: "French" },
+ { value: "ga", label: "Irish" },
+ { value: "hr", label: "Croatian" },
+ { value: "hu", label: "Hungarian" },
+ { value: "ia", label: "Interlingua" },
+ { value: "id", label: "Indonesian" },
+ { value: "is", label: "Icelandic" },
+ { value: "it", label: "Italian" },
+ { value: "mn", label: "Mongolian" },
+ { value: "ms", label: "Malay" },
+ { value: "nl", label: "Dutch" },
+ { value: "no", label: "Norwegian" },
+ { value: "pl", label: "Polish" },
+ { value: "pt", label: "Portuguese" },
+ { value: "ru", label: "Russian" },
+ { value: "sk", label: "Slovak" },
+ { value: "sv", label: "Swedish" }
+ ]
end
def paper_size_options
diff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rb
index 0bc2313dc6d..81e3613a662 100644
--- a/app/controllers/work_packages_controller.rb
+++ b/app/controllers/work_packages_controller.rb
@@ -37,7 +37,7 @@ class WorkPackagesController < ApplicationController
accept_key_auth :index, :show
before_action :authorize_on_work_package,
- :project, only: [:show, :generate_pdf_dialog, :generate_pdf]
+ :project, only: %i[show generate_pdf_dialog generate_pdf]
before_action :load_and_authorize_in_optional_project,
:check_allowed_export,
:protect_from_unauthorized_export, only: %i[index export_dialog]