Drop unmaintained ruby 3.0 support
This commit is contained in:
parent
886938495f
commit
07942a59e2
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.0', '3.1', '3.2']
|
||||
ruby: ['3.1', '3.2']
|
||||
redmine: ['5.0-stable', '5.1-stable', 'master']
|
||||
db: ['postgres', 'mysql']
|
||||
exclude:
|
||||
|
@ -4,7 +4,7 @@ require:
|
||||
- rubocop-minitest
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 3.0
|
||||
TargetRubyVersion: 3.1
|
||||
TargetRailsVersion: 6.1
|
||||
NewCops: enable
|
||||
ActiveSupportExtensionsEnabled: true
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- Maintenance release
|
||||
- Ruby 3.1 required
|
||||
|
||||
## 3.2.0
|
||||
|
||||
- add option to hide issue attachments, if number of file is too high
|
||||
|
36
README.md
36
README.md
@ -12,11 +12,10 @@ Additionals is a `Redmine` plugin for customizing Redmine, providing wiki macros
|
||||
| Name | requirement |
|
||||
| -------------------|----------------------------------|
|
||||
| `Redmine` version | >= 5.0 |
|
||||
| `Ruby` version | >= 3.0 |
|
||||
| `Ruby` version | >= 3.1 |
|
||||
| Database version | MySQL >= 8.0 or PostgreSQL >= 10 |
|
||||
|
||||
> **_NOTE:_** If you use MySQL, make sure all database tables using the same storage engine (InnoDB is recommended) and character set (utf8mb4 is recommended).
|
||||
|
||||
> **_NOTE:_** For more information use the official [Redmine install documentation](https://www.redmine.org/projects/redmine/wiki/RedmineInstall)
|
||||
|
||||
## Installation
|
||||
@ -222,27 +221,26 @@ The following plugin options are available to be edited by users with administra
|
||||
|
||||
And the following options can be edited by users with administratios rights in the area **Settings**:
|
||||
|
||||
- Open external URLs
|
||||
- Activate the option ``Open external URLs`` in order to open those URLs in a new window or browser tab if someone wants to visit them.
|
||||
* Open external URLs
|
||||
* Activate the option ``Open external URLs`` in order to open those URLs in a new window or browser tab if someone wants to visit them.
|
||||
|
||||
- Go to top Link
|
||||
- Add "Go to top" link. If you have a lot of long pages, it is enabling users to easily return to the top of a page.
|
||||
* Go to top Link
|
||||
* Add "Go to top" link. If you have a lot of long pages, it is enabling users to easily return to the top of a page.
|
||||
|
||||
- Emoji support
|
||||
- Activate this option if you want to convert emojis in text. For more info on Emoji-Browser support read [more here](http://caniemoji.com/). Have a look at the Emoji [cheat sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet) for available Emoji-Codes.
|
||||
|
||||
- Legacy smileys support
|
||||
- Activate the ``Legacy smileys support`` if you want to use the manual smiley code in your text (e.g. ``:)``). If you already use a plugin that supports Smileys this option should stay deactivated.
|
||||
* Emoji support
|
||||
* Activate this option if you want to convert emojis in text. For more info on Emoji-Browser support read [more here](http://caniemoji.com/). Have a look at the Emoji [cheat sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet) for available Emoji-Codes.
|
||||
|
||||
- Maximum number of LiveSearch results
|
||||
- This option only affects plugins, that support LiveSearch. If you enter a value here, the LiveSearch results will be limited by the entered value.
|
||||
* Legacy smileys support
|
||||
* Activate the ``Legacy smileys support`` if you want to use the manual smiley code in your text (e.g. ``:)``). If you already use a plugin that supports Smileys this option should stay deactivated.
|
||||
|
||||
* Maximum number of LiveSearch results
|
||||
* This option only affects plugins, that support LiveSearch. If you enter a value here, the LiveSearch results will be limited by the entered value.
|
||||
|
||||
### Disable modules
|
||||
|
||||
This feature will hide the selected modules in the project settings. Even if the module is enabled for usage in the admin area it can not be selected by the project manager within the projects. Please note, if these modules already activated in existing projects, you will have to change and re-save the respective project settings first.
|
||||
|
||||
> **_NOTE:_** Please restart the application server, if you make changes to the external urls settings as well as if you activate the Smileys support.
|
||||
|
||||
> **_Tip:_** You can use the following manual smiley codes: :), =), :D, =D, :'(, :(, ;), :P, :O, :/, :S, :|, :X, :*, O:), >:), B), (!), (?), (v), (x) and (/)
|
||||
|
||||
## Wiki section
|
||||
@ -339,7 +337,6 @@ Here you can define issue rules, which are used in issues of all projects.
|
||||
If *Assignee* is unchanged and the issue status changed from x to y, than the author is assigned to the issue.
|
||||
Issues should be automatically assigned to the author, if the status changes to *Approval*.
|
||||
|
||||
|
||||
> **_NOTE:_** Use Case for this option is that issues should be automatically assigned to author, if the status changes to *Approval*.
|
||||
|
||||
Current issue status x is only allowed if *Assignee* is the current user.
|
||||
@ -391,13 +388,13 @@ Known external plugins that have a user manual and support this feature are curr
|
||||
* redmine_service_desk
|
||||
* redmine_wiki_guide
|
||||
|
||||
## User account
|
||||
## User account
|
||||
|
||||
The following option has been added to the *Auto-watch* section in the user account:
|
||||
|
||||
* Issues assigned to me
|
||||
|
||||
If this option is activated, you will be set as a watcher based on the assignment. The aim is to be notified of changes even without prior interaction with the issue. For example, if the issue is assigned to another user in the meantime.
|
||||
If this option is activated, you will be set as a watcher based on the assignment. The aim is to be notified of changes even without prior interaction with the issue. For example, if the issue is assigned to another user in the meantime.
|
||||
|
||||

|
||||
|
||||
@ -595,10 +592,11 @@ This will always happen, if you work as user with the appropriate permission to
|
||||
|
||||
#### How many default Dashboards can be created?
|
||||
|
||||
There is just one system default dashboard possible for every area. This means one default dashboard for the Redmine "Home" page. And one for the general project overview page. But you can create also one default for a specific project overview page, which will than be "Project default".
|
||||
There is just one system default dashboard possible for every area. This means one default dashboard for the Redmine "Home" page. And one for the general project overview page. But you can create also one default for a specific project overview page, which will than be "Project default".
|
||||
|
||||
All you need to do is:
|
||||
* go to the project of your choice and set one of the existing dashboards as "System default".
|
||||
|
||||
* go to the project of your choice and set one of the existing dashboards as "System default".
|
||||
* If not yet any other dashboard exist, create a new one for the project and set it as "System default".
|
||||
|
||||

|
||||
|
@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
||||
f.match %r{^((contrib|test|node_modules)/|Gemfile|Gemfile\.lock|additionals\.gemspec|package\.json|yarn\.lock)}
|
||||
end
|
||||
spec.require_paths = ['lib']
|
||||
spec.required_ruby_version = '>= 3.0'
|
||||
spec.required_ruby_version = '>= 3.1'
|
||||
|
||||
spec.add_dependency 'redmine_plugin_kit'
|
||||
spec.add_dependency 'render_async'
|
||||
|
@ -17,7 +17,7 @@ class AdditionalsAssignToMeController < ApplicationController
|
||||
@issue.assigned_to = User.current
|
||||
|
||||
call_hook :controller_additionals_assign_to_me_before_save,
|
||||
params: params,
|
||||
params:,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
@ -27,7 +27,7 @@ class AdditionalsAssignToMeController < ApplicationController
|
||||
end
|
||||
|
||||
call_hook :controller_additionals_assign_to_me_after_save,
|
||||
params: params,
|
||||
params:,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
|
@ -20,7 +20,7 @@ class AdditionalsChangeStatusController < ApplicationController
|
||||
@issue.assigned_to = User.current if @issue.status_x_affected?(new_status_id) && issue_old_user != User.current
|
||||
|
||||
call_hook :controller_additionals_change_status_before_save,
|
||||
params: params,
|
||||
params:,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
@ -31,7 +31,7 @@ class AdditionalsChangeStatusController < ApplicationController
|
||||
end
|
||||
|
||||
call_hook :controller_additionals_change_status_after_save,
|
||||
params: params,
|
||||
params:,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
|
@ -28,7 +28,7 @@ class AdditionalsJournalsController < ApplicationController
|
||||
@journal.safe_attributes = journal_attributes
|
||||
@journal.save
|
||||
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
||||
call_hook(:controller_additionals_journals_edit_post, { journal: @journal, params: params })
|
||||
call_hook(:controller_additionals_journals_edit_post, { journal: @journal, params: })
|
||||
respond_to do |format|
|
||||
format.html { redirect_after_update }
|
||||
format.js { render 'additionals_journals/update' }
|
||||
|
@ -11,7 +11,7 @@ module AdditionalsClipboardjsHelper
|
||||
tag.acronym text,
|
||||
class: 'clipboard-text',
|
||||
title: l(:label_copy_to_clipboard),
|
||||
data: clipboardjs_data(text: text)
|
||||
data: clipboardjs_data(text:)
|
||||
end
|
||||
|
||||
def clipboardjs_data(clipboard_data)
|
||||
|
@ -85,8 +85,8 @@ module AdditionalsFontawesomeHelper
|
||||
render layout: false,
|
||||
partial: 'additionals/select2_ajax_call',
|
||||
formats: [:js],
|
||||
locals: { field_class: field_class,
|
||||
locals: { field_class:,
|
||||
ajax_url: fontawesome_auto_completes_path(selected: @selected_store.join(',')),
|
||||
options: options }
|
||||
options: }
|
||||
end
|
||||
end
|
||||
|
@ -91,9 +91,9 @@ module AdditionalsJournalsHelper
|
||||
end
|
||||
|
||||
if no_detail
|
||||
l :text_journal_changed_no_detail, label: label
|
||||
l(:text_journal_changed_no_detail, label:)
|
||||
elsif show_diff
|
||||
s = l :text_journal_changed_no_detail, label: label
|
||||
s = l(:text_journal_changed_no_detail, label:)
|
||||
unless no_html
|
||||
diff_link = link_to l(:label_diff),
|
||||
send(diff_url_method,
|
||||
@ -106,14 +106,14 @@ module AdditionalsJournalsHelper
|
||||
s
|
||||
elsif detail.value.present?
|
||||
if detail.old_value.present?
|
||||
l :text_journal_changed, label: label, old: old_value, new: value
|
||||
l :text_journal_changed, label:, old: old_value, new: value
|
||||
elsif multiple
|
||||
l :text_journal_added, label: label, value: value
|
||||
l(:text_journal_added, label:, value:)
|
||||
else
|
||||
l :text_journal_set_to, label: label, value: value
|
||||
l :text_journal_set_to, label:, value:
|
||||
end
|
||||
else
|
||||
l :text_journal_deleted, label: label, old: old_value
|
||||
l :text_journal_deleted, label:, old: old_value
|
||||
end.html_safe
|
||||
else
|
||||
# default implementation for journal detail rendering
|
||||
|
@ -25,12 +25,12 @@ module AdditionalsQueriesHelper
|
||||
session_key = additionals_query_session_key object_type
|
||||
query_class = Object.const_get :"#{object_type.camelcase}Query"
|
||||
if params[:query_id].present?
|
||||
additionals_load_query_id query_class,
|
||||
additionals_load_query_id(query_class,
|
||||
session_key,
|
||||
params[:query_id],
|
||||
object_type,
|
||||
user_filter: user_filter,
|
||||
search_string: search_string
|
||||
user_filter:,
|
||||
search_string:)
|
||||
elsif api_request? ||
|
||||
params[:set_filter] ||
|
||||
session[session_key].nil? ||
|
||||
@ -149,14 +149,14 @@ module AdditionalsQueriesHelper
|
||||
partial: 'auto_completes/grouped_users',
|
||||
locals: { with_me: with_me && (search_term.blank? || l(:label_me).downcase.include?(search_term.downcase)),
|
||||
with_ano: with_ano && (search_term.blank? || l(:label_user_anonymous).downcase.include?(search_term.downcase)),
|
||||
me_value: me_value,
|
||||
me_value:,
|
||||
sep_required: false }
|
||||
end
|
||||
|
||||
def additionals_query_to_xlsx(query, no_id_link: false)
|
||||
require 'write_xlsx'
|
||||
|
||||
options = { no_id_link: no_id_link,
|
||||
options = { no_id_link:,
|
||||
filename: StringIO.new(+'') }
|
||||
|
||||
export_to_xlsx query.entries, query.columns, options
|
||||
@ -297,7 +297,7 @@ module AdditionalsQueriesHelper
|
||||
flash[:notice] = l :notice_successful_update unless entries.empty?
|
||||
else
|
||||
flash[:error] = l :notice_failed_to_save_entity,
|
||||
name_plural: name_plural,
|
||||
name_plural:,
|
||||
count: unsaved_ids.size,
|
||||
total: entries.size,
|
||||
ids: "##{unsaved_ids.join ', #'}"
|
||||
|
@ -1,10 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module DashboardsHelper
|
||||
def dashboard_async_cache(dashboard, block, async, settings, &content_block)
|
||||
cache render_async_cache_key(_dashboard_async_blocks_path(@project, dashboard.async_params(block, async, settings))),
|
||||
def dashboard_async_cache(dashboard, block, async, settings, &)
|
||||
cache(render_async_cache_key(_dashboard_async_blocks_path(@project, dashboard.async_params(block, async, settings))),
|
||||
expires_in: async[:cache_expires_in] || DashboardContent::RENDER_ASYNC_CACHE_EXPIRES_IN,
|
||||
skip_digest: true, &content_block
|
||||
skip_digest: true, &)
|
||||
end
|
||||
|
||||
def dashboard_sidebar?(dashboard, params)
|
||||
@ -238,7 +238,7 @@ module DashboardsHelper
|
||||
icons << tag.span('', class: 'icon-only icon-warning', title: dashboard_block_sync_info(block_definition))
|
||||
end
|
||||
icons << tag.span('', class: 'icon-only icon-sort-handle sort-handle', title: l(:button_move))
|
||||
icons << delete_link(_remove_block_dashboard_path(@project, dashboard, block: block),
|
||||
icons << delete_link(_remove_block_dashboard_path(@project, dashboard, block:),
|
||||
method: :post,
|
||||
remote: true,
|
||||
class: 'icon-only icon-close',
|
||||
@ -251,10 +251,10 @@ module DashboardsHelper
|
||||
end
|
||||
|
||||
def build_dashboard_partial_locals(block, block_definition, settings, dashboard)
|
||||
partial_locals = { dashboard: dashboard,
|
||||
settings: settings,
|
||||
block: block,
|
||||
block_definition: block_definition,
|
||||
partial_locals = { dashboard:,
|
||||
settings:,
|
||||
block:,
|
||||
block_definition:,
|
||||
user: User.current }
|
||||
|
||||
if block_definition[:query_block]
|
||||
@ -318,7 +318,7 @@ module DashboardsHelper
|
||||
return unless title
|
||||
|
||||
font_awesome_icon('fas_info-circle',
|
||||
title: title,
|
||||
title:,
|
||||
class: 'dashboard-block-alert')
|
||||
end
|
||||
|
||||
@ -349,7 +349,7 @@ module DashboardsHelper
|
||||
.limit(max_entries)
|
||||
.to_a
|
||||
|
||||
render 'dashboards/blocks/documents', block: block, max_entries: max_entries, documents: documents
|
||||
render 'dashboards/blocks/documents', block:, max_entries:, documents:
|
||||
end
|
||||
|
||||
def render_news_block(block, _block_definition, settings, dashboard)
|
||||
@ -366,7 +366,7 @@ module DashboardsHelper
|
||||
.to_a
|
||||
end
|
||||
|
||||
render 'dashboards/blocks/news', block: block, max_entries: max_entries, news: news
|
||||
render 'dashboards/blocks/news', block:, max_entries:, news:
|
||||
end
|
||||
|
||||
def render_my_spent_time_block(block, block_definition, settings, dashboard)
|
||||
@ -380,11 +380,11 @@ module DashboardsHelper
|
||||
entries_days = scope.where spent_on: User.current.today - (days - 1)..User.current.today
|
||||
|
||||
render 'dashboards/blocks/my_spent_time',
|
||||
block: block,
|
||||
block_definition: block_definition,
|
||||
entries_today: entries_today,
|
||||
entries_days: entries_days,
|
||||
days: days
|
||||
block:,
|
||||
block_definition:,
|
||||
entries_today:,
|
||||
entries_days:,
|
||||
days:
|
||||
end
|
||||
|
||||
def activity_dashboard_data(settings, dashboard)
|
||||
|
@ -141,7 +141,7 @@ class AdditionalsFontAwesome
|
||||
(first_letter_search.present? && !values[:label].downcase.start_with?(first_letter_search) ||
|
||||
first_letter_search.blank? && values[:label] !~ /#{search}/i)
|
||||
|
||||
icons << { id: id, text: values[:label] }
|
||||
icons << { id:, text: values[:label] }
|
||||
cnt += 1
|
||||
end
|
||||
|
||||
|
@ -17,9 +17,9 @@ class AdditionalsJournal
|
||||
end
|
||||
|
||||
journal.details << JournalDetail.new(property: 'attr',
|
||||
prop_key: prop_key,
|
||||
old_value: old_value,
|
||||
value: value)
|
||||
prop_key:,
|
||||
old_value:,
|
||||
value:)
|
||||
journal.save
|
||||
end
|
||||
|
||||
|
@ -8,7 +8,7 @@ class AdditionalsMacro
|
||||
macro_list = []
|
||||
|
||||
# needs to run every request (for each user once)
|
||||
permissions = build_permissions controller_only: controller_only
|
||||
permissions = build_permissions(controller_only:)
|
||||
|
||||
if filtered.present?
|
||||
filtered << 'hello_world'
|
||||
|
@ -8,7 +8,7 @@ class AdditionalsPlugin
|
||||
|
||||
def method_missing(method_name, force: false)
|
||||
if validate_default_plugin_name method_name
|
||||
default_plugin_check? method_name, force: force
|
||||
default_plugin_check?(method_name, force:)
|
||||
else
|
||||
super
|
||||
end
|
||||
|
@ -72,14 +72,14 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
|
||||
class << self
|
||||
def system_default(dashboard_type)
|
||||
select(:id).find_by(dashboard_type: dashboard_type, system_default: true)
|
||||
select(:id).find_by(dashboard_type:, system_default: true)
|
||||
.try(:id)
|
||||
end
|
||||
|
||||
def default(dashboard_type, project = nil, user = User.current, recently_id = nil)
|
||||
recently_id ||= User.current.pref.recently_used_dashboard dashboard_type, project
|
||||
|
||||
scope = where dashboard_type: dashboard_type
|
||||
scope = where(dashboard_type:)
|
||||
scope = scope.where(project_id: project.id).or(scope.where(project_id: nil)) if project.present?
|
||||
|
||||
dashboard = scope.visible.find_by id: recently_id if recently_id.present?
|
||||
@ -177,7 +177,7 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
true
|
||||
when VISIBILITY_ROLES
|
||||
if project
|
||||
(user.roles_for_project(project) & roles).any?
|
||||
user.roles_for_project(project).intersect?(roles)
|
||||
else
|
||||
user.memberships.joins(:member_roles).where(member_roles: { role_id: roles.map(&:id) }).any?
|
||||
end
|
||||
@ -291,9 +291,9 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
end
|
||||
|
||||
def allowed_target_projects(user = User.current)
|
||||
self.class.allowed_entity_target_projects user: user,
|
||||
self.class.allowed_entity_target_projects user:,
|
||||
permission: :save_dashboards,
|
||||
project: project
|
||||
project:
|
||||
end
|
||||
|
||||
# this is used to get unique cache for blocks
|
||||
@ -305,7 +305,7 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
end
|
||||
|
||||
config = { dashboard_id: id,
|
||||
block: block }
|
||||
block: }
|
||||
|
||||
if RedminePluginKit.false? options[:skip_user_id]
|
||||
settings[:user_id] = User.current.id
|
||||
@ -402,8 +402,8 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
return unless system_default? && User.current.allowed_to?(:set_system_dashboards, project, global: true)
|
||||
|
||||
scope = self.class
|
||||
.where(dashboard_type: dashboard_type)
|
||||
.where.not(id: id)
|
||||
.where(dashboard_type:)
|
||||
.where.not(id:)
|
||||
|
||||
scope = scope.where project: project if dashboard_type == DashboardContentProject::TYPE_NAME
|
||||
|
||||
@ -429,10 +429,10 @@ class Dashboard < AdditionalsApplicationRecord
|
||||
def validate_name
|
||||
return if name.blank?
|
||||
|
||||
scope = self.class.visible.where name: name
|
||||
scope = self.class.visible.where(name:)
|
||||
if dashboard_type == DashboardContentProject::TYPE_NAME
|
||||
scope = scope.project_only
|
||||
scope = scope.where project_id: project_id
|
||||
scope = scope.where(project_id:)
|
||||
scope = scope.or scope.where(project_id: nil) if project_id.present?
|
||||
else
|
||||
scope = scope.welcome_only
|
||||
|
@ -105,7 +105,7 @@ class DashboardContent
|
||||
def find_block(block)
|
||||
block.to_s =~ /\A(.*?)(__\d+)?\z/
|
||||
name = Regexp.last_match 1
|
||||
available_blocks.key?(name) ? available_blocks[name].merge(name: name) : nil
|
||||
available_blocks.key?(name) ? available_blocks[name].merge(name:) : nil
|
||||
end
|
||||
|
||||
# Returns the default layout for a new dashboard
|
||||
@ -121,7 +121,7 @@ class DashboardContent
|
||||
def issues_cache_expires_in
|
||||
open_issue_count = Rails.cache.fetch issues_cache_key, expires_in: 1.hour do
|
||||
query = if project
|
||||
IssueQuery.new project: project, name: '_'
|
||||
IssueQuery.new project:, name: '_'
|
||||
else
|
||||
IssueQuery.new name: '_'
|
||||
end
|
||||
|
@ -7,4 +7,4 @@ fieldset.box
|
||||
= render_query_columns_selection query, name: "settings[#{setting_name_columns}][column_names]"
|
||||
|
||||
- if !defined?(totalable_columns) || totalable_columns
|
||||
= render 'additionals/settings_list_totals', query_class: query_class, query_type: query_type
|
||||
= render 'additionals/settings_list_totals', query_class:, query_type:
|
||||
|
@ -1,11 +1,11 @@
|
||||
= call_hook :view_dashboard_top, dashboard: dashboard, project: @project
|
||||
= call_hook :view_dashboard_top, dashboard:, project: @project
|
||||
|
||||
#my-page.splitcontent class="#{dashboard_css_classes dashboard}"
|
||||
- dashboard.available_groups.each do |group|
|
||||
.block-receiver id="list-#{group}" class="splitcontent#{group}"
|
||||
= render_dashboard_blocks dashboard.layout[group], dashboard
|
||||
|
||||
= call_hook :view_dashboard_bottom, dashboard: dashboard, project: @project
|
||||
= call_hook :view_dashboard_bottom, dashboard:, project: @project
|
||||
|
||||
= context_menu
|
||||
|
||||
|
@ -5,4 +5,4 @@
|
||||
h3 = link_to title, activity_path(user_id: User.current,
|
||||
from: events_by_day.keys.first)
|
||||
|
||||
= render 'activities/activities', events_by_day: events_by_day
|
||||
= render 'activities/activities', events_by_day:
|
||||
|
@ -12,7 +12,7 @@
|
||||
build_dashboard_partial_locals(block,
|
||||
block_definition,
|
||||
settings,
|
||||
dashboard).merge(with_async: with_async)
|
||||
dashboard).merge(with_async:)
|
||||
|
||||
p
|
||||
= submit_tag l(:button_save)
|
||||
|
@ -22,4 +22,4 @@ h3 = block_definition[:label]
|
||||
' :
|
||||
= formatted
|
||||
|
||||
= call_hook :view_projects_show_dashboard_info_block, project: @project, dashboard: dashboard
|
||||
= call_hook :view_projects_show_dashboard_info_block, project: @project, dashboard:
|
||||
|
@ -19,12 +19,12 @@
|
||||
/ required by some helpers of other plugins
|
||||
- @query = query
|
||||
|
||||
= render query_block[:list_partial],
|
||||
= render(query_block[:list_partial],
|
||||
query_block[:entities_var] => query.send(query_block[:entries_method] || 'entries',
|
||||
limit: settings[:max_entries] || DashboardContent::DEFAULT_MAX_ENTRIES),
|
||||
query: query,
|
||||
query:,
|
||||
query_options: { sort_param: 'sort',
|
||||
sort_link_options: { method: :post, remote: true } }
|
||||
sort_link_options: { method: :post, remote: true } })
|
||||
- else
|
||||
p.nodata = l :label_no_data
|
||||
- else
|
||||
|
@ -8,7 +8,7 @@
|
||||
- if @can_edit
|
||||
.hidden id="#{block}-settings"
|
||||
= form_tag _update_layout_setting_dashboard_path(@project, @dashboard), remote: true do
|
||||
= render 'dashboards/blocks/text_async_settings', block: block, settings: settings
|
||||
= render('dashboards/blocks/text_async_settings', block:, settings:)
|
||||
p
|
||||
= submit_tag l :button_save
|
||||
'
|
||||
|
@ -2,5 +2,5 @@ h2 = l :button_dashboard_edit
|
||||
= labelled_form_for :dashboard,
|
||||
@dashboard,
|
||||
html: { multipart: true, id: 'dashboard-form' } do |f|
|
||||
= render 'form', f: f
|
||||
= render('form', f:)
|
||||
= submit_tag l(:button_save)
|
||||
|
@ -3,5 +3,5 @@ h2 = l :label_new_dashboard
|
||||
@dashboard,
|
||||
url: { action: 'create', project_id: @project },
|
||||
html: { multipart: true, id: 'dashboard-form' } do |f|
|
||||
= render 'form', f: f
|
||||
= render('form', f:)
|
||||
= submit_tag l(:button_create)
|
||||
|
@ -62,7 +62,7 @@ module Additionals
|
||||
|
||||
def initialize_ids_filter(label: nil)
|
||||
if label
|
||||
add_available_filter 'ids', type: :integer, label: label
|
||||
add_available_filter 'ids', type: :integer, label:
|
||||
else
|
||||
add_available_filter 'ids', type: :integer, name: '#'
|
||||
end
|
||||
@ -123,10 +123,9 @@ module Additionals
|
||||
values: -> { project_statuses_values }
|
||||
end
|
||||
|
||||
def initialize_project_filter(always: false, position: nil, without_subprojects: false)
|
||||
def initialize_project_filter(always: false, without_subprojects: false)
|
||||
if project.nil? || always
|
||||
add_available_filter 'project_id', order: position,
|
||||
type: :list,
|
||||
add_available_filter 'project_id', type: :list,
|
||||
values: -> { project_values }
|
||||
end
|
||||
return if without_subprojects || project.nil? || project.leaf? || subproject_values.empty?
|
||||
@ -136,22 +135,19 @@ module Additionals
|
||||
values: -> { subproject_values }
|
||||
end
|
||||
|
||||
def initialize_created_filter(position: nil, label: nil)
|
||||
add_available_filter 'created_on', order: position,
|
||||
type: :date_past,
|
||||
label: label
|
||||
def initialize_created_filter(label: nil)
|
||||
add_available_filter 'created_on', type: :date_past,
|
||||
label:
|
||||
end
|
||||
|
||||
def initialize_updated_filter(position: nil, label: nil)
|
||||
add_available_filter 'updated_on', order: position,
|
||||
type: :date_past,
|
||||
label: label
|
||||
def initialize_updated_filter(label: nil)
|
||||
add_available_filter 'updated_on', type: :date_past,
|
||||
label:
|
||||
end
|
||||
|
||||
def initialize_author_filter(with_role: true, position: nil)
|
||||
def initialize_author_filter(with_role: true)
|
||||
add_available_filter 'author_id',
|
||||
type: :author,
|
||||
order: position
|
||||
type: :author
|
||||
|
||||
add_available_filter 'author.group',
|
||||
type: :list,
|
||||
@ -173,9 +169,8 @@ module Additionals
|
||||
name: l(:label_attribute_of_author, name: l(:field_hrm_user_type))
|
||||
end
|
||||
|
||||
def initialize_assignee_filter(with_role: true, position: nil)
|
||||
add_available_filter 'assigned_to_id', order: position,
|
||||
type: :assignee
|
||||
def initialize_assignee_filter(with_role: true)
|
||||
add_available_filter 'assigned_to_id', type: :assignee
|
||||
|
||||
add_available_filter 'assigned_to.group',
|
||||
type: :list,
|
||||
@ -197,11 +192,10 @@ module Additionals
|
||||
name: l(:label_attribute_of_assigned_to, name: l(:field_hrm_user_type))
|
||||
end
|
||||
|
||||
def initialize_watcher_filter(position: nil)
|
||||
def initialize_watcher_filter
|
||||
return unless User.current.logged?
|
||||
|
||||
add_available_filter 'watcher_id', order: position,
|
||||
type: :user_with_me
|
||||
add_available_filter 'watcher_id', type: :user_with_me
|
||||
end
|
||||
|
||||
def initialize_last_notes_filter(order: nil)
|
||||
@ -211,9 +205,8 @@ module Additionals
|
||||
add_available_filter 'last_notes', **options
|
||||
end
|
||||
|
||||
def initialize_notes_count_filter(position: nil)
|
||||
def initialize_notes_count_filter
|
||||
add_available_filter 'notes_count',
|
||||
order: position,
|
||||
type: :integer
|
||||
end
|
||||
|
||||
@ -221,7 +214,7 @@ module Additionals
|
||||
sql_aggr_condition table: Journal.table_name,
|
||||
values: value,
|
||||
group_field: 'journalized_id',
|
||||
operator: operator,
|
||||
operator:,
|
||||
use_sub_query_for_all: true,
|
||||
sub_query: "#{Journal.table_name} WHERE #{Journal.table_name}.journalized_id = #{queried_table_name}.id" \
|
||||
" AND #{Journal.table_name}.journalized_type = '#{queried_class.name}'" \
|
||||
@ -243,8 +236,8 @@ module Additionals
|
||||
values
|
||||
end
|
||||
|
||||
def initialize_notes_filter(position: nil)
|
||||
add_available_filter 'notes', type: :text, order: position
|
||||
def initialize_notes_filter
|
||||
add_available_filter 'notes', type: :text
|
||||
end
|
||||
|
||||
def roles_values
|
||||
|
@ -30,7 +30,7 @@ module Additionals
|
||||
notified << author if author
|
||||
notified += assigned_to_notified_users if assigned_to
|
||||
notified += project.notified_users if project
|
||||
Redmine::Hook.call_hook :model_notified_users, entity: self, notified: notified
|
||||
Redmine::Hook.call_hook(:model_notified_users, entity: self, notified:)
|
||||
|
||||
notified = notified.select(&:active?)
|
||||
notified.uniq!
|
||||
|
@ -56,7 +56,7 @@ module Additionals
|
||||
name: emoji.name,
|
||||
unicode_version: emoji.unicode_version
|
||||
}
|
||||
options = { title: emoji.description, data: data }
|
||||
options = { title: emoji.description, data: }
|
||||
|
||||
ActionController::Base.helpers.content_tag 'additionals-emoji', emoji.codepoints, options
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ module Additionals
|
||||
return if locals[:group_name].blank?
|
||||
|
||||
render partial: 'queries/additionals_group_view',
|
||||
locals: { query: query }.merge(locals)
|
||||
locals: { query: }.merge(locals)
|
||||
end
|
||||
|
||||
def render_query_block_columns(query, entry, tr_classes:, with_buttons: false, with_checkbox: true)
|
||||
@ -163,7 +163,7 @@ module Additionals
|
||||
formats: [:js],
|
||||
locals: { field_name_id: sanitize_to_id(name),
|
||||
ajax_url: send(:"#{type}_path", ajax_params),
|
||||
options: options })
|
||||
options: })
|
||||
safe_join s
|
||||
end
|
||||
|
||||
@ -178,7 +178,7 @@ module Additionals
|
||||
end
|
||||
|
||||
def addtionals_textarea_cols(text, min: 8, max: 20)
|
||||
RedminePluginKit.textarea_cols text, min: min, max: max
|
||||
RedminePluginKit.textarea_cols text, min:, max:
|
||||
end
|
||||
|
||||
def title_with_fontawesome(title, symbole, wrapper = 'span')
|
||||
@ -207,7 +207,7 @@ module Additionals
|
||||
end
|
||||
else
|
||||
s = []
|
||||
s << avatar(user, size: size, class: css_class)
|
||||
s << avatar(user, size:, class: css_class)
|
||||
s << if no_link
|
||||
no_link_name || user.name
|
||||
else
|
||||
@ -225,8 +225,8 @@ module Additionals
|
||||
|
||||
def human_float_number(value, precision: 2, separator: '.')
|
||||
ActionController::Base.helpers.number_with_precision(value,
|
||||
precision: precision,
|
||||
separator: separator,
|
||||
precision:,
|
||||
separator:,
|
||||
strip_insignificant_zeros: true)
|
||||
end
|
||||
|
||||
@ -238,7 +238,7 @@ module Additionals
|
||||
elsif params.nil?
|
||||
url_for params: request.query_parameters
|
||||
else
|
||||
url_for params: params
|
||||
url_for(params:)
|
||||
end
|
||||
|
||||
hidden_field_tag 'back_url', url, id: nil
|
||||
|
@ -25,7 +25,7 @@ module Additionals
|
||||
info.is_a?(Symbol) ? l(info) : info
|
||||
end
|
||||
|
||||
options[:label] = @template.tag.span text, title: title, class: 'field-description'
|
||||
options[:label] = @template.tag.span text, title:, class: 'field-description'
|
||||
end
|
||||
|
||||
super
|
||||
|
@ -43,7 +43,7 @@ module Additionals
|
||||
@entity = entity
|
||||
@entity_url = entity_url
|
||||
|
||||
mail to: user, subject: subject
|
||||
mail to: user, subject:
|
||||
end
|
||||
|
||||
def entity_updated(user, journal, entity_url:, headers:, subject:)
|
||||
@ -60,7 +60,7 @@ module Additionals
|
||||
@journal = journal
|
||||
@journal_details = journal.visible_details
|
||||
|
||||
mail to: user, subject: subject
|
||||
mail to: user, subject:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -74,7 +74,7 @@ module Additionals
|
||||
|
||||
def issues_assignable?(project = nil)
|
||||
scope = Principal.joins(members: :roles)
|
||||
.where(users: { id: id },
|
||||
.where(users: { id: },
|
||||
roles: { assignable: true })
|
||||
scope = scope.where members: { project_id: project.id } if project
|
||||
scope.exists?
|
||||
|
@ -90,7 +90,7 @@ module Additionals
|
||||
end
|
||||
src << "&#{mode}=" + ERB::Util.url_encode(options[:way_mode]) if options[:way_mode].present?
|
||||
|
||||
tag.iframe width: width, height: height, src: src, frameborder: 0, allowfullscreen: 'true'
|
||||
tag.iframe width:, height:, src:, frameborder: 0, allowfullscreen: 'true'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -46,7 +46,7 @@ module Additionals
|
||||
end
|
||||
|
||||
s = []
|
||||
s << tag.iframe(width: width, height: height, src: src, frameborder: 0, allowfullscreen: 'true')
|
||||
s << tag.iframe(width:, height:, src:, frameborder: 0, allowfullscreen: 'true')
|
||||
if options[:edit_link].present?
|
||||
raise '<edit_link> is not a Google document.' unless options[:edit_link].start_with? 'https://docs.google.com/'
|
||||
|
||||
|
@ -26,7 +26,7 @@ module Additionals
|
||||
users = Principal.visible.where(id: group.users).order(User.name_formatter[:order])
|
||||
render partial: 'wiki/user_macros',
|
||||
formats: [:html],
|
||||
locals: { users: users,
|
||||
locals: { users:,
|
||||
user_roles: nil,
|
||||
list_title: group_name }
|
||||
end
|
||||
|
@ -38,9 +38,9 @@ module Additionals
|
||||
|
||||
src = args[0]
|
||||
if Additionals.valid_iframe_url? src
|
||||
s = [tag.iframe(width: width,
|
||||
height: height,
|
||||
src: src,
|
||||
s = [tag.iframe(width:,
|
||||
height:,
|
||||
src:,
|
||||
frameborder: 0,
|
||||
allowfullscreen: 'true')]
|
||||
s << link_to(l(:label_open_in_new_windows), src, class: 'external') if RedminePluginKit.true? options[:with_link]
|
||||
|
@ -79,9 +79,9 @@ module Additionals
|
||||
options[:title]
|
||||
end
|
||||
|
||||
render 'wiki/user_macros', users: users,
|
||||
user_roles: user_roles,
|
||||
list_title: list_title
|
||||
render 'wiki/user_macros', users:,
|
||||
user_roles:,
|
||||
list_title:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -91,7 +91,7 @@ module Additionals
|
||||
src << Additionals.meteoblue_flag(options, :spot, true)
|
||||
src << Additionals.meteoblue_flag(options, :pressure, false)
|
||||
|
||||
tag.iframe width: width, height: height, src: src, frameborder: 0
|
||||
tag.iframe width:, height:, src:, frameborder: 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ module Additionals
|
||||
src = +"//www.slideshare.net/slideshow/embed_code/#{v}"
|
||||
src += "?startSlide=#{slide}" if slide.positive?
|
||||
|
||||
tag.iframe width: width, height: height, src: src, frameborder: 0, allowfullscreen: 'true'
|
||||
tag.iframe width:, height:, src:, frameborder: 0, allowfullscreen: 'true'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -54,7 +54,7 @@ module Additionals
|
||||
|
||||
render partial: 'wiki/tradingview',
|
||||
formats: [:html],
|
||||
locals: { options: options }
|
||||
locals: { options: }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ module Additionals
|
||||
else
|
||||
"//player.vimeo.com/video/#{v}"
|
||||
end
|
||||
tag.iframe width: width, height: height, src: src, frameborder: 0, allowfullscreen: 'true'
|
||||
tag.iframe width:, height:, src:, frameborder: 0, allowfullscreen: 'true'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ module Additionals
|
||||
else
|
||||
"//www.youtube-nocookie.com/embed/#{v}"
|
||||
end
|
||||
tag.iframe width: width, height: height, src: src, frameborder: 0, allowfullscreen: 'true'
|
||||
tag.iframe width:, height:, src:, frameborder: 0, allowfullscreen: 'true'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -116,12 +116,12 @@ module Additionals
|
||||
colspan -= 1 unless with_checkbox
|
||||
assert_select block_tr_select do
|
||||
block_columns.each do |column_name|
|
||||
assert_select_td_column column_name, colspan: colspan
|
||||
assert_select_td_column column_name, colspan:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def with_plugin_settings(plugin, settings, &_block)
|
||||
def with_plugin_settings(plugin, settings, &)
|
||||
change_plugin_settings plugin, settings
|
||||
yield
|
||||
ensure
|
||||
@ -160,14 +160,14 @@ module Additionals
|
||||
params[:sort] = "#{column}:asc"
|
||||
params[:c] = columns
|
||||
|
||||
get action, params: params
|
||||
get(action, params:)
|
||||
|
||||
assert_response :success
|
||||
assert_select "table.list.#{table_css}.sort-by-#{column_css}.sort-asc"
|
||||
|
||||
params[:sort] = "#{column}:desc"
|
||||
|
||||
get action, params: params
|
||||
get(action, params:)
|
||||
|
||||
assert_response :success
|
||||
assert_select "table.list.#{table_css}.sort-by-#{column_css}.sort-desc"
|
||||
|
@ -33,7 +33,7 @@ module Additionals
|
||||
end
|
||||
|
||||
Project.where(id: [1, 2]).find_each do |project|
|
||||
EnabledModule.create project: project, name: 'issue_tracking'
|
||||
EnabledModule.create project:, name: 'issue_tracking'
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user