diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index f49d3e0d1d23..b2eac6ca41e7 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -5,6 +5,3 @@
21a696ef9b170e14ad2daf53364a4c2113822c2f
# Update copyright information for 2023
c795874f7f281297bbd3bad2fdb58b24cb4ce624
-# switch to double quotes
-5c72ea0046a6b5230bf456f55a296ed6fd579535
-9e4934cd0a468f46d8f0fc0f11ebc2d4216f789c
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 7a014e6b9d54..937c42cd3c66 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -12,7 +12,7 @@ on:
inputs:
tag:
description: "The tag to release. Note that this happens by default on the tag push. Only run this action when something went wrong!"
- required: false
+ required: true
permissions:
contents: read # to fetch code (actions/checkout)
@@ -23,7 +23,7 @@ env:
jobs:
build:
if: github.repository == 'opf/openproject'
- runs-on: runs-on,runner=8cpu-linux,family=m7i+m7a,run-id=${{ github.run_id }}
+ runs-on: [ self-hosted, aws, ubuntu22, x64, 2XL ]
strategy:
matrix:
include:
@@ -45,31 +45,21 @@ jobs:
run: |
if [[ ${{ github.event_name }} == 'push' ]]; then
TAG_REF=${GITHUB_REF#refs/tags/}
- CHECKOUT_REF=$GITHUB_REF
- elif [[ ${{ github.event_name }} == 'schedule' ]]; then
- TAG_REF=dev
- CHECKOUT_REF=refs/heads/dev
elif [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
TAG_REF=${{ inputs.tag }}
- CHECKOUT_REF=${{ inputs.tag }}
- else
- echo "Unsupported event"
- exit 1
- fi
-
- if [ -z "$TAG_REF" ] || [ -z "$CHECKOUT_REF" ]; then
- echo "No TAG_REF or CHECKOUT_REF set. Aborting"
- exit 1
fi
VERSION=${TAG_REF#v}
echo "Version: $VERSION"
echo "::set-output name=version::$VERSION"
- echo "::set-output name=checkout_ref::$CHECKOUT_REF"
- - name: Checkout
+ - name: Checkout current release
+ if: ${{ github.event_name == 'push' }}
+ uses: actions/checkout@v3
+ - name: Checkout specific version
+ if: ${{ github.event_name != 'push' }}
with:
- ref: ${{ steps.extract_version.outputs.checkout_ref }}
- uses: actions/checkout@v4
+ ref: ${{ inputs.tag }}
+ uses: actions/checkout@v3
- name: Prepare docker files
run: |
cp ./docker/prod/Dockerfile ./Dockerfile
@@ -92,7 +82,6 @@ jobs:
images: |
${{ env.REGISTRY_IMAGE }}
- name: Build image
- id: build
uses: docker/build-push-action@v4
with:
context: .
@@ -115,7 +104,7 @@ jobs:
-e SUPERVISORD_LOG_LEVEL=debug \
-e OPENPROJECT_LOGIN__REQUIRED=false \
-e OPENPROJECT_HTTPS=false \
- ${{ steps.build.outputs.imageid }}
+ ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
sleep 60
diff --git a/.rubocop.yml b/.rubocop.yml
index f646e9c75e1f..b951a30741b5 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -415,9 +415,10 @@ Style/SpecialGlobalVars:
# For the record: using single quotes does NOT have any performance advantages.
# Even if it did, this would be a silly argument.
#
-# Quote away.
+# Ideally we would just use double quotes everywhere but since that would result
+# in innumerable rubocop offenses we will just disable this. Quote away.
Style/StringLiterals:
- EnforcedStyle: double_quotes
+ Enabled: false
Style/TrivialAccessors:
Enabled: false
diff --git a/Gemfile b/Gemfile
index 057eea92f93d..fe91826a6a2a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -26,361 +26,362 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-source "https://rubygems.org"
+source 'https://rubygems.org'
# TODO: Once packager.io and heroku buildpacks support bundler 2.4.22,
# then we can use the new bundler syntax `ruby file: '.ruby-version'`.
# https://github.com/heroku/heroku-buildpack-ruby/issues/1408#issuecomment-1841596215
-ruby File.read(".ruby-version").strip
+ruby File.read('.ruby-version').strip
-gem "actionpack-xml_parser", "~> 2.0.0"
-gem "activemodel-serializers-xml", "~> 1.0.1"
-gem "activerecord-import", "~> 1.6.0"
-gem "activerecord-session_store", "~> 2.1.0"
-gem "ox"
-gem "rails", "~> 7.1.3"
-gem "responders", "~> 3.0"
+gem 'actionpack-xml_parser', '~> 2.0.0'
+gem 'activemodel-serializers-xml', '~> 1.0.1'
+gem 'activerecord-import', '~> 1.5.0'
+gem 'activerecord-session_store', '~> 2.1.0'
+gem 'ox'
+gem 'rails', '~> 7.1.3'
+gem 'responders', '~> 3.0'
-gem "ffi", "~> 1.15"
+gem 'ffi', '~> 1.15'
-gem "rdoc", ">= 2.4.2"
+gem 'rdoc', '>= 2.4.2'
-gem "doorkeeper", "~> 5.6.6"
+gem 'doorkeeper', '~> 5.6.6'
# Maintain our own omniauth due to relative URL root issues
# see upstream PR: https://github.com/omniauth/omniauth/pull/903
-gem "omniauth", git: "https://github.com/opf/omniauth", ref: "fe862f986b2e846e291784d2caa3d90a658c67f0"
-gem "request_store", "~> 1.6.0"
+gem 'omniauth', git: 'https://github.com/opf/omniauth', ref: 'fe862f986b2e846e291784d2caa3d90a658c67f0'
+gem 'request_store', '~> 1.6.0'
-gem "warden", "~> 1.2"
-gem "warden-basic_auth", "~> 0.2.1"
+gem 'warden', '~> 1.2'
+gem 'warden-basic_auth', '~> 0.2.1'
-gem "will_paginate", "~> 4.0.0"
+gem 'will_paginate', '~> 4.0.0'
-gem "friendly_id", "~> 5.5.0"
+gem 'friendly_id', '~> 5.5.0'
-gem "acts_as_list", "~> 1.1.0"
-gem "acts_as_tree", "~> 2.9.0"
-gem "awesome_nested_set", "~> 3.6.0"
-gem "closure_tree", "~> 7.4.0"
-gem "rubytree", "~> 2.0.0"
+gem 'acts_as_list', '~> 1.1.0'
+gem 'acts_as_tree', '~> 2.9.0'
+gem 'awesome_nested_set', '~> 3.6.0'
+gem 'closure_tree', '~> 7.4.0'
+gem 'rubytree', '~> 2.0.0'
# Only used in down migrations now.
# Is to be removed once the referencing migrations have been squashed.
-gem "typed_dag", "~> 2.0.2", require: false
+gem 'typed_dag', '~> 2.0.2', require: false
-gem "addressable", "~> 2.8.0"
+gem 'addressable', '~> 2.8.0'
# Remove whitespace from model input
-gem "auto_strip_attributes", "~> 2.5"
+gem 'auto_strip_attributes', '~> 2.5'
# Provide timezone info for TZInfo used by AR
-gem "tzinfo-data", "~> 1.2024.1"
+gem 'tzinfo-data', '~> 1.2024.1'
# to generate html-diffs (e.g. for wiki comparison)
-gem "htmldiff"
+gem 'htmldiff'
# Generate url slugs with #to_url and other string niceties
-gem "stringex", "~> 2.8.5"
+gem 'stringex', '~> 2.8.5'
# CommonMark markdown parser with GFM extension
-gem "commonmarker", "~> 1.0.3"
+gem 'commonmarker', '~> 1.0.3'
# HTML pipeline for transformations on text formatter output
# such as sanitization or additional features
-gem "html-pipeline", "~> 2.14.0"
+gem 'html-pipeline', '~> 2.14.0'
# Tasklist parsing and renderer
-gem "deckar01-task_list", "~> 2.3.1"
+gem 'deckar01-task_list', '~> 2.3.1'
# Requires escape-utils for faster escaping
-gem "escape_utils", "~> 1.3"
+gem 'escape_utils', '~> 1.3'
# Syntax highlighting used in html-pipeline with rouge
-gem "rouge", "~> 4.2.0"
+gem 'rouge', '~> 4.2.0'
# HTML sanitization used for html-pipeline
-gem "sanitize", "~> 6.1.0"
+gem 'sanitize', '~> 6.1.0'
# HTML autolinking for mails and urls (replaces autolink)
-gem "rinku", "~> 2.0.4", require: %w[rinku rails_rinku]
+gem 'rinku', '~> 2.0.4', require: %w[rinku rails_rinku]
# Version parsing with semver
-gem "semantic", "~> 1.6.1"
+gem 'semantic', '~> 1.6.1'
# generates SVG Graphs
# used for statistics on svn repositories
-gem "svg-graph", "~> 2.2.0"
+gem 'svg-graph', '~> 2.2.0'
-gem "date_validator", "~> 0.12.0"
-gem "email_validator", "~> 2.2.3"
-gem "json_schemer", "~> 2.2.0"
-gem "ruby-duration", "~> 3.2.0"
+gem 'date_validator', '~> 0.12.0'
+gem 'email_validator', '~> 2.2.3'
+gem 'json_schemer', '~> 2.1.0'
+gem 'ruby-duration', '~> 3.2.0'
# `config/initializers/mail_starttls_patch.rb` has also been patched to
# fix STARTTLS handling until https://github.com/mikel/mail/pull/1536 is
# released.
-gem "mail", "= 2.8.1"
+gem 'mail', '= 2.8.1'
# provide compatible filesystem information for available storage
-gem "sys-filesystem", "~> 1.4.0", require: false
+gem 'sys-filesystem', '~> 1.4.0', require: false
-gem "bcrypt", "~> 3.1.6"
+gem 'bcrypt', '~> 3.1.6'
-gem "multi_json", "~> 1.15.0"
-gem "oj", "~> 3.16.0"
+gem 'multi_json', '~> 1.15.0'
+gem 'oj', '~> 3.16.0'
-gem "daemons"
-gem "good_job", "= 3.26.2" # update should be done manually in sync with saas-openproject version.
+gem 'daemons'
+gem 'delayed_cron_job', '~> 0.9.0'
+gem 'delayed_job_active_record', '~> 4.1.5'
-gem "rack-protection", "~> 3.2.0"
+gem 'rack-protection', '~> 3.2.0'
# Rack::Attack is a rack middleware to protect your web app from bad clients.
# It allows whitelisting, blacklisting, throttling, and tracking based
# on arbitrary properties of the request.
# https://github.com/kickstarter/rack-attack
-gem "rack-attack", "~> 6.7.0"
+gem 'rack-attack', '~> 6.7.0'
# CSP headers
-gem "secure_headers", "~> 6.5.0"
+gem 'secure_headers', '~> 6.5.0'
# Browser detection for incompatibility checks
-gem "browser", "~> 5.3.0"
+gem 'browser', '~> 5.3.0'
# Providing health checks
-gem "okcomputer", "~> 1.18.1"
+gem 'okcomputer', '~> 1.18.1'
-gem "gon", "~> 6.4.0"
+gem 'gon', '~> 6.4.0'
# Lograge to provide sane and non-verbose logging
-gem "lograge", "~> 0.14.0"
+gem 'lograge', '~> 0.14.0'
# Structured warnings to selectively disable them in production
-gem "structured_warnings", "~> 0.4.0"
+gem 'structured_warnings', '~> 0.4.0'
# catch exceptions and send them to any airbrake compatible backend
# don't require by default, instead load on-demand when actually configured
-gem "airbrake", "~> 13.0.0", require: false
+gem 'airbrake', '~> 13.0.0', require: false
-gem "md_to_pdf", git: "https://github.com/opf/md-to-pdf", ref: "8f14736a88ad0064d2a97be108fe7061ffbcee91"
-gem "prawn", "~> 2.4"
+gem 'md_to_pdf', git: 'https://github.com/opf/md-to-pdf', ref: '8f14736a88ad0064d2a97be108fe7061ffbcee91'
+gem 'prawn', '~> 2.4'
# prawn implicitly depends on matrix gem no longer in ruby core with 3.1
-gem "matrix", "~> 0.4.2"
+gem 'matrix', '~> 0.4.2'
-gem "meta-tags", "~> 2.20.0"
+gem 'meta-tags', '~> 2.20.0'
-gem "paper_trail", "~> 15.1.0"
+gem 'paper_trail', '~> 15.1.0'
-gem "clamav-client", github: "honestica/clamav-client", ref: "29e78ae94307cb34e79ddd29c5da79752239d8b7"
+gem 'clamav-client', github: 'honestica/clamav-client', ref: '29e78ae94307cb34e79ddd29c5da79752239d8b7'
group :production do
# we use dalli as standard memcache client
# requires memcached 1.4+
- gem "dalli", "~> 3.2.0"
- gem "redis", "~> 5.1.0"
+ gem 'dalli', '~> 3.2.0'
+ gem 'redis', '~> 5.1.0'
end
-gem "i18n-js", "~> 4.2.3"
-gem "rails-i18n", "~> 7.0.0"
+gem 'i18n-js', '~> 4.2.3'
+gem 'rails-i18n', '~> 7.0.0'
-gem "sprockets", "~> 3.7.2" # lock sprockets below 4.0
-gem "sprockets-rails", "~> 3.4.2"
+gem 'sprockets', '~> 3.7.2' # lock sprockets below 4.0
+gem 'sprockets-rails', '~> 3.4.2'
-gem "puma", "~> 6.4"
-gem "puma-plugin-statsd", "~> 2.0"
-gem "rack-timeout", "~> 0.6.3", require: "rack/timeout/base"
+gem 'puma', '~> 6.4'
+gem 'puma-plugin-statsd', '~> 2.0'
+gem 'rack-timeout', '~> 0.6.3', require: 'rack/timeout/base'
-gem "nokogiri", "~> 1.16.0"
+gem 'nokogiri', '~> 1.16.0'
-gem "carrierwave", "~> 1.3.1"
-gem "carrierwave_direct", "~> 2.1.0"
-gem "fog-aws"
+gem 'carrierwave', '~> 1.3.1'
+gem 'carrierwave_direct', '~> 2.1.0'
+gem 'fog-aws'
-gem "aws-sdk-core", "~> 3.107"
+gem 'aws-sdk-core', '~> 3.107'
# File upload via fog + screenshots on travis
-gem "aws-sdk-s3", "~> 1.91"
+gem 'aws-sdk-s3', '~> 1.91'
-gem "openproject-token", "~> 4.0"
+gem 'openproject-token', '~> 4.0'
-gem "plaintext", "~> 0.3.2"
+gem 'plaintext', '~> 0.3.2'
-gem "ruby-progressbar", "~> 1.13.0", require: false
+gem 'ruby-progressbar', '~> 1.13.0', require: false
-gem "mini_magick", "~> 4.12.0", require: false
+gem 'mini_magick', '~> 4.12.0', require: false
-gem "validate_url"
+gem 'validate_url'
# Storages support code
-gem "dry-container"
+gem 'dry-container'
# ActiveRecord extension which adds typecasting to store accessors
-gem "store_attribute", "~> 1.0"
+gem 'store_attribute', '~> 1.0'
# Appsignal integration
-gem "appsignal", "~> 3.0", require: false
+gem 'appsignal', '~> 3.0', require: false
-gem "view_component"
+gem 'view_component'
# Lookbook
-gem "lookbook", "~> 2.2.1"
+gem 'lookbook', '~> 2.2.1'
# Require factory_bot for usage with openproject plugins testing
-gem "factory_bot", "~> 6.4.0", require: false
+gem 'factory_bot', '~> 6.4.0', require: false
# require factory_bot_rails for convenience in core development
-gem "factory_bot_rails", "~> 6.4.0", require: false
+gem 'factory_bot_rails', '~> 6.4.0', require: false
-gem "turbo-rails", "~> 2.0.0"
+gem 'turbo-rails', '~> 2.0.0'
-gem "httpx"
+gem 'httpx'
group :test do
- gem "launchy", "~> 3.0.0"
- gem "rack-test", "~> 2.1.0"
- gem "shoulda-context", "~> 2.0"
+ gem 'launchy', '~> 3.0.0'
+ gem 'rack-test', '~> 2.1.0'
+ gem 'shoulda-context', '~> 2.0'
# Test prof provides factories from code
# and other niceties
- gem "test-prof", "~> 1.3.0"
- gem "turbo_tests", github: "crohr/turbo_tests", ref: "fix/runtime-info"
+ gem 'test-prof', '~> 1.3.0'
+ gem 'turbo_tests', github: 'crohr/turbo_tests', ref: 'fix/runtime-info'
- gem "rack_session_access"
- gem "rspec", "~> 3.13.0"
+ gem 'rack_session_access'
+ gem 'rspec', '~> 3.13.0'
# also add to development group, so 'spec' rake task gets loaded
- gem "rspec-rails", "~> 6.1.0", group: :development
+ gem 'rspec-rails', '~> 6.1.0', group: :development
# Retry failures within the same environment
- gem "retriable", "~> 3.1.1"
- gem "rspec-retry", "~> 0.6.1"
+ gem 'retriable', '~> 3.1.1'
+ gem 'rspec-retry', '~> 0.6.1'
# Accessibility tests
- gem "axe-core-rspec"
+ gem 'axe-core-rspec'
# Modify ENV
- gem "climate_control"
+ gem 'climate_control'
# XML comparison tests
- gem "compare-xml", "~> 0.66", require: false
+ gem 'compare-xml', '~> 0.66', require: false
# PDF Export tests
- gem "pdf-inspector", "~> 1.2"
+ gem 'pdf-inspector', '~> 1.2'
# brings back testing for 'assigns' and 'assert_template' extracted in rails 5
- gem "rails-controller-testing", "~> 1.0.2"
+ gem 'rails-controller-testing', '~> 1.0.2'
- gem "capybara", "~> 3.40.0"
- gem "capybara_accessible_selectors", git: "https://github.com/citizensadvice/capybara_accessible_selectors", branch: "main"
- gem "capybara-screenshot", "~> 1.0.17"
- gem "cuprite", "~> 0.15.0"
- gem "selenium-devtools"
- gem "selenium-webdriver", "~> 4.18.0"
+ gem 'capybara', '~> 3.40.0'
+ gem 'capybara_accessible_selectors', git: 'https://github.com/citizensadvice/capybara_accessible_selectors', branch: 'main'
+ gem 'capybara-screenshot', '~> 1.0.17'
+ gem 'cuprite', '~> 0.15.0'
+ gem 'selenium-devtools'
+ gem 'selenium-webdriver', '~> 4.18.0'
- gem "fuubar", "~> 2.5.0"
- gem "timecop", "~> 0.9.0"
+ gem 'fuubar', '~> 2.5.0'
+ gem 'timecop', '~> 0.9.0'
# Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
- gem "vcr"
+ gem 'vcr'
# Mock backend requests (for ruby tests)
- gem "webmock", "~> 3.12", require: false
+ gem 'webmock', '~> 3.12', require: false
# Mock selenium requests through proxy (for feature tests)
- gem "puffing-billy", "~> 4.0.0"
- gem "table_print", "~> 1.5.6"
+ gem 'puffing-billy', '~> 4.0.0'
+ gem 'table_print', '~> 1.5.6'
- gem "equivalent-xml", "~> 0.6"
- gem "json_spec", "~> 1.1.4"
- gem "shoulda-matchers", "~> 6.0", require: nil
+ gem 'equivalent-xml', '~> 0.6'
+ gem 'json_spec', '~> 1.1.4'
+ gem 'shoulda-matchers', '~> 6.0', require: nil
- gem "parallel_tests", "~> 4.0"
+ gem 'parallel_tests', '~> 4.0'
end
group :ldap do
- gem "net-ldap", "~> 0.19.0"
+ gem 'net-ldap', '~> 0.19.0'
end
group :development do
- gem "listen", "~> 3.9.0" # Use for event-based reloaders
+ gem 'listen', '~> 3.9.0' # Use for event-based reloaders
- gem "letter_opener"
+ gem 'letter_opener'
- gem "spring"
- gem "spring-commands-rspec"
- gem "spring-commands-rubocop"
+ gem 'spring'
+ gem 'spring-commands-rspec'
+ gem 'spring-commands-rubocop'
- gem "colored2"
+ gem 'colored2'
# git hooks manager
- gem "lefthook", require: false
+ gem 'lefthook', require: false
end
group :development, :test do
- gem "dotenv-rails"
+ gem 'dotenv-rails'
# Tracing and profiling gems
- gem "flamegraph", require: false
- gem "rack-mini-profiler", require: false
- gem "ruby-prof", require: false
- gem "stackprof", require: false
+ gem 'flamegraph', require: false
+ gem 'rack-mini-profiler', require: false
+ gem 'ruby-prof', require: false
+ gem 'stackprof', require: false
# REPL with debug commands
- gem "debug"
+ gem 'debug'
- gem "pry-byebug", "~> 3.10.0", platforms: [:mri]
- gem "pry-doc"
- gem "pry-rails", "~> 0.3.6"
- gem "pry-rescue", "~> 1.6.0"
+ gem 'pry-byebug', '~> 3.10.0', platforms: [:mri]
+ gem 'pry-doc'
+ gem 'pry-rails', '~> 0.3.6'
+ gem 'pry-rescue', '~> 1.6.0'
# ruby linting
- gem "rubocop", require: false
- gem "rubocop-inflector", require: false
- gem "rubocop-performance", require: false
- gem "rubocop-rails", require: false
- gem "rubocop-rspec", require: false
+ gem 'rubocop', require: false
+ gem 'rubocop-inflector', require: false
+ gem 'rubocop-performance', require: false
+ gem 'rubocop-rails', require: false
+ gem 'rubocop-rspec', require: false
# erb linting
- gem "erb_lint", require: false
- gem "erblint-github", require: false
+ gem 'erb_lint', require: false
+ gem 'erblint-github', require: false
# Brakeman scanner
- gem "brakeman", "~> 6.1.0"
+ gem 'brakeman', '~> 6.1.0'
# i18n-tasks helps find and manage missing and unused translations.
- gem "i18n-tasks", "~> 1.0.13"
+ gem 'i18n-tasks', '~> 1.0.13'
end
-gem "bootsnap", "~> 1.18.0", require: false
+gem 'bootsnap', '~> 1.18.0', require: false
# API gems
-gem "grape", "~> 2.0.0"
-gem "grape_logging", "~> 1.8.4"
-gem "roar", "~> 1.2.0"
+gem 'grape', '~> 2.0.0'
+gem 'grape_logging', '~> 1.8.4'
+gem 'roar', '~> 1.2.0'
# CORS for API
-gem "rack-cors", "~> 2.0.2"
+gem 'rack-cors', '~> 2.0.2'
# Gmail API
-gem "google-apis-gmail_v1", require: false
-gem "googleauth", require: false
+gem 'google-apis-gmail_v1', require: false
+gem 'googleauth', require: false
# Required for contracts
-gem "disposable", "~> 0.6.2"
+gem 'disposable', '~> 0.6.2'
platforms :mri, :mingw, :x64_mingw do
group :postgres do
- gem "pg", "~> 1.5.0"
+ gem 'pg', '~> 1.5.0'
end
# Support application loading when no database exists yet.
- gem "activerecord-nulldb-adapter", "~> 1.0.0"
+ gem 'activerecord-nulldb-adapter', '~> 1.0.0'
# Have application level locks on the database to have a mutex shared between workers/hosts.
# We e.g. employ this to safeguard the creation of journals.
- gem "with_advisory_lock", "~> 5.1.0"
+ gem 'with_advisory_lock', '~> 5.1.0'
end
# Load Gemfile.modules explicitly to allow dependabot to work
-eval_gemfile "./Gemfile.modules"
+eval_gemfile './Gemfile.modules'
# Load Gemfile.local, Gemfile.plugins and custom Gemfiles
-gemfiles = Dir.glob File.expand_path("{Gemfile.plugins,Gemfile.local}", __dir__)
-gemfiles << ENV["CUSTOM_PLUGIN_GEMFILE"] unless ENV["CUSTOM_PLUGIN_GEMFILE"].nil?
+gemfiles = Dir.glob File.expand_path('{Gemfile.plugins,Gemfile.local}', __dir__)
+gemfiles << ENV['CUSTOM_PLUGIN_GEMFILE'] unless ENV['CUSTOM_PLUGIN_GEMFILE'].nil?
gemfiles.each do |file|
# We use send to allow dependabot to function
# don't use eval_gemfile(file) here as it will break dependabot!
send(:eval_gemfile, file) if File.readable?(file)
end
-gem "openproject-octicons", "~>19.8.0"
-gem "openproject-octicons_helper", "~>19.8.0"
-gem "openproject-primer_view_components", "~>0.23.0"
+gem 'openproject-octicons', '~>19.8.0'
+gem 'openproject-octicons_helper', '~>19.8.0'
+gem 'openproject-primer_view_components', '~>0.23.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index a3a96368eeb2..5e742abc3ad6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -299,7 +299,7 @@ GEM
activemodel (= 7.1.3.2)
activesupport (= 7.1.3.2)
timeout (>= 0.4.0)
- activerecord-import (1.6.0)
+ activerecord-import (1.5.1)
activerecord (>= 4.2)
activerecord-nulldb-adapter (1.0.1)
activerecord (>= 5.2.0, < 7.2)
@@ -349,16 +349,16 @@ GEM
activerecord (>= 4.0.0, < 7.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
- aws-partitions (1.899.0)
- aws-sdk-core (3.191.4)
+ aws-partitions (1.895.0)
+ aws-sdk-core (3.191.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
- aws-sdk-kms (1.78.0)
+ aws-sdk-kms (1.77.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
- aws-sdk-s3 (1.146.0)
+ aws-sdk-s3 (1.143.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
@@ -380,14 +380,14 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
base64 (0.2.0)
bcrypt (3.1.20)
- better_html (2.1.1)
+ better_html (2.0.2)
actionview (>= 6.0)
activesupport (>= 6.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
- bigdecimal (3.1.7)
+ bigdecimal (3.1.6)
bindata (2.5.0)
bootsnap (1.18.3)
msgpack (~> 1.2)
@@ -459,6 +459,13 @@ GEM
deckar01-task_list (2.3.4)
html-pipeline (~> 2.0)
declarative (0.0.20)
+ delayed_cron_job (0.9.0)
+ fugit (>= 1.5)
+ delayed_job (4.1.11)
+ activesupport (>= 3.0, < 8.0)
+ delayed_job_active_record (4.1.8)
+ activerecord (>= 3.0, < 8.0)
+ delayed_job (>= 3.0, < 5)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.1)
@@ -514,11 +521,11 @@ GEM
erblint-github (1.0.1)
erubi (1.12.0)
escape_utils (1.3.0)
- et-orbi (1.2.9)
+ et-orbi (1.2.7)
tzinfo
eventmachine (1.2.7)
eventmachine_httpserver (0.2.1)
- excon (0.110.0)
+ excon (0.109.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
@@ -538,7 +545,7 @@ GEM
websocket-driver (>= 0.6, < 0.8)
ffi (1.16.3)
flamegraph (0.9.5)
- fog-aws (3.22.0)
+ fog-aws (3.21.0)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
@@ -557,7 +564,7 @@ GEM
friendly_id (5.5.1)
activerecord (>= 4.0.0)
front_matter_parser (1.0.1)
- fugit (1.10.1)
+ fugit (1.9.0)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
fuubar (2.5.1)
@@ -571,14 +578,7 @@ GEM
i18n (>= 0.7)
multi_json
request_store (>= 1.0)
- good_job (3.26.2)
- activejob (>= 6.0.0)
- activerecord (>= 6.0.0)
- concurrent-ruby (>= 1.0.2)
- fugit (>= 1.1)
- railties (>= 6.0.0)
- thor (>= 0.14.1)
- google-apis-core (0.14.1)
+ google-apis-core (0.14.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.1, < 3.a)
@@ -624,7 +624,7 @@ GEM
httpclient (2.8.3)
httpx (1.2.3)
http-2-next (>= 1.0.3)
- i18n (1.14.4)
+ i18n (1.14.1)
concurrent-ruby (~> 1.0)
i18n-js (4.2.3)
glob (>= 0.4.0)
@@ -646,7 +646,7 @@ GEM
ice_nine (0.11.2)
interception (0.5)
io-console (0.7.2)
- irb (1.12.0)
+ irb (1.11.2)
rdoc
reline (>= 0.4.2)
iso8601 (0.13.0)
@@ -659,11 +659,9 @@ GEM
bindata
faraday (~> 2.0)
faraday-follow_redirects
- json-schema (4.2.0)
+ json-schema (4.1.1)
addressable (>= 2.8)
- json_schemer (2.2.1)
- base64
- bigdecimal
+ json_schemer (2.1.1)
hana (~> 1.3)
regexp_parser (~> 2.0)
simpleidn (~> 0.2)
@@ -678,7 +676,7 @@ GEM
launchy (3.0.0)
addressable (~> 2.8)
childprocess (~> 5.0)
- lefthook (1.6.7)
+ lefthook (1.6.5)
letter_opener (1.0.0)
launchy (>= 2.0.4)
listen (3.9.0)
@@ -696,7 +694,7 @@ GEM
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
- lookbook (2.2.2)
+ lookbook (2.2.1)
activemodel
css_parser
htmlbeautifier (~> 1.3)
@@ -706,7 +704,7 @@ GEM
redcarpet (~> 3.5)
rouge (>= 3.26, < 5.0)
view_component (>= 2.0)
- yard (~> 0.9)
+ yard (~> 0.9.25)
zeitwerk (~> 2.5)
mail (2.8.1)
mini_mime (>= 0.1.1)
@@ -722,11 +720,11 @@ GEM
method_source (1.0.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
- mime-types-data (3.2024.0305)
+ mime-types-data (3.2024.0206)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
- minitest (5.22.3)
+ minitest (5.22.2)
msgpack (1.7.2)
multi_json (1.15.0)
mustermann (3.0.0)
@@ -747,7 +745,7 @@ GEM
net-smtp (0.4.0.1)
net-protocol
nio4r (2.7.0)
- nokogiri (1.16.3)
+ nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oj (3.16.3)
@@ -901,7 +899,7 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
- rails-i18n (7.0.9)
+ rails-i18n (7.0.8)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.1.3.2)
@@ -925,7 +923,7 @@ GEM
redcarpet (3.6.0)
redis (5.1.0)
redis-client (>= 0.17.0)
- redis-client (0.21.0)
+ redis-client (0.20.0)
connection_pool
regexp_parser (2.9.0)
reline (0.4.3)
@@ -945,7 +943,7 @@ GEM
roar (1.2.0)
representable (~> 3.1)
rotp (6.3.0)
- rouge (4.2.1)
+ rouge (4.2.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
@@ -958,18 +956,18 @@ GEM
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
- rspec-rails (6.1.2)
+ rspec-rails (6.1.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
- rspec-core (~> 3.13)
- rspec-expectations (~> 3.13)
- rspec-mocks (~> 3.13)
- rspec-support (~> 3.13)
+ rspec-core (~> 3.12)
+ rspec-expectations (~> 3.12)
+ rspec-mocks (~> 3.12)
+ rspec-support (~> 3.12)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.13.1)
- rubocop (1.62.1)
+ rubocop (1.62.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
@@ -980,7 +978,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
- rubocop-ast (1.31.2)
+ rubocop-ast (1.31.1)
parser (>= 3.3.0.4)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
@@ -1032,7 +1030,7 @@ GEM
websocket (~> 1.0)
semantic (1.6.1)
shoulda-context (2.0.0)
- shoulda-matchers (6.2.0)
+ shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
signet (0.19.0)
addressable (~> 2.8)
@@ -1075,7 +1073,7 @@ GEM
table_print (1.5.7)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
- test-prof (1.3.2)
+ test-prof (1.3.1)
text-hyphen (1.5.0)
thor (1.3.1)
thread_safe (0.3.6)
@@ -1088,7 +1086,7 @@ GEM
trailblazer-option (0.1.2)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
- turbo-rails (2.0.5)
+ turbo-rails (2.0.4)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
@@ -1160,7 +1158,7 @@ PLATFORMS
DEPENDENCIES
actionpack-xml_parser (~> 2.0.0)
activemodel-serializers-xml (~> 1.0.1)
- activerecord-import (~> 1.6.0)
+ activerecord-import (~> 1.5.0)
activerecord-nulldb-adapter (~> 1.0.0)
activerecord-session_store (~> 2.1.0)
acts_as_list (~> 1.1.0)
@@ -1197,6 +1195,8 @@ DEPENDENCIES
date_validator (~> 0.12.0)
debug
deckar01-task_list (~> 2.3.1)
+ delayed_cron_job (~> 0.9.0)
+ delayed_job_active_record (~> 4.1.5)
disposable (~> 0.6.2)
doorkeeper (~> 5.6.6)
dotenv-rails
@@ -1214,7 +1214,6 @@ DEPENDENCIES
friendly_id (~> 5.5.0)
fuubar (~> 2.5.0)
gon (~> 6.4.0)
- good_job (= 3.26.2)
google-apis-gmail_v1
googleauth
grape (~> 2.0.0)
@@ -1225,7 +1224,7 @@ DEPENDENCIES
httpx
i18n-js (~> 4.2.3)
i18n-tasks (~> 1.0.13)
- json_schemer (~> 2.2.0)
+ json_schemer (~> 2.1.0)
json_spec (~> 1.1.4)
ladle
launchy (~> 3.0.0)
diff --git a/Procfile.dev b/Procfile.dev
index 26ad472210c8..60c25648b2df 100644
--- a/Procfile.dev
+++ b/Procfile.dev
@@ -1,3 +1,3 @@
web: bundle exec rails server -p 3000 -b ${HOST:="127.0.0.1"} --environment ${RAILS_ENV:="development"}
angular: npm run serve
-worker: bundle exec good_job start
+worker: bundle exec rake jobs:work
diff --git a/README.md b/README.md
index cdb6ab166a74..4089849e7cb7 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/opf/openproject)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/opf/openproject)
![GitHub branch checks state](https://img.shields.io/github/checks-status/opf/openproject/dev)
-[![Github Tests](https://github.com/opf/openproject/actions/workflows/test-core.yml/badge.svg?branch=dev)](https://github.com/opf/openproject/actions/workflows/test-core.yml)
+[![GitHub Tests](https://github.com/opf/openproject/actions/workflows/test-core.yml/badge.svg?branch=dev)](https://github.com/opf/openproject/actions/workflows/test-core.yml)
OpenProject is a web-based project management software. Its key features are:
diff --git a/Rakefile b/Rakefile
index 30e586c3e063..536d51cd911d 100755
--- a/Rakefile
+++ b/Rakefile
@@ -30,9 +30,9 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require File.expand_path("config/application", __dir__)
+require File.expand_path('config/application', __dir__)
Rails.application.load_rake_tasks
Rake::Task[:default].clear
-task default: "test:suite:run"
+task default: 'test:suite:run'
diff --git a/app/components/activities/days_component.rb b/app/components/activities/days_component.rb
index fe76971cb6c8..27c7668f5c44 100644
--- a/app/components/activities/days_component.rb
+++ b/app/components/activities/days_component.rb
@@ -29,7 +29,7 @@
#++
class Activities::DaysComponent < ViewComponent::Base
- def initialize(events:, current_project: nil, display_user: true, header_tag: "h3", activity_page: nil)
+ def initialize(events:, current_project: nil, display_user: true, header_tag: 'h3', activity_page: nil)
super()
@events = events
@current_project = current_project
diff --git a/app/components/add_button_component.rb b/app/components/add_button_component.rb
index 956d16c5fec5..5f267b1ad661 100644
--- a/app/components/add_button_component.rb
+++ b/app/components/add_button_component.rb
@@ -33,7 +33,7 @@ class AddButtonComponent < ApplicationComponent
options :current_project
def render?
- raise "Implement the conditions for which the component should render or not"
+ raise 'Implement the conditions for which the component should render or not'
end
def dynamic_path
@@ -45,7 +45,7 @@ def id
end
def li_css_class
- "toolbar-item"
+ 'toolbar-item'
end
def title
@@ -55,7 +55,7 @@ def title
def label
content_tag(:span,
label_text,
- class: "button--text")
+ class: 'button--text')
end
def aria_label
@@ -71,10 +71,10 @@ def label_text
end
def link_css_class
- "button -primary"
+ 'button -alt-highlight'
end
def icon
- helpers.op_icon("button--icon icon-add")
+ helpers.op_icon('button--icon icon-add')
end
end
diff --git a/app/components/admin/quarantined_attachments/row_component.rb b/app/components/admin/quarantined_attachments/row_component.rb
index 0af393a4b4d1..392929a4db1a 100644
--- a/app/components/admin/quarantined_attachments/row_component.rb
+++ b/app/components/admin/quarantined_attachments/row_component.rb
@@ -45,7 +45,7 @@ def row_css_id
delegate :filename, to: :attachment
def attached_to
- description = attachment.description.present? ? "(#{attachment.description})" : ""
+ description = attachment.description.present? ? "(#{attachment.description})" : ''
text = "#{container_name} #{attachment.container_id} #{description}"
case container
when Message
@@ -83,9 +83,9 @@ def button_links
def delete_link
helpers.link_to(
- helpers.op_icon("icon icon-delete"),
- { controller: "/admin/attachments/quarantined_attachments", action: :destroy, id: model },
- title: I18n.t("antivirus_scan.quarantined_attachments.delete"),
+ helpers.op_icon('icon icon-delete'),
+ { controller: '/admin/attachments/quarantined_attachments', action: :destroy, id: model },
+ title: I18n.t('antivirus_scan.quarantined_attachments.delete'),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure), disable_with: I18n.t(:label_loading) }
)
diff --git a/app/components/admin/quarantined_attachments/table_component.rb b/app/components/admin/quarantined_attachments/table_component.rb
index 7ea4e52020fd..f2f2d429b814 100644
--- a/app/components/admin/quarantined_attachments/table_component.rb
+++ b/app/components/admin/quarantined_attachments/table_component.rb
@@ -44,10 +44,10 @@ def sortable?
def headers
[
- ["filename", { caption: Attachment.human_attribute_name(:filename) }],
- ["attached_to", { caption: I18n.t("antivirus_scan.quarantined_attachments.container") }],
- ["author", { caption: Attachment.human_attribute_name(:author) }],
- ["created_at", { caption: Attachment.human_attribute_name(:created_at) }]
+ ['filename', { caption: Attachment.human_attribute_name(:filename) }],
+ ['attached_to', { caption: I18n.t('antivirus_scan.quarantined_attachments.container') }],
+ ['author', { caption: Attachment.human_attribute_name(:author) }],
+ ['created_at', { caption: Attachment.human_attribute_name(:created_at) }]
]
end
end
diff --git a/app/components/custom_actions/row_component.rb b/app/components/custom_actions/row_component.rb
index a8f2f3586cec..78aae79668f9 100644
--- a/app/components/custom_actions/row_component.rb
+++ b/app/components/custom_actions/row_component.rb
@@ -41,7 +41,7 @@ def name
delegate :description, to: :action
def sort
- helpers.reorder_links("custom_action", { action: "update", id: action }, method: :put)
+ helpers.reorder_links('custom_action', { action: 'update', id: action }, method: :put)
end
def button_links
@@ -53,7 +53,7 @@ def button_links
def edit_link
link_to(
- helpers.op_icon("icon icon-edit"),
+ helpers.op_icon('icon icon-edit'),
helpers.edit_custom_action_path(action),
title: t(:button_edit)
)
@@ -61,7 +61,7 @@ def edit_link
def delete_link
link_to(
- helpers.op_icon("icon icon-delete"),
+ helpers.op_icon('icon icon-delete'),
helpers.custom_action_path(action),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
diff --git a/app/components/custom_actions/table_component.rb b/app/components/custom_actions/table_component.rb
index 0c7dfe58fd4f..5b35e3a3c40e 100644
--- a/app/components/custom_actions/table_component.rb
+++ b/app/components/custom_actions/table_component.rb
@@ -36,18 +36,18 @@ class TableComponent < ::TableComponent
def headers
[
- ["name", { caption: CustomAction.human_attribute_name(:name) }],
- ["description", { caption: CustomAction.human_attribute_name(:description) }],
- ["sort", { caption: I18n.t(:label_sort) }]
+ ['name', { caption: CustomAction.human_attribute_name(:name) }],
+ ['description', { caption: CustomAction.human_attribute_name(:description) }],
+ ['sort', { caption: I18n.t(:label_sort) }]
]
end
def inline_create_link
link_to new_custom_action_path,
- aria: { label: t("custom_actions.new") },
- class: "wp-inline-create--add-link",
- title: t("custom_actions.new") do
- helpers.op_icon("icon icon-add")
+ aria: { label: t('custom_actions.new') },
+ class: 'wp-inline-create--add-link',
+ title: t('custom_actions.new') do
+ helpers.op_icon('icon icon-add')
end
end
end
diff --git a/app/components/enumerations/row_component.rb b/app/components/enumerations/row_component.rb
index 9c885f3a3752..78c5597f23cc 100644
--- a/app/components/enumerations/row_component.rb
+++ b/app/components/enumerations/row_component.rb
@@ -51,7 +51,7 @@ def active
end
def sort
- helpers.reorder_links("enumeration", { action: "move", id: enumeration }, method: :post)
+ helpers.reorder_links('enumeration', { action: 'move', id: enumeration }, method: :post)
end
def button_links
@@ -62,7 +62,7 @@ def button_links
def delete_link
helpers.link_to(
- helpers.op_icon("icon icon-delete"),
+ helpers.op_icon('icon icon-delete'),
helpers.enumeration_path(enumeration),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
diff --git a/app/components/enumerations/table_component.rb b/app/components/enumerations/table_component.rb
index bba8eff05e1e..08b5c1a4286c 100644
--- a/app/components/enumerations/table_component.rb
+++ b/app/components/enumerations/table_component.rb
@@ -44,13 +44,13 @@ def sortable?
def headers
[
- ["name", { caption: Enumeration.human_attribute_name(:name) }],
- ["is_default", { caption: Enumeration.human_attribute_name(:is_default) }],
- ["active", { caption: Enumeration.human_attribute_name(:active) }],
- ["sort", { caption: I18n.t(:label_sort) }]
+ ['name', { caption: Enumeration.human_attribute_name(:name) }],
+ ['is_default', { caption: Enumeration.human_attribute_name(:is_default) }],
+ ['active', { caption: Enumeration.human_attribute_name(:active) }],
+ ['sort', { caption: I18n.t(:label_sort) }]
].tap do |default|
if with_colors
- default.insert 3, ["color", { caption: Enumeration.human_attribute_name(:color) }]
+ default.insert 3, ['color', { caption: Enumeration.human_attribute_name(:color) }]
end
end
end
@@ -62,10 +62,10 @@ def with_colors
def inline_create_link
link_to new_enumeration_path(type: rows.name),
aria: { label: t(:label_enumeration_new) },
- class: "wp-inline-create--add-link",
- data: { "test-selector": "create-enumeration-#{rows.name.underscore.dasherize}" },
+ class: 'wp-inline-create--add-link',
+ data: { 'test-selector': "create-enumeration-#{rows.name.underscore.dasherize}" },
title: t(:label_enumeration_new) do
- helpers.op_icon("icon icon-add")
+ helpers.op_icon('icon icon-add')
end
end
end
diff --git a/app/components/filters_component.html.erb b/app/components/filters_component.html.erb
index f17e15685497..0fab3fba3f19 100644
--- a/app/components/filters_component.html.erb
+++ b/app/components/filters_component.html.erb
@@ -123,7 +123,7 @@
- <%= submit_tag t('button_apply'), class: 'button -small -primary', name: nil %>
+ <%= submit_tag t('button_apply'), class: 'button -small -highlight', name: nil %>
<% unless EnterpriseToken.allows_to?(:custom_fields_in_projects_list)%>
diff --git a/app/components/individual_principal_base_filter_component.html.erb b/app/components/individual_principal_base_filter_component.html.erb
index 265c4a8ad61a..588b7e913c94 100644
--- a/app/components/individual_principal_base_filter_component.html.erb
+++ b/app/components/individual_principal_base_filter_component.html.erb
@@ -105,7 +105,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= text_field_tag 'name', params[:name], class: 'simple-filters--filter-value' %>
- <%= submit_tag t(:button_apply), class: 'button -primary -small', name: nil %>
+ <%= submit_tag t(:button_apply), class: 'button -highlight -small', name: nil %>
<%= link_to t(:button_clear), clear_url, class: 'button -small -with-icon icon-undo' %>
diff --git a/app/components/individual_principal_base_filter_component.rb b/app/components/individual_principal_base_filter_component.rb
index b82f9f6bd263..1bff0229a696 100644
--- a/app/components/individual_principal_base_filter_component.rb
+++ b/app/components/individual_principal_base_filter_component.rb
@@ -52,25 +52,25 @@ def filtered?(params)
def filter_name(query, name)
if name.present?
- query.where(:any_name_attribute, "~", name)
+ query.where(:any_name_attribute, '~', name)
end
end
def filter_group(query, group_id)
if group_id.present?
- query.where(:group, "=", group_id)
+ query.where(:group, '=', group_id)
end
end
def filter_role(query, role_id)
if role_id.present?
- query.where(:role_id, "=", role_id)
+ query.where(:role_id, '=', role_id)
end
end
def filter_project(query, project_id)
if project_id.present?
- query.where(:project_id, "=", project_id)
+ query.where(:project_id, '=', project_id)
end
end
diff --git a/app/components/ldap_auth_sources/row_component.rb b/app/components/ldap_auth_sources/row_component.rb
index 975c87e46252..2e8a9a8ccdf2 100644
--- a/app/components/ldap_auth_sources/row_component.rb
+++ b/app/components/ldap_auth_sources/row_component.rb
@@ -33,7 +33,7 @@ class RowComponent < ::RowComponent
def name
content = link_to model.name, edit_ldap_auth_source_path(model)
if model.seeded_from_env?
- content += helpers.op_icon("icon icon-info2", title: I18n.t(:label_seeded_from_env_warning))
+ content += helpers.op_icon('icon icon-info2', title: I18n.t(:label_seeded_from_env_warning))
end
content
@@ -54,17 +54,17 @@ def button_links
end
def test_link
- link_to t(:button_test), { controller: "ldap_auth_sources", action: "test_connection", id: model }
+ link_to t(:button_test), { controller: 'ldap_auth_sources', action: 'test_connection', id: model }
end
def delete_link
return if users > 0
link_to I18n.t(:button_delete),
- { controller: "ldap_auth_sources", id: model.id, action: :destroy },
+ { controller: 'ldap_auth_sources', id: model.id, action: :destroy },
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
- class: "icon icon-delete",
+ class: 'icon icon-delete',
title: I18n.t(:button_delete)
end
end
diff --git a/app/components/ldap_auth_sources/table_component.rb b/app/components/ldap_auth_sources/table_component.rb
index ffbf507c6b39..f4735796b600 100644
--- a/app/components/ldap_auth_sources/table_component.rb
+++ b/app/components/ldap_auth_sources/table_component.rb
@@ -46,17 +46,17 @@ def sortable_column?(_column)
def inline_create_link
link_to(new_ldap_auth_source_path,
- class: "budget-add-row wp-inline-create--add-link",
+ class: 'budget-add-row wp-inline-create--add-link',
title: I18n.t(:label_ldap_auth_source_new)) do
- helpers.op_icon("icon icon-add")
+ helpers.op_icon('icon icon-add')
end
end
def headers
[
- ["name", { caption: LdapAuthSource.human_attribute_name("name") }],
- ["host", { caption: LdapAuthSource.human_attribute_name("host") }],
- ["users", { caption: I18n.t(:label_user_plural) }]
+ ['name', { caption: LdapAuthSource.human_attribute_name('name') }],
+ ['host', { caption: LdapAuthSource.human_attribute_name('host') }],
+ ['users', { caption: I18n.t(:label_user_plural) }]
]
end
end
diff --git a/app/components/members/index_page_header_component.rb b/app/components/members/index_page_header_component.rb
index 485aa1e1b6a4..689eb40daab8 100644
--- a/app/components/members/index_page_header_component.rb
+++ b/app/components/members/index_page_header_component.rb
@@ -41,20 +41,20 @@ def initialize(project: nil)
def add_button_data_attributes
attributes = {
- "members-form-target": "addMemberButton",
- action: "members-form#showAddMemberForm",
- "test-selector": "member-add-button"
+ 'members-form-target': 'addMemberButton',
+ action: 'members-form#showAddMemberForm',
+ 'test-selector': 'member-add-button'
}
- attributes["trigger-initially"] = "true" if params[:show_add_members]
+ attributes['trigger-initially'] = "true" if params[:show_add_members]
attributes
end
def filter_button_data_attributes
{
- "members-form-target": "filterMemberButton",
- action: "members-form#toggleMemberFilter"
+ 'members-form-target': 'filterMemberButton',
+ action: 'members-form#toggleMemberFilter'
}
end
end
diff --git a/app/components/members/role_form_component.html.erb b/app/components/members/role_form_component.html.erb
index f07b488ed48c..45d06ed41219 100644
--- a/app/components/members/role_form_component.html.erb
+++ b/app/components/members/role_form_component.html.erb
@@ -48,7 +48,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= f.submit t(:button_change), class: "button -primary -small" %>
+ <%= f.submit t(:button_change), class: "button -highlight -small" %>
<%= link_to t(:button_cancel),
'#',
data: {
diff --git a/app/components/members/role_form_component.rb b/app/components/members/role_form_component.rb
index c207c31c03df..47eca2ba63d5 100644
--- a/app/components/members/role_form_component.rb
+++ b/app/components/members/role_form_component.rb
@@ -41,7 +41,7 @@ def form_html_options
id: "#{row.roles_css_id}-form",
class: row.toggle_item_class_name,
style: "display:none",
- data: { "members-form-target": "membershipEditForm" }
+ data: { 'members-form-target': 'membershipEditForm' }
}
end
diff --git a/app/components/members/user_filter_component.rb b/app/components/members/user_filter_component.rb
index e128e44d99a7..3dc96333fc07 100644
--- a/app/components/members/user_filter_component.rb
+++ b/app/components/members/user_filter_component.rb
@@ -30,7 +30,7 @@
module Members
class UserFilterComponent < ::UserFilterComponent
- ALL_SHARED_FILTER_KEY = "all"
+ ALL_SHARED_FILTER_KEY = 'all'
def initially_visible?
false
@@ -52,12 +52,12 @@ def shares
# Adapts the user filter counts to count members as opposed to users.
def extra_user_status_options
{
- all: status_members_query("all").count,
- blocked: status_members_query("blocked").count,
- active: status_members_query("active").count,
- invited: status_members_query("invited").count,
- registered: status_members_query("registered").count,
- locked: status_members_query("locked").count
+ all: status_members_query('all').count,
+ blocked: status_members_query('blocked').count,
+ active: status_members_query('active').count,
+ invited: status_members_query('invited').count,
+ registered: status_members_query('registered').count,
+ locked: status_members_query('locked').count
}
end
@@ -89,7 +89,7 @@ def share_options
.order(builtin: :asc)
.map { |role| [mapped_shared_role_name(role), role.id] }
- share_options.unshift([I18n.t("members.filters.all_shares"), ALL_SHARED_FILTER_KEY])
+ share_options.unshift([I18n.t('members.filters.all_shares'), ALL_SHARED_FILTER_KEY])
end
def builtin_share_roles
@@ -103,11 +103,11 @@ def builtin_share_roles
def mapped_shared_role_name(role)
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- I18n.t("work_package.sharing.permissions.view")
+ I18n.t('work_package.sharing.permissions.view')
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- I18n.t("work_package.sharing.permissions.comment")
+ I18n.t('work_package.sharing.permissions.comment')
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- I18n.t("work_package.sharing.permissions.edit")
+ I18n.t('work_package.sharing.permissions.edit')
else
role.name
end
@@ -121,9 +121,9 @@ def filter_shares(query, role_id)
.where(builtin: builtin_share_roles)
.pluck(:id)
- query.where(:role_id, "=", ids.uniq)
+ query.where(:role_id, '=', ids.uniq)
elsif role_id.to_i > 0
- query.where(:role_id, "=", role_id.to_i)
+ query.where(:role_id, '=', role_id.to_i)
end
end
diff --git a/app/components/oauth/applications/row_component.rb b/app/components/oauth/applications/row_component.rb
index 70b598eac265..33bfc1e631db 100644
--- a/app/components/oauth/applications/row_component.rb
+++ b/app/components/oauth/applications/row_component.rb
@@ -47,20 +47,20 @@ def owner
def confidential
if application.confidential?
- helpers.op_icon "icon icon-checkmark"
+ helpers.op_icon 'icon icon-checkmark'
end
end
def redirect_uri
urls = application.redirect_uri.split("\n")
- safe_join urls, " ".html_safe
+ safe_join urls, ' '.html_safe
end
def client_credentials
if user_id = application.client_credentials_user_id
helpers.link_to_user User.find(user_id)
else
- "-"
+ '-'
end
end
diff --git a/app/components/oauth/applications/table_component.rb b/app/components/oauth/applications/table_component.rb
index 144742596aa5..86b0cd15f099 100644
--- a/app/components/oauth/applications/table_component.rb
+++ b/app/components/oauth/applications/table_component.rb
@@ -51,10 +51,10 @@ def columns
def inline_create_link
link_to new_oauth_application_path,
- aria: { label: t("oauth.application.new") },
- class: "wp-inline-create--add-link",
- title: t("oauth.application.new") do
- helpers.op_icon("icon icon-add")
+ aria: { label: t('oauth.application.new') },
+ class: 'wp-inline-create--add-link',
+ title: t('oauth.application.new') do
+ helpers.op_icon('icon icon-add')
end
end
@@ -64,11 +64,11 @@ def empty_row_message
def headers
[
- ["name", { caption: ::Doorkeeper::Application.human_attribute_name(:name) }],
- ["owner", { caption: ::Doorkeeper::Application.human_attribute_name(:owner) }],
- ["client_credentials", { caption: I18n.t("oauth.client_credentials") }],
- ["redirect_uri", { caption: ::Doorkeeper::Application.human_attribute_name(:redirect_uri) }],
- ["confidential", { caption: ::Doorkeeper::Application.human_attribute_name(:confidential) }]
+ ['name', { caption: ::Doorkeeper::Application.human_attribute_name(:name) }],
+ ['owner', { caption: ::Doorkeeper::Application.human_attribute_name(:owner) }],
+ ['client_credentials', { caption: I18n.t('oauth.client_credentials') }],
+ ['redirect_uri', { caption: ::Doorkeeper::Application.human_attribute_name(:redirect_uri) }],
+ ['confidential', { caption: ::Doorkeeper::Application.human_attribute_name(:confidential) }]
]
end
end
diff --git a/app/components/open_project/common/duration_component.rb b/app/components/open_project/common/duration_component.rb
index 70639b9dd3a5..f5dd5c34de0e 100644
--- a/app/components/open_project/common/duration_component.rb
+++ b/app/components/open_project/common/duration_component.rb
@@ -32,7 +32,7 @@ class DurationComponent < Primer::Component
VALID_TYPES = %i[seconds minutes hours days weeks months years].freeze
attr_reader :duration, :abbreviated, :separator
- def initialize(duration, type = :seconds, separator: ", ", abbreviated: false, **args)
+ def initialize(duration, type = :seconds, separator: ', ', abbreviated: false, **args)
super
@duration = parse_duration(duration, type)
diff --git a/app/components/placeholder_users/placeholder_user_filter_component.rb b/app/components/placeholder_users/placeholder_user_filter_component.rb
index a9d999197f90..989b3991a4a0 100644
--- a/app/components/placeholder_users/placeholder_user_filter_component.rb
+++ b/app/components/placeholder_users/placeholder_user_filter_component.rb
@@ -40,7 +40,7 @@ def apply_filters(params, query)
# Filter for active placeholders
# to skip to-be-deleted users
- query.where(:status, "=", :active)
+ query.where(:status, '=', :active)
end
end
diff --git a/app/components/placeholder_users/row_component.rb b/app/components/placeholder_users/row_component.rb
index e419ddeb4351..3f439b37fb7d 100644
--- a/app/components/placeholder_users/row_component.rb
+++ b/app/components/placeholder_users/row_component.rb
@@ -47,10 +47,10 @@ def button_links
def delete_link
if helpers.can_delete_placeholder_user?(placeholder_user, User.current)
link_to deletion_info_placeholder_user_path(placeholder_user) do
- helpers.tooltip_tag I18n.t("placeholder_users.delete_tooltip"), icon: "icon-delete"
+ helpers.tooltip_tag I18n.t('placeholder_users.delete_tooltip'), icon: 'icon-delete'
end
else
- helpers.tooltip_tag I18n.t("placeholder_users.right_to_manage_members_missing"), icon: "icon-help2"
+ helpers.tooltip_tag I18n.t('placeholder_users.right_to_manage_members_missing'), icon: 'icon-help2'
end
end
diff --git a/app/components/placeholder_users/table_component.rb b/app/components/placeholder_users/table_component.rb
index cebf3a43a88a..99cd383d0485 100644
--- a/app/components/placeholder_users/table_component.rb
+++ b/app/components/placeholder_users/table_component.rb
@@ -43,7 +43,7 @@ def headers
def header_options(name)
options = { caption: PlaceholderUser.human_attribute_name(name) }
- options[:default_order] = "desc" if desc_by_default.include? name
+ options[:default_order] = 'desc' if desc_by_default.include? name
options
end
diff --git a/app/components/projects/configure_view_modal_component.rb b/app/components/projects/configure_view_modal_component.rb
index 5d1f93d83aae..173b3bfeaf12 100644
--- a/app/components/projects/configure_view_modal_component.rb
+++ b/app/components/projects/configure_view_modal_component.rb
@@ -29,9 +29,9 @@
# ++
class Projects::ConfigureViewModalComponent < ApplicationComponent
- MODAL_ID = "op-project-list-configure-dialog"
- COLUMN_FORM_ID = "op-project-list-configure-columns-form"
- COLUMN_HTML_NAME = "columns"
+ MODAL_ID = 'op-project-list-configure-dialog'
+ COLUMN_FORM_ID = 'op-project-list-configure-columns-form'
+ COLUMN_HTML_NAME = 'columns'
options :query
diff --git a/app/components/projects/delete_list_modal_component.rb b/app/components/projects/delete_list_modal_component.rb
index d8ba7523c3a0..70f8c39fdad7 100644
--- a/app/components/projects/delete_list_modal_component.rb
+++ b/app/components/projects/delete_list_modal_component.rb
@@ -29,7 +29,7 @@
# ++
class Projects::DeleteListModalComponent < ApplicationComponent # rubocop:disable OpenProject/AddPreviewForViewComponent
- MODAL_ID = "op-project-list-delete-dialog"
+ MODAL_ID = 'op-project-list-delete-dialog'
options :query
end
diff --git a/app/components/projects/export_list_modal_component.rb b/app/components/projects/export_list_modal_component.rb
index e540403fbd98..601cc29649a5 100644
--- a/app/components/projects/export_list_modal_component.rb
+++ b/app/components/projects/export_list_modal_component.rb
@@ -29,7 +29,7 @@
# ++
class Projects::ExportListModalComponent < ApplicationComponent # rubocop:disable OpenProject/AddPreviewForViewComponent
- MODAL_ID = "op-project-list-export-dialog"
+ MODAL_ID = 'op-project-list-export-dialog'
options :query
end
diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rb
index 62e6d88d4890..e6fb6f526ce2 100644
--- a/app/components/projects/row_component.rb
+++ b/app/components/projects/row_component.rb
@@ -39,7 +39,7 @@ def level
# Hierarchy cell is just a placeholder
def hierarchy
- ""
+ ''
end
def column_value(column)
@@ -56,10 +56,10 @@ def custom_field_column(column)
cf = column.custom_field
custom_value = project.formatted_custom_value_for(cf)
- if cf.field_format == "text" && custom_value.present?
+ if cf.field_format == 'text' && custom_value.present?
render OpenProject::Common::AttributeComponent.new("dialog-#{project.id}-cf-#{cf.id}", cf.name, custom_value.html_safe) # rubocop:disable Rails/OutputSafety
elsif custom_value.is_a?(Array)
- safe_join(Array(custom_value).compact_blank, ", ")
+ safe_join(Array(custom_value).compact_blank, ', ')
else
custom_value
end
@@ -74,20 +74,20 @@ def latest_activity_at
end
def required_disk_space
- return "" unless project.required_disk_space.to_i > 0
+ return '' unless project.required_disk_space.to_i > 0
number_to_human_size(project.required_disk_space, precision: 2)
end
def name
- content = content_tag(:i, "", class: "projects-table--hierarchy-icon")
+ content = content_tag(:i, '', class: "projects-table--hierarchy-icon")
if project.archived?
- content << " "
- content << content_tag(:span, I18n.t("project.archive.archived"), class: "archived-label")
+ content << ' '
+ content << content_tag(:span, I18n.t('project.archive.archived'), class: 'archived-label')
end
- content << " "
+ content << ' '
content << helpers.link_to_project(project, {}, {}, false)
content
end
@@ -95,13 +95,13 @@ def name
def project_status
return nil unless user_can_view_project?
- content = "".html_safe
+ content = ''.html_safe
status_code = project.status_code
if status_code
classes = helpers.project_status_css_class(status_code)
- content << content_tag(:span, "", class: "project-status--bulb -inline #{classes}")
+ content << content_tag(:span, '', class: "project-status--bulb -inline #{classes}")
content << content_tag(:span, helpers.project_status_name(status_code), class: "project-status--name #{classes}")
end
@@ -113,7 +113,7 @@ def status_explanation
if project.status_explanation.present? && project.status_explanation
render OpenProject::Common::AttributeComponent.new("dialog-#{project.id}-status-explanation",
- I18n.t("activerecord.attributes.project.status_explanation"),
+ I18n.t('activerecord.attributes.project.status_explanation'),
project.status_explanation)
end
end
@@ -123,7 +123,7 @@ def description
if project.description.present?
render OpenProject::Common::AttributeComponent.new("dialog-#{project.id}-description",
- I18n.t("activerecord.attributes.project.description"),
+ I18n.t('activerecord.attributes.project.description'),
project.description)
end
end
@@ -149,11 +149,11 @@ def row_css_level_classes
end
def project_css_classes
- s = " project ".html_safe
+ s = ' project '.html_safe
- s << " root" if project.root?
- s << " child" if project.child?
- s << (project.leaf? ? " leaf" : " parent")
+ s << ' root' if project.root?
+ s << ' child' if project.child?
+ s << (project.leaf? ? ' leaf' : ' parent')
s
end
@@ -169,7 +169,7 @@ def additional_css_class(column)
"project-long-text-container"
elsif custom_field_column?(column)
cf = column.custom_field
- formattable = cf.field_format == "text" ? " project-long-text-container" : ""
+ formattable = cf.field_format == 'text' ? ' project-long-text-container' : ''
"format-#{cf.field_format}#{formattable}"
end
end
@@ -188,17 +188,17 @@ def more_menu_subproject_item
if User.current.allowed_in_project?(:add_subprojects, project)
[t(:label_subproject_new),
new_project_path(parent_id: project.id),
- { class: "icon-context icon-add",
+ { class: 'icon-context icon-add',
title: t(:label_subproject_new) }]
end
end
def more_menu_settings_item
- if User.current.allowed_in_project?({ controller: "/projects/settings/general", action: "show", project_id: project.id },
+ if User.current.allowed_in_project?({ controller: '/projects/settings/general', action: 'show', project_id: project.id },
project)
[t(:label_project_settings),
project_settings_general_path(project),
- { class: "icon-context icon-settings",
+ { class: 'icon-context icon-settings',
title: t(:label_project_settings) }]
end
end
@@ -207,8 +207,8 @@ def more_menu_activity_item
if User.current.allowed_in_project?(:view_project_activity, project)
[
t(:label_project_activity),
- project_activity_index_path(project, event_types: ["project_attributes"]),
- { class: "icon-context icon-checkmark",
+ project_activity_index_path(project, event_types: ['project_attributes']),
+ { class: 'icon-context icon-checkmark',
title: t(:label_project_activity) }
]
end
@@ -218,9 +218,9 @@ def more_menu_archive_item
if User.current.allowed_in_project?(:archive_project, project) && project.active?
[t(:button_archive),
project_archive_path(project, status: params[:status]),
- { data: { confirm: t("project.archive.are_you_sure", name: project.name) },
+ { data: { confirm: t('project.archive.are_you_sure', name: project.name) },
method: :post,
- class: "icon-context icon-locked",
+ class: 'icon-context icon-locked',
title: t(:button_archive) }]
end
end
@@ -230,7 +230,7 @@ def more_menu_unarchive_item
[t(:button_unarchive),
project_archive_path(project, status: params[:status]),
{ method: :delete,
- class: "icon-context icon-unlocked",
+ class: 'icon-context icon-unlocked',
title: t(:button_unarchive) }]
end
end
@@ -239,7 +239,7 @@ def more_menu_copy_item
if User.current.allowed_in_project?(:copy_projects, project) && !project.archived?
[t(:button_copy),
copy_project_path(project),
- { class: "icon-context icon-copy",
+ { class: 'icon-context icon-copy',
title: t(:button_copy) }]
end
end
@@ -248,7 +248,7 @@ def more_menu_delete_item
if User.current.admin
[t(:button_delete),
confirm_destroy_project_path(project),
- { class: "icon-context icon-delete",
+ { class: 'icon-context icon-delete',
title: t(:button_delete) }]
end
end
diff --git a/app/components/projects/table_component.rb b/app/components/projects/table_component.rb
index 4183827f40f7..2033139373d2 100644
--- a/app/components/projects/table_component.rb
+++ b/app/components/projects/table_component.rb
@@ -48,7 +48,7 @@ def initial_sort
end
def table_id
- "project-table"
+ 'project-table'
end
##
@@ -80,13 +80,13 @@ def paginated?
def deactivate_class_on_lft_sort
if sorted_by_lft?
- "spot-link_inactive"
+ 'spot-link_inactive'
end
end
def href_only_when_not_sort_lft
unless sorted_by_lft?
- projects_path(sortBy: JSON::dump([["lft", "asc"]]))
+ projects_path(sortBy: JSON::dump([['lft', 'asc']]))
end
end
@@ -96,9 +96,9 @@ def order_options(select)
data:
{
controller: "params-from-query",
- "application-target": "dynamic",
- "params-from-query-allowed-value": '["query_id"]',
- "params-from-query-all-anchors-value": "true"
+ 'application-target': "dynamic",
+ 'params-from-query-allowed-value': '["query_id"]',
+ 'params-from-query-all-anchors-value': "true"
}
}
end
diff --git a/app/components/row_component.rb b/app/components/row_component.rb
index 7ed07b4e4af7..640a26176676 100644
--- a/app/components/row_component.rb
+++ b/app/components/row_component.rb
@@ -70,7 +70,7 @@ def row_css_class
def checkmark(condition)
if condition
- helpers.op_icon "icon icon-checkmark"
+ helpers.op_icon 'icon icon-checkmark'
end
end
end
diff --git a/app/components/settings/time_zone_setting_component.rb b/app/components/settings/time_zone_setting_component.rb
index 7cb43e8120de..84b2f964c1b7 100644
--- a/app/components/settings/time_zone_setting_component.rb
+++ b/app/components/settings/time_zone_setting_component.rb
@@ -79,7 +79,7 @@ def time_zone_entries
private
def time_zone_option(canonical_zone, zones)
- zone_names = zones.map(&:name).join(", ")
+ zone_names = zones.map(&:name).join(', ')
[
"(UTC#{ActiveSupport::TimeZone.seconds_to_utc_offset(canonical_zone.base_utc_offset)}) #{zone_names}",
canonical_zone.identifier
diff --git a/app/components/statuses/row_component.rb b/app/components/statuses/row_component.rb
index 8c2f1d8d6b6c..27c24d9b14b2 100644
--- a/app/components/statuses/row_component.rb
+++ b/app/components/statuses/row_component.rb
@@ -59,8 +59,8 @@ def done_ratio
end
def sort
- helpers.reorder_links "status",
- { action: "update", id: status },
+ helpers.reorder_links 'status',
+ { action: 'update', id: status },
method: :patch
end
@@ -72,7 +72,7 @@ def button_links
def delete_link
link_to(
- helpers.op_icon("icon icon-delete"),
+ helpers.op_icon('icon icon-delete'),
status_path(status),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
diff --git a/app/components/statuses/table_component.rb b/app/components/statuses/table_component.rb
index 9bfbaab1d108..e7792d44ae5b 100644
--- a/app/components/statuses/table_component.rb
+++ b/app/components/statuses/table_component.rb
@@ -45,9 +45,9 @@ def columns
def inline_create_link
link_to new_status_path,
aria: { label: t(:label_work_package_status_new) },
- class: "wp-inline-create--add-link",
+ class: 'wp-inline-create--add-link',
title: t(:label_work_package_status_new) do
- helpers.op_icon("icon icon-add")
+ helpers.op_icon('icon icon-add')
end
end
diff --git a/app/components/table_component.rb b/app/components/table_component.rb
index c1c85c05fcc4..26a88eaa6784 100644
--- a/app/components/table_component.rb
+++ b/app/components/table_component.rb
@@ -174,7 +174,7 @@ def initial_sort
end
def initial_order
- initial_sort_correlation.join(" ")
+ initial_sort_correlation.join(' ')
end
def paginated?
diff --git a/app/components/user_filter_component.rb b/app/components/user_filter_component.rb
index 9cd43c565989..c70909092459 100644
--- a/app/components/user_filter_component.rb
+++ b/app/components/user_filter_component.rb
@@ -35,20 +35,20 @@ class << self
# or the default status to be filtered by (all)
# if no status is given.
def status_param(params)
- params[:status].presence || "all"
+ params[:status].presence || 'all'
end
def filter_status(query, status)
- return unless status && status != "all"
+ return unless status && status != 'all'
case status
- when "blocked"
- query.where(:blocked, "=", :blocked)
- when "active"
- query.where(:status, "=", status.to_sym)
- query.where(:blocked, "!", :blocked)
+ when 'blocked'
+ query.where(:blocked, '=', :blocked)
+ when 'active'
+ query.where(:status, '=', status.to_sym)
+ query.where(:blocked, '!', :blocked)
else
- query.where(:status, "=", status.to_sym)
+ query.where(:status, '=', status.to_sym)
end
end
diff --git a/app/components/users/auto_login_tokens/row_component.rb b/app/components/users/auto_login_tokens/row_component.rb
index 640415c2af8f..784205909c99 100644
--- a/app/components/users/auto_login_tokens/row_component.rb
+++ b/app/components/users/auto_login_tokens/row_component.rb
@@ -45,22 +45,22 @@ def current?
def is_current # rubocop:disable Naming/PredicateName
if current?
- helpers.op_icon "icon-yes"
+ helpers.op_icon 'icon-yes'
end
end
def device
- token_data[:platform] || I18n.t("users.sessions.unknown_os")
+ token_data[:platform] || I18n.t('users.sessions.unknown_os')
end
def browser
- name = token_data[:browser] || "unknown browser"
+ name = token_data[:browser] || 'unknown browser'
version = token_data[:browser_version]
"#{name} #{version ? "(Version #{version})" : ''}"
end
def platform
- token_data[:platform] || "unknown platform"
+ token_data[:platform] || 'unknown platform'
end
def expires_on
@@ -76,9 +76,9 @@ def delete_link
return if current?
link_to(
- helpers.op_icon("icon icon-delete"),
- { controller: "/my/auto_login_tokens", action: "destroy", id: token.id },
- class: "button--link",
+ helpers.op_icon('icon icon-delete'),
+ { controller: '/my/auto_login_tokens', action: 'destroy', id: token.id },
+ class: 'button--link',
role: :button,
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure), disable_with: I18n.t(:label_loading) },
diff --git a/app/components/users/auto_login_tokens/table_component.rb b/app/components/users/auto_login_tokens/table_component.rb
index eda17cd9ea12..a73c1a959857 100644
--- a/app/components/users/auto_login_tokens/table_component.rb
+++ b/app/components/users/auto_login_tokens/table_component.rb
@@ -41,10 +41,10 @@ def sortable?
def headers
[
- [:is_current, { caption: I18n.t("users.sessions.current") }],
- [:browser, { caption: I18n.t("users.sessions.browser") }],
- [:device, { caption: I18n.t("users.sessions.device") }],
- [:expires_on, { caption: I18n.t("attributes.expires_at") }]
+ [:is_current, { caption: I18n.t('users.sessions.current') }],
+ [:browser, { caption: I18n.t('users.sessions.browser') }],
+ [:device, { caption: I18n.t('users.sessions.device') }],
+ [:expires_on, { caption: I18n.t('attributes.expires_at') }]
]
end
end
diff --git a/app/components/users/avatar_component.rb b/app/components/users/avatar_component.rb
index df53c25f2394..a95a5f0c3683 100644
--- a/app/components/users/avatar_component.rb
+++ b/app/components/users/avatar_component.rb
@@ -32,7 +32,7 @@ class AvatarComponent < ApplicationComponent
include AvatarHelper
include OpPrimer::ComponentHelpers
- def initialize(user:, show_name: true, link: true, size: "default", classes: "", title: nil, name_classes: "")
+ def initialize(user:, show_name: true, link: true, size: 'default', classes: '', title: nil, name_classes: '')
super
@user = user
diff --git a/app/components/users/sessions/row_component.rb b/app/components/users/sessions/row_component.rb
index 6888306c7a76..3410ffcda4c2 100644
--- a/app/components/users/sessions/row_component.rb
+++ b/app/components/users/sessions/row_component.rb
@@ -48,27 +48,27 @@ def current?
def is_current # rubocop:disable Naming/PredicateName
if current?
- helpers.op_icon "icon-yes"
+ helpers.op_icon 'icon-yes'
end
end
def device
- session_data[:platform] || I18n.t("users.sessions.unknown_os")
+ session_data[:platform] || I18n.t('users.sessions.unknown_os')
end
def browser
- name = session_data[:browser] || "unknown browser"
+ name = session_data[:browser] || 'unknown browser'
version = session_data[:browser_version]
"#{name} #{version ? "(Version #{version})" : ''}"
end
def platform
- session_data[:platform] || "unknown platform"
+ session_data[:platform] || 'unknown platform'
end
def updated_at
if current?
- I18n.t("users.sessions.current")
+ I18n.t('users.sessions.current')
else
helpers.format_time session.updated_at
end
@@ -82,9 +82,9 @@ def delete_link
return if current?
link_to(
- helpers.op_icon("icon icon-delete"),
- { controller: "/my/sessions", action: "destroy", id: session },
- class: "button--link",
+ helpers.op_icon('icon icon-delete'),
+ { controller: '/my/sessions', action: 'destroy', id: session },
+ class: 'button--link',
role: :button,
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure), disable_with: I18n.t(:label_loading) },
diff --git a/app/components/users/sessions/table_component.rb b/app/components/users/sessions/table_component.rb
index 0abc12875df7..8cff7a6775c2 100644
--- a/app/components/users/sessions/table_component.rb
+++ b/app/components/users/sessions/table_component.rb
@@ -41,10 +41,10 @@ def initial_sort
def headers
[
- [:is_current, { caption: I18n.t("users.sessions.current") }],
- [:browser, { caption: I18n.t("users.sessions.browser") }],
- [:device, { caption: I18n.t("users.sessions.device") }],
- [:updated_at, { caption: I18n.t("attributes.updated_at") }]
+ [:is_current, { caption: I18n.t('users.sessions.current') }],
+ [:browser, { caption: I18n.t('users.sessions.browser') }],
+ [:device, { caption: I18n.t('users.sessions.device') }],
+ [:updated_at, { caption: I18n.t('attributes.updated_at') }]
]
end
end
diff --git a/app/components/users/table_component.rb b/app/components/users/table_component.rb
index cd159c89dd0d..b7f2eea504b3 100644
--- a/app/components/users/table_component.rb
+++ b/app/components/users/table_component.rb
@@ -46,7 +46,7 @@ def headers
def header_options(name)
options = { caption: User.human_attribute_name(name) }
- options[:default_order] = "desc" if desc_by_default.include? name
+ options[:default_order] = 'desc' if desc_by_default.include? name
options
end
diff --git a/app/components/versions/row_component.rb b/app/components/versions/row_component.rb
index d1fb386ecca8..0bddbf1bc6cb 100644
--- a/app/components/versions/row_component.rb
+++ b/app/components/versions/row_component.rb
@@ -75,11 +75,11 @@ def sharing
end
def wiki_page
- return "" if wiki_page_title.blank? || version.project.wiki.nil?
+ return '' if wiki_page_title.blank? || version.project.wiki.nil?
helpers.link_to_if_authorized(wiki_page_title,
- controller: "/wiki",
- action: "show",
+ controller: '/wiki',
+ action: 'show',
project_id: version.project,
id: wiki_page_title) || h(wiki_page_title)
end
@@ -97,20 +97,20 @@ def wiki_page_title
def edit_link
return unless version.project == table.project
- helpers.link_to_if_authorized "",
- { controller: "/versions", action: "edit", id: version },
- class: "icon icon-edit",
+ helpers.link_to_if_authorized '',
+ { controller: '/versions', action: 'edit', id: version },
+ class: 'icon icon-edit',
title: t(:button_edit)
end
def delete_link
return unless version.project == table.project
- helpers.link_to_if_authorized "",
- { controller: "/versions", action: "destroy", id: version },
+ helpers.link_to_if_authorized '',
+ { controller: '/versions', action: 'destroy', id: version },
data: { confirm: t(:text_are_you_sure) },
method: :delete,
- class: "icon icon-delete",
+ class: 'icon icon-delete',
title: t(:button_delete)
end
diff --git a/app/components/versions/table_component.rb b/app/components/versions/table_component.rb
index bede23fbfdcc..eebc3e41af4f 100644
--- a/app/components/versions/table_component.rb
+++ b/app/components/versions/table_component.rb
@@ -49,7 +49,7 @@ def header_options(name)
end
def wiki_page_header_options
- ["wiki_page_title", { caption: WikiPage.model_name.human }]
+ ['wiki_page_title', { caption: WikiPage.model_name.human }]
end
end
end
diff --git a/app/components/work_packages/share/concerns/displayable_roles.rb b/app/components/work_packages/share/concerns/displayable_roles.rb
index ff0faa338347..d02b55255c6d 100644
--- a/app/components/work_packages/share/concerns/displayable_roles.rb
+++ b/app/components/work_packages/share/concerns/displayable_roles.rb
@@ -34,15 +34,15 @@ module Concerns
module DisplayableRoles
def options
[
- { label: I18n.t("work_package.sharing.permissions.edit"),
+ { label: I18n.t('work_package.sharing.permissions.edit'),
value: Role::BUILTIN_WORK_PACKAGE_EDITOR,
- description: I18n.t("work_package.sharing.permissions.edit_description") },
- { label: I18n.t("work_package.sharing.permissions.comment"),
+ description: I18n.t('work_package.sharing.permissions.edit_description') },
+ { label: I18n.t('work_package.sharing.permissions.comment'),
value: Role::BUILTIN_WORK_PACKAGE_COMMENTER,
- description: I18n.t("work_package.sharing.permissions.comment_description") },
- { label: I18n.t("work_package.sharing.permissions.view"),
+ description: I18n.t('work_package.sharing.permissions.comment_description') },
+ { label: I18n.t('work_package.sharing.permissions.view'),
value: Role::BUILTIN_WORK_PACKAGE_VIEWER,
- description: I18n.t("work_package.sharing.permissions.view_description") }
+ description: I18n.t('work_package.sharing.permissions.view_description') }
]
end
end
diff --git a/app/components/work_packages/share/modal_body_component.rb b/app/components/work_packages/share/modal_body_component.rb
index e8a3c661d94a..2d80e91e9c10 100644
--- a/app/components/work_packages/share/modal_body_component.rb
+++ b/app/components/work_packages/share/modal_body_component.rb
@@ -55,39 +55,39 @@ def insert_target_modified?
end
def insert_target_modifier_id
- "op-share-wp-active-shares"
+ 'op-share-wp-active-shares'
end
def blankslate_config
@blankslate_config ||= {}.tap do |config|
if params[:filters].blank?
config[:icon] = :people
- config[:heading_text] = I18n.t("work_package.sharing.text_empty_state_header")
- config[:description_text] = I18n.t("work_package.sharing.text_empty_state_description")
+ config[:heading_text] = I18n.t('work_package.sharing.text_empty_state_header')
+ config[:description_text] = I18n.t('work_package.sharing.text_empty_state_description')
else
config[:icon] = :search
- config[:heading_text] = I18n.t("work_package.sharing.text_empty_search_header")
- config[:description_text] = I18n.t("work_package.sharing.text_empty_search_description")
+ config[:heading_text] = I18n.t('work_package.sharing.text_empty_search_header')
+ config[:description_text] = I18n.t('work_package.sharing.text_empty_search_description')
end
end
end
def type_filter_options
[
- { label: I18n.t("work_package.sharing.filter.project_member"),
- value: { principal_type: "User", project_member: true } },
- { label: I18n.t("work_package.sharing.filter.not_project_member"),
- value: { principal_type: "User", project_member: false } },
- { label: I18n.t("work_package.sharing.filter.project_group"),
- value: { principal_type: "Group", project_member: true } },
- { label: I18n.t("work_package.sharing.filter.not_project_group"),
- value: { principal_type: "Group", project_member: false } }
+ { label: I18n.t('work_package.sharing.filter.project_member'),
+ value: { principal_type: 'User', project_member: true } },
+ { label: I18n.t('work_package.sharing.filter.not_project_member'),
+ value: { principal_type: 'User', project_member: false } },
+ { label: I18n.t('work_package.sharing.filter.project_group'),
+ value: { principal_type: 'Group', project_member: true } },
+ { label: I18n.t('work_package.sharing.filter.not_project_group'),
+ value: { principal_type: 'Group', project_member: false } }
]
end
def type_filter_option_active?(_option)
- principal_type_filter_value = current_filter_value(params[:filters], "principal_type")
- project_member_filter_value = current_filter_value(params[:filters], "also_project_member")
+ principal_type_filter_value = current_filter_value(params[:filters], 'principal_type')
+ project_member_filter_value = current_filter_value(params[:filters], 'also_project_member')
return false if principal_type_filter_value.nil? || project_member_filter_value.nil?
@@ -100,7 +100,7 @@ def type_filter_option_active?(_option)
end
def role_filter_option_active?(_option)
- role_filter_value = current_filter_value(params[:filters], "role_id")
+ role_filter_value = current_filter_value(params[:filters], 'role_id')
return false if role_filter_value.nil?
@@ -122,7 +122,7 @@ def filter_url(type_option: nil, role_option: nil)
end
def apply_role_filter(_option)
- current_role_filter_value = current_filter_value(params[:filters], "role_id")
+ current_role_filter_value = current_filter_value(params[:filters], 'role_id')
filter = []
if _option.nil? && current_role_filter_value.present?
@@ -141,8 +141,8 @@ def role_filter_for(_option, builtin_role: true)
end
def apply_type_filter(_option)
- current_type_filter_value = current_filter_value(params[:filters], "principal_type")
- current_member_filter_value = current_filter_value(params[:filters], "also_project_member")
+ current_type_filter_value = current_filter_value(params[:filters], 'principal_type')
+ current_member_filter_value = current_filter_value(params[:filters], 'also_project_member')
filter = []
if _option.nil? && current_type_filter_value.present? && current_member_filter_value.present?
@@ -173,7 +173,7 @@ def current_filter_value(filters, filter_key)
return nil if filters.nil?
given_filters = JSON.parse(filters).find { |key| key.key?(filter_key) }
- given_filters ? given_filters[filter_key]["values"].first : nil
+ given_filters ? given_filters[filter_key]['values'].first : nil
end
end
end
diff --git a/app/components/work_packages/share/permission_button_component.rb b/app/components/work_packages/share/permission_button_component.rb
index 9bfee0e573d2..e6e03482a364 100644
--- a/app/components/work_packages/share/permission_button_component.rb
+++ b/app/components/work_packages/share/permission_button_component.rb
@@ -54,7 +54,7 @@ def option_active?(option)
end
def wrapper_uniq_by
- share.id || @system_arguments.dig(:data, :"test-selector")
+ share.id || @system_arguments.dig(:data, :'test-selector')
end
private
@@ -77,8 +77,8 @@ def permission_name(value)
def form_inputs(role_id)
[].tap do |inputs|
- inputs << { name: "role_ids[]", value: role_id }
- inputs << { name: "filters", value: params[:filters] } if params[:filters]
+ inputs << { name: 'role_ids[]', value: role_id }
+ inputs << { name: 'filters', value: params[:filters] } if params[:filters]
end
end
end
diff --git a/app/components/work_packages/share/share_row_component.rb b/app/components/work_packages/share/share_row_component.rb
index 16d82a331a09..ef5dbb1fbf7f 100644
--- a/app/components/work_packages/share/share_row_component.rb
+++ b/app/components/work_packages/share/share_row_component.rb
@@ -60,9 +60,9 @@ def share_editable?
def grid_css_classes
if sharing_manageable?
- "op-share-wp-modal-body--user-row_manageable"
+ 'op-share-wp-modal-body--user-row_manageable'
else
- "op-share-wp-modal-body--user-row"
+ 'op-share-wp-modal-body--user-row'
end
end
diff --git a/app/contracts/attachments/validate_replacements.rb b/app/contracts/attachments/validate_replacements.rb
index 7bbc91d763bf..b283805712d0 100644
--- a/app/contracts/attachments/validate_replacements.rb
+++ b/app/contracts/attachments/validate_replacements.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "model_contract"
+require 'model_contract'
module Attachments
module ValidateReplacements
diff --git a/app/contracts/authentication/omniauth_auth_hash_contract.rb b/app/contracts/authentication/omniauth_auth_hash_contract.rb
index ba0b257f1761..3e89231559a0 100644
--- a/app/contracts/authentication/omniauth_auth_hash_contract.rb
+++ b/app/contracts/authentication/omniauth_auth_hash_contract.rb
@@ -49,9 +49,9 @@ def validate_auth_hash
end
def validate_auth_hash_not_expired
- return unless auth_hash["timestamp"]
+ return unless auth_hash['timestamp']
- if auth_hash["timestamp"] < Time.now - 30.minutes
+ if auth_hash['timestamp'] < Time.now - 30.minutes
errors.add(:base, I18n.t(:error_omniauth_registration_timed_out))
end
end
diff --git a/app/contracts/concerns/assignable_custom_field_values.rb b/app/contracts/concerns/assignable_custom_field_values.rb
index 133f1ecbf6f2..91d7339f9bab 100644
--- a/app/contracts/concerns/assignable_custom_field_values.rb
+++ b/app/contracts/concerns/assignable_custom_field_values.rb
@@ -32,9 +32,9 @@ module AssignableCustomFieldValues
included do
def assignable_custom_field_values(custom_field)
case custom_field.field_format
- when "list"
+ when 'list'
custom_field.possible_values
- when "version"
+ when 'version'
assignable_versions(only_open: !custom_field.allow_non_open_versions?)
end
end
diff --git a/app/contracts/custom_actions/cu_contract.rb b/app/contracts/custom_actions/cu_contract.rb
index e2c2d65abcc4..54e7025349d1 100644
--- a/app/contracts/custom_actions/cu_contract.rb
+++ b/app/contracts/custom_actions/cu_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "model_contract"
+require 'model_contract'
# Contract for create (c) and update (u)
module CustomActions
diff --git a/app/contracts/groups/create_contract.rb b/app/contracts/groups/create_contract.rb
index af3eb12b13ad..8c7d48ed5005 100644
--- a/app/contracts/groups/create_contract.rb
+++ b/app/contracts/groups/create_contract.rb
@@ -36,7 +36,7 @@ class CreateContract < BaseContract
def type_is_group
unless model.type == Group.name
- errors.add(:type, "Type and class mismatch")
+ errors.add(:type, 'Type and class mismatch')
end
end
end
diff --git a/app/contracts/model_contract.rb b/app/contracts/model_contract.rb
index 07ba44ffd920..4c482f3cbdf1 100644
--- a/app/contracts/model_contract.rb
+++ b/app/contracts/model_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base_contract"
+require_relative 'base_contract'
##
# Model contract for AR records that
diff --git a/app/contracts/placeholder_users/create_contract.rb b/app/contracts/placeholder_users/create_contract.rb
index 308b7750fd99..7a02a7b15da7 100644
--- a/app/contracts/placeholder_users/create_contract.rb
+++ b/app/contracts/placeholder_users/create_contract.rb
@@ -39,7 +39,7 @@ class CreateContract < BaseContract
def type_is_placeholder_user
unless model.type == PlaceholderUser.name
- errors.add(:type, "Type and class mismatch")
+ errors.add(:type, 'Type and class mismatch')
end
end
end
diff --git a/app/contracts/projects/create_contract.rb b/app/contracts/projects/create_contract.rb
index 78b38a775c73..2db60762324c 100644
--- a/app/contracts/projects/create_contract.rb
+++ b/app/contracts/projects/create_contract.rb
@@ -28,11 +28,6 @@
module Projects
class CreateContract < BaseContract
- include AdminWritableTimestamps
- # Projects update their updated_at timestamp due to awesome_nested_set
- # so allowing writing here would be useless.
- allow_writable_timestamps :created_at
-
private
def validate_user_allowed_to_manage
diff --git a/app/contracts/queries/copy_contract.rb b/app/contracts/queries/copy_contract.rb
index c184b13b43f2..b67a0c02dcd5 100644
--- a/app/contracts/queries/copy_contract.rb
+++ b/app/contracts/queries/copy_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "queries/base_contract"
+require 'queries/base_contract'
module Queries
class CopyContract < BaseContract
diff --git a/app/contracts/queries/global_create_contract.rb b/app/contracts/queries/global_create_contract.rb
index ba75246e447a..586679b96758 100644
--- a/app/contracts/queries/global_create_contract.rb
+++ b/app/contracts/queries/global_create_contract.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require "queries/create_contract"
+require 'queries/create_contract'
module Queries
class GlobalCreateContract < CreateContract
diff --git a/app/contracts/queries/ical_sharing_contract.rb b/app/contracts/queries/ical_sharing_contract.rb
index 58390a9d0c06..64dcc1f8db58 100644
--- a/app/contracts/queries/ical_sharing_contract.rb
+++ b/app/contracts/queries/ical_sharing_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "queries/base_contract"
+require 'queries/base_contract'
module Queries
class ICalSharingContract < BaseContract
diff --git a/app/contracts/queries/update_contract.rb b/app/contracts/queries/update_contract.rb
index 867c2559b925..a2479b775187 100644
--- a/app/contracts/queries/update_contract.rb
+++ b/app/contracts/queries/update_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "queries/base_contract"
+require 'queries/base_contract'
module Queries
class UpdateContract < BaseContract
diff --git a/app/contracts/queries/update_form_contract.rb b/app/contracts/queries/update_form_contract.rb
index 8f2805706d78..ff83d8dad989 100644
--- a/app/contracts/queries/update_form_contract.rb
+++ b/app/contracts/queries/update_form_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "queries/base_contract"
+require 'queries/base_contract'
module Queries
class UpdateFormContract < BaseContract
diff --git a/app/contracts/relations/base_contract.rb b/app/contracts/relations/base_contract.rb
index 2a1ddc9d7056..981653ad605c 100644
--- a/app/contracts/relations/base_contract.rb
+++ b/app/contracts/relations/base_contract.rb
@@ -57,7 +57,7 @@ def validate_to_exists
def validate_nodes_relatable
if (model.from_id_changed? || model.to_id_changed?) &&
WorkPackage.relatable(model.from, model.relation_type, ignored_relation: model).where(id: model.to_id).empty?
- errors.add :base, I18n.t(:"activerecord.errors.messages.circular_dependency")
+ errors.add :base, I18n.t(:'activerecord.errors.messages.circular_dependency')
end
end
diff --git a/app/contracts/relations/create_contract.rb b/app/contracts/relations/create_contract.rb
index fe139dfa70bb..6f6318ceef6d 100644
--- a/app/contracts/relations/create_contract.rb
+++ b/app/contracts/relations/create_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "relations/base_contract"
+require 'relations/base_contract'
module Relations
class CreateContract < BaseContract
diff --git a/app/contracts/settings/working_days_params_contract.rb b/app/contracts/settings/working_days_params_contract.rb
index 42bacb779bab..c19f63062f85 100644
--- a/app/contracts/settings/working_days_params_contract.rb
+++ b/app/contracts/settings/working_days_params_contract.rb
@@ -42,7 +42,7 @@ def working_days_are_present
end
def unique_job
- WorkPackages::ApplyWorkingDaysChangeJob.new.check_concurrency do
+ if WorkPackages::ApplyWorkingDaysChangeJob.scheduled?
errors.add :base, :previous_working_day_changes_unprocessed
end
end
diff --git a/app/contracts/types/base_contract.rb b/app/contracts/types/base_contract.rb
index 59d349d82afa..22202424a38b 100644
--- a/app/contracts/types/base_contract.rb
+++ b/app/contracts/types/base_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "model_contract"
+require 'model_contract'
module Types
class BaseContract < ::ModelContract
@@ -93,7 +93,7 @@ def validate_attribute_group(group)
if key.is_a?(String) && valid_attributes.exclude?(key)
errors.add(
:attribute_groups,
- I18n.t("activerecord.errors.models.type.attributes.attribute_groups.attribute_unknown_name",
+ I18n.t('activerecord.errors.models.type.attributes.attribute_groups.attribute_unknown_name',
attribute: key)
)
end
diff --git a/app/contracts/user_preferences/base_contract.rb b/app/contracts/user_preferences/base_contract.rb
index 4aa2a4be0757..c23970bf1e7f 100644
--- a/app/contracts/user_preferences/base_contract.rb
+++ b/app/contracts/user_preferences/base_contract.rb
@@ -81,7 +81,7 @@ def namesake_time_zone(time_zones)
if time_zones.length == 1
time_zones.first
else
- time_zones.detect { |tz| tz.tzinfo.name.include?(tz.name.tr(" ", "_")) }
+ time_zones.detect { |tz| tz.tzinfo.name.include?(tz.name.tr(' ', '_')) }
end
end
end
@@ -109,7 +109,7 @@ def user_allowed_to_access
end
def full_hour_reminder_time
- unless model.daily_reminders[:times].all? { |time| time.end_with?("00:00+00:00") }
+ unless model.daily_reminders[:times].all? { |time| time.end_with?('00:00+00:00') }
errors.add :daily_reminders, :full_hour
end
end
diff --git a/app/contracts/users/base_contract.rb b/app/contracts/users/base_contract.rb
index 2dfb83fd0c6f..a28ddcd0ec13 100644
--- a/app/contracts/users/base_contract.rb
+++ b/app/contracts/users/base_contract.rb
@@ -64,7 +64,7 @@ def self.model
def reduce_writable_attributes(attributes)
super.tap do |writable|
- writable << "password" if password_writable?
+ writable << 'password' if password_writable?
end
end
diff --git a/app/contracts/users/create_contract.rb b/app/contracts/users/create_contract.rb
index 2ef001e6446b..3055261bf060 100644
--- a/app/contracts/users/create_contract.rb
+++ b/app/contracts/users/create_contract.rb
@@ -76,7 +76,7 @@ def user_allowed_to_add
def type_is_user
unless model.type == User.name
- errors.add(:type, "Type and class mismatch")
+ errors.add(:type, 'Type and class mismatch')
end
end
end
diff --git a/app/contracts/work_packages/copy_project_contract.rb b/app/contracts/work_packages/copy_project_contract.rb
index 5aa7993f1fdb..178289a5517c 100644
--- a/app/contracts/work_packages/copy_project_contract.rb
+++ b/app/contracts/work_packages/copy_project_contract.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "work_packages/create_contract"
+require 'work_packages/create_contract'
# Can be used to copy all of a project's work packages. As the
# work packages can be old, some of the validations that would
diff --git a/app/contracts/work_packages/create_contract.rb b/app/contracts/work_packages/create_contract.rb
index e8086638b262..a8090b4ff267 100644
--- a/app/contracts/work_packages/create_contract.rb
+++ b/app/contracts/work_packages/create_contract.rb
@@ -26,16 +26,14 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "work_packages/base_contract"
+require 'work_packages/base_contract'
module WorkPackages
class CreateContract < BaseContract
- include AdminWritableTimestamps
- allow_writable_timestamps
-
attribute :author_id,
- writable: -> { default_attributes_admin_writable? }
-
+ writable: false do
+ errors.add :author_id, :invalid if model.author != user
+ end
attribute :status_id,
# Overriding permission from WP base contract to ignore change_work_package_status for creation,
# because we don't require that permission for writable status during WP creation.
@@ -64,7 +62,7 @@ def user_allowed_to_manage_file_links
def attributes_changed_by_user
# lock version is initialized by AR itself
- super - ["lock_version"]
+ super - ['lock_version']
end
end
end
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 700a0c132ed2..9ff7cc1a4114 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -42,7 +42,7 @@ class AccountController < ApplicationController
before_action :check_auth_source_sso_failure, only: :auth_source_sso_failed
before_action :check_internal_login_enabled, only: :internal_login
- layout "no_menu"
+ layout 'no_menu'
# Login request and validation
def login
@@ -58,7 +58,7 @@ def login
end
def internal_login
- render "account/login"
+ render 'account/login'
end
# Log out current user and redirect to welcome page
@@ -88,12 +88,12 @@ def lost_password
if call.success?
@token.destroy
- redirect_to action: "login"
+ redirect_to action: 'login'
return
end
end
- render template: "account/password_recovery"
+ render template: 'account/password_recovery'
elsif request.post?
mail = params[:mail]
user = User.find_by_mail(mail) if mail.present?
@@ -120,7 +120,7 @@ def lost_password
if token.save
UserMailer.password_lost(token).deliver_later
flash[:notice] = I18n.t(:notice_account_lost_email_sent)
- redirect_to action: "login", back_url: home_url
+ redirect_to action: 'login', back_url: home_url
nil
end
end
@@ -235,7 +235,7 @@ def activate_user(user)
if omniauth_direct_login?
direct_login user
elsif OpenProject::Configuration.disable_password_login?
- flash[:notice] = I18n.t("account.omniauth_login")
+ flash[:notice] = I18n.t('account.omniauth_login')
redirect_to signin_path
else
@@ -249,7 +249,7 @@ def activate_through_ldap(user)
ldap_auth_source_id: user.ldap_auth_source_id
}
- flash[:notice] = I18n.t("account.auth_source_login", login: user.login).html_safe
+ flash[:notice] = I18n.t('account.auth_source_login', login: user.login).html_safe
redirect_to signin_path(username: user.login)
end
@@ -283,7 +283,7 @@ def auth_source_sso_failed
flash.now[:error] = I18n.t(:error_auth_source_sso_failed, value: failure[:login]) +
": " + String(flash.now[:error])
- render action: "login", back_url: failure[:back_url]
+ render action: 'login', back_url: failure[:back_url]
end
private
@@ -470,11 +470,11 @@ def pending_omniauth_registration?
def onthefly_creation_failed(user, auth_source_options = {})
@user = user
session[:auth_source_registration] = auth_source_options unless auth_source_options.empty?
- render action: "register"
+ render action: 'register'
end
def self_registration_disabled
- flash[:error] = I18n.t("account.error_self_registration_disabled")
+ flash[:error] = I18n.t('account.error_self_registration_disabled')
redirect_to signin_url
end
@@ -489,18 +489,18 @@ def account_inactive(user, flash_now: true)
# Log an attempt to log in to an account in "registered" state and show a flash message.
def account_not_activated(flash_now: true)
- flash_error_message(log_reason: "NOT ACTIVATED", flash_now:) do
+ flash_error_message(log_reason: 'NOT ACTIVATED', flash_now:) do
if Setting::SelfRegistration.by_email?
- "account.error_inactive_activation_by_mail"
+ 'account.error_inactive_activation_by_mail'
else
- "account.error_inactive_manual_activation"
+ 'account.error_inactive_manual_activation'
end
end
end
def invited_account_not_activated(_user)
- flash_error_message(log_reason: "invited, NOT ACTIVATED", flash_now: false) do
- "account.error_inactive_activation_by_mail"
+ flash_error_message(log_reason: 'invited, NOT ACTIVATED', flash_now: false) do
+ 'account.error_inactive_activation_by_mail'
end
end
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index fee13edbd990..89aec8fd9052 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -75,7 +75,7 @@ def set_activity
end
def verify_activities_module_activated
- render_403 if @project && !@project.module_enabled?("activity")
+ render_403 if @project && !@project.module_enabled?('activity')
end
def determine_date_range
@@ -101,7 +101,7 @@ def determine_subprojects
elsif params[:with_subprojects].nil?
session[:activity][:with_subprojects]
else
- params[:with_subprojects] == "1"
+ params[:with_subprojects] == '1'
end
end
@@ -136,7 +136,7 @@ def activity_scope
end
def set_current_activity_page
- @activity_page = @project ? "projects/#{@project.identifier}" : "all"
+ @activity_page = @project ? "projects/#{@project.identifier}" : 'all'
end
def set_session
diff --git a/app/controllers/admin/attachments/quarantined_attachments_controller.rb b/app/controllers/admin/attachments/quarantined_attachments_controller.rb
index 8856adcce0c9..a931d5576ad8 100644
--- a/app/controllers/admin/attachments/quarantined_attachments_controller.rb
+++ b/app/controllers/admin/attachments/quarantined_attachments_controller.rb
@@ -29,7 +29,7 @@
module Admin
module Attachments
class QuarantinedAttachmentsController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin
before_action :find_quarantined_attachments
@@ -45,14 +45,14 @@ def destroy
create_journal(container,
User.system,
- I18n.t("antivirus_scan.deleted_by_admin", filename: @attachment.filename))
+ I18n.t('antivirus_scan.deleted_by_admin', filename: @attachment.filename))
flash[:notice] = t(:notice_successful_delete)
redirect_to action: :index
end
def default_breadcrumb
- t("antivirus_scan.quarantined_attachments.title")
+ t('antivirus_scan.quarantined_attachments.title')
end
def show_local_breadcrumb
diff --git a/app/controllers/admin/settings/aggregation_settings_controller.rb b/app/controllers/admin/settings/aggregation_settings_controller.rb
index 56ebfd5880c4..a01f5b774a33 100644
--- a/app/controllers/admin/settings/aggregation_settings_controller.rb
+++ b/app/controllers/admin/settings/aggregation_settings_controller.rb
@@ -37,7 +37,7 @@ def show
end
def default_breadcrumb
- t(:"menus.admin.aggregation")
+ t(:'menus.admin.aggregation')
end
def show_local_breadcrumb
diff --git a/app/controllers/admin/settings/attachments_settings_controller.rb b/app/controllers/admin/settings/attachments_settings_controller.rb
index 5b2440de78b3..929520884250 100644
--- a/app/controllers/admin/settings/attachments_settings_controller.rb
+++ b/app/controllers/admin/settings/attachments_settings_controller.rb
@@ -31,7 +31,7 @@ class AttachmentsSettingsController < ::Admin::SettingsController
menu_item :attachments_settings
def default_breadcrumb
- t(:"attributes.attachments")
+ t(:'attributes.attachments')
end
def settings_params
diff --git a/app/controllers/admin/settings/date_format_settings_controller.rb b/app/controllers/admin/settings/date_format_settings_controller.rb
index 9c14335914fe..27f21858d511 100644
--- a/app/controllers/admin/settings/date_format_settings_controller.rb
+++ b/app/controllers/admin/settings/date_format_settings_controller.rb
@@ -48,7 +48,7 @@ def validate_start_of_week_and_first_week_of_year_combination
if start_of_week.present? ^ start_of_year.present?
flash[:error] = I18n.t(
- "settings.date_format.first_date_of_week_and_year_set",
+ 'settings.date_format.first_date_of_week_and_year_set',
first_week_setting_name: I18n.t(:setting_first_week_of_year),
day_of_week_setting_name: I18n.t(:setting_start_of_week)
)
diff --git a/app/controllers/admin/settings/mail_notifications_settings_controller.rb b/app/controllers/admin/settings/mail_notifications_settings_controller.rb
index 8af36f26c00f..2029d00a2a22 100644
--- a/app/controllers/admin/settings/mail_notifications_settings_controller.rb
+++ b/app/controllers/admin/settings/mail_notifications_settings_controller.rb
@@ -39,7 +39,7 @@ def show
end
def default_breadcrumb
- t(:"menus.admin.mail_notification")
+ t(:'menus.admin.mail_notification')
end
def show_local_breadcrumb
diff --git a/app/controllers/admin/settings/users_settings_controller.rb b/app/controllers/admin/settings/users_settings_controller.rb
index 8fb79712df0a..e41ae5479f27 100644
--- a/app/controllers/admin/settings/users_settings_controller.rb
+++ b/app/controllers/admin/settings/users_settings_controller.rb
@@ -47,7 +47,7 @@ def show_local_breadcrumb
def settings_params
super.tap do |settings|
- if settings["consent_required"] == "1" && params["toggle_consent_time"] == "1"
+ if settings["consent_required"] == '1' && params['toggle_consent_time'] == '1'
settings["consent_time"] = Time.zone.now.iso8601
end
end
diff --git a/app/controllers/admin/settings/virus_scanning_settings_controller.rb b/app/controllers/admin/settings/virus_scanning_settings_controller.rb
index 842990f4a726..a15aff0fbc87 100644
--- a/app/controllers/admin/settings/virus_scanning_settings_controller.rb
+++ b/app/controllers/admin/settings/virus_scanning_settings_controller.rb
@@ -34,7 +34,7 @@ class VirusScanningSettingsController < ::Admin::SettingsController
before_action :check_clamav, only: %i[update], if: -> { scan_enabled? }
def default_breadcrumb
- t("settings.antivirus.title")
+ t('settings.antivirus.title')
end
def av_form
@@ -52,7 +52,7 @@ def av_form
private
def require_ee
- render("upsale") unless EnterpriseToken.allows_to?(:virus_scanning)
+ render('upsale') unless EnterpriseToken.allows_to?(:virus_scanning)
end
def mark_unscanned_attachments
@@ -60,7 +60,7 @@ def mark_unscanned_attachments
end
def check_clamav
- return if params.dig(:settings, :antivirus_scan_mode) == "disabled"
+ return if params.dig(:settings, :antivirus_scan_mode) == 'disabled'
service = ::Attachments::ClamAVService.new(params[:settings][:antivirus_scan_mode].to_sym,
params[:settings][:antivirus_scan_target])
@@ -68,12 +68,12 @@ def check_clamav
service.ping
rescue StandardError => e
Rails.logger.error { "Failed to check availability of ClamAV: #{e.message}" }
- flash[:error] = t(:"settings.antivirus.clamav_ping_failed")
+ flash[:error] = t(:'settings.antivirus.clamav_ping_failed')
redirect_to action: :show
end
def scan_enabled?
- Setting.antivirus_scan_mode != :disabled || params.dig(:settings, :antivirus_scan_mode) != "disabled"
+ Setting.antivirus_scan_mode != :disabled || params.dig(:settings, :antivirus_scan_mode) != 'disabled'
end
def success_callback(_call)
@@ -87,7 +87,7 @@ def success_callback(_call)
end
def rescan_files
- flash[:notice] = t("settings.antivirus.remaining_rescanned_files",
+ flash[:notice] = t('settings.antivirus.remaining_rescanned_files',
file_count: t(:label_x_files, count: Attachment.status_uploaded.count))
Attachment.status_uploaded.update_all(status: :rescan)
@@ -96,8 +96,8 @@ def rescan_files
end
def remaining_quarantine_warning
- flash[:info] = t("settings.antivirus.remaining_quarantined_files_html",
- link: helpers.link_to(t("antivirus_scan.quarantined_attachments.title"),
+ flash[:info] = t('settings.antivirus.remaining_quarantined_files_html',
+ link: helpers.link_to(t('antivirus_scan.quarantined_attachments.title'),
admin_quarantined_attachments_path),
file_count: t(:label_x_files, count: Attachment.status_quarantined.count))
redirect_to action: :show
diff --git a/app/controllers/admin/settings/working_days_settings_controller.rb b/app/controllers/admin/settings/working_days_settings_controller.rb
index fa0d390f7e49..f0c7bdfa89fb 100644
--- a/app/controllers/admin/settings/working_days_settings_controller.rb
+++ b/app/controllers/admin/settings/working_days_settings_controller.rb
@@ -37,7 +37,7 @@ def default_breadcrumb
def failure_callback(call)
@modified_non_working_days = modified_non_working_days_for(call.result)
flash[:error] = call.message || I18n.t(:notice_internal_server_error)
- render action: "show"
+ render action: 'show'
end
protected
diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb
index 8d9823ced5a1..72d222b08e68 100644
--- a/app/controllers/admin/settings_controller.rb
+++ b/app/controllers/admin/settings_controller.rb
@@ -28,7 +28,7 @@
module Admin
class SettingsController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin
before_action :find_plugin, only: %i[show_plugin update_plugin]
@@ -99,12 +99,12 @@ def update_service
def success_callback(_call)
flash[:notice] = t(:notice_successful_update)
- redirect_to action: "show", tab: params[:tab]
+ redirect_to action: 'show', tab: params[:tab]
end
def failure_callback(call)
flash[:error] = call.message || I18n.t(:notice_internal_server_error)
- redirect_to action: "show", tab: params[:tab]
+ redirect_to action: 'show', tab: params[:tab]
end
end
end
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 88eb45a947e4..91dd292afc99 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -25,10 +25,10 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open3"
+require 'open3'
class AdminController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin, except: %i[index]
before_action :authorize_global, only: %i[index]
@@ -53,11 +53,11 @@ def index
end
def projects
- redirect_to controller: "projects", action: "index"
+ redirect_to controller: 'projects', action: 'index'
end
def plugins
- @plugins = Redmine::Plugin.not_bundled.sort
+ @plugins = Redmine::Plugin.all.sort
end
def test_email
@@ -91,9 +91,9 @@ def info
def default_breadcrumb
case params[:action]
- when "plugins"
+ when 'plugins'
t(:label_plugins)
- when "info"
+ when 'info'
t(:label_information)
end
end
@@ -111,12 +111,12 @@ def hidden_admin_menu_items
def plaintext_extraction_checks
if OpenProject::Database.allows_tsv?
[
- [:"extraction.available.pdftotext", Plaintext::PdfHandler.available?],
- [:"extraction.available.unrtf", Plaintext::RtfHandler.available?],
- [:"extraction.available.catdoc", Plaintext::DocHandler.available?],
- [:"extraction.available.xls2csv", Plaintext::XlsHandler.available?],
- [:"extraction.available.catppt", Plaintext::PptHandler.available?],
- [:"extraction.available.tesseract", Plaintext::ImageHandler.available?]
+ [:'extraction.available.pdftotext', Plaintext::PdfHandler.available?],
+ [:'extraction.available.unrtf', Plaintext::RtfHandler.available?],
+ [:'extraction.available.catdoc', Plaintext::DocHandler.available?],
+ [:'extraction.available.xls2csv', Plaintext::XlsHandler.available?],
+ [:'extraction.available.catppt', Plaintext::PptHandler.available?],
+ [:'extraction.available.tesseract', Plaintext::ImageHandler.available?]
]
else
[]
@@ -124,11 +124,11 @@ def plaintext_extraction_checks
end
def image_conversion_checks
- [[:"image_conversion.imagemagick", image_conversion_libs_available?]]
+ [[:'image_conversion.imagemagick', image_conversion_libs_available?]]
end
def image_conversion_libs_available?
- Open3.capture2e("convert", "-version").first.include?("ImageMagick")
+ Open3.capture2e('convert', '-version').first.include?('ImageMagick')
rescue StandardError
false
end
diff --git a/app/controllers/angular_controller.rb b/app/controllers/angular_controller.rb
index d44fd99127a7..c92abcda3769 100644
--- a/app/controllers/angular_controller.rb
+++ b/app/controllers/angular_controller.rb
@@ -32,13 +32,13 @@ class AngularController < ApplicationController
def empty_layout
# Frontend will handle rendering
# but we will need to render with layout
- render html: "", layout: "angular/angular"
+ render html: '', layout: 'angular/angular'
end
def notifications_layout
# Frontend will handle rendering
# but we will need to render with notification specific layout
- render html: "", layout: "angular/notifications"
+ render html: '', layout: 'angular/notifications'
end
def login_back_url_params
diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb
index 59591fb70d56..ec637699c1ea 100644
--- a/app/controllers/announcements_controller.rb
+++ b/app/controllers/announcements_controller.rb
@@ -1,5 +1,5 @@
class AnnouncementsController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin
@@ -15,7 +15,7 @@ def update
flash[:notice] = t(:notice_successful_update)
end
- redirect_to action: "edit"
+ redirect_to action: 'edit'
end
private
@@ -29,6 +29,6 @@ def show_local_breadcrumb
end
def announcement_params
- params.require(:announcement).permit("text", "show_until", "active")
+ params.require(:announcement).permit('text', 'show_until', 'active')
end
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 4375d2aa21dc..564973057f70 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -26,10 +26,10 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "uri"
-require "cgi"
+require 'uri'
+require 'cgi'
-require "doorkeeper/dashboard_helper"
+require 'doorkeeper/dashboard_helper'
class ApplicationController < ActionController::Base
class_attribute :_model_object
@@ -51,7 +51,7 @@ class ApplicationController < ActionController::Base
include AdditionalUrlHelpers
include OpenProjectErrorHelper
- layout "base"
+ layout 'base'
protect_from_forgery
# CSRF protection prevents two things. It prevents an attacker from using a
@@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base
# Thus, we show an error message unless the request probably is an API
# request.
def handle_unverified_request
- cookies.delete(OpenProject::Configuration["autologin_cookie_name"])
+ cookies.delete(OpenProject::Configuration['autologin_cookie_name'])
self.logged_user = nil
# Don't render an error message for requests that appear to be API requests.
@@ -105,7 +105,7 @@ def handle_unverified_request
# Check whether user have cookies enabled, otherwise they'll only be
# greeted with the CSRF error upon login.
message = I18n.t(:error_token_authenticity)
- message << (" " + I18n.t(:error_cookie_missing)) if openproject_cookie_missing?
+ message << (' ' + I18n.t(:error_cookie_missing)) if openproject_cookie_missing?
log_csrf_failure
@@ -148,7 +148,7 @@ def handle_unverified_request
def default_url_options(_options = {})
{
- layout: params["layout"],
+ layout: params['layout'],
protocol: Setting.protocol
}
end
@@ -159,7 +159,7 @@ def default_url_options(_options = {})
# https://websecuritytool.codeplex.com/wikipage?title=Checks#http-cache-control-header-no-store
# http://stackoverflow.com/questions/711418/how-to-prevent-browser-page-caching-in-rails
def set_cache_buster
- if OpenProject::Configuration["disable_browser_cache"]
+ if OpenProject::Configuration['disable_browser_cache']
response.cache_control.merge!(
max_age: 0,
public: false,
@@ -179,7 +179,7 @@ def reload_mailer_settings!
# Checks if the session cookie is missing.
# This is useful only on a second request
def openproject_cookie_missing?
- request.cookies[OpenProject::Configuration["session_cookie_name"]].nil?
+ request.cookies[OpenProject::Configuration['session_cookie_name']].nil?
end
helper_method :openproject_cookie_missing?
@@ -187,8 +187,8 @@ def openproject_cookie_missing?
##
# Create CSRF issue
def log_csrf_failure
- message = "CSRF validation error"
- message << " (No session cookie present)" if openproject_cookie_missing?
+ message = 'CSRF validation error'
+ message << ' (No session cookie present)' if openproject_cookie_missing?
op_handle_error message, reference: :csrf_validation_failed
end
@@ -208,7 +208,7 @@ def log_requesting_user
# replaces all invalid characters with #
def escape_for_logging(string)
# only allow numbers, ASCII letters, space and the following characters: @.-"'!?=/
- string.gsub(/[^0-9a-zA-Z@._\-"'!?=\/ ]{1}/, "#")
+ string.gsub(/[^0-9a-zA-Z@._\-"'!?=\/ ]{1}/, '#')
end
def reset_i18n_fallbacks
@@ -228,7 +228,7 @@ def set_localization
user = RequestStore[:current_user] ||
(session[:authenticated_user_id].present? && User.find_by(id: session[:authenticated_user_id])) ||
User.anonymous
- SetLocalizationService.new(user, request.env["HTTP_ACCEPT_LANGUAGE"]).call
+ SetLocalizationService.new(user, request.env['HTTP_ACCEPT_LANGUAGE']).call
end
def deny_access(not_found: false)
@@ -413,7 +413,7 @@ def find_object_and_scope
associated = find_belongs_to_chained_objects(associations, model_object)
associated.each do |a|
- instance_variable_set("@" + a.class.to_s.downcase, a)
+ instance_variable_set('@' + a.class.to_s.downcase, a)
end
rescue ActiveRecord::RecordNotFound
render_404
@@ -452,7 +452,7 @@ def self.model_object(model, options = {})
def find_work_packages
@work_packages = WorkPackage.includes(:project)
.where(id: params[:work_package_id] || params[:ids])
- .order("id ASC")
+ .order('id ASC')
fail ActiveRecord::RecordNotFound if @work_packages.empty?
@projects = @work_packages.filter_map(&:project).uniq
@@ -479,7 +479,7 @@ def check_project_privacy
end
def back_url
- params[:back_url] || request.env["HTTP_REFERER"]
+ params[:back_url] || request.env['HTTP_REFERER']
end
def redirect_back_or_default(default, use_escaped = true)
@@ -497,7 +497,7 @@ def redirect_back_or_default(default, use_escaped = true)
#
# @return [boolean, string] name of the layout to use or false for no layout
def use_layout
- request.xhr? ? false : "no_menu"
+ request.xhr? ? false : 'no_menu'
end
def render_feed(items, options = {})
@@ -505,7 +505,7 @@ def render_feed(items, options = {})
@items = @items.sort { |x, y| y.event_datetime <=> x.event_datetime }
@items = @items.slice(0, Setting.feeds_limit.to_i)
@title = options[:title] || Setting.app_title
- render template: "common/feed", layout: false, content_type: "application/atom+xml"
+ render template: 'common/feed', layout: false, content_type: 'application/atom+xml'
end
def self.accept_key_auth(*actions)
@@ -519,7 +519,7 @@ def accept_key_auth_actions
# Returns a string that can be used as filename value in Content-Disposition header
def filename_for_content_disposition(name)
- %r{(MSIE|Trident)}.match?(request.env["HTTP_USER_AGENT"]) ? ERB::Util.url_encode(name) : name
+ %r{(MSIE|Trident)}.match?(request.env['HTTP_USER_AGENT']) ? ERB::Util.url_encode(name) : name
end
def api_request?
@@ -534,8 +534,8 @@ def api_request?
def api_key_from_request
if params[:key].present?
params[:key]
- elsif request.headers["X-OpenProject-API-Key"].present?
- request.headers["X-OpenProject-API-Key"]
+ elsif request.headers['X-OpenProject-API-Key'].present?
+ request.headers['X-OpenProject-API-Key']
end
end
@@ -550,10 +550,10 @@ def object_errors_to_json(object)
def render_validation_errors(object)
options = { status: :unprocessable_entity, layout: false }
errors = case params[:format]
- when "xml"
+ when 'xml'
{ xml: object.errors }
- when "json"
- { json: { "errors" => object.errors } } # ActiveResource client compliance
+ when 'json'
+ { json: { 'errors' => object.errors } } # ActiveResource client compliance
else
fail "Unknown format #{params[:format]} in #render_validation_errors"
end
@@ -566,7 +566,7 @@ def render_validation_errors(object)
def default_template(action_name = self.action_name)
if api_request?
begin
- return view_paths.find_template(default_template_name(action_name), "api")
+ return view_paths.find_template(default_template_name(action_name), 'api')
rescue ::ActionView::MissingTemplate
# the api template was not found
# fallback to the default behaviour
@@ -584,7 +584,7 @@ def pick_layout(*args)
def default_breadcrumb
label = "label_#{controller_name.singularize}"
- I18n.t(label + "_plural",
+ I18n.t(label + '_plural',
default: label.to_sym)
end
@@ -607,8 +607,8 @@ def check_session_lifetime
if session_expired?
self.logged_user = nil
- flash[:warning] = I18n.t("notice_forced_logout", ttl_time: Setting.session_ttl)
- redirect_to(controller: "/account", action: "login", back_url: login_back_url)
+ flash[:warning] = I18n.t('notice_forced_logout', ttl_time: Setting.session_ttl)
+ redirect_to(controller: '/account', action: 'login', back_url: login_back_url)
end
session[:updated_at] = Time.now
end
@@ -623,7 +623,7 @@ def feed_request?
def stop_if_feeds_disabled
if feed_request? && !Setting.feeds_enabled?
- render_404(message: I18n.t("label_disabled"))
+ render_404(message: I18n.t('label_disabled'))
end
end
@@ -649,7 +649,7 @@ def login_back_url
else
url_params = params.permit(:action, :id, :project_id, :controller)
- unless url_params[:controller].to_s.starts_with?("/")
+ unless url_params[:controller].to_s.starts_with?('/')
url_params[:controller] = "/#{url_params[:controller]}"
end
diff --git a/app/controllers/attribute_help_texts_controller.rb b/app/controllers/attribute_help_texts_controller.rb
index 50e759264db9..f9a5b2bbdf0b 100644
--- a/app/controllers/attribute_help_texts_controller.rb
+++ b/app/controllers/attribute_help_texts_controller.rb
@@ -27,7 +27,7 @@
#++
class AttributeHelpTextsController < ApplicationController
- layout "admin"
+ layout 'admin'
menu_item :attribute_help_texts
before_action :authorize_global
@@ -56,8 +56,8 @@ def create
redirect_to attribute_help_texts_path(tab: call.result.attribute_scope)
else
@attribute_help_text = call.result
- flash[:error] = call.message || I18n.t("notice_internal_server_error")
- render action: "new"
+ flash[:error] = call.message || I18n.t('notice_internal_server_error')
+ render action: 'new'
end
end
@@ -70,8 +70,8 @@ def update
flash[:notice] = t(:notice_successful_update)
redirect_to attribute_help_texts_path(tab: @attribute_help_text.attribute_scope)
else
- flash[:error] = call.message || I18n.t("notice_internal_server_error")
- render action: "edit"
+ flash[:error] = call.message || I18n.t('notice_internal_server_error')
+ render action: 'edit'
end
end
@@ -88,10 +88,10 @@ def destroy
protected
def default_breadcrumb
- if action_name == "index"
- t("attribute_help_texts.label_plural")
+ if action_name == 'index'
+ t('attribute_help_texts.label_plural')
else
- ActionController::Base.helpers.link_to(t("attribute_help_texts.label_plural"), attribute_help_texts_path)
+ ActionController::Base.helpers.link_to(t('attribute_help_texts.label_plural'), attribute_help_texts_path)
end
end
@@ -122,7 +122,7 @@ def find_entry
end
def find_type_scope
- name = params.fetch(:name, "WorkPackage")
+ name = params.fetch(:name, 'WorkPackage')
submodule = AttributeHelpText.available_types.find { |mod| mod == name }
if submodule.nil?
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index 242abdc4b65a..1c9755f07c5a 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -70,7 +70,7 @@ def update
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to project_settings_categories_path(@project)
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -82,7 +82,7 @@ def destroy
redirect_to project_settings_categories_path(@project)
return
elsif params[:todo]
- reassign_to = @project.categories.find_by(id: params[:reassign_to_id]) if params[:todo] == "reassign"
+ reassign_to = @project.categories.find_by(id: params[:reassign_to_id]) if params[:todo] == 'reassign'
@category.destroy(reassign_to)
redirect_to project_settings_categories_path(@project)
return
diff --git a/app/controllers/colors_controller.rb b/app/controllers/colors_controller.rb
index 018c6cbfaac1..5e671dc1ee5e 100644
--- a/app/controllers/colors_controller.rb
+++ b/app/controllers/colors_controller.rb
@@ -29,7 +29,7 @@
class ColorsController < ApplicationController
before_action :require_admin_unless_readonly_api_request
- layout "admin"
+ layout 'admin'
menu_item :colors
@@ -68,7 +68,7 @@ def create
redirect_to colors_path
else
flash.now[:error] = I18n.t(:error_color_could_not_be_saved)
- render action: "new"
+ render action: 'new'
end
end
@@ -80,7 +80,7 @@ def update
redirect_to colors_path
else
flash.now[:error] = I18n.t(:error_color_could_not_be_saved)
- render action: "edit"
+ render action: 'edit'
end
end
@@ -102,7 +102,7 @@ def destroy
protected
def default_breadcrumb
- if action_name == "index"
+ if action_name == 'index'
t(:label_color_plural)
else
ActionController::Base.helpers.link_to(t(:label_color_plural), colors_path)
diff --git a/app/controllers/concerns/accounts/authentication_stages.rb b/app/controllers/concerns/accounts/authentication_stages.rb
index 1d2dbb19b743..c2524f58e16d 100644
--- a/app/controllers/concerns/accounts/authentication_stages.rb
+++ b/app/controllers/concerns/accounts/authentication_stages.rb
@@ -65,7 +65,7 @@ def stage_success
else
flash[:error] = I18n.t(
:notice_auth_stage_wrong_stage,
- expected: stage || "(none)",
+ expected: stage || '(none)',
actual: params[:stage]
)
@@ -119,7 +119,7 @@ def init_authentication_stages(after_activation:)
session[:back_url] ||= params[:back_url]
# Remember the autologin cookie decision
- session[:autologin_requested] = params[:autologin] == "1"
+ session[:autologin_requested] = params[:autologin] == '1'
stages
end
diff --git a/app/controllers/concerns/accounts/omniauth_login.rb b/app/controllers/concerns/accounts/omniauth_login.rb
index efb866c89664..3e882cc5d017 100644
--- a/app/controllers/concerns/accounts/omniauth_login.rb
+++ b/app/controllers/concerns/accounts/omniauth_login.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "uri"
+require 'uri'
##
# Intended to be used by the AccountController to handle omniauth logins
@@ -47,10 +47,10 @@ module Accounts::OmniauthLogin
end
def omniauth_login
- params[:back_url] = request.env["omniauth.origin"] if remember_back_url?
+ params[:back_url] = request.env['omniauth.origin'] if remember_back_url?
# Extract auth info and perform check / login or activate user
- auth_hash = request.env["omniauth.auth"]
+ auth_hash = request.env['omniauth.auth']
handle_omniauth_authentication(auth_hash)
end
@@ -75,7 +75,7 @@ def redirect_omniauth_register_modal(user, auth_hash)
# Avoid remembering the back_url if we're coming from the login page
def remember_back_url?
- provided_back_url = request.env["omniauth.origin"]
+ provided_back_url = request.env['omniauth.origin']
return if provided_back_url.blank?
account_routes = /\/(login|account)/
@@ -84,7 +84,7 @@ def remember_back_url?
def show_error(error)
flash[:error] = error
- redirect_to action: "login"
+ redirect_to action: 'login'
end
def register_via_omniauth(session, user_attributes)
@@ -93,7 +93,7 @@ def register_via_omniauth(session, user_attributes)
def handle_omniauth_authentication(auth_hash, user_params: nil)
call = ::Authentication::OmniauthService
- .new(strategy: request.env["omniauth.strategy"], auth_hash:, controller: self)
+ .new(strategy: request.env['omniauth.strategy'], auth_hash:, controller: self)
.call(user_params)
if call.success?
diff --git a/app/controllers/concerns/accounts/user_consent.rb b/app/controllers/concerns/accounts/user_consent.rb
index e3beee7a7de0..a2603dfae3ef 100644
--- a/app/controllers/concerns/accounts/user_consent.rb
+++ b/app/controllers/concerns/accounts/user_consent.rb
@@ -34,7 +34,7 @@ module Accounts::UserConsent
def consent
if user_consent_required? && consenting_user&.consent_expired?
- render "account/consent"
+ render 'account/consent'
else
consent_finished
end
@@ -51,12 +51,12 @@ def confirm_consent
end
def decline_consent
- message = I18n.t("consent.decline_warning_message") + "\n"
+ message = I18n.t('consent.decline_warning_message') + "\n"
message <<
if Setting.consent_decline_mail.present?
- I18n.t("consent.contact_this_mail_address", mail_address: Setting.consent_decline_mail)
+ I18n.t('consent.contact_this_mail_address', mail_address: Setting.consent_decline_mail)
else
- I18n.t("consent.contact_your_administrator")
+ I18n.t('consent.contact_your_administrator')
end
flash[:error] = message
@@ -77,7 +77,7 @@ def consent_finished
end
def reject_consent!
- flash[:error] = I18n.t("consent.failure_message")
+ flash[:error] = I18n.t('consent.failure_message')
redirect_to authentication_stage_failure_path :consent
end
end
diff --git a/app/controllers/concerns/accounts/user_password_change.rb b/app/controllers/concerns/accounts/user_password_change.rb
index 1ce7f02cbd4e..00ccee1b98bf 100644
--- a/app/controllers/concerns/accounts/user_password_change.rb
+++ b/app/controllers/concerns/accounts/user_password_change.rb
@@ -70,7 +70,7 @@ def flash_and_log_invalid_credentials(flash_now: true, is_logged_in: false)
return
end
- flash_error_message(log_reason: "invalid credentials", flash_now:) do
+ flash_error_message(log_reason: 'invalid credentials', flash_now:) do
if Setting.brute_force_block_after_failed_logins.to_i > 0
:notice_account_invalid_credentials_or_blocked
else
@@ -83,7 +83,7 @@ def render_password_change(user, message, show_user_name: false)
flash[:error] = message unless message.nil?
@user = user
@username = user.login
- render "my/password", locals: { show_user_name: }
+ render 'my/password', locals: { show_user_name: }
end
##
@@ -91,15 +91,15 @@ def render_password_change(user, message, show_user_name: false)
def redirect_if_password_change_not_allowed(user)
if user and not user.change_password_allowed?
logger.warn "Password change for user '#{user}' forced, but user is not allowed " +
- "to change password"
+ 'to change password'
flash[:error] = I18n.t(:notice_can_t_change_password)
- redirect_to action: "login"
+ redirect_to action: 'login'
return true
end
false
end
- def flash_error_message(log_reason: "", flash_now: true)
+ def flash_error_message(log_reason: '', flash_now: true)
flash_hash = flash_now ? flash.now : flash
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} " \
diff --git a/app/controllers/concerns/auth_source_sso.rb b/app/controllers/concerns/auth_source_sso.rb
index 3147ffa84455..dbfaef94258e 100644
--- a/app/controllers/concerns/auth_source_sso.rb
+++ b/app/controllers/concerns/auth_source_sso.rb
@@ -103,7 +103,7 @@ def get_validated_login!(value)
def extract_from_header(value)
if header_secret.present?
valid_secret = value.end_with?(":#{header_secret}")
- login = value.gsub(/:#{Regexp.escape(header_secret)}\z/, "")
+ login = value.gsub(/:#{Regexp.escape(header_secret)}\z/, '')
[login, valid_secret]
else
diff --git a/app/controllers/concerns/layout.rb b/app/controllers/concerns/layout.rb
index 47b8057307ca..c1efaadd2374 100644
--- a/app/controllers/concerns/layout.rb
+++ b/app/controllers/concerns/layout.rb
@@ -36,7 +36,7 @@ def layout_non_or_no_menu
elsif @project
true
else
- "no_menu"
+ 'no_menu'
end
end
diff --git a/app/controllers/concerns/member_helper.rb b/app/controllers/concerns/member_helper.rb
index 701b5b237721..93f15002b4e7 100644
--- a/app/controllers/concerns/member_helper.rb
+++ b/app/controllers/concerns/member_helper.rb
@@ -88,7 +88,7 @@ def transform_array_of_comma_separated_ids(array)
return array if array.blank?
each_comma_separated(array) do |elem|
- elem.to_s.split(",")
+ elem.to_s.split(',')
end
end
diff --git a/app/controllers/concerns/user_invitation.rb b/app/controllers/concerns/user_invitation.rb
index 9d33dfaacdf6..f95192f48ff5 100644
--- a/app/controllers/concerns/user_invitation.rb
+++ b/app/controllers/concerns/user_invitation.rb
@@ -30,11 +30,11 @@ module UserInvitation
module Events
class << self
def user_invited
- "user_invited"
+ 'user_invited'
end
def user_reinvited
- "user_reinvited"
+ 'user_reinvited'
end
end
end
diff --git a/app/controllers/custom_actions_controller.rb b/app/controllers/custom_actions_controller.rb
index a676ef0410f9..50a017ce0247 100644
--- a/app/controllers/custom_actions_controller.rb
+++ b/app/controllers/custom_actions_controller.rb
@@ -35,7 +35,7 @@ class CustomActionsController < ApplicationController
before_action :find_model_object, only: %i(edit update destroy)
before_action :pad_params, only: %i(create update)
- layout "admin"
+ layout 'admin'
def index
@custom_actions = CustomAction.order_by_position
@@ -86,12 +86,12 @@ def require_enterprise_token
return if EnterpriseToken.allows_to?(:custom_actions)
if request.get?
- render template: "common/upsale",
+ render template: 'common/upsale',
locals: {
- feature_title: I18n.t("custom_actions.upsale.title"),
- feature_description: I18n.t("custom_actions.upsale.description"),
- feature_reference: "custom_actions_admin",
- feature_video: "enterprise/custom-actions.mp4"
+ feature_title: I18n.t('custom_actions.upsale.title'),
+ feature_description: I18n.t('custom_actions.upsale.description'),
+ feature_reference: 'custom_actions_admin',
+ feature_video: 'enterprise/custom-actions.mp4'
}
else
render_403
@@ -110,10 +110,10 @@ def pad_params
end
def default_breadcrumb
- if action_name == "index"
- t("custom_actions.plural")
+ if action_name == 'index'
+ t('custom_actions.plural')
else
- ActionController::Base.helpers.link_to(t("custom_actions.plural"), custom_actions_path)
+ ActionController::Base.helpers.link_to(t('custom_actions.plural'), custom_actions_path)
end
end
diff --git a/app/controllers/custom_styles_controller.rb b/app/controllers/custom_styles_controller.rb
index 692a06ec23f1..3eacc1d00a7d 100644
--- a/app/controllers/custom_styles_controller.rb
+++ b/app/controllers/custom_styles_controller.rb
@@ -27,7 +27,7 @@
#++
class CustomStylesController < ApplicationController
- layout "admin"
+ layout 'admin'
menu_item :custom_style
before_action :require_admin,
@@ -154,7 +154,7 @@ def show_local_breadcrumb
def options_for_theme_select
options = OpenProject::CustomStyles::ColorThemes.themes.pluck(:theme)
unless @current_theme.present?
- options << [t("admin.custom_styles.color_theme_custom"), "",
+ options << [t('admin.custom_styles.color_theme_custom'), '',
{ selected: true, disabled: true }]
end
@@ -197,6 +197,7 @@ def file_delete(remove_method)
end
@custom_style.send(remove_method)
+ @custom_style.save
redirect_to custom_style_path
end
end
diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb
index 836b5896ba49..ef36a889c0c6 100644
--- a/app/controllers/enterprises_controller.rb
+++ b/app/controllers/enterprises_controller.rb
@@ -28,7 +28,7 @@
class EnterprisesController < ApplicationController
include EnterpriseTrialHelper
- layout "admin"
+ layout 'admin'
menu_item :enterprise
before_action :chargebee_content_security_policy
diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb
index 8cc2a55280e0..6dee9f4253fe 100644
--- a/app/controllers/enumerations_controller.rb
+++ b/app/controllers/enumerations_controller.rb
@@ -27,7 +27,7 @@
#++
class EnumerationsController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin
before_action :find_enumeration, only: %i[edit update move destroy]
@@ -56,9 +56,9 @@ def create
if @enumeration.save
flash[:notice] = I18n.t(:notice_successful_create)
- redirect_to action: "index", type: @enumeration.type
+ redirect_to action: 'index', type: @enumeration.type
else
- render action: "new"
+ render action: 'new'
end
end
@@ -70,7 +70,7 @@ def update
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to enumerations_path(type: @enumeration.type)
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -78,12 +78,12 @@ def destroy
if !@enumeration.in_use?
# No associated objects
@enumeration.destroy
- redirect_to action: "index"
+ redirect_to action: 'index'
return
elsif params[:reassign_to_id]
if reassign_to = @enumeration.class.find_by(id: params[:reassign_to_id])
@enumeration.destroy(reassign_to)
- redirect_to action: "index"
+ redirect_to action: 'index'
return
end
end
@@ -96,14 +96,14 @@ def move
redirect_to enumerations_path
else
flash.now[:error] = I18n.t(:error_type_could_not_be_saved)
- render action: "edit"
+ render action: 'edit'
end
end
protected
def default_breadcrumb
- if action_name == "index"
+ if action_name == 'index'
t(:label_enumerations)
else
ActionController::Base.helpers.link_to(t(:label_enumerations), enumerations_path)
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb
index aa7d59807d0e..d67db8c46e18 100644
--- a/app/controllers/errors_controller.rb
+++ b/app/controllers/errors_controller.rb
@@ -26,6 +26,6 @@ def error_options
end
def use_layout
- "only_logo"
+ 'only_logo'
end
end
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index f28372d7d7fb..b7795a503b42 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -47,26 +47,26 @@ def index
end
def show
- sort_init "updated_at", "desc"
- sort_update "created_at" => "#{Message.table_name}.created_at",
- "replies" => "#{Message.table_name}.replies_count",
- "updated_at" => "#{Message.table_name}.updated_at"
+ sort_init 'updated_at', 'desc'
+ sort_update 'created_at' => "#{Message.table_name}.created_at",
+ 'replies' => "#{Message.table_name}.replies_count",
+ 'updated_at' => "#{Message.table_name}.updated_at"
respond_to do |format|
format.html do
set_topics
@message = Message.new
- render action: "show", layout: !request.xhr?
+ render action: 'show', layout: !request.xhr?
end
format.json do
set_topics
- render template: "messages/index"
+ render template: 'messages/index'
end
format.atom do
@messages = @forum
.messages
- .order(["#{Message.table_name}.sticked_on ASC", sort_clause].compact.join(", "))
+ .order(["#{Message.table_name}.sticked_on ASC", sort_clause].compact.join(', '))
.includes(:author, :forum)
.limit(Setting.feeds_limit.to_i)
@@ -78,7 +78,7 @@ def show
def set_topics
@topics = @forum
.topics
- .order(["#{Message.table_name}.sticked_on ASC", sort_clause].compact.join(", "))
+ .order(["#{Message.table_name}.sticked_on ASC", sort_clause].compact.join(', '))
.includes(:author, last_reply: :author)
.page(page_param)
.per_page(per_page_param)
@@ -91,7 +91,7 @@ def edit; end
def create
if @forum.save
flash[:notice] = I18n.t(:notice_successful_create)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
render :new
end
@@ -100,7 +100,7 @@ def create
def update
if @forum.update(permitted_params.forum)
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
render :edit
end
@@ -110,16 +110,16 @@ def move
if @forum.update(permitted_params.forum_move)
flash[:notice] = t(:notice_successful_update)
else
- flash.now[:error] = t("forum_could_not_be_saved")
- render action: "edit"
+ flash.now[:error] = t('forum_could_not_be_saved')
+ render action: 'edit'
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
def destroy
@forum.destroy
flash[:notice] = I18n.t(:notice_successful_delete)
- redirect_to action: "index"
+ redirect_to action: 'index'
end
private
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index c305bb1c7f78..ddd33e3cade7 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -28,19 +28,19 @@
class GroupsController < ApplicationController
include GroupsHelper
- layout "admin"
+ layout 'admin'
before_action :require_admin, except: %i[show]
before_action :find_group, only: %i[destroy update show create_memberships destroy_membership
edit_membership add_users]
def index
- @groups = Group.order(Arel.sql("lastname ASC"))
+ @groups = Group.order(Arel.sql('lastname ASC'))
end
def show
@group_users = group_members
- render layout: "no_menu"
+ render layout: 'no_menu'
end
def new
@@ -75,7 +75,7 @@ def update
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to(groups_path)
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -135,7 +135,7 @@ def destroy_membership
.call
flash[:notice] = I18n.t :notice_successful_delete
- redirect_to controller: "/groups", action: "edit", id: @group, tab: redirected_to_tab(member)
+ redirect_to controller: '/groups', action: 'edit', id: @group, tab: redirected_to_tab(member)
end
protected
@@ -158,10 +158,10 @@ def visible_group_members?
end
def default_breadcrumb
- if action_name == "index" || !current_user.admin?
- t("label_group_plural")
+ if action_name == 'index' || !current_user.admin?
+ t('label_group_plural')
else
- ActionController::Base.helpers.link_to(t("label_group_plural"), groups_path)
+ ActionController::Base.helpers.link_to(t('label_group_plural'), groups_path)
end
end
@@ -176,14 +176,14 @@ def respond_membership_altered(service_call)
flash[:error] = service_call.errors.full_messages.join("\n")
end
- redirect_to controller: "/groups", action: "edit", id: @group, tab: redirected_to_tab(service_call.result)
+ redirect_to controller: '/groups', action: 'edit', id: @group, tab: redirected_to_tab(service_call.result)
end
def redirected_to_tab(membership)
if membership.project
- "memberships"
+ 'memberships'
else
- "global_roles"
+ 'global_roles'
end
end
@@ -194,6 +194,6 @@ def respond_users_altered(service_call)
service_call.apply_flash_message!(flash)
end
- redirect_to controller: "/groups", action: "edit", id: @group, tab: "users"
+ redirect_to controller: '/groups', action: 'edit', id: @group, tab: 'users'
end
end
diff --git a/app/controllers/highlighting_controller.rb b/app/controllers/highlighting_controller.rb
index 6cd953a7f8f6..4a19f32904e1 100644
--- a/app/controllers/highlighting_controller.rb
+++ b/app/controllers/highlighting_controller.rb
@@ -36,8 +36,8 @@ def styles
expires_in 1.year, public: true, must_revalidate: false
if stale?(last_modified: Time.zone.parse(@max_updated_at), etag: @highlight_version_tag, public: true)
- OpenProject::Cache.fetch("highlighting/styles", @highlight_version_tag) do
- render template: "highlighting/styles", formats: [:css]
+ OpenProject::Cache.fetch('highlighting/styles', @highlight_version_tag) do
+ render template: 'highlighting/styles', formats: [:css]
end
end
end
diff --git a/app/controllers/homescreen_controller.rb b/app/controllers/homescreen_controller.rb
index c4a3b1c53e57..686c1434e39f 100644
--- a/app/controllers/homescreen_controller.rb
+++ b/app/controllers/homescreen_controller.rb
@@ -29,7 +29,7 @@
class HomescreenController < ApplicationController
skip_before_action :check_if_login_required, only: [:robots]
- layout "global"
+ layout 'global'
def index
@newest_projects = Project.visible.newest.take(3)
@@ -46,7 +46,7 @@ def index
def robots
if Setting.login_required?
- render template: "homescreen/robots-login-required", format: :text
+ render template: 'homescreen/robots-login-required', format: :text
else
@projects = Project.active.public_projects
end
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index 391c70863e12..c1725f4bdbc2 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -40,7 +40,7 @@ class JournalsController < ApplicationController
def index
@query = retrieve_query(@project)
- sort_init "id", "desc"
+ sort_init 'id', 'desc'
sort_update(@query.sortable_key_by_column_name)
if @query.valid?
@@ -51,7 +51,7 @@ def index
respond_to do |format|
format.atom do
render layout: false,
- content_type: "application/atom+xml",
+ content_type: 'application/atom+xml',
locals: { title: journals_index_title,
journals: @journals }
end
@@ -67,13 +67,13 @@ def diff
return render_400 message: I18n.t(:error_journal_attribute_not_present, attribute: field_param)
end
- @activity_page = params["activity_page"]
+ @activity_page = params['activity_page']
@diff = Redmine::Helpers::Diff.new(to, from)
respond_to do |format|
format.html
format.js do
- render partial: "diff", locals: { diff: @diff }
+ render partial: 'diff', locals: { diff: @diff }
end
end
end
@@ -90,8 +90,8 @@ def find_journal
def ensure_permitted
permission = case @journal.journable_type
- when "WorkPackage" then :view_work_packages
- when "Project" then :view_project
+ when 'WorkPackage' then :view_work_packages
+ when 'Project' then :view_project
end
do_authorize(permission)
diff --git a/app/controllers/ldap_auth_sources_controller.rb b/app/controllers/ldap_auth_sources_controller.rb
index 172a358af681..286329269deb 100644
--- a/app/controllers/ldap_auth_sources_controller.rb
+++ b/app/controllers/ldap_auth_sources_controller.rb
@@ -29,7 +29,7 @@
class LdapAuthSourcesController < ApplicationController
menu_item :ldap_authentication
include PaginationHelper
- layout "admin"
+ layout 'admin'
before_action :require_admin
before_action :block_if_password_login_disabled
@@ -55,9 +55,9 @@ def create
@ldap_auth_source = LdapAuthSource.new permitted_params.ldap_auth_source
if @ldap_auth_source.save
flash[:notice] = I18n.t(:notice_successful_create)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
- render "new"
+ render 'new'
end
end
@@ -68,9 +68,9 @@ def update
if @ldap_auth_source.update updated
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
- render "edit"
+ render 'edit'
end
end
@@ -82,7 +82,7 @@ def test_connection
rescue StandardError => e
flash[:error] = I18n.t(:error_unable_to_connect, value: e.message)
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
def destroy
@@ -94,7 +94,7 @@ def destroy
else
flash[:warning] = t(:notice_wont_delete_auth_source)
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
protected
@@ -107,7 +107,7 @@ def prevent_editing_when_seeded
end
def default_breadcrumb
- if action_name == "index"
+ if action_name == 'index'
t(:label_ldap_auth_source_plural)
else
ActionController::Base.helpers.link_to(t(:label_ldap_auth_source_plural), ldap_auth_sources_path)
diff --git a/app/controllers/members/menus_controller.rb b/app/controllers/members/menus_controller.rb
index ab205fc3aff0..6d0aeca4cc65 100644
--- a/app/controllers/members/menus_controller.rb
+++ b/app/controllers/members/menus_controller.rb
@@ -45,13 +45,13 @@ def first_level_menu_items
def user_status_options
[
- OpenProject::Menu::MenuItem.new(title: I18n.t("members.menu.all"),
+ OpenProject::Menu::MenuItem.new(title: I18n.t('members.menu.all'),
href: project_members_path,
selected: active_filter_count == 0),
- OpenProject::Menu::MenuItem.new(title: I18n.t("members.menu.locked"),
+ OpenProject::Menu::MenuItem.new(title: I18n.t('members.menu.locked'),
href: project_members_path(status: :locked),
selected: selected?(:status, :locked)),
- OpenProject::Menu::MenuItem.new(title: I18n.t("members.menu.invited"),
+ OpenProject::Menu::MenuItem.new(title: I18n.t('members.menu.invited'),
href: project_members_path(status: :invited),
selected: selected?(:status, :invited))
]
@@ -59,9 +59,9 @@ def user_status_options
def nested_menu_items
[
- OpenProject::Menu::MenuGroup.new(header: I18n.t("members.menu.project_roles"), children: project_roles_entries),
- OpenProject::Menu::MenuGroup.new(header: I18n.t("members.menu.wp_shares"), children: permission_menu_entries),
- OpenProject::Menu::MenuGroup.new(header: I18n.t("members.menu.groups"), children: project_group_entries)
+ OpenProject::Menu::MenuGroup.new(header: I18n.t('members.menu.project_roles'), children: project_roles_entries),
+ OpenProject::Menu::MenuGroup.new(header: I18n.t('members.menu.wp_shares'), children: permission_menu_entries),
+ OpenProject::Menu::MenuGroup.new(header: I18n.t('members.menu.groups'), children: project_group_entries)
]
end
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index efe9fcb66f33..24937ec88998 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -57,7 +57,7 @@ def show
.per_page(per_page_param)
@reply = Message.new(subject: "RE: #{@message.subject}", parent: @topic, forum: @topic.forum)
- render action: "show", layout: !request.xhr?
+ render action: 'show', layout: !request.xhr?
end
# new topic
@@ -87,7 +87,7 @@ def create
redirect_to topic_path(@message)
else
- render action: "new"
+ render action: 'new'
end
end
@@ -116,7 +116,7 @@ def update
@message.reload
redirect_to topic_path(@message.root, r: @message.parent_id && @message.id)
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -128,9 +128,9 @@ def destroy
@message.destroy
flash[:notice] = t(:notice_successful_delete)
redirect_target = if @message.parent.nil?
- { controller: "/forums", action: "show", project_id: @project, id: @forum }
+ { controller: '/forums', action: 'show', project_id: @project, id: @forum }
else
- { action: "show", id: @message.parent, r: @message }
+ { action: 'show', id: @message.parent, r: @message }
end
redirect_to redirect_target
@@ -140,10 +140,10 @@ def quote
user = @message.author
text = @message.content
subject = @message.subject
- subject = "RE: #{subject}" unless subject.starts_with?("RE:")
+ subject = "RE: #{subject}" unless subject.starts_with?('RE:')
user_wrote = I18n.t(:text_user_wrote, value: ERB::Util.html_escape(user), locale: Setting.default_language)
content = "#{user_wrote}\n> "
- content << (text.to_s.strip.gsub(%r{
(.+?) }m, "[...]").gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n")
+ content << (text.to_s.strip.gsub(%r{(.+?) }m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n")
respond_to do |format|
format.json { render json: { subject:, content: } }
diff --git a/app/controllers/my/auto_login_tokens_controller.rb b/app/controllers/my/auto_login_tokens_controller.rb
index 21de9f6f2214..058012090196 100644
--- a/app/controllers/my/auto_login_tokens_controller.rb
+++ b/app/controllers/my/auto_login_tokens_controller.rb
@@ -2,7 +2,7 @@ module My
class AutoLoginTokensController < ::ApplicationController
before_action :find_token, only: %i(destroy)
- layout "my"
+ layout 'my'
menu_item :sessions
def destroy
diff --git a/app/controllers/my/sessions_controller.rb b/app/controllers/my/sessions_controller.rb
index b243be219a6d..7d244f9549bf 100644
--- a/app/controllers/my/sessions_controller.rb
+++ b/app/controllers/my/sessions_controller.rb
@@ -6,7 +6,7 @@ class SessionsController < ::ApplicationController
before_action :find_model_object, only: %i(show destroy)
before_action :prevent_current_session_deletion, only: %i(destroy)
- layout "my"
+ layout 'my'
menu_item :sessions
def index
@@ -18,7 +18,7 @@ def index
.for_user(current_user)
.order(expires_on: :asc)
- token = cookies[OpenProject::Configuration["autologin_cookie_name"]]
+ token = cookies[OpenProject::Configuration['autologin_cookie_name']]
if token
@current_token = @autologin_tokens.find_by_plaintext_value(token) # rubocop:disable Rails/DynamicFindBy
end
@@ -37,7 +37,7 @@ def destroy
def prevent_current_session_deletion
if @session.current?(session)
- render_400 message: I18n.t("users.sessions.may_not_delete_current")
+ render_400 message: I18n.t('users.sessions.may_not_delete_current')
end
end
end
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index 92d31cf6c088..56f9b39854ce 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -77,9 +77,9 @@ def create
@news.attributes = permitted_params.news
if @news.save
flash[:notice] = I18n.t(:notice_successful_create)
- redirect_to controller: "/news", action: "index", project_id: @project
+ redirect_to controller: '/news', action: 'index', project_id: @project
else
- render action: "new"
+ render action: 'new'
end
end
@@ -87,16 +87,16 @@ def update
@news.attributes = permitted_params.news
if @news.save
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "show", id: @news
+ redirect_to action: 'show', id: @news
else
- render action: "edit"
+ render action: 'edit'
end
end
def destroy
@news.destroy
flash[:notice] = I18n.t(:notice_successful_delete)
- redirect_to action: "index", project_id: @project
+ redirect_to action: 'index', project_id: @project
end
private
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index d77870eb8019..11610214d967 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -32,7 +32,7 @@ class ApplicationsController < ::ApplicationController
before_action :new_app, only: %i[new create]
before_action :find_app, only: %i[edit update show destroy]
- layout "admin"
+ layout 'admin'
menu_item :oauth_applications
def index
@@ -87,10 +87,10 @@ def destroy
protected
def default_breadcrumb
- if action_name == "index"
- t("oauth.application.plural")
+ if action_name == 'index'
+ t('oauth.application.plural')
else
- ActionController::Base.helpers.link_to(t("oauth.application.plural"), oauth_applications_path)
+ ActionController::Base.helpers.link_to(t('oauth.application.plural'), oauth_applications_path)
end
end
diff --git a/app/controllers/oauth/auth_base_controller.rb b/app/controllers/oauth/auth_base_controller.rb
index 1428e5230193..7da92dbfe624 100644
--- a/app/controllers/oauth/auth_base_controller.rb
+++ b/app/controllers/oauth/auth_base_controller.rb
@@ -37,7 +37,7 @@ class AuthBaseController < ::ApplicationController
prepend_before_action :extend_content_security_policy
skip_before_action :check_if_login_required
- layout "only_logo"
+ layout 'only_logo'
def extend_content_security_policy
return unless pre_auth&.authorizable?
@@ -51,13 +51,13 @@ def extend_content_security_policy
def application_http_redirect_uris
registered_redirect_uris
- .select { |url| url.start_with?("http") }
- .map { |url| URI.join(url, "/").to_s }
+ .select { |url| url.start_with?('http') }
+ .map { |url| URI.join(url, '/').to_s }
end
def application_native_redirect_uris
registered_redirect_uris
- .reject { |url| url.start_with?("http", "urn") }
+ .reject { |url| url.start_with?('http', 'urn') }
.map(&method(:parse_native_redirect_uri))
.compact
end
diff --git a/app/controllers/oauth/grants_controller.rb b/app/controllers/oauth/grants_controller.rb
index e38afe156b12..de59afa3ab57 100644
--- a/app/controllers/oauth/grants_controller.rb
+++ b/app/controllers/oauth/grants_controller.rb
@@ -30,7 +30,7 @@ module OAuth
class GrantsController < ::ApplicationController
before_action :require_login
- layout "my"
+ layout 'my'
menu_item :access_token
def index
@@ -49,8 +49,8 @@ def revoke_application
current_user
)
- flash[:notice] = I18n.t("oauth.grants.successful_application_revocation", application_name: application.name)
- redirect_to controller: "/my", action: :access_token
+ flash[:notice] = I18n.t('oauth.grants.successful_application_revocation', application_name: application.name)
+ redirect_to controller: '/my', action: :access_token
end
private
diff --git a/app/controllers/placeholder_users/memberships_controller.rb b/app/controllers/placeholder_users/memberships_controller.rb
index b75532b9a878..346c8d91edbd 100644
--- a/app/controllers/placeholder_users/memberships_controller.rb
+++ b/app/controllers/placeholder_users/memberships_controller.rb
@@ -28,7 +28,7 @@
class PlaceholderUsers::MembershipsController < ApplicationController
include IndividualPrincipals::MembershipControllerMethods
- layout "admin"
+ layout 'admin'
before_action :authorize_global
before_action :find_individual_principal
@@ -40,6 +40,6 @@ def find_individual_principal
end
def redirected_to_tab(_membership)
- "memberships"
+ 'memberships'
end
end
diff --git a/app/controllers/placeholder_users_controller.rb b/app/controllers/placeholder_users_controller.rb
index 8ec919515c30..06ad095d445a 100644
--- a/app/controllers/placeholder_users_controller.rb
+++ b/app/controllers/placeholder_users_controller.rb
@@ -28,7 +28,7 @@
class PlaceholderUsersController < ApplicationController
include EnterpriseTrialHelper
- layout "admin"
+ layout 'admin'
before_action :authorize_global, except: %i[show]
before_action :find_placeholder_user, only: %i[show
@@ -60,7 +60,7 @@ def show
.where(id: Member.visible(current_user))
respond_to do |format|
- format.html { render layout: "no_menu" }
+ format.html { render layout: 'no_menu' }
end
end
@@ -153,20 +153,20 @@ def find_placeholder_user
def authorize_deletion
unless helpers.can_delete_placeholder_user?(@placeholder_user, current_user)
- render_403 message: I18n.t("placeholder_users.right_to_manage_members_missing")
+ render_403 message: I18n.t('placeholder_users.right_to_manage_members_missing')
end
end
def default_breadcrumb
- if action_name == "index"
- t("label_placeholder_user_plural")
+ if action_name == 'index'
+ t('label_placeholder_user_plural')
else
- ActionController::Base.helpers.link_to(t("label_placeholder_user_plural"),
+ ActionController::Base.helpers.link_to(t('label_placeholder_user_plural'),
placeholder_users_path)
end
end
def show_local_breadcrumb
- action_name != "show"
+ action_name != 'show'
end
end
diff --git a/app/controllers/projects/archive_controller.rb b/app/controllers/projects/archive_controller.rb
index b18c6f86c44c..5ac441fa9c8d 100644
--- a/app/controllers/projects/archive_controller.rb
+++ b/app/controllers/projects/archive_controller.rb
@@ -48,7 +48,7 @@ def change_status_action(status)
redirect_to(projects_path)
else
flash[:error] = t(:"error_can_not_#{status}_project",
- errors: service_call.errors.full_messages.join(", "))
+ errors: service_call.errors.full_messages.join(', '))
redirect_back fallback_location: projects_path
end
end
diff --git a/app/controllers/projects/identifier_controller.rb b/app/controllers/projects/identifier_controller.rb
index 5178dc0e94bf..9d640988e907 100644
--- a/app/controllers/projects/identifier_controller.rb
+++ b/app/controllers/projects/identifier_controller.rb
@@ -42,7 +42,7 @@ def update
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to project_settings_general_path(@project)
else
- render action: "show"
+ render action: 'show'
end
end
end
diff --git a/app/controllers/projects/menus_controller.rb b/app/controllers/projects/menus_controller.rb
index 78281abee108..9a99912c0168 100644
--- a/app/controllers/projects/menus_controller.rb
+++ b/app/controllers/projects/menus_controller.rb
@@ -41,9 +41,9 @@ def first_level_menu_items
[
OpenProject::Menu::MenuGroup.new(header: nil,
children: static_filters),
- OpenProject::Menu::MenuGroup.new(header: I18n.t(:"projects.lists.my_private"),
+ OpenProject::Menu::MenuGroup.new(header: I18n.t(:'projects.lists.my_private'),
children: my_filters),
- OpenProject::Menu::MenuGroup.new(header: I18n.t(:"activerecord.attributes.project.status_code"),
+ OpenProject::Menu::MenuGroup.new(header: I18n.t(:'activerecord.attributes.project.status_code'),
children: static_status_filters)
]
end
diff --git a/app/controllers/projects/queries_controller.rb b/app/controllers/projects/queries_controller.rb
index b1e2d162eb79..35d87f7c9225 100644
--- a/app/controllers/projects/queries_controller.rb
+++ b/app/controllers/projects/queries_controller.rb
@@ -39,8 +39,8 @@ class Projects::QueriesController < ApplicationController
end
def new
- render template: "/projects/index",
- layout: "global",
+ render template: '/projects/index',
+ layout: 'global',
locals: { query: @query, state: :edit }
end
@@ -52,8 +52,8 @@ def create
if call.success?
redirect_to projects_path(query_id: call.result.id)
else
- render template: "/projects/index",
- layout: "global",
+ render template: '/projects/index',
+ layout: 'global',
locals: { query: call.result, state: :edit }
end
end
diff --git a/app/controllers/projects/settings/custom_fields_controller.rb b/app/controllers/projects/settings/custom_fields_controller.rb
index 25cbac60b795..03f6a1acacaa 100644
--- a/app/controllers/projects/settings/custom_fields_controller.rb
+++ b/app/controllers/projects/settings/custom_fields_controller.rb
@@ -30,7 +30,7 @@ class Projects::Settings::CustomFieldsController < Projects::SettingsController
menu_item :settings_custom_fields
def show
- @wp_custom_fields = WorkPackageCustomField.order("lower(name)")
+ @wp_custom_fields = WorkPackageCustomField.order('lower(name)')
end
def update
@@ -39,7 +39,7 @@ def update
flash[:notice] = t(:notice_successful_update)
else
flash[:error] = t(:notice_project_cannot_update_custom_fields,
- errors: @project.errors.full_messages.join(", "))
+ errors: @project.errors.full_messages.join(', '))
raise ActiveRecord::Rollback
end
end
diff --git a/app/controllers/projects/settings/modules_controller.rb b/app/controllers/projects/settings/modules_controller.rb
index c7f3dc070e10..1ef457ae26d1 100644
--- a/app/controllers/projects/settings/modules_controller.rb
+++ b/app/controllers/projects/settings/modules_controller.rb
@@ -39,7 +39,7 @@ def update
redirect_to project_settings_modules_path(@project)
else
- render "show"
+ render 'show'
end
end
end
diff --git a/app/controllers/projects/templated_controller.rb b/app/controllers/projects/templated_controller.rb
index c59e7c033144..6f74a5a77cc5 100644
--- a/app/controllers/projects/templated_controller.rb
+++ b/app/controllers/projects/templated_controller.rb
@@ -50,7 +50,7 @@ def change_templated_action(templated)
flash[:notice] = t(:notice_successful_update)
else
messages = [
- t("activerecord.errors.template.header", model: Project.model_name.human, count: service_call.errors.count),
+ t('activerecord.errors.template.header', model: Project.model_name.human, count: service_call.errors.count),
service_call.message
]
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 94e4281e5aef..de4617468a01 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -53,7 +53,7 @@ def index
format.html do
flash.now[:error] = @query.errors.full_messages if @query.errors.any?
- render layout: "global", locals: { query: @query, state: :show }
+ render layout: 'global', locals: { query: @query, state: :show }
end
format.any(*supported_export_formats) do
@@ -63,7 +63,7 @@ def index
end
def new
- render layout: "no_menu"
+ render layout: 'no_menu'
end
def copy
@@ -77,9 +77,9 @@ def destroy
.call
if service_call.success?
- flash[:notice] = I18n.t("projects.delete.scheduled")
+ flash[:notice] = I18n.t('projects.delete.scheduled')
else
- flash[:error] = I18n.t("projects.delete.schedule_failed", errors: service_call.errors.full_messages.join("\n"))
+ flash[:error] = I18n.t('projects.delete.schedule_failed', errors: service_call.errors.full_messages.join("\n"))
end
redirect_to projects_path
@@ -118,7 +118,7 @@ def export_list(query, mime_type)
query: query.to_hash
)
- if request.headers["Accept"]&.include?("application/json")
+ if request.headers['Accept']&.include?('application/json')
render json: { job_id: job.job_id }
else
redirect_to job_status_path(job.job_id)
diff --git a/app/controllers/queries/params_parser.rb b/app/controllers/queries/params_parser.rb
index d93e5747b025..301d2dd15deb 100644
--- a/app/controllers/queries/params_parser.rb
+++ b/app/controllers/queries/params_parser.rb
@@ -49,7 +49,7 @@ def parse_orders_from_params(params)
.to_h
.map { |k, v| { attribute: k, direction: v } }
rescue JSON::ParserError
- [{ attribute: "invalid", direction: "asc" }]
+ [{ attribute: 'invalid', direction: 'asc' }]
end
def parse_columns_from_params(params)
@@ -86,7 +86,7 @@ def parse_filter
def consume_ampersand
case @buffer.peek(1)
- when "&", /\s/
+ when '&', /\s/
@buffer.getch
consume_ampersand
end
@@ -106,9 +106,9 @@ def parse_values
parse_doublequoted_value
when "'"
parse_singlequoted_value
- when "["
+ when '['
parse_array_value
- when "&"
+ when '&'
[]
else
parse_unguarded_value
@@ -128,7 +128,7 @@ def parse_singlequoted_value
def parse_unguarded_value
value = @buffer
.scan_until(/&|\z/)
- .delete_suffix("&")
+ .delete_suffix('&')
[value]
end
@@ -136,8 +136,8 @@ def parse_unguarded_value
def parse_array_value
@buffer
.scan_until(/]|\z/)
- .delete_suffix("]")
- .delete_prefix("[")
+ .delete_suffix(']')
+ .delete_prefix('[')
.scan(/(?:'([^']*)')|(?:"([^"]*)")/)
.flatten
.compact
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 741493d32a1b..08cb4596df0c 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -26,9 +26,9 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "SVG/Graph/Bar"
-require "SVG/Graph/BarHorizontal"
-require "digest/sha1"
+require 'SVG/Graph/Bar'
+require 'SVG/Graph/BarHorizontal'
+require 'digest/sha1'
class ChangesetNotFound < StandardError
end
@@ -63,7 +63,7 @@ def show
if request.xhr?
if @entries && @repository.valid?
- render(partial: "dir_list_content")
+ render(partial: 'dir_list_content')
else
render(nothing: true)
end
@@ -72,7 +72,7 @@ def show
else
@changesets = @repository.latest_changesets(@path, @rev)
@properties = @repository.properties(@path, @rev)
- render action: "show"
+ render action: 'show'
end
end
@@ -80,8 +80,8 @@ def create
service = SCM::RepositoryFactoryService.new(@project, params)
if service.build_and_save
@repository = service.repository
- flash[:notice] = I18n.t("repositories.create_successful")
- flash[:notice] << (" " + I18n.t("repositories.create_managed_delay")) if @repository.managed?
+ flash[:notice] = I18n.t('repositories.create_successful')
+ flash[:notice] << (' ' + I18n.t('repositories.create_managed_delay')) if @repository.managed?
else
flash[:error] = service.build_error
end
@@ -111,7 +111,7 @@ def committers
h
end
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "committers", project_id: @project
+ redirect_to action: 'committers', project_id: @project
end
end
@@ -123,7 +123,7 @@ def destroy_info
def destroy
repository = @project.repository
if repository.destroy
- flash[:notice] = I18n.t("repositories.delete_sucessful")
+ flash[:notice] = I18n.t('repositories.delete_sucessful')
else
flash[:error] = repository.errors.full_messages
end
@@ -146,7 +146,7 @@ def changes
@properties = @repository.properties(@path, @rev)
@changeset = @repository.find_changeset_by_name(@rev)
- render "changes", formats: [:html]
+ render 'changes', formats: [:html]
end
def revisions
@@ -203,7 +203,7 @@ def annotate
@annotate = @repository.scm.annotate(@path, @rev)
@changeset = @repository.find_changeset_by_name(@rev)
- render "annotate", formats: [:html]
+ render 'annotate', formats: [:html]
end
def revision
@@ -221,7 +221,7 @@ def revision
end
def diff
- if params[:format] == "diff"
+ if params[:format] == 'diff'
@diff = @repository.diff(@path, @rev, @rev_to)
unless @diff
@@ -233,8 +233,8 @@ def diff
filename << "_r#{@rev_to}" if @rev_to
send_data @diff.join,
filename: "#{filename}.diff",
- type: "text/x-patch",
- disposition: "attachment"
+ type: 'text/x-patch',
+ disposition: 'attachment'
else
@diff_type = diff_type_persisted
@@ -250,7 +250,7 @@ def diff
@changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
@diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
- render "diff", formats: :html
+ render 'diff', formats: :html
end
end
@@ -264,9 +264,9 @@ def stats
def graph
data = nil
case params[:graph]
- when "commits_per_month"
+ when 'commits_per_month'
data = graph_commits_per_month(@repository)
- when "commits_per_author"
+ when 'commits_per_author'
unless current_user.allowed_in_project?(:view_commit_author_statistics, @project)
return deny_access
end
@@ -275,8 +275,8 @@ def graph
end
if data
- headers["Content-Type"] = "image/svg+xml"
- send_data(data, type: "image/svg+xml", disposition: "inline")
+ headers['Content-Type'] = 'image/svg+xml'
+ send_data(data, type: 'image/svg+xml', disposition: 'inline')
else
render_404
end
@@ -290,7 +290,7 @@ def update_repository(repo_params)
@repository.attributes = @repository.class.permitted_params(repo_params)
if @repository.save
- flash[:notice] = I18n.t("repositories.update_settings_successful")
+ flash[:notice] = I18n.t('repositories.update_settings_successful')
else
flash[:error] = @repository.errors.full_messages.join('\n')
end
@@ -306,7 +306,7 @@ def find_repository
# Prepare checkout instructions
# available on all pages (even empty!)
- @path = params[:repo_path] || ""
+ @path = params[:repo_path] || ''
@instructions = ::SCM::CheckoutInstructionsService.new(@repository, path: @path)
# Asserts repository availability, or renders an appropriate error
@@ -319,7 +319,7 @@ def find_repository
raise InvalidRevisionParam
end
rescue OpenProject::SCM::Exceptions::SCMEmpty
- render "empty"
+ render 'empty'
rescue ActiveRecord::RecordNotFound
render_404
rescue InvalidRevisionParam
@@ -339,7 +339,7 @@ def graph_commits_per_month(repository)
@date_from = @date_to << 11
@date_from = Date.civil(@date_from.year, @date_from.month, 1)
commits_by_day = Changeset.where(
- ["repository_id = ? AND commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]
+ ['repository_id = ? AND commit_date BETWEEN ? AND ?', repository.id, @date_from, @date_to]
).group(:commit_date).size
commits_by_month = [0] * 12
commits_by_day.each do |c|
@@ -389,7 +389,7 @@ def graph_commits_per_month(repository)
end
def graph_commits_per_author(repository)
- commits_by_author = Changeset.where(["repository_id = ?", repository.id]).group(:committer).size
+ commits_by_author = Changeset.where(['repository_id = ?', repository.id]).group(:committer).size
commits_by_author.to_a.sort_by!(&:last)
changes_by_author = Change.includes(:changeset)
@@ -406,12 +406,12 @@ def graph_commits_per_author(repository)
commits_data = commits_by_author.map(&:last)
changes_data = commits_by_author.map { |r| h[r.first] || 0 }
- fields = fields + ([""] * (10 - fields.length)) if fields.length < 10
+ fields = fields + ([''] * (10 - fields.length)) if fields.length < 10
commits_data = commits_data + ([0] * (10 - commits_data.length)) if commits_data.length < 10
changes_data = changes_data + ([0] * (10 - changes_data.length)) if changes_data.length < 10
# Remove email address in usernames
- fields = fields.map { |c| c.gsub(%r{<.+@.+>}, "") }
+ fields = fields.map { |c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
height: 400,
@@ -440,14 +440,14 @@ def login_back_url_params
end
def raw_or_to_large_or_non_text(content, path)
- params[:format] == "raw" ||
+ params[:format] == 'raw' ||
(content.size && content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
!entry_text_data?(content, path)
end
def send_raw(content, path)
# Force the download
- send_opt = { filename: filename_for_content_disposition(path.split("/").last) }
+ send_opt = { filename: filename_for_content_disposition(path.split('/').last) }
send_type = OpenProject::MimeType.of(path)
send_opt[:type] = send_type.to_s if send_type
send_data content, send_opt
@@ -462,14 +462,14 @@ def render_text_entry
# Forcing html format here to avoid
# rails looking for e.g text when .txt is asked for
- render "entry", formats: [:html]
+ render 'entry', formats: [:html]
end
def diff_type_persisted
preferences = current_user.pref
diff_type = params[:type] || preferences.diff_type
- diff_type = "inline" unless %w(inline sbs).include?(diff_type)
+ diff_type = 'inline' unless %w(inline sbs).include?(diff_type)
# Save diff type as user preference
if current_user.logged? && diff_type != preferences.diff_type
@@ -485,7 +485,7 @@ def entry_text_data?(ent, path)
# It is very strict that file contains less than 30% of ascii symbols
# in non Western Europe.
# TODO: need to handle edge cases of non-binary content that isn't UTF-8
- OpenProject::MimeType.is_type?("text", path) ||
- ent.dup.force_encoding("UTF-8") == ent.dup.force_encoding("BINARY")
+ OpenProject::MimeType.is_type?('text', path) ||
+ ent.dup.force_encoding('UTF-8') == ent.dup.force_encoding('BINARY')
end
end
diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb
index 893c26866539..3fd874957eee 100644
--- a/app/controllers/roles_controller.rb
+++ b/app/controllers/roles_controller.rb
@@ -29,7 +29,7 @@
class RolesController < ApplicationController
include PaginationHelper
- layout "admin"
+ layout 'admin'
before_action :require_admin
@@ -41,7 +41,7 @@ def index
.page(page_param)
.per_page(per_page_param)
- render action: "index", layout: false if request.xhr?
+ render action: 'index', layout: false if request.xhr?
end
def new
@@ -52,7 +52,7 @@ def new
def edit
@role = Role.find(params[:id])
- @call = set_role_attributes(@role, "update")
+ @call = set_role_attributes(@role, 'update')
end
def create
@@ -61,11 +61,11 @@ def create
if @call.success?
flash[:notice] = t(:notice_successful_create)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
@roles = roles_scope
- render action: "new"
+ render action: 'new'
end
end
@@ -75,9 +75,9 @@ def update
if @call.success?
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -92,7 +92,7 @@ def destroy
else
flash[:error] = I18n.t(:error_can_not_remove_role)
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
def report
@@ -107,11 +107,11 @@ def bulk_update
if calls.all?(&:success?)
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
@calls = calls
@permissions = OpenProject::AccessControl.permissions.reject(&:public?)
- render action: "report"
+ render action: 'report'
end
end
@@ -144,10 +144,10 @@ def roles_scope
end
def default_breadcrumb
- if action_name == "index"
- t("label_role_plural")
+ if action_name == 'index'
+ t('label_role_plural')
else
- ActionController::Base.helpers.link_to(t("label_role_plural"), roles_path)
+ ActionController::Base.helpers.link_to(t('label_role_plural'), roles_path)
end
end
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index dbdf68110eb1..c71ef05ecbd4 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -53,12 +53,12 @@ def index
private
def prepare_tokens
- @question = search_params[:q] || ""
+ @question = search_params[:q] || ''
@question.strip!
@tokens = scan_query_tokens(@question).uniq
unless @tokens.any?
- @question = ""
+ @question = ''
end
end
@@ -92,7 +92,7 @@ def limit_results_subsequent_page
# extract tokens from the question
# eg. hello "bye bye" => ["hello", "bye bye"]
def scan_query_tokens(query)
- tokens = query.scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}).map { |m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, "") }
+ tokens = query.scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}).map { |m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '') }
# no more than 5 tokens to search for
tokens.slice! 5..-1 if tokens.size > 5
@@ -111,9 +111,9 @@ def offset
def projects_to_search
case search_params[:scope]
- when "all"
+ when 'all'
nil
- when "current_project"
+ when 'current_project'
@project
else
@project ? @project.self_and_descendants.active : nil
@@ -149,7 +149,7 @@ def search_types
if projects_to_search.is_a? Project
# don't search projects
- types.delete("projects")
+ types.delete('projects')
# only show what the user is allowed to view
types = types.select { |o| User.current.allowed_in_project?(:"view_#{o}", projects_to_search) }
end
@@ -162,7 +162,7 @@ def search_classes
scope = if scope.empty?
search_types
- elsif scope & ["work_packages"] == scope
+ elsif scope & ['work_packages'] == scope
[]
else
scope
@@ -176,7 +176,7 @@ def scope_class(scope)
end
def provision_gon
- available_search_types = search_types.dup.push("all")
+ available_search_types = search_types.dup.push('all')
gon.global_search = {
search_term: @question,
@@ -187,7 +187,7 @@ def provision_gon
name: OpenProject::GlobalSearch.tab_name(search_type)
}
end,
- current_tab: available_search_types.detect { |search_type| search_params[search_type] } || "all"
+ current_tab: available_search_types.detect { |search_type| search_params[search_type] } || 'all'
}
end
end
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index a9c83c066ed8..38e24b96c080 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -29,7 +29,7 @@
class StatusesController < ApplicationController
include PaginationHelper
- layout "admin"
+ layout 'admin'
before_action :require_admin
@@ -37,7 +37,7 @@ def index
@statuses = Status.page(page_param)
.per_page(per_page_param)
- render action: "index", layout: false if request.xhr?
+ render action: 'index', layout: false if request.xhr?
end
def new
@@ -52,9 +52,9 @@ def create
@status = Status.new(permitted_params.status)
if @status.save
flash[:notice] = I18n.t(:notice_successful_create)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
- render action: "new"
+ render action: 'new'
end
end
@@ -62,9 +62,9 @@ def update
@status = Status.find(params[:id])
if @status.update(permitted_params.status)
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "index"
+ redirect_to action: 'index'
else
- render action: "edit"
+ render action: 'edit'
end
end
@@ -76,10 +76,10 @@ def destroy
status.destroy
flash[:notice] = I18n.t(:notice_successful_delete)
end
- redirect_to action: "index"
+ redirect_to action: 'index'
rescue StandardError
flash[:error] = I18n.t(:error_unable_delete_status)
- redirect_to action: "index"
+ redirect_to action: 'index'
end
def update_work_package_done_ratio
@@ -88,13 +88,13 @@ def update_work_package_done_ratio
else
flash[:error] = I18n.t(:error_work_package_done_ratios_not_updated)
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
protected
def default_breadcrumb
- if action_name == "index"
+ if action_name == 'index'
t(:label_work_package_status_plural)
else
ActionController::Base.helpers.link_to(t(:label_work_package_status_plural), statuses_path)
diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb
index e709ef3b705f..a94c13e4ea1f 100644
--- a/app/controllers/sys_controller.rb
+++ b/app/controllers/sys_controller.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open_project/repository_authentication"
+require 'open_project/repository_authentication'
class SysController < ActionController::Base
before_action :check_enabled
@@ -38,7 +38,7 @@ def projects
p = Project.active.has_module(:repository)
.includes(:repository)
.references(:repositories)
- .order(Arel.sql("identifier"))
+ .order(Arel.sql('identifier'))
respond_to do |format|
format.json do
render json: p.to_json(include: :repository)
@@ -50,7 +50,7 @@ def projects
end
def update_required_storage
- result = update_storage_information(@repository, params[:force] == "1")
+ result = update_storage_information(@repository, params[:force] == '1')
render plain: "Updated: #{result}", status: :ok
end
@@ -75,9 +75,9 @@ def fetch_changesets
def repo_auth
project = Project.find_by(identifier: params[:repository])
if project && authorized?(project, @authenticated_user)
- render plain: "Access granted"
+ render plain: 'Access granted'
else
- render plain: "Not allowed", status: :forbidden # default to deny
+ render plain: 'Not allowed', status: :forbidden # default to deny
end
end
@@ -96,7 +96,7 @@ def authorized?(project, user)
def check_enabled
User.current = nil
unless Setting.sys_api_enabled? && params[:key].to_s == Setting.sys_api_key
- render plain: "Access denied. Repository management WS is disabled or key is invalid.",
+ render plain: 'Access denied. Repository management WS is disabled or key is invalid.',
status: :forbidden
false
end
@@ -125,7 +125,7 @@ def find_repository_with_storage
else
return true if @repository.scm.storage_available?
- render plain: "repositories.storage.not_available", status: :bad_request
+ render plain: 'repositories.storage.not_available', status: :bad_request
end
false
@@ -137,8 +137,8 @@ def require_basic_auth
return true if @authenticated_user
end
- response.headers["WWW-Authenticate"] = 'Basic realm="Repository Authentication"'
- render plain: "Authorization required", status: :unauthorized
+ response.headers['WWW-Authenticate'] = 'Basic realm="Repository Authentication"'
+ render plain: 'Authorization required', status: :unauthorized
false
end
@@ -155,10 +155,10 @@ def cached_user_login(username, password)
user_id = Rails.cache.fetch(OpenProject::RepositoryAuthentication::CACHE_PREFIX + Digest::SHA1.hexdigest("#{username}#{password}"),
expires_in: OpenProject::RepositoryAuthentication::CACHE_EXPIRES_AFTER) do
user = user_login(username, password)
- user ? user.id.to_s : "-1"
+ user ? user.id.to_s : '-1'
end
- return nil if user_id.blank? or user_id == "-1"
+ return nil if user_id.blank? or user_id == '-1'
user || User.find_by(id: user_id.to_i)
end
diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb
index 224593c207b2..43be056024b2 100644
--- a/app/controllers/types_controller.rb
+++ b/app/controllers/types_controller.rb
@@ -29,7 +29,7 @@
class TypesController < ApplicationController
include PaginationHelper
- layout "admin"
+ layout 'admin'
before_action :require_admin
before_action :find_type, only: %i[update move destroy]
@@ -73,7 +73,7 @@ def create
call.on_failure do |result|
flash[:error] = result.errors.full_messages.join("\n")
load_projects_and_types
- render action: "new"
+ render action: 'new'
end
end
end
@@ -99,7 +99,7 @@ def move
redirect_to types_path
else
flash.now[:error] = I18n.t(:error_type_could_not_be_saved)
- render action: "edit"
+ render action: 'edit'
end
end
@@ -113,7 +113,7 @@ def destroy
else
flash[:error] = destroy_error_message
end
- redirect_to action: "index"
+ redirect_to action: 'index'
end
protected
@@ -129,7 +129,7 @@ def permitted_type_params
end
def load_projects_and_types
- @types = ::Type.order(Arel.sql("position"))
+ @types = ::Type.order(Arel.sql('position'))
@projects = Project.all
end
@@ -140,7 +140,7 @@ def redirect_to_type_tab_path(type, notice)
end
def default_breadcrumb
- if action_name == "index"
+ if action_name == 'index'
t(:label_work_package_types)
else
ActionController::Base.helpers.link_to(t(:label_work_package_types), types_path)
@@ -152,7 +152,7 @@ def render_edit_tab(type)
@projects = Project.all
@type = type
- render action: "edit"
+ render action: 'edit'
end
def show_local_breadcrumb
@@ -173,7 +173,7 @@ def destroy_error_message
else
error_message = [
ApplicationController.helpers.sanitize(
- t(:"error_can_not_delete_type.explanation", url: belonging_wps_url(@type.id)),
+ t(:'error_can_not_delete_type.explanation', url: belonging_wps_url(@type.id)),
attributes: %w(href target)
)
]
diff --git a/app/controllers/users/memberships_controller.rb b/app/controllers/users/memberships_controller.rb
index 2e02321d568c..778675af5c07 100644
--- a/app/controllers/users/memberships_controller.rb
+++ b/app/controllers/users/memberships_controller.rb
@@ -28,7 +28,7 @@
class Users::MembershipsController < ApplicationController
include IndividualPrincipals::MembershipControllerMethods
- layout "admin"
+ layout 'admin'
before_action :authorize_global
before_action :find_individual_principal
@@ -41,9 +41,9 @@ def find_individual_principal
def redirected_to_tab(membership)
if membership.project
- "memberships"
+ 'memberships'
else
- "global_roles"
+ 'global_roles'
end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 1a599d96d232..bb332a605199 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -27,7 +27,7 @@
#++
class UsersController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :authorize_global, except: %i[show deletion_info destroy]
@@ -76,7 +76,7 @@ def show
if can_show_user?
@events = events
- render layout: (can_manage_or_create_users? ? "admin" : "no_menu")
+ render layout: (can_manage_or_create_users? ? 'admin' : 'no_menu')
else
render_404
end
@@ -102,7 +102,7 @@ def create
flash[:notice] = I18n.t(:notice_successful_create)
redirect_to(params[:continue] ? new_user_path : helpers.allowed_management_user_profile_path(@user))
else
- render action: "new"
+ render action: 'new'
end
end
@@ -134,7 +134,7 @@ def update
respond_to do |format|
format.html do
flash[:notice] = I18n.t(:notice_successful_update)
- render action: :edit
+ redirect_back(fallback_location: edit_user_path(@user))
end
end
else
@@ -160,14 +160,14 @@ def change_status_info
def change_status
if @user.id == current_user.id
# user is not allowed to change own status
- redirect_back_or_default(action: "edit", id: @user)
+ redirect_back_or_default(action: 'edit', id: @user)
return
end
if (params[:unlock] || params[:activate]) && user_limit_reached?
show_user_limit_error!
- return redirect_back_or_default(action: "edit", id: @user)
+ return redirect_back_or_default(action: 'edit', id: @user)
end
if params[:unlock]
@@ -182,7 +182,7 @@ def change_status
was_activated = (@user.status_change == %w[registered active])
if params[:activate] && @user.missing_authentication_method?
- flash[:error] = I18n.t("user.error_status_change_failed",
+ flash[:error] = I18n.t('user.error_status_change_failed',
errors: I18n.t(:notice_user_missing_authentication_method))
elsif @user.save
flash[:notice] = I18n.t(:notice_successful_update)
@@ -190,10 +190,10 @@ def change_status
UserMailer.account_activated(@user).deliver_later
end
else
- flash[:error] = I18n.t("user.error_status_change_failed",
- errors: @user.errors.full_messages.join(", "))
+ flash[:error] = I18n.t('user.error_status_change_failed',
+ errors: @user.errors.full_messages.join(', '))
end
- redirect_back_or_default(action: "edit", id: @user)
+ redirect_back_or_default(action: 'edit', id: @user)
end
def resend_invitation
@@ -218,7 +218,7 @@ def destroy
Users::DeleteService.new(model: @user, user: User.current).call
- flash[:notice] = I18n.t("account.deletion_pending")
+ flash[:notice] = I18n.t('account.deletion_pending')
respond_to do |format|
format.html do
@@ -228,7 +228,7 @@ def destroy
end
def deletion_info
- render action: "deletion_info", layout: my_or_admin_layout
+ render action: 'deletion_info', layout: my_or_admin_layout
end
private
@@ -267,9 +267,9 @@ def authorize_for_user
respond_to do |format|
format.html { render_403 }
- format.xml { head :unauthorized, "WWW-Authenticate" => 'Basic realm="OpenProject API"' }
- format.js { head :unauthorized, "WWW-Authenticate" => 'Basic realm="OpenProject API"' }
- format.json { head :unauthorized, "WWW-Authenticate" => 'Basic realm="OpenProject API"' }
+ format.xml { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="OpenProject API"' }
+ format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="OpenProject API"' }
+ format.json { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="OpenProject API"' }
end
false
@@ -288,9 +288,9 @@ def my_or_admin_layout
# TODO: how can this be done better:
# check if the route used to call the action is in the 'my' namespace
if url_for(:delete_my_account_info) == request.url
- "my"
+ 'my'
else
- "admin"
+ 'admin'
end
end
@@ -301,10 +301,10 @@ def set_password?(params)
protected
def default_breadcrumb
- if action_name == "index"
- t("label_user_plural")
+ if action_name == 'index'
+ t('label_user_plural')
else
- ActionController::Base.helpers.link_to(t("label_user_plural"), users_path)
+ ActionController::Base.helpers.link_to(t('label_user_plural'), users_path)
end
end
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 9d4d4fd40ae1..8576812a74a0 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -37,7 +37,7 @@ class VersionsController < ApplicationController
before_action :authorize
def index
- @types = @project.types.order(Arel.sql("position"))
+ @types = @project.types.order(Arel.sql('position'))
retrieve_selected_type_ids(@types, @types.select(&:is_in_roadmap?))
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_work_packages? : (params[:with_subprojects].to_i == 1)
project_ids = @with_subprojects ? @project.self_and_descendants.includes(:wiki).map(&:id) : [@project.id]
@@ -76,7 +76,7 @@ def create
.new(user: current_user)
.call(attributes)
- render_cu(call, :notice_successful_create, "new")
+ render_cu(call, :notice_successful_create, 'new')
end
def update
@@ -88,7 +88,7 @@ def update
model: @version)
.call(attributes)
- render_cu(call, :notice_successful_update, "edit")
+ render_cu(call, :notice_successful_update, 'edit')
end
def close_completed
@@ -146,7 +146,7 @@ def retrieve_selected_type_ids(selectable_types, default_types = nil)
def selected_type_ids(selectable_types, default_types = nil)
if (ids = params[:type_ids])
- ids.is_a?(Array) ? ids.map(&:to_s) : ids.split("/")
+ ids.is_a?(Array) ? ids.map(&:to_s) : ids.split('/')
else
(default_types || selectable_types).map { |t| t.id.to_s }
end
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index d0b646e7df9b..0babd91d5d37 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "htmldiff"
+require 'htmldiff'
# The WikiController follows the Rails REST controller pattern but with
# a few differences
@@ -76,10 +76,10 @@ class WikiController < ApplicationController
# List of pages, sorted alphabetically and by parent (hierarchy)
def index
- slug = wiki_page_title.nil? ? "wiki" : WikiPage.slug(wiki_page_title)
+ slug = wiki_page_title.nil? ? 'wiki' : WikiPage.slug(wiki_page_title)
@related_page = WikiPage.find_by(wiki_id: @wiki.id, slug:)
- @pages = @wiki.pages.order(Arel.sql("title")).includes(wiki: :project)
+ @pages = @wiki.pages.order(Arel.sql('title')).includes(wiki: :project)
@pages_by_parent_id = @pages.group_by(&:parent_id)
end
@@ -92,8 +92,8 @@ def show
@page = ::WikiPages::AtVersion.new(@page, version)
- if params[:format] == "markdown" && User.current.allowed_in_project?(:export_wiki_pages, @project)
- send_data(@page.text, type: "text/plain", filename: "#{@page.title}.md")
+ if params[:format] == 'markdown' && User.current.allowed_in_project?(:export_wiki_pages, @project)
+ send_data(@page.text, type: 'text/plain', filename: "#{@page.title}.md")
return
end
@@ -111,7 +111,7 @@ def new_child
build_wiki_page
@page.parent = old_page
- render action: "new"
+ render action: 'new'
end
def menu
@@ -144,7 +144,7 @@ def create
flash[:notice] = I18n.t(:notice_successful_create)
redirect_to_show
else
- render action: "new"
+ render action: 'new'
end
end
@@ -170,12 +170,12 @@ def update
flash[:notice] = I18n.t(:notice_successful_update)
redirect_to_show
else
- render action: "edit"
+ render action: 'edit'
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash.now[:error] = I18n.t(:notice_locking_conflict)
- render action: "edit"
+ render action: 'edit'
end
# rename a page
@@ -237,7 +237,7 @@ def update_parent_page
redirect_to_show
else
@parent_pages = @wiki.pages.includes(:parent) - @page.self_and_descendants
- render "edit_parent_page"
+ render 'edit_parent_page'
end
end
@@ -252,7 +252,7 @@ def history
@versions = @page
.journals
.select(:id, :user_id, :notes, :created_at, :version)
- .order(Arel.sql("version DESC"))
+ .order(Arel.sql('version DESC'))
.page(page_param)
.per_page(per_page_param)
@@ -286,12 +286,12 @@ def destroy
@descendants_count = @page.descendants.size
if @descendants_count > 0
case params[:todo]
- when "nullify"
+ when 'nullify'
# Nothing to do
- when "destroy"
+ when 'destroy'
# Removes all its descendants
@page.descendants.each(&:destroy)
- when "reassign"
+ when 'reassign'
# Reassign children to another parent page
reassign_to = @wiki.pages.find_by(id: params[:reassign_to_id].presence)
return unless reassign_to
@@ -308,7 +308,7 @@ def destroy
if page = @wiki.find_page(@wiki.start_page) || @wiki.pages.first
flash[:notice] = I18n.t(:notice_successful_delete)
- redirect_to action: "index", project_id: @project, id: page
+ redirect_to action: 'index', project_id: @project, id: page
else
flash[:notice] = I18n.t(:notice_successful_delete)
redirect_to project_path(@project)
@@ -318,11 +318,11 @@ def destroy
# Export wiki to a single html file
def export
if User.current.allowed_in_project?(:export_wiki_pages, @project)
- @pages = @wiki.pages.order(Arel.sql("title"))
- export = render_to_string action: "export_multiple", layout: false
- send_data(export, type: "text/html", filename: "wiki.html")
+ @pages = @wiki.pages.order(Arel.sql('title'))
+ export = render_to_string action: 'export_multiple', layout: false
+ send_data(export, type: 'text/html', filename: 'wiki.html')
else
- redirect_to action: "show", project_id: @project, id: nil
+ redirect_to action: 'show', project_id: @project, id: nil
end
end
@@ -360,7 +360,7 @@ def page_for_menu_item(page)
end
def wiki_page_title
- params[:title] || (action_name == "new_child" ? "" : params[:id].to_s.capitalize.tr("-", " "))
+ params[:title] || (action_name == 'new_child' ? '' : params[:id].to_s.capitalize.tr('-', ' '))
end
def find_wiki
@@ -384,8 +384,8 @@ def handle_new_wiki_page
if User.current.allowed_in_project?(:edit_wiki_pages, @project) && editable?
edit
render action: :new
- elsif params[:id] == "wiki"
- flash[:info] = I18n.t("wiki.page_not_editable_index")
+ elsif params[:id] == 'wiki'
+ flash[:info] = I18n.t('wiki.page_not_editable_index')
redirect_to action: :index
else
render_404
diff --git a/app/controllers/wiki_menu_items_controller.rb b/app/controllers/wiki_menu_items_controller.rb
index 6ac9c2358cc6..b3dcb8d87351 100644
--- a/app/controllers/wiki_menu_items_controller.rb
+++ b/app/controllers/wiki_menu_items_controller.rb
@@ -68,7 +68,7 @@ def update
get_data_from_params(params)
- if wiki_menu_setting == "no_item"
+ if wiki_menu_setting == 'no_item'
unless @wiki_menu_item.nil?
if @wiki_menu_item.is_only_main_item?
if @page.only_wiki_page?
@@ -86,9 +86,9 @@ def update
@wiki_menu_item.name = @page.slug
@wiki_menu_item.title = wiki_menu_item_params[:title] || @page_title
- if wiki_menu_setting == "sub_item"
+ if wiki_menu_setting == 'sub_item'
@wiki_menu_item.parent_id = parent_wiki_menu_item
- elsif wiki_menu_setting == "main_item"
+ elsif wiki_menu_setting == 'main_item'
@wiki_menu_item.parent_id = nil
assign_wiki_menu_item_params @wiki_menu_item
end
@@ -101,11 +101,11 @@ def update
flash[:notice] = t(:notice_successful_update)
end
- redirect_back_or_default(action: "edit", id: @page)
+ redirect_back_or_default(action: 'edit', id: @page)
else
respond_to do |format|
format.html do
- render action: "edit", id: @page
+ render action: 'edit', id: @page
end
end
end
@@ -163,15 +163,15 @@ def get_data_from_params(params)
end
def assign_wiki_menu_item_params(menu_item)
- if wiki_menu_item_params[:new_wiki_page] == "1"
+ if wiki_menu_item_params[:new_wiki_page] == '1'
menu_item.new_wiki_page = true
- elsif wiki_menu_item_params[:new_wiki_page] == "0"
+ elsif wiki_menu_item_params[:new_wiki_page] == '0'
menu_item.new_wiki_page = false
end
- if wiki_menu_item_params[:index_page] == "1"
+ if wiki_menu_item_params[:index_page] == '1'
menu_item.index_page = true
- elsif wiki_menu_item_params[:index_page] == "0"
+ elsif wiki_menu_item_params[:index_page] == '0'
menu_item.index_page = false
end
end
diff --git a/app/controllers/work_packages/auto_completes_controller.rb b/app/controllers/work_packages/auto_completes_controller.rb
index 58152a1e5ff0..955140e59050 100644
--- a/app/controllers/work_packages/auto_completes_controller.rb
+++ b/app/controllers/work_packages/auto_completes_controller.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "rack/utils"
+require 'rack/utils'
class WorkPackages::AutoCompletesController < ApplicationController
def index
@@ -41,7 +41,7 @@ def index
def work_packages_matching_query_prop
Query.new.tap do |query|
- query.add_filter(:typeahead, "**", params[:q])
+ query.add_filter(:typeahead, '**', params[:q])
query.sort_criteria = [%i[updated_at desc]]
query.include_subprojects = true
end
@@ -52,7 +52,7 @@ def work_packages_matching_query_prop
def wp_hashes_with_string(work_packages)
work_packages.map do |work_package|
- work_package.attributes.merge("to_s" => work_package.to_s)
+ work_package.attributes.merge('to_s' => work_package.to_s)
end
end
end
diff --git a/app/controllers/work_packages/bulk_error_message.rb b/app/controllers/work_packages/bulk_error_message.rb
index a0e5a9acf2ad..05df1e659b17 100644
--- a/app/controllers/work_packages/bulk_error_message.rb
+++ b/app/controllers/work_packages/bulk_error_message.rb
@@ -33,7 +33,7 @@ module WorkPackages::BulkErrorMessage
private
def bulk_error_message(selected_work_packages, service_result)
- ApplicationController.renderer.render partial: "work_packages/bulk/errors",
+ ApplicationController.renderer.render partial: 'work_packages/bulk/errors',
locals: { service_result:,
selected_work_packages: }
end
diff --git a/app/controllers/work_packages/moves_controller.rb b/app/controllers/work_packages/moves_controller.rb
index 42c65161fafa..3d0cc952d960 100644
--- a/app/controllers/work_packages/moves_controller.rb
+++ b/app/controllers/work_packages/moves_controller.rb
@@ -104,7 +104,7 @@ def default_breadcrumb
def check_project_uniqueness
unless @project
# TODO: let users bulk move/copy work packages from different projects
- render_error message: :"work_packages.move.unsupported_for_multiple_projects", status: 400
+ render_error message: :'work_packages.move.unsupported_for_multiple_projects', status: 400
false
end
end
@@ -118,7 +118,7 @@ def prepare_for_work_package_move
@target_type = @types.find { |t| t.id.to_s == params[:new_type_id].to_s }
@available_versions = @target_project.assignable_versions
@available_statuses = Workflow.available_statuses(@project)
- @notes = params[:notes] || ""
+ @notes = params[:notes] || ''
end
def attributes_for_create
@@ -126,7 +126,7 @@ def attributes_for_create
.move_work_package
.compact_blank
# 'none' is used in the frontend as a value to unset the property, e.g. the assignee.
- .transform_values { |v| v == "none" ? nil : v }
+ .transform_values { |v| v == 'none' ? nil : v }
.to_h
end
end
diff --git a/app/controllers/work_packages/reports_controller.rb b/app/controllers/work_packages/reports_controller.rb
index e1cb28000300..76be8b1393ac 100644
--- a/app/controllers/work_packages/reports_controller.rb
+++ b/app/controllers/work_packages/reports_controller.rb
@@ -34,16 +34,16 @@ def report
reports_service = Reports::ReportsService.new(@project)
@reports = [
- reports_service.report_for("type"),
- reports_service.report_for("priority"),
- reports_service.report_for("assigned_to"),
- reports_service.report_for("responsible"),
- reports_service.report_for("author"),
- reports_service.report_for("version"),
- reports_service.report_for("category")
+ reports_service.report_for('type'),
+ reports_service.report_for('priority'),
+ reports_service.report_for('assigned_to'),
+ reports_service.report_for('responsible'),
+ reports_service.report_for('author'),
+ reports_service.report_for('version'),
+ reports_service.report_for('category')
]
- @reports << reports_service.report_for("subproject") if @project.children.any?
+ @reports << reports_service.report_for('subproject') if @project.children.any?
end
def report_details
diff --git a/app/controllers/work_packages/shares/bulk_controller.rb b/app/controllers/work_packages/shares/bulk_controller.rb
index 79db00e72854..ea553b7657f9 100644
--- a/app/controllers/work_packages/shares/bulk_controller.rb
+++ b/app/controllers/work_packages/shares/bulk_controller.rb
@@ -70,7 +70,7 @@ def respond_with_update_permission_buttons
@selected_shares.each do |share|
replace_via_turbo_stream(
component: WorkPackages::Share::PermissionButtonComponent.new(share:,
- data: { "test-selector": "op-share-wp-update-role" })
+ data: { 'test-selector': 'op-share-wp-update-role' })
)
end
diff --git a/app/controllers/work_packages/shares_controller.rb b/app/controllers/work_packages/shares_controller.rb
index c539a7185685..8facf685413f 100644
--- a/app/controllers/work_packages/shares_controller.rb
+++ b/app/controllers/work_packages/shares_controller.rb
@@ -168,7 +168,7 @@ def respond_with_new_invite_form
def respond_with_update_permission_button
replace_via_turbo_stream(
component: WorkPackages::Share::PermissionButtonComponent.new(share: @share,
- data: { "test-selector": "op-share-wp-update-role" })
+ data: { 'test-selector': 'op-share-wp-update-role' })
)
respond_with_turbo_streams
@@ -223,9 +223,9 @@ def load_query
.call(params)
# Set default filter on the entity
- @query.where("entity_id", "=", @work_package.id)
- @query.where("entity_type", "=", WorkPackage.name)
- @query.where("project_id", "=", @project.id)
+ @query.where('entity_id', '=', @work_package.id)
+ @query.where('entity_type', '=', WorkPackage.name)
+ @query.where('project_id', '=', @project.id)
@query.order(name: :asc) unless params[:sortBy]
diff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rb
index 8bbc4624afb4..2b0f2fbfce19 100644
--- a/app/controllers/work_packages_controller.rb
+++ b/app/controllers/work_packages_controller.rb
@@ -47,7 +47,7 @@ def index
format.html do
render :index,
locals: { query: @query, project: @project, menu_name: project_or_global_menu },
- layout: "angular/angular"
+ layout: 'angular/angular'
end
format.any(*supported_list_formats) do
@@ -65,7 +65,7 @@ def show
format.html do
render :show,
locals: { work_package:, menu_name: project_or_global_menu },
- layout: "angular/angular"
+ layout: 'angular/angular'
end
format.any(*supported_single_formats) do
@@ -90,7 +90,7 @@ def export_list(mime_type)
.call(query: @query, mime_type:, params:)
.result
- if request.headers["Accept"]&.include?("application/json")
+ if request.headers['Accept']&.include?('application/json')
render json: { job_id: }
else
redirect_to job_status_path(job_id)
@@ -110,9 +110,9 @@ def export_single(mime_type)
end
def atom_journals
- render template: "journals/index",
+ render template: 'journals/index',
layout: false,
- content_type: "application/atom+xml",
+ content_type: 'application/atom+xml',
locals: { title: "#{Setting.app_title} - #{work_package}",
journals: }
end
@@ -125,7 +125,7 @@ def authorize_on_work_package
def per_page_param
case params[:format]
- when "atom"
+ when 'atom'
Setting.feeds_limit.to_i
else
super
@@ -144,9 +144,9 @@ def journals
@journals ||= begin
order =
if current_user.wants_comments_in_reverse_order?
- Journal.arel_table["created_at"].desc
+ Journal.arel_table['created_at'].desc
else
- Journal.arel_table["created_at"].asc
+ Journal.arel_table['created_at'].asc
end
work_package
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb
index 26f94fb71b36..00a7ac3b7b0f 100644
--- a/app/controllers/workflows_controller.rb
+++ b/app/controllers/workflows_controller.rb
@@ -27,7 +27,7 @@
#++
class WorkflowsController < ApplicationController
- layout "admin"
+ layout 'admin'
before_action :require_admin
@@ -45,7 +45,7 @@ def show
end
def edit
- @used_statuses_only = params[:used_statuses_only] != "0"
+ @used_statuses_only = params[:used_statuses_only] != '0'
statuses_for_form
@@ -57,21 +57,21 @@ def edit
def update
call = Workflows::BulkUpdateService
.new(role: @role, type: @type)
- .call(params["status"])
+ .call(params['status'])
if call.success?
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "edit", role_id: @role, type_id: @type
+ redirect_to action: 'edit', role_id: @role, type_id: @type
end
end
def copy
- @source_type = if params[:source_type_id].blank? || params[:source_type_id] == "any"
+ @source_type = if params[:source_type_id].blank? || params[:source_type_id] == 'any'
nil
else
::Type.find(params[:source_type_id])
end
- @source_role = if params[:source_role_id].blank? || params[:source_role_id] == "any"
+ @source_role = if params[:source_role_id].blank? || params[:source_role_id] == 'any'
nil
else
eligible_roles.find(params[:source_role_id])
@@ -88,16 +88,16 @@ def copy
else
Workflow.copy(@source_type, @source_role, @target_types, @target_roles)
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_to action: "copy", source_type_id: @source_type, source_role_id: @source_role
+ redirect_to action: 'copy', source_type_id: @source_type, source_role_id: @source_role
end
end
end
def default_breadcrumb
- if action_name == "edit"
- t("label_workflow")
+ if action_name == 'edit'
+ t('label_workflow')
else
- ActionController::Base.helpers.link_to(t("label_workflow"), url_for(controller: "/workflows", action: "edit"))
+ ActionController::Base.helpers.link_to(t('label_workflow'), url_for(controller: '/workflows', action: 'edit'))
end
end
@@ -118,9 +118,9 @@ def statuses_for_form
def workflows_for_form
workflows = Workflow.where(role_id: @role.id, type_id: @type.id)
@workflows = {}
- @workflows["always"] = workflows.select { |w| !w.author && !w.assignee }
- @workflows["author"] = workflows.select(&:author)
- @workflows["assignee"] = workflows.select(&:assignee)
+ @workflows['always'] = workflows.select { |w| !w.author && !w.assignee }
+ @workflows['author'] = workflows.select(&:author)
+ @workflows['assignee'] = workflows.select(&:assignee)
end
def find_roles
diff --git a/app/forms/queries/projects/create.rb b/app/forms/queries/projects/create.rb
index f6cc39ce1a29..c53f999538f1 100644
--- a/app/forms/queries/projects/create.rb
+++ b/app/forms/queries/projects/create.rb
@@ -35,9 +35,9 @@ class Queries::Projects::Create < ApplicationForm
visually_hide_label: true,
required: true,
autofocus: true,
- name: "name",
+ name: 'name',
label: Queries::Projects::ProjectQuery.human_attribute_name(:name),
- placeholder: I18n.t(:"projects.lists.new.placeholder")
+ placeholder: I18n.t(:'projects.lists.new.placeholder')
)
group.submit(
@@ -51,7 +51,7 @@ class Queries::Projects::Create < ApplicationForm
scheme: :secondary,
label: I18n.t(:button_cancel),
tag: :a,
- data: { "params-from-query-target": "anchor" },
+ data: { 'params-from-query-target': 'anchor' },
href: OpenProject::StaticRouting::StaticUrlHelpers.new.projects_path
)
end
diff --git a/app/helpers/accessibility_helper.rb b/app/helpers/accessibility_helper.rb
index 155fd8269faa..3568ac8ddc83 100644
--- a/app/helpers/accessibility_helper.rb
+++ b/app/helpers/accessibility_helper.rb
@@ -33,12 +33,12 @@ def you_are_here_info(condition = true, disabled = nil)
elsif condition && disabled
"#{I18n.t(:description_current_position)} ".html_safe
else
- ""
+ ''
end
end
def empty_element_tag
- @empty_element_tag ||= ApplicationController.new.render_to_string(partial: "accessibility/empty_element_tag").html_safe
+ @empty_element_tag ||= ApplicationController.new.render_to_string(partial: 'accessibility/empty_element_tag').html_safe
end
# Returns the locale :en for the given menu item if the user locale is
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index d7578d9c5bb5..4c62e7e928b3 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -28,13 +28,13 @@
module AdminHelper
def project_status_options_for_select(selected)
- options_for_select([[I18n.t(:label_all), ""],
+ options_for_select([[I18n.t(:label_all), ''],
[I18n.t(:status_active), 1]], selected)
end
def linked_sha_reference(sha, url)
if sha && url
- link_to sha, url, target: "_blank", rel: "noopener"
+ link_to sha, url, target: '_blank', rel: 'noopener'
else
sha
end
diff --git a/app/helpers/angular_helper.rb b/app/helpers/angular_helper.rb
index a287f2b40aa1..be0fb75e6146 100644
--- a/app/helpers/angular_helper.rb
+++ b/app/helpers/angular_helper.rb
@@ -38,10 +38,10 @@ def angular_component_tag(component, options = {})
.transform_values(&:to_json)
options[:data] = options.fetch(:data, {}).merge(inputs)
- options[:class] ||= [options[:class], "op-angular-component"]
+ options[:class] ||= [options[:class], 'op-angular-component']
.compact
- .join(" ")
+ .join(' ')
- content_tag(component, "", options)
+ content_tag(component, '', options)
end
end
diff --git a/app/helpers/announcements_helper.rb b/app/helpers/announcements_helper.rb
index 891b354e69b5..ef727a2ddba7 100644
--- a/app/helpers/announcements_helper.rb
+++ b/app/helpers/announcements_helper.rb
@@ -1,9 +1,9 @@
module AnnouncementsHelper
def notice_annoucement_active
if @announcement.active_and_current?
- I18n.t(:"announcements.is_active")
+ I18n.t(:'announcements.is_active')
else
- I18n.t(:"announcements.is_inactive")
+ I18n.t(:'announcements.is_inactive')
end
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5a1610f8a357..86113995dcac 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "forwardable"
-require "cgi"
+require 'forwardable'
+require 'cgi'
module ApplicationHelper
include OpenProject::TextFormatting
@@ -72,8 +72,8 @@ def link_to_if_authorized(*args, &)
end
end
- def required_field_name(name = "")
- safe_join [name, " ", content_tag("span", "*", class: "required")]
+ def required_field_name(name = '')
+ safe_join [name, ' ', content_tag('span', '*', class: 'required')]
end
def li_unless_nil(link, options = {})
@@ -82,12 +82,12 @@ def li_unless_nil(link, options = {})
# Show a sorted linkified (if active) comma-joined list of users
def list_users(users, options = {})
- users.sort.map { |u| link_to_user(u, options) }.join(", ")
+ users.sort.map { |u| link_to_user(u, options) }.join(', ')
end
# returns a class name based on the user's status
def user_status_class(user)
- "status_" + user.status
+ 'status_' + user.status
end
def user_status_i18n(user)
@@ -98,7 +98,7 @@ def delete_link(url, options = {})
options = {
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
- class: "icon icon-delete"
+ class: 'icon icon-delete'
}.merge(options)
link_to I18n.t(:button_delete), url, options
@@ -123,7 +123,7 @@ def project_tree(projects, &)
end
def project_nested_ul(projects, &)
- s = ""
+ s = ''
if projects.any?
ancestors = []
Project.project_tree(projects) do |project, _level|
@@ -131,13 +131,13 @@ def project_nested_ul(projects, &)
s << "\n"
else
ancestors.pop
- s << ""
+ s << ''
while ancestors.any? && !project.is_descendant_of?(ancestors.last)
ancestors.pop
s << " \n"
end
end
- s << ""
+ s << ' '
s << yield(project).to_s
ancestors << project
end
@@ -154,7 +154,7 @@ def principals_check_box_tags(name, principals)
def labeled_check_box_tags(name, collection, options = {})
collection.sort.map do |object|
- id = name.gsub(/[\[\]]+/, "_") + object.id.to_s
+ id = name.gsub(/[\[\]]+/, '_') + object.id.to_s
object_options = options.inject({}) do |h, (k, v)|
h[k] = v.is_a?(Symbol) ? send(v, object) : v
@@ -163,7 +163,7 @@ def labeled_check_box_tags(name, collection, options = {})
object_options[:class] = Array(object_options[:class]) + %w(form--label-with-check-box)
- content_tag :div, class: "form--field" do
+ content_tag :div, class: 'form--field' do
label_tag(id, object, object_options) do
styled_check_box_tag(name, object.id, false, id:) + object.to_s
end
@@ -185,7 +185,7 @@ def authoring(created, author, options = {})
def authoring_at(created, author)
return if author.nil?
- I18n.t(:"js.label_added_time_by",
+ I18n.t(:'js.label_added_time_by',
author: html_escape(author.name),
age: created,
authorLink: user_path(author)).html_safe
@@ -193,16 +193,16 @@ def authoring_at(created, author)
def time_tag(time)
text = distance_of_time_in_words(Time.now, time)
- if @project and @project.module_enabled?("activity")
- link_to(text, { controller: "/activities",
- action: "index",
+ if @project and @project.module_enabled?('activity')
+ link_to(text, { controller: '/activities',
+ action: 'index',
project_id: @project,
from: time.to_date },
title: format_time(time))
else
datetime = time.acts_like?(:time) ? time.xmlschema : time.iso8601
content_tag(:time, text, datetime:,
- title: format_time(time), class: "timestamp")
+ title: format_time(time), class: 'timestamp')
end
end
@@ -220,7 +220,7 @@ def to_path_param(path)
def other_formats_links(&)
formats = capture(Redmine::Views::OtherFormatsBuilder.new(self), &)
unless formats.nil? || formats.strip.empty?
- content_tag "p", class: "other-formats" do
+ content_tag 'p', class: 'other-formats' do
(I18n.t(:label_export_to) + formats).html_safe
end
end
@@ -229,11 +229,11 @@ def other_formats_links(&)
# Returns the theme, controller name, and action as css classes for the
# HTML body.
def body_css_classes
- css = ["theme-" + OpenProject::CustomStyles::Design.identifier.to_s]
+ css = ['theme-' + OpenProject::CustomStyles::Design.identifier.to_s]
if params[:controller] && params[:action]
- css << ("controller-" + params[:controller])
- css << ("action-" + params[:action])
+ css << ('controller-' + params[:controller])
+ css << ('action-' + params[:action])
end
css << "ee-banners-#{EnterpriseToken.show_banners? ? 'visible' : 'hidden'}"
@@ -243,7 +243,7 @@ def body_css_classes
# Add browser specific classes to aid css fixes
css += browser_specific_classes
- css.join(" ")
+ css.join(' ')
end
def accesskey(s)
@@ -254,14 +254,14 @@ def accesskey(s)
def simple_format_without_paragraph(text)
text.to_s
.gsub(/\r\n?/, "\n") # \r\n and \r -> \n
- .gsub(/\n\n+/, " ") # 2+ newline -> 2 br
+ .gsub(/\n\n+/, ' ') # 2+ newline -> 2 br
.gsub(/([^\n]\n)(?=[^\n])/, '\1 ') # 1 newline -> br
.html_safe
end
def lang_options_for_select(blank = true)
auto = if blank && (valid_languages - all_languages) == (all_languages - valid_languages)
- [["(auto)", ""]]
+ [['(auto)', '']]
else
[]
end
@@ -279,8 +279,8 @@ def all_lang_options_for_select
def theme_options_for_select
[
- [t("themes.light"), "light"],
- [t("themes.light_high_contrast"), "light_high_contrast"]
+ [t('themes.light'), 'light'],
+ [t('themes.light_high_contrast'), 'light_high_contrast']
]
end
@@ -292,7 +292,7 @@ def user_theme_data_attributes
def highlight_default_language(lang_options)
lang_options.map do |(language_name, code)|
if code == Setting.default_language
- [I18n.t("settings.language_name_being_default", language_name:), code, { disabled: true, checked: true }]
+ [I18n.t('settings.language_name_being_default', language_name:), code, { disabled: true, checked: true }]
else
[language_name, code]
end
@@ -301,14 +301,14 @@ def highlight_default_language(lang_options)
def labelled_tabular_form_for(record, options = {}, &)
options.reverse_merge!(builder: TabularFormBuilder, html: {})
- options[:html][:class] = "form" unless options[:html].has_key?(:class)
+ options[:html][:class] = 'form' unless options[:html].has_key?(:class)
form_for(record, options, &)
end
def back_url_hidden_field_tag(use_referer: true)
- back_url = params[:back_url] || (use_referer ? request.env["HTTP_REFERER"] : nil)
+ back_url = params[:back_url] || (use_referer ? request.env['HTTP_REFERER'] : nil)
back_url = CGI.unescape(back_url.to_s)
- hidden_field_tag("back_url", CGI.escape(back_url), id: nil) if back_url.present?
+ hidden_field_tag('back_url', CGI.escape(back_url), id: nil) if back_url.present?
end
def back_url_to_current_page_hidden_field_tag
@@ -319,12 +319,12 @@ def back_url_to_current_page_hidden_field_tag
back_url = request.url
end
- hidden_field_tag("back_url", back_url) if back_url.present?
+ hidden_field_tag('back_url', back_url) if back_url.present?
end
def check_all_links(form_name)
link_to_function(t(:button_check_all), "OpenProject.helpers.checkAll('#{form_name}', true)") +
- " | " +
+ ' | ' +
link_to_function(t(:button_uncheck_all), "OpenProject.helpers.checkAll('#{form_name}', false)")
end
@@ -347,23 +347,23 @@ def progress_bar(pcts, options = {})
pcts = Array(pcts).map(&:round)
closed = pcts[0]
done = pcts[1] || 0
- width = options[:width] || "100px;"
- legend = options[:legend] || ""
- total_progress = options[:hide_total_progress] ? "" : t(:total_progress)
- percent_sign = options[:hide_percent_sign] ? "" : "%"
+ width = options[:width] || '100px;'
+ legend = options[:legend] || ''
+ total_progress = options[:hide_total_progress] ? '' : t(:total_progress)
+ percent_sign = options[:hide_percent_sign] ? '' : '%'
content_tag :span do
- progress = content_tag :span, class: "progress-bar", style: "width: #{width}" do
- concat content_tag(:span, "", class: "inner-progress closed", style: "width: #{closed}%")
- concat content_tag(:span, "", class: "inner-progress done", style: "width: #{done}%")
+ progress = content_tag :span, class: 'progress-bar', style: "width: #{width}" do
+ concat content_tag(:span, '', class: 'inner-progress closed', style: "width: #{closed}%")
+ concat content_tag(:span, '', class: 'inner-progress done', style: "width: #{done}%")
end
- progress + content_tag(:span, "#{legend}#{percent_sign} #{total_progress}", class: "progress-bar-legend")
+ progress + content_tag(:span, "#{legend}#{percent_sign} #{total_progress}", class: 'progress-bar-legend')
end
end
def checked_image(checked = true)
if checked
- icon_wrapper("icon-context icon-checkmark", t(:label_checked))
+ icon_wrapper('icon-context icon-checkmark', t(:label_checked))
end
end
@@ -375,41 +375,41 @@ def calendar_for(*_args)
def locale_first_day_of_week
case Setting.start_of_week.to_i
when 1
- "1" # Monday
+ '1' # Monday
when 7
- "0" # Sunday
+ '0' # Sunday
when 6
- "6" # Saturday
+ '6' # Saturday
else
# use language default (pass a blank string) and moment.js will reuse existing info
# /frontend/src/main.ts
- ""
+ ''
end
end
def locale_first_week_of_year
case Setting.first_week_of_year.to_i
when 1
- "1" # Monday
+ '1' # Monday
when 4
- "4" # Thursday
+ '4' # Thursday
else
# use language default (pass a blank string) and moment.js will reuse existing info
# /frontend/src/main.ts
- ""
+ ''
end
end
# To avoid the menu flickering, disable it
# by default unless we're in test mode
def initial_menu_styles(side_displayed)
- Rails.env.test? || !side_displayed ? "" : "display:none"
+ Rails.env.test? || !side_displayed ? '' : 'display:none'
end
def initial_menu_classes(side_displayed, show_decoration)
- classes = "can-hide-navigation"
- classes << " nosidebar" unless side_displayed
- classes << " nomenus" unless show_decoration
+ classes = 'can-hide-navigation'
+ classes << ' nosidebar' unless side_displayed
+ classes << ' nomenus' unless show_decoration
classes
end
@@ -418,7 +418,7 @@ def initial_menu_classes(side_displayed, show_decoration)
#
# @param [optional, String] content the content of the ROBOTS tag.
# defaults to no index, follow, and no archive
- def robot_exclusion_tag(content = "NOINDEX,FOLLOW,NOARCHIVE")
+ def robot_exclusion_tag(content = 'NOINDEX,FOLLOW,NOARCHIVE')
" ".html_safe
end
@@ -437,7 +437,7 @@ def translate_language(lang_code)
::I18n.locale != Redmine::I18n::IN_CONTEXT_TRANSLATION_CODE
[Redmine::I18n::IN_CONTEXT_TRANSLATION_NAME, lang_code.to_s]
else
- [I18n.t("cldr.language_name", locale: lang_code), lang_code.to_s]
+ [I18n.t('cldr.language_name', locale: lang_code), lang_code.to_s]
end
end
@@ -450,8 +450,8 @@ def password_complexity_requirements
# use 0..0, so this doesn't fail if rules is an empty string
rules[0] = rules[0..0].upcase
- s = raw "" + OpenProject::Passwords::Evaluator.min_length_description + " "
- s += raw "" + rules + " " unless rules.empty?
+ s = raw '' + OpenProject::Passwords::Evaluator.min_length_description + ' '
+ s += raw '' + rules + ' ' unless rules.empty?
s
end
end
diff --git a/app/helpers/appsignal_helper.rb b/app/helpers/appsignal_helper.rb
index 592f1d7c0e17..9203f4878fc9 100644
--- a/app/helpers/appsignal_helper.rb
+++ b/app/helpers/appsignal_helper.rb
@@ -1,9 +1,9 @@
module AppsignalHelper
def appsignal_frontend_tag
- return "" unless OpenProject::Configuration.appsignal_frontend_key
+ return '' unless OpenProject::Configuration.appsignal_frontend_key
tag :meta,
- name: "openproject_appsignal",
+ name: 'openproject_appsignal',
data: {
push_key: OpenProject::Configuration.appsignal_frontend_key,
version: OpenProject::VERSION.to_s
diff --git a/app/helpers/archived_projects_helper.rb b/app/helpers/archived_projects_helper.rb
index 20535782cba4..7246f0f8a2bb 100644
--- a/app/helpers/archived_projects_helper.rb
+++ b/app/helpers/archived_projects_helper.rb
@@ -31,19 +31,19 @@ def archived_projects_urls_for(projects)
urls = projects.map do |project|
link_to project.name,
projects_path(filters: archived_project_filters_for(project)),
- target: "_blank",
- rel: "noopener"
+ target: '_blank',
+ rel: 'noopener'
end
- safe_join(urls, ", ")
+ safe_join(urls, ', ')
end
private
def archived_project_filters_for(project)
[
- { active: { operator: "=", values: ["f"] } },
- { name_and_identifier: { operator: "=", values: [html_escape(project.name)] } }
+ { active: { operator: '=', values: ['f'] } },
+ { name_and_identifier: { operator: '=', values: [html_escape(project.name)] } }
].to_json
end
end
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
index 368ad7e253a3..9d71015f3b6b 100644
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -29,10 +29,10 @@
module AttachmentsHelper
def to_utf8_for_attachments(str)
forced_str = str.dup
- forced_str.force_encoding("UTF-8")
+ forced_str.force_encoding('UTF-8')
return forced_str if forced_str.valid_encoding?
- str.encode("UTF-8", invalid: :replace, undef: :replace, replace: "") # better replace: '?'
+ str.encode('UTF-8', invalid: :replace, undef: :replace, replace: '') # better replace: '?'
end
##
@@ -42,11 +42,11 @@ def to_utf8_for_attachments(str)
# Within ckeditor-augmented-textarea-form, this attachment list is added automatically
# when a resource is added.
def list_attachments(resource, options = {})
- content_tag "op-attachments",
- "",
- "data-resource": resource.to_json,
- "data-allow-uploading": false,
- "data-destroy-immediately": true,
+ content_tag 'op-attachments',
+ '',
+ 'data-resource': resource.to_json,
+ 'data-allow-uploading': false,
+ 'data-destroy-immediately': true,
**options
end
end
diff --git a/app/helpers/augmenting_helper.rb b/app/helpers/augmenting_helper.rb
index dd3f5ccf4b03..a86884220676 100644
--- a/app/helpers/augmenting_helper.rb
+++ b/app/helpers/augmenting_helper.rb
@@ -37,7 +37,7 @@ module AugmentingHelper
# @param block [Block] A block that renders the section's body.
def augmented_collapsible_section(title:, initiallyExpanded: true, &block)
render(
- partial: "/augmented/collapsible_section",
+ partial: '/augmented/collapsible_section',
locals: { title:, initiallyExpanded: !!initiallyExpanded, block: }
)
end
diff --git a/app/helpers/browser_helper.rb b/app/helpers/browser_helper.rb
index 73e076d21111..c3b3190eb06e 100644
--- a/app/helpers/browser_helper.rb
+++ b/app/helpers/browser_helper.rb
@@ -32,14 +32,14 @@ def unsupported_browser?
# or mobile detection
def browser_specific_classes
[].tap do |classes|
- classes << "-browser-chrome" if browser.chrome?
- classes << "-browser-firefox" if browser.firefox?
- classes << "-browser-safari" if browser.safari?
- classes << "-browser-edge" if browser.edge?
-
- classes << "-browser-mobile" if browser.device.mobile?
- classes << "-browser-windows" if browser.platform.windows?
- classes << "-unsupported-browser" if unsupported_browser?
+ classes << '-browser-chrome' if browser.chrome?
+ classes << '-browser-firefox' if browser.firefox?
+ classes << '-browser-safari' if browser.safari?
+ classes << '-browser-edge' if browser.edge?
+
+ classes << '-browser-mobile' if browser.device.mobile?
+ classes << '-browser-windows' if browser.platform.windows?
+ classes << '-unsupported-browser' if unsupported_browser?
end
end
end
diff --git a/app/helpers/calendars_helper.rb b/app/helpers/calendars_helper.rb
index 8273fc5b3bff..4cdf772bb153 100644
--- a/app/helpers/calendars_helper.rb
+++ b/app/helpers/calendars_helper.rb
@@ -35,7 +35,7 @@ module CalendarsHelper
# @return [String] link to the calendar
def link_to_previous_month(year, month, options = {})
target_date = Date.new(year, month, 1) - 1.month
- link_to_month(target_date, options.merge(class: "navigate-left",
+ link_to_month(target_date, options.merge(class: 'navigate-left',
display_year: target_date.year != year))
end
@@ -46,7 +46,7 @@ def link_to_previous_month(year, month, options = {})
# @return [String] link to the calendar
def link_to_next_month(year, month, options = {})
target_date = Date.new(year, month, 1) + 1.month
- link_to_month(target_date, options.merge(class: "navigate-right",
+ link_to_month(target_date, options.merge(class: 'navigate-right',
display_year: target_date.year != year))
end
@@ -57,7 +57,7 @@ def link_to_next_month(year, month, options = {})
# @return [String] link to the calendar
def link_to_month(date_to_show, options = {})
date = date_to_show.to_date
- name = ::I18n.l date, format: options.delete(:display_year) ? "%B %Y" : "%B"
+ name = ::I18n.l date, format: options.delete(:display_year) ? '%B %Y' : '%B'
merged_params = permitted_params
.calendar_filter
diff --git a/app/helpers/colors_helper.rb b/app/helpers/colors_helper.rb
index c2dfcd88511b..618eaa53b534 100644
--- a/app/helpers/colors_helper.rb
+++ b/app/helpers/colors_helper.rb
@@ -37,7 +37,7 @@ def options_for_colors(colored_thing)
color: c.hexcode,
bright: c.bright?,
dark: c.dark?,
- background: c.contrasting_color(light_color: "transparent")
+ background: c.contrasting_color(light_color: 'transparent')
}
options[:selected] = true if c.id == colored_thing.color_id
@@ -51,9 +51,9 @@ def selected_color(colored_thing)
end
def colored_text(color)
- background = color.contrasting_color(dark_color: "#333", light_color: "transparent")
+ background = color.contrasting_color(dark_color: '#333', light_color: 'transparent')
style = "background-color: #{background}; color: #{color.hexcode}"
- content_tag(:span, color.hexcode, class: "color--text-preview", style:)
+ content_tag(:span, color.hexcode, class: 'color--text-preview', style:)
end
#
@@ -81,16 +81,16 @@ def resource_color_css(name, scope)
end
styles = color.color_styles
- background_style = styles.map { |k, v| "#{k}:#{v} !important" }.join(";")
+ background_style = styles.map { |k, v| "#{k}:#{v} !important" }.join(';')
- if name === "type"
+ if name === 'type'
concat ".__hl_inline_#{name}_#{entry.id} { color: #{color.hexcode} !important;}"
concat ".__hl_inline_#{name}_#{entry.id} { -webkit-text-stroke: 0.5px grey;}" if color.super_bright?
- border_color = color.super_bright? ? "#555555" : color.hexcode
+ border_color = color.super_bright? ? '#555555' : color.hexcode
concat ".__hl_background_#{name}_#{entry.id} { border-color: #{border_color} !important; }"
else
- border_color = color.bright? ? "#555555" : color.hexcode
+ border_color = color.bright? ? '#555555' : color.hexcode
concat ".__hl_inline_#{name}_#{entry.id}::before { #{background_style}; border-color: #{border_color}; }\n"
end
@@ -107,11 +107,11 @@ def resource_color_css(name, scope)
def icon_for_color(color, options = {})
return unless color
- options.merge! class: "color--preview " + options[:class].to_s,
+ options.merge! class: 'color--preview ' + options[:class].to_s,
title: color.name,
style: "background-color: #{color.hexcode};" + options[:style].to_s
- content_tag(:span, " ", options)
+ content_tag(:span, ' ', options)
end
def color_by_variable(variable)
diff --git a/app/helpers/confirmation_dialog_helper.rb b/app/helpers/confirmation_dialog_helper.rb
index a0f7eed4a362..a7e41f366328 100644
--- a/app/helpers/confirmation_dialog_helper.rb
+++ b/app/helpers/confirmation_dialog_helper.rb
@@ -45,7 +45,7 @@ def augmented_confirmation_dialog(
passed_data: nil
)
{
- "augmented-confirm-dialog": {
+ 'augmented-confirm-dialog': {
text: {
title:,
text:,
diff --git a/app/helpers/error_message_helper.rb b/app/helpers/error_message_helper.rb
index 1c435aafe894..6b3205e4f3ac 100644
--- a/app/helpers/error_message_helper.rb
+++ b/app/helpers/error_message_helper.rb
@@ -38,12 +38,12 @@ def error_messages_for(object)
end
def render_error_messages_partial(errors, object)
- return "" if errors.empty?
+ return '' if errors.empty?
base_error_messages = errors.full_messages_for(:base)
fields_error_messages = errors.full_messages - base_error_messages
- render partial: "common/validation_error",
+ render partial: 'common/validation_error',
locals: { base_error_messages:,
fields_error_messages:,
object_name: object.class.model_name.human }
@@ -52,7 +52,7 @@ def render_error_messages_partial(errors, object)
def text_header_invalid_fields(base_error_messages, fields_error_messages)
return if fields_error_messages.blank?
- i18n_key = base_error_messages.present? ? "errors.header_additional_invalid_fields" : "errors.header_invalid_fields"
+ i18n_key = base_error_messages.present? ? 'errors.header_additional_invalid_fields' : 'errors.header_invalid_fields'
t(i18n_key, count: fields_error_messages.count)
end
diff --git a/app/helpers/errors_helper.rb b/app/helpers/errors_helper.rb
index a7c389dfe810..f1af78315794 100644
--- a/app/helpers/errors_helper.rb
+++ b/app/helpers/errors_helper.rb
@@ -94,7 +94,7 @@ def render_error(arg)
@message_details = arg[:message_details]
respond_to do |format|
format.html do
- render template: "common/error", layout: use_layout, status: @status
+ render template: 'common/error', layout: use_layout, status: @status
end
format.any do
head @status
diff --git a/app/helpers/flash_messages_helper.rb b/app/helpers/flash_messages_helper.rb
index 0fc868657ed8..edd9139efb7d 100644
--- a/app/helpers/flash_messages_helper.rb
+++ b/app/helpers/flash_messages_helper.rb
@@ -50,7 +50,7 @@ def render_flash_messages
return if render_primer_banner_message?
messages = flash
- .reject { |k, _| k.start_with? "_" }
+ .reject { |k, _| k.start_with? '_' }
.map do |k, v|
if k.to_sym == :modal
component = v[:type].constantize
@@ -65,31 +65,31 @@ def render_flash_messages
def join_flash_messages(messages)
if messages.respond_to?(:join)
- safe_join(messages, " ".html_safe)
+ safe_join(messages, ' '.html_safe)
else
messages
end
end
def render_flash_message(type, message, html_options = {}) # rubocop:disable Metrics/AbcSize
- if type.to_s == "notice"
- type = "success"
+ if type.to_s == 'notice'
+ type = 'success'
end
toast_css_classes = ["op-toast -#{type}", html_options.delete(:class)]
# Add autohide class to notice flashes if configured
- if type.to_s == "success" && User.current.pref.auto_hide_popups?
- toast_css_classes << "autohide-toaster"
+ if type.to_s == 'success' && User.current.pref.auto_hide_popups?
+ toast_css_classes << 'autohide-toaster'
end
- html_options = { class: toast_css_classes.join(" "), role: "alert" }.merge(html_options)
- close_button = content_tag :a, "", class: "op-toast--close icon-context icon-close",
- title: I18n.t("js.close_popup_title"),
- tabindex: "0"
- toast = content_tag(:div, join_flash_messages(message), class: "op-toast--content")
- content_tag :div, "", class: "op-toast--wrapper" do
- content_tag :div, "", class: "op-toast--casing" do
+ html_options = { class: toast_css_classes.join(' '), role: 'alert' }.merge(html_options)
+ close_button = content_tag :a, '', class: 'op-toast--close icon-context icon-close',
+ title: I18n.t('js.close_popup_title'),
+ tabindex: '0'
+ toast = content_tag(:div, join_flash_messages(message), class: 'op-toast--content')
+ content_tag :div, '', class: 'op-toast--wrapper' do
+ content_tag :div, '', class: 'op-toast--casing' do
content_tag :div, html_options do
concat(close_button)
concat(toast)
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index f64b3ef16da7..24a0baddcb97 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -30,26 +30,26 @@ module GroupsHelper
def group_settings_tabs(group)
[
{
- name: "general",
- partial: "groups/general",
+ name: 'general',
+ partial: 'groups/general',
path: edit_group_path(group),
label: :label_general
},
{
- name: "users",
- partial: "groups/users",
+ name: 'users',
+ partial: 'groups/users',
path: edit_group_path(group, tab: :users),
label: :label_user_plural
},
{
- name: "memberships",
- partial: "groups/memberships",
+ name: 'memberships',
+ partial: 'groups/memberships',
path: edit_group_path(group, tab: :memberships),
label: :label_project_plural
},
{
- name: "global_roles",
- partial: "principals/global_roles",
+ name: 'global_roles',
+ partial: 'principals/global_roles',
path: edit_group_path(group, tab: :global_roles),
label: :label_global_roles
}
@@ -58,8 +58,8 @@ def group_settings_tabs(group)
def autocompleter_filters(group)
[
- { name: "status", operator: "=", values: ["active", "invited"] },
- { name: "group", operator: "!", values: [group.id] }
+ { name: 'status', operator: '=', values: ['active', 'invited'] },
+ { name: 'group', operator: '!', values: [group.id] }
]
end
end
diff --git a/app/helpers/homescreen_helper.rb b/app/helpers/homescreen_helper.rb
index e0c624877b78..06bdf8d6452a 100644
--- a/app/helpers/homescreen_helper.rb
+++ b/app/helpers/homescreen_helper.rb
@@ -36,7 +36,7 @@ def organization_name
##
# Homescreen organization icon
def organization_icon
- op_icon("icon-context icon-enterprise")
+ op_icon('icon-context icon-enterprise')
end
##
@@ -48,7 +48,7 @@ def static_link_to(key)
link_to label,
link[:href],
title: label,
- target: "_blank", rel: "noopener"
+ target: '_blank', rel: 'noopener'
end
##
diff --git a/app/helpers/hook_helper.rb b/app/helpers/hook_helper.rb
index 40e10e1e5dab..c4e4a81b86cd 100644
--- a/app/helpers/hook_helper.rb
+++ b/app/helpers/hook_helper.rb
@@ -27,7 +27,7 @@ def call_hook(hook, context = {})
default_context = { project: @project, hook_caller: self }
default_context[:controller] = controller if respond_to?(:controller)
default_context[:request] = request if respond_to?(:request)
- OpenProject::Hook.call_hook(hook, default_context.merge(context)).join(" ").html_safe
+ OpenProject::Hook.call_hook(hook, default_context.merge(context)).join(' ').html_safe
end
end
end
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index b9b6db8386ab..33a794a2285d 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -43,7 +43,7 @@ def spot_icon(icon_name, title: nil, size: nil, inline: false, classnames: nil)
inline ? "spot-icon_inline" : nil,
"spot-icon_#{icon_name}",
classnames
- ].compact.join(" ")
+ ].compact.join(' ')
content_tag(:span, title, class: classes)
end
@@ -52,7 +52,7 @@ def spot_icon(icon_name, title: nil, size: nil, inline: false, classnames: nil)
# Icon wrapper with an invisible label
def icon_wrapper(icon_class, label)
content = op_icon(icon_class)
- content << content_tag(:span, label, class: "hidden-for-sighted")
+ content << content_tag(:span, label, class: 'hidden-for-sighted')
content
end
end
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb
index 1fcd32af5b64..1682c1e96edc 100644
--- a/app/helpers/journals_helper.rb
+++ b/app/helpers/journals_helper.rb
@@ -30,14 +30,14 @@
module JournalsHelper
def back_to_activity_page_url(activity_page)
- case activity_page&.split("/")
- in ["all"]
+ case activity_page&.split('/')
+ in ['all']
activities_url
- in ["projects", project_id]
+ in ['projects', project_id]
project_activities_url(project_id)
- in ["users", user_id]
+ in ['users', user_id]
user_url(user_id)
- in ["work_packages", work_package_id]
+ in ['work_packages', work_package_id]
work_package_url(work_package_id)
else
nil
diff --git a/app/helpers/mail_digest_helper.rb b/app/helpers/mail_digest_helper.rb
index a449114a15a1..a299e59289cc 100644
--- a/app/helpers/mail_digest_helper.rb
+++ b/app/helpers/mail_digest_helper.rb
@@ -28,8 +28,8 @@
module MailDigestHelper
def digest_summary_text(notification_count, mentioned_count)
- mentioned = mentioned_count > 1 ? "plural" : "singular"
- notifications = notification_count > 1 ? "plural" : "singular"
+ mentioned = mentioned_count > 1 ? 'plural' : 'singular'
+ notifications = notification_count > 1 ? 'plural' : 'singular'
summary = I18n.t(:"mail.digests.unread_notification_#{notifications}",
number_unread: notification_count).to_s
@@ -63,7 +63,7 @@ def digest_additional_author_text(notifications)
number_of_additional_authors = number_of_authors(notifications) - 1
if notifications.length > 1 && number_of_additional_authors > 0
- amount = number_of_additional_authors === 1 ? "one" : "other"
+ amount = number_of_additional_authors === 1 ? 'one' : 'other'
I18n.t(:"js.notifications.center.and_more_users.#{amount}", count: number_of_additional_authors)
end
end
@@ -76,7 +76,7 @@ def timestamp_text(user, journal)
I18n.t(:"mail.work_packages.#{value}_at",
user:,
timestamp: journal.created_at.strftime(
- "#{I18n.t(:"date.formats.default")}, #{I18n.t(:"time.formats.time")}"
+ "#{I18n.t(:'date.formats.default')}, #{I18n.t(:'time.formats.time')}"
))
)
end
@@ -100,27 +100,27 @@ def text_modifiers_for(notification, value)
end
def build_property_text(notification, is_overdue, days_diff)
- return I18n.t("js.notifications.date_alerts.overdue") if is_overdue && days_diff > 0
- return I18n.t("js.notifications.date_alerts.milestone_date") if notification.resource.milestone?
- return I18n.t("js.work_packages.properties.startDate") if notification.reason == "date_alert_start_date"
+ return I18n.t('js.notifications.date_alerts.overdue') if is_overdue && days_diff > 0
+ return I18n.t('js.notifications.date_alerts.milestone_date') if notification.resource.milestone?
+ return I18n.t('js.work_packages.properties.startDate') if notification.reason == "date_alert_start_date"
- I18n.t("js.work_packages.properties.dueDate")
+ I18n.t('js.work_packages.properties.dueDate')
end
def build_alert_text(date_value, is_past, is_overdue, days_diff)
- return I18n.t("js.notifications.date_alerts.property_is_deleted") unless date_value
- return I18n.t("js.notifications.date_alerts.property_today") if days_diff == 0
+ return I18n.t('js.notifications.date_alerts.property_is_deleted') unless date_value
+ return I18n.t('js.notifications.date_alerts.property_today') if days_diff == 0
- days_text = I18n.t("js.units.day", count: days_diff)
- return I18n.t("js.notifications.date_alerts.overdue_since", difference_in_days: days_text) if is_overdue
- return I18n.t("js.notifications.date_alerts.property_was", difference_in_days: days_text) if is_past
+ days_text = I18n.t('js.units.day', count: days_diff)
+ return I18n.t('js.notifications.date_alerts.overdue_since', difference_in_days: days_text) if is_overdue
+ return I18n.t('js.notifications.date_alerts.property_was', difference_in_days: days_text) if is_past
- I18n.t("js.notifications.date_alerts.property_is", difference_in_days: days_text)
+ I18n.t('js.notifications.date_alerts.property_is', difference_in_days: days_text)
end
def highlight_overdue(text, is_overdue, html)
return text unless html && is_overdue
- content_tag :span, text, style: "color: #C92A2A"
+ content_tag :span, text, style: 'color: #C92A2A'
end
end
diff --git a/app/helpers/mail_layout_helper.rb b/app/helpers/mail_layout_helper.rb
index 911fe514f0d1..3ca91ed4817b 100644
--- a/app/helpers/mail_layout_helper.rb
+++ b/app/helpers/mail_layout_helper.rb
@@ -29,32 +29,32 @@
module MailLayoutHelper
def placeholder_table_styles(options = {})
default_options = {
- style: "table-layout:fixed;border-collapse:separate;border-spacing:0;font-family:Helvetica;" <<
- (options[:style].present? ? options.delete(:style) : ""),
+ style: 'table-layout:fixed;border-collapse:separate;border-spacing:0;font-family:Helvetica;' <<
+ (options[:style].present? ? options.delete(:style) : ''),
cellspacing: "0",
cellpadding: "0"
}
- default_options.merge(options).map { |k, v| "#{k}=#{v}" }.join(" ")
+ default_options.merge(options).map { |k, v| "#{k}=#{v}" }.join(' ')
end
def placeholder_text_styles(**overwrites)
{
- color: "#878787",
- "line-height": "24px",
- "font-size": "14px",
- "white-space": "normal",
- overflow: "hidden",
- "max-width": "100%",
- width: "100%"
+ color: '#878787',
+ 'line-height': '24px',
+ 'font-size': '14px',
+ 'white-space': 'normal',
+ overflow: 'hidden',
+ 'max-width': '100%',
+ width: '100%'
}.merge(overwrites)
.map { |k, v| "#{k}: #{v}" }
- .join("; ")
+ .join('; ')
end
def action_button(&block)
render(
- partial: "mailer/mailer_button",
+ partial: 'mailer/mailer_button',
locals: { block: }
)
end
@@ -66,15 +66,15 @@ def placeholder_cell(number, vertical:)
"line-height:#{number}; max-width:0; min-width:0; height:#{number}; width:0; font-size:#{number}"
end
- content_tag("td", " ".html_safe, style:)
+ content_tag('td', ' '.html_safe, style:)
end
def user_salutation(user)
case Setting.emails_salutation
when :name
- I18n.t(:"mail.salutation", user: user.name)
+ I18n.t(:'mail.salutation', user: user.name)
else
- I18n.t(:"mail.salutation", user: user.firstname)
+ I18n.t(:'mail.salutation', user: user.firstname)
end
end
end
diff --git a/app/helpers/mail_notification_helper.rb b/app/helpers/mail_notification_helper.rb
index 6adcbea006ef..ef987c475f8d 100644
--- a/app/helpers/mail_notification_helper.rb
+++ b/app/helpers/mail_notification_helper.rb
@@ -36,7 +36,7 @@ def unique_reasons_of_notifications(notifications)
end
def notifications_path(id)
- notifications_center_url(["details", id, "activity"])
+ notifications_center_url(['details', id, 'activity'])
end
def type_color(type, default_fallback)
@@ -51,6 +51,6 @@ def type_color(type, default_fallback)
def status_colors(status)
color_id = selected_color(status)
- Color.find(color_id).color_styles.map { |k, v| "#{k}:#{v};" }.join(" ") if color_id
+ Color.find(color_id).color_styles.map { |k, v| "#{k}:#{v};" }.join(' ') if color_id
end
end
diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb
index 464e87e9f315..16d9998b0ded 100644
--- a/app/helpers/members_helper.rb
+++ b/app/helpers/members_helper.rb
@@ -34,13 +34,13 @@ module MembersHelper
# If it is the later, the ids of the non delete roles are appended to the url so that they are kept.
def global_member_role_deletion_link(member, role)
if member.roles.length == 1
- link_to("",
+ link_to('',
principal_membership_path(member.principal, member),
- { method: :delete, class: "icon icon-delete", title: t(:button_delete) })
+ { method: :delete, class: 'icon icon-delete', title: t(:button_delete) })
else
- link_to("",
- principal_membership_path(member.principal, member, "membership[role_ids]" => member.roles - [role]),
- { method: :patch, class: "icon icon-delete", title: t(:button_delete) })
+ link_to('',
+ principal_membership_path(member.principal, member, 'membership[role_ids]' => member.roles - [role]),
+ { method: :patch, class: 'icon icon-delete', title: t(:button_delete) })
end
end
diff --git a/app/helpers/meta_tags_helper.rb b/app/helpers/meta_tags_helper.rb
index 480d244e13bd..2f8b27616bd6 100644
--- a/app/helpers/meta_tags_helper.rb
+++ b/app/helpers/meta_tags_helper.rb
@@ -32,7 +32,7 @@ module MetaTagsHelper
def output_title_and_meta_tags
display_meta_tags site: Setting.app_title,
title: html_title_parts,
- separator: " | ", # Update the TitleService when changing this!
+ separator: ' | ', # Update the TitleService when changing this!
reverse: true
end
@@ -47,7 +47,7 @@ def initializer_meta_tag
firstDayOfWeek: locale_first_day_of_week,
environment: Rails.env,
edition: OpenProject::Configuration.edition,
- "asset-host": OpenProject::Configuration.rails_asset_host.presence
+ 'asset-host': OpenProject::Configuration.rails_asset_host.presence
}.compact
end
diff --git a/app/helpers/no_results_helper.rb b/app/helpers/no_results_helper.rb
index 1e4e7f25a4b1..872690b0b8cd 100644
--- a/app/helpers/no_results_helper.rb
+++ b/app/helpers/no_results_helper.rb
@@ -53,15 +53,15 @@ def no_results_box(action_url: nil,
display_action: false,
custom_title: nil,
custom_action_text: nil)
- title_text = custom_title || t(".no_results_title_text", cascade: true) || ""
+ title_text = custom_title || t('.no_results_title_text', cascade: true) || ''
action_text = if display_action
- custom_action_text || t(".no_results_content_text")
+ custom_action_text || t('.no_results_content_text')
else
- ""
+ ''
end
- action_url = action_url || ""
+ action_url = action_url || ''
- render partial: "/common/no_results",
+ render partial: '/common/no_results',
locals: {
title_text:,
action_text:,
diff --git a/app/helpers/oauth_helper.rb b/app/helpers/oauth_helper.rb
index 52b85a0a25fe..824be596f1a8 100644
--- a/app/helpers/oauth_helper.rb
+++ b/app/helpers/oauth_helper.rb
@@ -35,7 +35,7 @@ def oauth_scope_translations(application)
if strings.empty?
I18n.t("oauth.scopes.api_v3")
else
- safe_join(strings.map { |scope| I18n.t("oauth.scopes.#{scope}", default: scope) }, "".html_safe)
+ safe_join(strings.map { |scope| I18n.t("oauth.scopes.#{scope}", default: scope) }, ''.html_safe)
end
end
diff --git a/app/helpers/omniauth_helper.rb b/app/helpers/omniauth_helper.rb
index b8507f9b8589..78904124ec5c 100644
--- a/app/helpers/omniauth_helper.rb
+++ b/app/helpers/omniauth_helper.rb
@@ -42,6 +42,6 @@ def omniauth_direct_login?
# If this option is active /login will lead directly to the configured omniauth provider
# and so will a click on 'Sign in' (as opposed to opening the drop down menu).
def direct_login_provider
- OpenProject::Configuration["omniauth_direct_login_provider"]
+ OpenProject::Configuration['omniauth_direct_login_provider']
end
end
diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb
index 95793c3f7be0..72389977c074 100644
--- a/app/helpers/pagination_helper.rb
+++ b/app/helpers/pagination_helper.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "will_paginate"
+require 'will_paginate'
module PaginationHelper
def pagination_links_full(paginator, options = {})
@@ -34,10 +34,10 @@ def pagination_links_full(paginator, options = {})
pagination_options = default_options.merge(options)
- content_tag(:div, class: "op-pagination") do
+ content_tag(:div, class: 'op-pagination') do
content = content_tag(:nav,
pagination_entries(paginator, pagination_options),
- class: "op-pagination--pages")
+ class: 'op-pagination--pages')
if pagination_options[:per_page_links]
content << pagination_option_links(paginator, pagination_options)
@@ -52,7 +52,7 @@ def pagination_option_links(paginator, pagination_options)
pagination_options[:params]
.merge(safe_query_params(%w{filters sortBy expand})))
- content_tag(:div, option_links, class: "op-pagination--options")
+ content_tag(:div, option_links, class: 'op-pagination--options')
end
##
@@ -62,12 +62,12 @@ def pagination_entries(paginator, options)
page_last = paginator.offset + paginator.length
total = paginator.total_entries
- content_tag(:ul, class: "op-pagination--items op-pagination--items_start") do
+ content_tag(:ul, class: 'op-pagination--items op-pagination--items_start') do
# will_paginate will return nil early when no pages available
- content = will_paginate(paginator, options) || ""
+ content = will_paginate(paginator, options) || ''
range = "(#{page_first} - #{page_last}/#{total})"
- content << content_tag(:li, range, class: "op-pagination--range", title: range)
+ content << content_tag(:li, range, class: 'op-pagination--range', title: range)
content.html_safe
end
@@ -80,8 +80,8 @@ def pagination_settings(paginator, options)
if links.size > 1
label = I18n.t(:label_per_page)
- content_tag(:ul, class: "op-pagination--items op-pagination--items_end") do
- content_tag(:li, label + ":", class: "op-pagination--label", title: label) + links
+ content_tag(:ul, class: 'op-pagination--items op-pagination--items_end') do
+ content_tag(:li, label + ':', class: 'op-pagination--label', title: label) + links
end
end
end
@@ -90,12 +90,12 @@ def pagination_settings(paginator, options)
# Constructs the 'n items per page' entries
# determined from available options in the settings.
def per_page_links(paginator, options)
- Setting.per_page_options_array.inject("") do |html, n|
+ Setting.per_page_options_array.inject('') do |html, n|
if n == paginator.per_page
- html + content_tag(:li, n, class: "op-pagination--item op-pagination--item_current")
+ html + content_tag(:li, n, class: 'op-pagination--item op-pagination--item_current')
else
- link = link_to_content_update(n, options.merge(page: 1, per_page: n), { class: "op-pagination--item-link" })
- html + content_tag(:li, link.html_safe, class: "op-pagination--item")
+ link = link_to_content_update(n, options.merge(page: 1, per_page: n), { class: 'op-pagination--item-link' })
+ html + content_tag(:li, link.html_safe, class: 'op-pagination--item')
end
end.html_safe
end
@@ -159,7 +159,7 @@ def per_page_param(options = params)
class LinkRenderer < ::WillPaginate::ActionView::LinkRenderer
def to_html
- pagination.inject("") do |html, item|
+ pagination.inject('') do |html, item|
html + (item.is_a?(Integer) ? page_number(item) : send(item))
end.html_safe
end
@@ -173,33 +173,33 @@ def merge_get_params(url_params)
def page_number(page)
if page == current_page
- tag(:li, page, class: "op-pagination--item op-pagination--item_current")
+ tag(:li, page, class: 'op-pagination--item op-pagination--item_current')
else
- tag(:li, link(page, page, { class: "op-pagination--item-link" }), class: "op-pagination--item")
+ tag(:li, link(page, page, { class: 'op-pagination--item-link' }), class: 'op-pagination--item')
end
end
def gap
- tag(:li, "…", class: "op-pagination--space")
+ tag(:li, '…', class: 'op-pagination--space')
end
def previous_page
num = @collection.current_page > 1 && (@collection.current_page - 1)
- previous_or_next_page(num, I18n.t(:label_previous), "prev")
+ previous_or_next_page(num, I18n.t(:label_previous), 'prev')
end
def next_page
num = @collection.current_page < total_pages && (@collection.current_page + 1)
- previous_or_next_page(num, I18n.t(:label_next), "next")
+ previous_or_next_page(num, I18n.t(:label_next), 'next')
end
def previous_or_next_page(page, text, class_suffix)
if page
tag(:li,
- link(text, page, { class: "op-pagination--item-link op-pagination--item-link_" + class_suffix }),
- class: "op-pagination--item op-pagination--item_" + class_suffix)
+ link(text, page, { class: 'op-pagination--item-link op-pagination--item-link_' + class_suffix }),
+ class: 'op-pagination--item op-pagination--item_' + class_suffix)
else
- ""
+ ''
end
end
diff --git a/app/helpers/password_helper.rb b/app/helpers/password_helper.rb
index fb2f3cf47366..c210329a4f31 100644
--- a/app/helpers/password_helper.rb
+++ b/app/helpers/password_helper.rb
@@ -56,7 +56,7 @@ def password_confirmation_form_tag(url_for_options = {}, options = {}, &)
def password_confirmation_data_attribute(with_data = {})
if password_confirmation_required?
- with_data.merge("request-for-confirmation": true)
+ with_data.merge('request-for-confirmation': true)
else
with_data
end
@@ -84,7 +84,7 @@ def password_active_rules
# Returns a text describing the active password complexity rules,
# the minimum number of rules to adhere to and the total number of rules.
def password_rules_description
- return "" if OpenProject::Passwords::Evaluator.min_adhered_rules == 0
+ return '' if OpenProject::Passwords::Evaluator.min_adhered_rules == 0
OpenProject::Passwords::Evaluator.rules_description_locale(password_active_rules)
end
diff --git a/app/helpers/project_status_helper.rb b/app/helpers/project_status_helper.rb
index c919bb61c825..8510e2d43dbb 100644
--- a/app/helpers/project_status_helper.rb
+++ b/app/helpers/project_status_helper.rb
@@ -29,7 +29,7 @@
module ProjectStatusHelper
def project_status_css_class(status_code)
code = project_status_ensure_default_code(status_code)
- "-" + code.tr("_", "-")
+ '-' + code.tr('_', '-')
end
def project_status_name(status_code)
@@ -38,11 +38,11 @@ def project_status_name(status_code)
end
def project_status_name_for_code(code)
- code ||= "not_set"
- I18n.t("js.grid.widgets.project_status." + code)
+ code ||= 'not_set'
+ I18n.t('js.grid.widgets.project_status.' + code)
end
def project_status_ensure_default_code(status_code)
- status_code || "not_set"
+ status_code || 'not_set'
end
end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 25557a74abec..e69ab162878d 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -35,7 +35,7 @@ module ProjectsHelper
def projects_sort_header_tag(*)
former_criteria = @sort_criteria.criteria.dup
- @sort_criteria.criteria.reject! { |a, _| a == "lft" }
+ @sort_criteria.criteria.reject! { |a, _| a == 'lft' }
sort_header_tag(*)
ensure
@@ -44,7 +44,7 @@ def projects_sort_header_tag(*)
def short_project_description(project, length = 255)
if project.description.blank?
- return ""
+ return ''
end
project.description.gsub(/\A(.{#{length}}[^\n\r]*).*\z/m, '\1...').strip
diff --git a/app/helpers/removed_js_helpers_helper.rb b/app/helpers/removed_js_helpers_helper.rb
index 1d0b68095e3a..0c29d1809af1 100644
--- a/app/helpers/removed_js_helpers_helper.rb
+++ b/app/helpers/removed_js_helpers_helper.rb
@@ -36,7 +36,7 @@ def link_to_function(content, function, html_options = {})
id = html_options.delete(:id) { "link-to-function-#{SecureRandom.uuid}" }
csp_onclick(function, "##{id}")
- content_tag(:a, content, html_options.merge(id:, href: ""))
+ content_tag(:a, content, html_options.merge(id:, href: ''))
end
##
diff --git a/app/helpers/reorder_links_helper.rb b/app/helpers/reorder_links_helper.rb
index 85e48232cbda..efa2463f4787 100644
--- a/app/helpers/reorder_links_helper.rb
+++ b/app/helpers/reorder_links_helper.rb
@@ -31,19 +31,19 @@ def reorder_links(name, url, options = {})
method = options[:method] || :post
content_tag(:span,
- reorder_link(name, url, "highest", "icon-sort-up", t(:label_sort_highest), method) +
- reorder_link(name, url, "higher", "icon-arrow-up2", t(:label_sort_higher), method) +
- reorder_link(name, url, "lower", "icon-arrow-down2", t(:label_sort_lower), method) +
- reorder_link(name, url, "lowest", "icon-sort-down", t(:label_sort_lowest), method),
- class: "reorder-icons")
+ reorder_link(name, url, 'highest', 'icon-sort-up', t(:label_sort_highest), method) +
+ reorder_link(name, url, 'higher', 'icon-arrow-up2', t(:label_sort_higher), method) +
+ reorder_link(name, url, 'lower', 'icon-arrow-down2', t(:label_sort_lower), method) +
+ reorder_link(name, url, 'lowest', 'icon-sort-down', t(:label_sort_lowest), method),
+ class: 'reorder-icons')
end
def reorder_link(name, url, direction, icon_class, label, method)
text = content_tag(:span,
label,
- class: "hidden-for-sighted")
+ class: 'hidden-for-sighted')
icon = content_tag(:span,
- "",
+ '',
class: "icon-context #{icon_class} icon-small")
link_to(text + icon,
url.merge("#{name}[move_to]" => direction),
diff --git a/app/helpers/reports_helper.rb b/app/helpers/reports_helper.rb
index 13f30ad0b890..a2896d9f195f 100644
--- a/app/helpers/reports_helper.rb
+++ b/app/helpers/reports_helper.rb
@@ -32,10 +32,10 @@ module ReportsHelper
def aggregate(data, criteria)
data&.inject(0) do |sum, row|
match = criteria&.all? do |k, v|
- row[k].to_s == v.to_s || (k == "closed" && row[k] == ActiveRecord::Type::Boolean.new.cast(v))
+ row[k].to_s == v.to_s || (k == 'closed' && row[k] == ActiveRecord::Type::Boolean.new.cast(v))
end
- sum += row["total"].to_i if match
+ sum += row['total'].to_i if match
sum
end || 0
@@ -43,6 +43,6 @@ def aggregate(data, criteria)
def aggregate_link(data, criteria, *)
a = aggregate data, criteria
- a.positive? ? link_to(h(a), *) : "-"
+ a.positive? ? link_to(h(a), *) : '-'
end
end
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 0fd7366f5804..151811a6fad9 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -38,7 +38,7 @@ def format_revision(revision)
##
# Format revision commits with plain formatter
def format_revision_text(commit_message)
- format_text(commit_message, format: "plain")
+ format_text(commit_message, format: 'plain')
end
def truncate_at_line_break(text, length = 255)
@@ -47,25 +47,25 @@ def truncate_at_line_break(text, length = 255)
def render_properties(properties)
unless properties.nil? || properties.empty?
- content = ""
+ content = ''
properties.keys.sort.each do |property|
- content << content_tag("li", raw("#{h property} : #{h properties[property]} "))
+ content << content_tag('li', raw("#{h property} : #{h properties[property]} "))
end
- content_tag("ul", content.html_safe, class: "properties")
+ content_tag('ul', content.html_safe, class: 'properties')
end
end
def render_changeset_changes
- changes = @changeset.file_changes.limit(1000).order(Arel.sql("path")).filter_map do |change|
+ changes = @changeset.file_changes.limit(1000).order(Arel.sql('path')).filter_map do |change|
case change.action
- when "A"
+ when 'A'
# Detects moved/copied files
if change.from_path.present?
- action = @changeset.file_changes.detect { |c| c.action == "D" && c.path == change.from_path }
- change.action = action ? "R" : "C"
+ action = @changeset.file_changes.detect { |c| c.action == 'D' && c.path == change.from_path }
+ change.action = action ? 'R' : 'C'
end
change
- when "D"
+ when 'D'
@changeset.file_changes.detect { |c| c.from_path == change.path } ? nil : change
else
change
@@ -75,8 +75,8 @@ def render_changeset_changes
tree = {}
changes.each do |change|
p = tree
- dirs = change.path.to_s.split("/").select { |d| d.present? }
- path = ""
+ dirs = change.path.to_s.split('/').select { |d| d.present? }
+ path = ''
dirs.each do |dir|
path += with_leading_slash(dir)
p[:s] ||= {}
@@ -93,8 +93,8 @@ def render_changeset_changes
# Mapping from internal action to (folder|file)-icon type
def change_action_mapping
{
- "A" => :add,
- "B" => :remove
+ 'A' => :add,
+ 'B' => :remove
}
end
@@ -112,14 +112,14 @@ def calculate_folder_action(tree)
end
def render_changes_tree(tree)
- return "" if tree.nil?
+ return '' if tree.nil?
- output = ""
+ output = ''
tree.keys.sort.each do |file|
- style = "change"
+ style = 'change'
text = File.basename(file)
if s = tree[file][:s]
- style << " folder"
+ style << ' folder'
path_param = without_leading_slash(to_path_param(@repository.relative_path(file)))
text = link_to(h(text),
show_revisions_path_project_repository_path(project_id: @project,
@@ -133,7 +133,7 @@ def render_changes_tree(tree)
style << " change-#{c.action}"
path_param = without_leading_slash(to_path_param(@repository.relative_path(c.path)))
- unless c.action == "D"
+ unless c.action == 'D'
title_text = changes_tree_change_title c.action
text = link_to(h(text),
@@ -145,19 +145,19 @@ def render_changes_tree(tree)
text << raw(" - #{h(c.revision)}") if c.revision.present?
- if c.action == "M"
- text << raw(" (" + link_to(I18n.t(:label_diff),
+ if c.action == 'M'
+ text << raw(' (' + link_to(I18n.t(:label_diff),
diff_revision_project_repository_path(project_id: @project,
repo_path: path_param,
- rev: @changeset.identifier)) + ") ")
+ rev: @changeset.identifier)) + ') ')
end
- text << raw(" " + content_tag("span", h(c.from_path), class: "copied-from")) if c.from_path.present?
+ text << raw(' ' + content_tag('span', h(c.from_path), class: 'copied-from')) if c.from_path.present?
output << changes_tree_li_element(c.action, text, style)
end
end
- output << " "
+ output << ' '
output.html_safe
end
@@ -166,7 +166,7 @@ def to_utf8_for_repositories(str)
str = to_utf8_internal(str)
if str.respond_to?(:force_encoding)
- str.force_encoding("UTF-8")
+ str.force_encoding('UTF-8')
end
str
end
@@ -175,17 +175,17 @@ def to_utf8_internal(str)
return str if str.nil?
if str.respond_to?(:force_encoding)
- str.force_encoding("ASCII-8BIT")
+ str.force_encoding('ASCII-8BIT')
end
return str if str.empty?
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match?(str) # for us-ascii
if str.respond_to?(:force_encoding)
- str.force_encoding("UTF-8")
+ str.force_encoding('UTF-8')
end
- @encodings ||= Setting.repositories_encodings.split(",").map(&:strip)
+ @encodings ||= Setting.repositories_encodings.split(',').map(&:strip)
@encodings.each do |encoding|
- return str.to_s.encode("UTF-8", encoding)
+ return str.to_s.encode('UTF-8', encoding)
rescue Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError
# do nothing here and try the next encoding
end
@@ -198,15 +198,15 @@ def replace_invalid_utf8(str)
return str if str.nil?
if str.respond_to?(:force_encoding)
- str.force_encoding("UTF-8")
+ str.force_encoding('UTF-8')
if !str.valid_encoding?
str = str.encode("US-ASCII", invalid: :replace,
- undef: :replace, replace: "?").encode("UTF-8")
+ undef: :replace, replace: '?').encode("UTF-8")
end
else
# removes invalid UTF8 sequences
begin
- (str + " ").encode("UTF-8", invalid: :replace, undef: :replace, replace: "?")[0..-3]
+ (str + ' ').encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')[0..-3]
rescue Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError
end
end
@@ -234,29 +234,29 @@ def scm_options(repository = nil)
def default_selected_option
[
"--- #{I18n.t(:actionview_instancetag_blank_option)} ---",
- "",
+ '',
{ disabled: true, selected: true }
]
end
def scm_vendor_tag(repository)
# rubocop:disable Rails/HelperInstanceVariable
- url = url_for(controller: "/projects/settings/repository", action: "show", id: @project.id)
+ url = url_for(controller: '/projects/settings/repository', action: 'show', id: @project.id)
# rubocop:enable Rails/HelperInstanceVariable
#
- select_tag("scm_vendor",
+ select_tag('scm_vendor',
scm_options(repository),
- class: "form--select",
+ class: 'form--select',
data: {
url:,
- action: "repository-settings#updateSelectedType",
- "repository-settings-target": "scmVendor"
+ action: 'repository-settings#updateSelectedType',
+ 'repository-settings-target': 'scmVendor'
},
disabled: repository && !repository.new_record?)
end
def git_path_encoding_options(repository)
- default = repository.new_record? ? "UTF-8" : repository.path_encoding
+ default = repository.new_record? ? 'UTF-8' : repository.path_encoding
options_for_select(Setting::ENCODINGS, default)
end
@@ -270,22 +270,22 @@ def show_settings_save_button?(_repository)
end
def with_leading_slash(path)
- path.to_s.starts_with?("/") ? path : "/#{path}"
+ path.to_s.starts_with?('/') ? path : "/#{path}"
end
def without_leading_slash(path)
- path.gsub(%r{\A/+}, "")
+ path.gsub(%r{\A/+}, '')
end
def changes_tree_change_title(action)
case action
- when "A"
+ when 'A'
I18n.t(:label_added)
- when "D"
+ when 'D'
I18n.t(:label_deleted)
- when "C"
+ when 'C'
I18n.t(:label_copied)
- when "R"
+ when 'R'
I18n.t(:label_renamed)
else
I18n.t(:label_modified)
@@ -294,16 +294,16 @@ def changes_tree_change_title(action)
def changes_tree_li_element(action, text, style)
icon_name = case action
- when "A"
- "icon-add"
- when "D"
- "icon-delete"
- when "C"
- "icon-copy"
- when "R"
- "icon-rename"
+ when 'A'
+ 'icon-add'
+ when 'D'
+ 'icon-delete'
+ when 'C'
+ 'icon-copy'
+ when 'R'
+ 'icon-rename'
else
- "icon-arrow-left-right"
+ 'icon-arrow-left-right'
end
" ")
+ .gsub(/[\r\n]+/, ' ')
else
stripped_text
end
diff --git a/app/helpers/toolbar_helper.rb b/app/helpers/toolbar_helper.rb
index b8ec2dec5ab4..f5642ab5f45f 100644
--- a/app/helpers/toolbar_helper.rb
+++ b/app/helpers/toolbar_helper.rb
@@ -2,32 +2,32 @@ module ToolbarHelper
include ERB::Util
include ActionView::Helpers::OutputSafetyHelper
- def toolbar(title:, title_extra: nil, title_class: nil, subtitle: "", link_to: nil, html: {})
- classes = ["toolbar-container", html[:class]].compact.join(" ")
+ def toolbar(title:, title_extra: nil, title_class: nil, subtitle: '', link_to: nil, html: {})
+ classes = ['toolbar-container', html[:class]].compact.join(' ')
content_tag :div, class: classes do
- toolbar = content_tag :div, class: "toolbar" do
+ toolbar = content_tag :div, class: 'toolbar' do
dom_title(title, link_to, title_class:, title_extra:) + dom_toolbar do
yield if block_given?
end
end
next toolbar if subtitle.blank?
- toolbar + content_tag(:p, subtitle, class: "subtitle")
+ toolbar + content_tag(:p, subtitle, class: 'subtitle')
end
end
def editable_toolbar(form:, field_name:, html: {})
- container_classes = ["toolbar-container -editable", html[:class]].compact.join(" ")
+ container_classes = ['toolbar-container -editable', html[:class]].compact.join(' ')
content_tag :div, class: container_classes do
- content_tag :div, class: "toolbar" do
+ content_tag :div, class: 'toolbar' do
concat(editable_toolbar_title(form, field_name))
concat(dom_toolbar { yield if block_given? })
end
end
end
- def breadcrumb_toolbar(*elements, subtitle: "", html: {}, &)
- toolbar(title: safe_join(elements, " » ".html_safe), subtitle:, html:, &)
+ def breadcrumb_toolbar(*elements, subtitle: '', html: {}, &)
+ toolbar(title: safe_join(elements, ' » '.html_safe), subtitle:, html:, &)
end
protected
@@ -35,12 +35,12 @@ def breadcrumb_toolbar(*elements, subtitle: "", html: {}, &)
def editable_toolbar_title(form, field_name)
new_element = form.object.new_record?
- content_tag :div, class: "title-container" do
+ content_tag :div, class: 'title-container' do
form.text_field field_name,
- class: "toolbar--editable-toolbar -border-on-hover-only",
+ class: 'toolbar--editable-toolbar -border-on-hover-only',
placeholder: t(:label_page_title),
- "aria-label": t(:label_page_title),
- autocomplete: "off",
+ 'aria-label': t(:label_page_title),
+ autocomplete: 'off',
required: true,
autofocus: new_element,
no_label: true
@@ -48,28 +48,28 @@ def editable_toolbar_title(form, field_name)
end
def dom_title(raw_title, link_to = nil, title_class: nil, title_extra: nil)
- title = "".html_safe
+ title = ''.html_safe
title << raw_title
if link_to.present?
- title << ": "
+ title << ': '
title << link_to
end
- content_tag :div, class: "title-container" do
+ content_tag :div, class: 'title-container' do
opts = {}
opts[:class] = title_class if title_class.present?
content_tag(:h2, title, opts) + (
- title_extra.presence || ""
+ title_extra.presence || ''
)
end
end
def dom_toolbar(&)
- return "" unless block_given?
+ return '' unless block_given?
- content_tag(:ul, class: "toolbar-items", &)
+ content_tag(:ul, class: 'toolbar-items', &)
end
end
diff --git a/app/helpers/tooltip_helper.rb b/app/helpers/tooltip_helper.rb
index bb81bdd0d59b..50c2a277a536 100644
--- a/app/helpers/tooltip_helper.rb
+++ b/app/helpers/tooltip_helper.rb
@@ -36,7 +36,7 @@ module TooltipHelper
# @param placement [string] placement (top, left, right, bottom)
# @param span_classes [string] Additional classes on the span
# @param icon [string] icon class
- def tooltip_tag(text, placement: "left", icon: "icon-help", span_classes: nil)
+ def tooltip_tag(text, placement: 'left', icon: 'icon-help', span_classes: nil)
content_tag :span,
class: "tooltip--#{placement} #{span_classes}",
data: { tooltip: text } do
diff --git a/app/helpers/types_helper.rb b/app/helpers/types_helper.rb
index dd28b3e603db..c0772e72fb77 100644
--- a/app/helpers/types_helper.rb
+++ b/app/helpers/types_helper.rb
@@ -30,22 +30,22 @@ module ::TypesHelper
def types_tabs
[
{
- name: "settings",
- partial: "types/form/settings",
+ name: 'settings',
+ partial: 'types/form/settings',
path: edit_type_tab_path(id: @type.id, tab: :settings),
- label: "types.edit.settings"
+ label: 'types.edit.settings'
},
{
- name: "form_configuration",
- partial: "types/form/form_configuration",
+ name: 'form_configuration',
+ partial: 'types/form/form_configuration',
path: edit_type_tab_path(id: @type.id, tab: :form_configuration),
- label: "types.edit.form_configuration"
+ label: 'types.edit.form_configuration'
},
{
- name: "projects",
- partial: "types/form/projects",
+ name: 'projects',
+ partial: 'types/form/projects',
path: edit_type_tab_path(id: @type.id, tab: :projects),
- label: "types.edit.projects"
+ label: 'types.edit.projects'
}
]
end
@@ -54,18 +54,18 @@ def icon_for_type(type)
return unless type
css_class = if type.is_milestone?
- "color--milestone-icon"
+ 'color--milestone-icon'
else
- "color--phase-icon"
+ 'color--phase-icon'
end
color = if type.color.present?
type.color.hexcode
else
- "#CCC"
+ '#CCC'
end
- content_tag(:span, " ",
+ content_tag(:span, ' ',
class: css_class,
style: "background-color: #{color}")
end
diff --git a/app/helpers/user_consent_helper.rb b/app/helpers/user_consent_helper.rb
index b4ca59ecc3ed..66d5a6dafbe8 100644
--- a/app/helpers/user_consent_helper.rb
+++ b/app/helpers/user_consent_helper.rb
@@ -49,14 +49,14 @@ def user_consent_instructions(locale)
end
def consent_checkbox_label(locale: I18n.locale)
- I18n.t("consent.checkbox_label", locale:)
+ I18n.t('consent.checkbox_label', locale:)
end
private
def consent_configured?
if Setting.consent_info.count == 0
- Rails.logger.error "Instance is configured to require consent, but no consent_info has been set."
+ Rails.logger.error 'Instance is configured to require consent, but no consent_info has been set.'
false
else
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 9fb5c90c194c..a6615893d604 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -49,11 +49,11 @@ def translate_user_status(status_name)
# Format user status, including brute force prevention status
def full_user_status(user, include_num_failed_logins = false)
- user_status = ""
+ user_status = ''
unless user.active?
user_status = translate_user_status(user.status)
end
- brute_force_status = ""
+ brute_force_status = ''
if user.failed_too_many_recent_login_attempts?
format = include_num_failed_logins ? :blocked_num_failed_logins : :blocked
brute_force_status = I18n.t(format,
@@ -63,7 +63,7 @@ def full_user_status(user, include_num_failed_logins = false)
both_statuses = user_status + brute_force_status
if user_status.present? and brute_force_status.present?
- I18n.t("user.status_user_and_brute_force",
+ I18n.t('user.status_user_and_brute_force',
user: user_status,
brute_force: brute_force_status)
elsif not both_statuses.empty?
@@ -75,13 +75,13 @@ def full_user_status(user, include_num_failed_logins = false)
STATUS_CHANGE_ACTIONS = {
# status, blocked => [[button_title, button_name], ...]
- [:active, false] => [[:lock, "lock"]],
- [:active, true] => [[:reset_failed_logins, "unlock"],
- [:lock, "lock"]],
- [:locked, false] => [[:unlock, "unlock"]],
- [:locked, true] => [[:unlock_and_reset_failed_logins, "unlock"]],
- [:registered, false] => [[:activate, "activate"]],
- [:registered, true] => [[:activate_and_reset_failed_logins, "activate"]]
+ [:active, false] => [[:lock, 'lock']],
+ [:active, true] => [[:reset_failed_logins, 'unlock'],
+ [:lock, 'lock']],
+ [:locked, false] => [[:unlock, 'unlock']],
+ [:locked, true] => [[:unlock_and_reset_failed_logins, 'unlock']],
+ [:registered, false] => [[:activate, 'activate']],
+ [:registered, true] => [[:activate_and_reset_failed_logins, 'activate']]
}
# Create buttons to lock/unlock a user and reset failed logins
@@ -89,29 +89,29 @@ def build_change_user_status_action(user)
status = user.status.to_sym
blocked = !!user.failed_too_many_recent_login_attempts?
- result = "".html_safe
+ result = ''.html_safe
(STATUS_CHANGE_ACTIONS[[status, blocked]] || []).each do |title, name|
- result << ((yield I18n.t(title, scope: :user), name) + " ".html_safe)
+ result << ((yield I18n.t(title, scope: :user), name) + ' '.html_safe)
end
result
end
def change_user_status_buttons(user)
build_change_user_status_action(user) do |title, name|
- submit_tag(title, name:, class: "button")
+ submit_tag(title, name:, class: 'button')
end
end
def change_user_status_links(user)
icons = {
- "unlock" => "unlocked",
- "activate" => "unlocked",
- "lock" => "locked"
+ 'unlock' => 'unlocked',
+ 'activate' => 'unlocked',
+ 'lock' => 'locked'
}
build_change_user_status_action(user) do |title, name|
link_to title,
change_status_user_path(user,
- name.to_sym => "1",
+ name.to_sym => '1',
back_url: request.fullpath),
method: :post,
class: "icon icon-#{icons[name]}"
@@ -123,7 +123,7 @@ def visible_user_information?(user)
end
def user_name(user)
- user ? user.name : I18n.t("user.deleted")
+ user ? user.name : I18n.t('user.deleted')
end
def allowed_management_user_profile_path(user)
diff --git a/app/helpers/warning_bar_helper.rb b/app/helpers/warning_bar_helper.rb
index d8aab4e8dc4e..2fb79735d329 100644
--- a/app/helpers/warning_bar_helper.rb
+++ b/app/helpers/warning_bar_helper.rb
@@ -50,15 +50,15 @@ def setting_protocol_mismatched?
end
def setting_hostname_mismatched?
- Setting.host_name.gsub(/:\d+$/, "") != request.host
+ Setting.host_name.gsub(/:\d+$/, '') != request.host
end
def no_workflow_for_wp_edit_role?
- workflow_exists = OpenProject::Cache.read("no_wp_share_editor_workflow")
+ workflow_exists = OpenProject::Cache.read('no_wp_share_editor_workflow')
if workflow_exists.nil?
workflow_exists = Workflow.exists?(role_id: Role.where(builtin: Role::BUILTIN_WORK_PACKAGE_EDITOR).select(:id))
- OpenProject::Cache.write("no_wp_share_editor_workflow", workflow_exists) if workflow_exists
+ OpenProject::Cache.write('no_wp_share_editor_workflow', workflow_exists) if workflow_exists
end
!workflow_exists
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index 286e352ae4b3..b34c6ac1f456 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -30,25 +30,25 @@ module WatchersHelper
# Create a link to watch/unwatch object
#
# * :replace - a string or array of strings with css selectors that will be updated, whenever the watcher status is changed
- def watcher_link(object, user, options = { replace: ".watcher_link", class: "watcher_link" })
+ def watcher_link(object, user, options = { replace: '.watcher_link', class: 'watcher_link' })
options = options.with_indifferent_access
- raise ArgumentError, "Missing :replace option in options hash" if options["replace"].blank?
+ raise ArgumentError, 'Missing :replace option in options hash' if options['replace'].blank?
- return "" unless user&.logged? && object.respond_to?(:watched_by?)
+ return '' unless user&.logged? && object.respond_to?(:watched_by?)
watched = object.watched_by?(user)
html_options = options
path = send(:"#{(watched ? 'unwatch' : 'watch')}_path", object_type: object.class.to_s.underscore.pluralize,
object_id: object.id,
- replace: options.delete("replace"))
- html_options[:class] = html_options[:class].to_s + " button"
+ replace: options.delete('replace'))
+ html_options[:class] = html_options[:class].to_s + ' button'
method = watched ? :delete : :post
label = watched ? I18n.t(:button_unwatch) : I18n.t(:button_watch)
- link_to(content_tag(:i, "", class: watched ? "button--icon icon-watched" : " button--icon icon-unwatched") + " " +
- content_tag(:span, label, class: "button--text"), path, html_options.merge(method:))
+ link_to(content_tag(:i, '', class: watched ? 'button--icon icon-watched' : ' button--icon icon-unwatched') + ' ' +
+ content_tag(:span, label, class: 'button--text'), path, html_options.merge(method:))
end
end
diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb
index ee894ddfd828..ae03e0c18f15 100644
--- a/app/helpers/wiki_helper.rb
+++ b/app/helpers/wiki_helper.rb
@@ -31,7 +31,7 @@ def wiki_page_options_for_select(pages,
ids: true,
placeholder: true)
s = if placeholder
- [["-- #{t('label_no_parent_page')} --", ""]]
+ [["-- #{t('label_no_parent_page')} --", '']]
else
[]
end
@@ -59,7 +59,7 @@ def breadcrumb_for_page(page, action = nil)
end
def nl2br(content)
- content.gsub(/(?:\n\r?|\r\n?)/, " ").html_safe
+ content.gsub(/(?:\n\r?|\r\n?)/, ' ').html_safe
end
private
@@ -78,7 +78,7 @@ def wiki_page_options_for_select_of_level(pages,
end
def wiki_page_option(page, level, ids)
- indent = level.positive? ? ((" " * level * 2) + "» ") : ""
+ indent = level.positive? ? ((' ' * level * 2) + '» ') : ''
id = ids ? page.id : page.title
[(indent + h(page.title)).html_safe, id]
end
diff --git a/app/helpers/wiki_pages/at_version.rb b/app/helpers/wiki_pages/at_version.rb
index e7701291ba98..7326b9bdfb60 100644
--- a/app/helpers/wiki_pages/at_version.rb
+++ b/app/helpers/wiki_pages/at_version.rb
@@ -56,7 +56,7 @@ def initialize(wiki_page, version = nil)
# rubocop:disable Style/OptionalBooleanParameter
# Overwriting a superclass method.
def respond_to?(method_name, include_all = false)
- if method_name.to_s == "to_model"
+ if method_name.to_s == 'to_model'
false
else
super
diff --git a/app/helpers/work_packages_controller_helper.rb b/app/helpers/work_packages_controller_helper.rb
index 55d1fa6335ce..dc1b985694eb 100644
--- a/app/helpers/work_packages_controller_helper.rb
+++ b/app/helpers/work_packages_controller_helper.rb
@@ -52,7 +52,7 @@ def load_and_validate_query
unless @query.valid?
# Ensure outputting an html response
- request.format = "html"
+ request.format = 'html'
render_400(message: @query.errors.full_messages.join(". "))
end
rescue ActiveRecord::RecordNotFound
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index fb1a258d38ec..2253c19f6e47 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -27,7 +27,7 @@
#++
class ApplicationMailer < ActionMailer::Base
- layout "mailer"
+ layout 'mailer'
helper :application, # for format_text
:work_packages, # for css classes
@@ -56,7 +56,7 @@ def host
if OpenProject::Configuration.rails_relative_url_root.blank?
Setting.host_name
else
- Setting.host_name.to_s.gsub(%r{/.*\z}, "")
+ Setting.host_name.to_s.gsub(%r{/.*\z}, '')
end
end
@@ -87,7 +87,7 @@ def mail(headers = {}, &block)
# Because of this, the message id and the value affected by it (In-Reply-To) is not relied upon when an email response
# is handled by OpenProject.
def message_id(object, user)
- headers["Message-ID"] = "<#{message_id_value(object, user)}>"
+ headers['Message-ID'] = "<#{message_id_value(object, user)}>"
end
# Sets a References header.
@@ -105,7 +105,7 @@ def references(*objects)
end
end
- headers["References"] = refs.join(" ")
+ headers['References'] = refs.join(' ')
end
# Prepends given fields with 'X-OpenProject-' to save some duplication
@@ -142,12 +142,12 @@ def message_id_value(object, recipient)
else
"#{object.class.name.demodulize.underscore}-#{object.id}"
end
- hash = "op" \
- "." \
+ hash = 'op' \
+ '.' \
"#{object_reference}" \
- "." \
+ '.' \
"#{Time.current.strftime('%Y%m%d%H%M%S')}" \
- "." \
+ '.' \
"#{recipient.id}"
"#{hash}@#{header_host_value}"
@@ -162,15 +162,15 @@ def message_id_value(object, recipient)
# It in fact is aimed not not so that similar messages (i.e. those belonging to the same
# work package and journal) end up being grouped together.
def references_value(object)
- hash = "op" \
- "." \
+ hash = 'op' \
+ '.' \
"#{object.class.name.demodulize.underscore}-#{object.id}"
"#{hash}@#{header_host_value}"
end
def header_host_value
- host = Setting.mail_from.to_s.gsub(%r{\A.*@}, "")
+ host = Setting.mail_from.to_s.gsub(%r{\A.*@}, '')
host = "#{::Socket.gethostname}.openproject" if host.empty?
host
end
diff --git a/app/mailers/digest_mailer.rb b/app/mailers/digest_mailer.rb
index 90bbb5e8cd0f..ee49040dcd28 100644
--- a/app/mailers/digest_mailer.rb
+++ b/app/mailers/digest_mailer.rb
@@ -45,7 +45,7 @@ class DigestMailer < ApplicationMailer
class << self
def generate_message_id(_, user)
hash = "openproject.digest-#{user.id}-#{Time.current.strftime('%Y%m%d%H%M%S')}"
- host = Setting.mail_from.to_s.gsub(%r{\A.*@}, "")
+ host = Setting.mail_from.to_s.gsub(%r{\A.*@}, '')
host = "#{::Socket.gethostname}.openproject" if host.empty?
"#{hash}@#{host}"
end
@@ -55,7 +55,7 @@ def work_packages(recipient_id, notification_ids)
recipient = User.find(recipient_id)
open_project_headers User: recipient.name
- message_id "digest", recipient
+ message_id 'digest', recipient
@user = recipient
@notification_ids = notification_ids
diff --git a/app/mailers/interceptors/default_headers.rb b/app/mailers/interceptors/default_headers.rb
index 7c585e61b3e7..d087f704b126 100644
--- a/app/mailers/interceptors/default_headers.rb
+++ b/app/mailers/interceptors/default_headers.rb
@@ -8,11 +8,11 @@ def delivering_email(mail)
def default_headers
{
- "X-Mailer" => "OpenProject",
- "X-OpenProject-Host" => Setting.host_name,
- "X-OpenProject-Site" => Setting.app_title,
- "Precedence" => "bulk",
- "Auto-Submitted" => "auto-generated"
+ 'X-Mailer' => 'OpenProject',
+ 'X-OpenProject-Host' => Setting.host_name,
+ 'X-OpenProject-Site' => Setting.app_title,
+ 'Precedence' => 'bulk',
+ 'Auto-Submitted' => 'auto-generated'
}
end
end
diff --git a/app/mailers/member_mailer.rb b/app/mailers/member_mailer.rb
index c118b4d3460a..704638ef949d 100644
--- a/app/mailers/member_mailer.rb
+++ b/app/mailers/member_mailer.rb
@@ -44,21 +44,21 @@ class MemberMailer < ApplicationMailer
def added_project(current_user, member, message)
alter_project(current_user,
member,
- in_member_locale(member) { I18n.t(:"mail_member_added_project.subject", project: member.project.name) },
+ in_member_locale(member) { I18n.t(:'mail_member_added_project.subject', project: member.project.name) },
message)
end
def updated_project(current_user, member, message)
alter_project(current_user,
member,
- in_member_locale(member) { I18n.t(:"mail_member_updated_project.subject", project: member.project.name) },
+ in_member_locale(member) { I18n.t(:'mail_member_updated_project.subject', project: member.project.name) },
message)
end
def updated_global(current_user, member, message)
send_mail(current_user,
member,
- in_member_locale(member) { I18n.t(:"mail_member_updated_global.subject") },
+ in_member_locale(member) { I18n.t(:'mail_member_updated_global.subject') },
message)
end
diff --git a/app/mailers/project_mailer.rb b/app/mailers/project_mailer.rb
index 4ca7351a9433..4cf9fc897e3b 100644
--- a/app/mailers/project_mailer.rb
+++ b/app/mailers/project_mailer.rb
@@ -36,7 +36,7 @@ def delete_project_completed(project, user:, dependent_projects: [])
@dependent_projects = dependent_projects
send_localized_mail(user) do
- I18n.t("projects.delete.completed", name: project.name)
+ I18n.t('projects.delete.completed', name: project.name)
end
end
@@ -48,7 +48,7 @@ def delete_project_failed(project, user:)
@project = project
send_localized_mail(user) do
- I18n.t("projects.delete.failed", name: project.name)
+ I18n.t('projects.delete.failed', name: project.name)
end
end
@@ -57,13 +57,13 @@ def copy_project_failed(user, source_project, target_project_name, errors)
@target_project_name = target_project_name
@errors = errors
- open_project_headers "Source-Project" => source_project.identifier,
- "Author" => user.login
+ open_project_headers 'Source-Project' => source_project.identifier,
+ 'Author' => user.login
message_id source_project, user
send_localized_mail(user) do
- I18n.t("copy_project.failed", source_project_name: source_project.name)
+ I18n.t('copy_project.failed', source_project_name: source_project.name)
end
end
@@ -72,14 +72,14 @@ def copy_project_succeeded(user, source_project, target_project, errors)
@target_project = target_project
@errors = errors
- open_project_headers "Source-Project" => source_project.identifier,
- "Target-Project" => target_project.identifier,
- "Author" => user.login
+ open_project_headers 'Source-Project' => source_project.identifier,
+ 'Target-Project' => target_project.identifier,
+ 'Author' => user.login
message_id target_project, user
send_localized_mail(user) do
- I18n.t("copy_project.succeeded", target_project_name: target_project.name)
+ I18n.t('copy_project.succeeded', target_project_name: target_project.name)
end
end
end
diff --git a/app/mailers/sharing_mailer.rb b/app/mailers/sharing_mailer.rb
index d01efe5a9169..267146dc050e 100644
--- a/app/mailers/sharing_mailer.rb
+++ b/app/mailers/sharing_mailer.rb
@@ -21,7 +21,7 @@ def shared_work_package(sharer, membership, group = nil)
message_id(membership, sharer)
send_localized_mail(@shared_with_user) do
- I18n.t("mail.sharing.work_packages.subject", id: @work_package.id)
+ I18n.t('mail.sharing.work_packages.subject', id: @work_package.id)
end
end
@@ -30,7 +30,7 @@ def shared_work_package(sharer, membership, group = nil)
def optionally_activated_url(back_url, invitation_token)
return back_url unless invitation_token
- url_for(controller: "/account",
+ url_for(controller: '/account',
action: :activate,
token: invitation_token.value,
back_url:)
@@ -39,11 +39,11 @@ def optionally_activated_url(back_url, invitation_token)
def derive_role_rights(role)
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- I18n.t("work_package.sharing.permissions.edit")
+ I18n.t('work_package.sharing.permissions.edit')
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- I18n.t("work_package.sharing.permissions.comment")
+ I18n.t('work_package.sharing.permissions.comment')
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- I18n.t("work_package.sharing.permissions.view")
+ I18n.t('work_package.sharing.permissions.view')
end
end
@@ -51,22 +51,22 @@ def derive_allowed_work_package_actions(role)
allowed_actions =
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- [I18n.t("work_package.sharing.permissions.view"),
- I18n.t("work_package.sharing.permissions.comment"),
- I18n.t("work_package.sharing.permissions.edit")]
+ [I18n.t('work_package.sharing.permissions.view'),
+ I18n.t('work_package.sharing.permissions.comment'),
+ I18n.t('work_package.sharing.permissions.edit')]
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- [I18n.t("work_package.sharing.permissions.view"),
- I18n.t("work_package.sharing.permissions.comment")]
+ [I18n.t('work_package.sharing.permissions.view'),
+ I18n.t('work_package.sharing.permissions.comment')]
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- [I18n.t("work_package.sharing.permissions.view")]
+ [I18n.t('work_package.sharing.permissions.view')]
end
allowed_actions.map(&:downcase)
end
def set_open_project_headers(work_package)
- open_project_headers "Project" => work_package.project.identifier,
- "WorkPackage-Id" => work_package.id,
- "Type" => "WorkPackage"
+ open_project_headers 'Project' => work_package.project.identifier,
+ 'WorkPackage-Id' => work_package.id,
+ 'Type' => 'WorkPackage'
end
end
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index 3838cecfdcfb..8e77d0f0a0b1 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -32,9 +32,9 @@ class UserMailer < ApplicationMailer
helper_method :message_url
def test_mail(user)
- @welcome_url = url_for(controller: "/homescreen")
+ @welcome_url = url_for(controller: '/homescreen')
- open_project_headers "Type" => "Test"
+ open_project_headers 'Type' => 'Test'
send_localized_mail(user) { "#{Setting.app_title} Test" }
end
@@ -57,11 +57,11 @@ def password_lost(token)
return unless token.user # token's can have no user
@token = token
- @reset_password_url = url_for(controller: "/account",
+ @reset_password_url = url_for(controller: '/account',
action: :lost_password,
token: @token.value)
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
send_localized_mail(token.user) { I18n.t(:mail_subject_lost_password, value: Setting.app_title) }
end
@@ -74,21 +74,21 @@ def password_change_not_possible(user)
else
user.authentication_provider
end
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
- send_localized_mail(user) { I18n.t("mail_password_change_not_possible.title") }
+ send_localized_mail(user) { I18n.t('mail_password_change_not_possible.title') }
end
def news_added(user, news)
@news = news
- open_project_headers "Type" => "News"
- open_project_headers "Project" => @news.project.identifier if @news.project
+ open_project_headers 'Type' => 'News'
+ open_project_headers 'Project' => @news.project.identifier if @news.project
message_id @news, user
references @news
- project = @news.project ? "#{@news.project.name}] " : ""
+ project = @news.project ? "#{@news.project.name}] " : ''
send_localized_mail(user) { "#{project}#{News.model_name.human}: #{@news.title}" }
end
@@ -97,11 +97,11 @@ def user_signed_up(token)
@user = token.user
@token = token
- @activation_url = url_for(controller: "/account",
+ @activation_url = url_for(controller: '/account',
action: :activate,
token: @token.value)
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
send_localized_mail(token.user) { I18n.t(:mail_subject_register, value: Setting.app_title) }
end
@@ -110,14 +110,14 @@ def news_comment_added(user, comment)
@comment = comment
@news = @comment.commented
- open_project_headers "Project" => @news.project.identifier if @news.project
+ open_project_headers 'Project' => @news.project.identifier if @news.project
message_id @comment, user
references @news, @comment
subject = "#{News.model_name.human}: #{@news.title}"
- project = @news.project ? "#{@news.project.name}] " : ""
+ project = @news.project ? "#{@news.project.name}] " : ''
send_localized_mail(user) do
"Re: #{project}#{subject}"
end
@@ -136,7 +136,7 @@ def wiki_page_added(user, wiki_page)
def wiki_page_updated(user, wiki_page)
@wiki_page = wiki_page
- @wiki_diff_url = url_for(controller: "/wiki",
+ @wiki_diff_url = url_for(controller: '/wiki',
action: :diff,
project_id: wiki_page.project,
id: wiki_page.slug,
@@ -165,7 +165,7 @@ def message_posted(user, message)
def account_activated(user)
@user = user
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
send_localized_mail(user) { t(:mail_subject_register, value: Setting.app_title) }
end
@@ -174,19 +174,19 @@ def account_information(user, password)
@user = user
@password = password
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
send_localized_mail(user) { t(:mail_subject_register, value: Setting.app_title) }
end
def account_activation_requested(admin, user)
@user = user
- @activation_url = url_for(controller: "/users",
+ @activation_url = url_for(controller: '/users',
action: :index,
- status: "registered",
- sort: "created_at:desc")
+ status: 'registered',
+ sort: 'created_at:desc')
- open_project_headers "Type" => "Account"
+ open_project_headers 'Type' => 'Account'
send_localized_mail(admin) { t(:mail_subject_account_activation_request, value: Setting.app_title) }
end
@@ -217,8 +217,8 @@ def incoming_email_error(user, mail, logs)
@incoming_text = mail[:text]
@quote = mail[:quote]
- headers["References"] = ["<#{mail[:message_id]}>"]
- headers["In-Reply-To"] = ["<#{mail[:message_id]}>"]
+ headers['References'] = ["<#{mail[:message_id]}>"]
+ headers['In-Reply-To'] = ["<#{mail[:message_id]}>"]
send_localized_mail(user) do
mail[:subject].present? ? "Re: #{mail[:subject]}" : I18n.t("mail_subject_incoming_email_error")
@@ -228,14 +228,14 @@ def incoming_email_error(user, mail, logs)
private
def open_project_wiki_headers(wiki_page)
- open_project_headers "Project" => wiki_page.project.identifier,
- "Wiki-Page-Id" => wiki_page.id,
- "Type" => "Wiki"
+ open_project_headers 'Project' => wiki_page.project.identifier,
+ 'Wiki-Page-Id' => wiki_page.id,
+ 'Type' => 'Wiki'
end
def open_project_message_headers(message)
- open_project_headers "Project" => message.project.identifier,
- "Message-Id" => message.parent_id || message.id,
- "Type" => "Forum"
+ open_project_headers 'Project' => message.project.identifier,
+ 'Message-Id' => message.parent_id || message.id,
+ 'Type' => 'Forum'
end
end
diff --git a/app/models/actions/scopes/default.rb b/app/models/actions/scopes/default.rb
index 18eeea9417bb..a98eeb9a7ca7 100644
--- a/app/models/actions/scopes/default.rb
+++ b/app/models/actions/scopes/default.rb
@@ -39,7 +39,7 @@ def default
SQL
unscoped # prevent triggering the default scope again
- .select("actions.*")
+ .select('actions.*')
.from(actions_sql)
end
end
@@ -51,7 +51,7 @@ def action_map
.contract_actions_map
.map { |permission, v| map_actions(permission, **v) }
.flatten
- .join(", ")
+ .join(', ')
end
def map_actions(permission, actions:, global:, module_name:, grant_to_admin:, public:)
@@ -61,10 +61,10 @@ def map_actions(permission, actions:, global:, module_name:, grant_to_admin:, pu
quote_string("#{action_v3_name(namespace)}/#{action}"),
quote_string(permission),
global,
- module_name ? quote_string(module_name) : "NULL",
+ module_name ? quote_string(module_name) : 'NULL',
grant_to_admin,
public
- ].join(", ")
+ ].join(', ')
"(#{values})"
end
diff --git a/app/models/activities/changeset_activity_provider.rb b/app/models/activities/changeset_activity_provider.rb
index 395e5b89e5c4..4d3bee979e46 100644
--- a/app/models/activities/changeset_activity_provider.rb
+++ b/app/models/activities/changeset_activity_provider.rb
@@ -27,7 +27,7 @@
#++
class Activities::ChangesetActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "changesets",
+ activity_provider_for type: 'changesets',
permission: :view_changesets
def extend_event_query(query)
@@ -36,11 +36,11 @@ def extend_event_query(query)
def event_query_projection
[
- activity_journal_projection_statement(:revision, "revision"),
- activity_journal_projection_statement(:comments, "comments"),
- activity_journal_projection_statement(:committed_on, "committed_on"),
- projection_statement(repositories_table, :project_id, "project_id"),
- projection_statement(repositories_table, :type, "repository_type")
+ activity_journal_projection_statement(:revision, 'revision'),
+ activity_journal_projection_statement(:comments, 'comments'),
+ activity_journal_projection_statement(:committed_on, 'committed_on'),
+ projection_statement(repositories_table, :project_id, 'project_id'),
+ projection_statement(repositories_table, :type, 'repository_type')
]
end
@@ -66,24 +66,24 @@ def filter_for_event_datetime(query, from, to)
protected
def event_type(_event)
- "changeset"
+ 'changeset'
end
def event_title(event)
revision = format_revision(event)
- short_comment = split_comment(event["comments"]).first
+ short_comment = split_comment(event['comments']).first
title = "#{I18n.t(:label_revision)} #{revision}"
- title << (short_comment.blank? ? "" : (": " + short_comment))
+ title << (short_comment.blank? ? '' : (': ' + short_comment))
end
def event_description(event)
- split_comment(event["comments"]).last
+ split_comment(event['comments']).last
end
def event_datetime(event)
- committed_on = event["committed_on"]
+ committed_on = event['committed_on']
committed_on.is_a?(String) ? DateTime.parse(committed_on) : committed_on
end
@@ -102,9 +102,9 @@ def repositories_table
end
def format_revision(event)
- repository_class = event["repository_type"].constantize
+ repository_class = event['repository_type'].constantize
- repository_class.respond_to?(:format_revision) ? repository_class.format_revision(event["revision"]) : event["revision"]
+ repository_class.respond_to?(:format_revision) ? repository_class.format_revision(event['revision']) : event['revision']
end
def split_comment(comments)
@@ -116,6 +116,6 @@ def split_comment(comments)
end
def url_helper_parameter(event)
- { project_id: event["project_id"], rev: event["revision"] }
+ { project_id: event['project_id'], rev: event['revision'] }
end
end
diff --git a/app/models/activities/message_activity_provider.rb b/app/models/activities/message_activity_provider.rb
index 5b5189d40e0b..bbb4e181bdf7 100644
--- a/app/models/activities/message_activity_provider.rb
+++ b/app/models/activities/message_activity_provider.rb
@@ -27,7 +27,7 @@
#++
class Activities::MessageActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "messages",
+ activity_provider_for type: 'messages',
permission: :view_messages
def extend_event_query(query)
@@ -36,12 +36,12 @@ def extend_event_query(query)
def event_query_projection
[
- activity_journal_projection_statement(:subject, "message_subject"),
- activity_journal_projection_statement(:content, "message_content"),
- activity_journal_projection_statement(:parent_id, "message_parent_id"),
- projection_statement(forums_table, :id, "forum_id"),
- projection_statement(forums_table, :name, "forum_name"),
- projection_statement(forums_table, :project_id, "project_id")
+ activity_journal_projection_statement(:subject, 'message_subject'),
+ activity_journal_projection_statement(:content, 'message_content'),
+ activity_journal_projection_statement(:parent_id, 'message_parent_id'),
+ projection_statement(forums_table, :id, 'forum_id'),
+ projection_statement(forums_table, :name, 'forum_name'),
+ projection_statement(forums_table, :project_id, 'project_id')
]
end
@@ -56,11 +56,11 @@ def event_title(event)
end
def event_description(event)
- event["message_content"]
+ event['message_content']
end
def event_type(event)
- event["parent_id"].blank? ? "message" : "reply"
+ event['parent_id'].blank? ? 'message' : 'reply'
end
def event_path(event)
@@ -78,12 +78,12 @@ def forums_table
end
def url_helper_parameter(event)
- is_reply = event["parent_id"].present?
+ is_reply = event['parent_id'].present?
if is_reply
- { id: event["parent_id"], r: event["journable_id"], anchor: "message-#{event['journable_id']}" }
+ { id: event['parent_id'], r: event['journable_id'], anchor: "message-#{event['journable_id']}" }
else
- [event["journable_id"]]
+ [event['journable_id']]
end
end
end
diff --git a/app/models/activities/news_activity_provider.rb b/app/models/activities/news_activity_provider.rb
index ee8f9ae6297d..b333ac886e73 100644
--- a/app/models/activities/news_activity_provider.rb
+++ b/app/models/activities/news_activity_provider.rb
@@ -27,24 +27,24 @@
#++
class Activities::NewsActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "news",
+ activity_provider_for type: 'news',
permission: :view_news
def event_query_projection
[
- activity_journal_projection_statement(:title, "title"),
- activity_journal_projection_statement(:project_id, "project_id")
+ activity_journal_projection_statement(:title, 'title'),
+ activity_journal_projection_statement(:project_id, 'project_id')
]
end
protected
def event_title(event)
- event["title"]
+ event['title']
end
def event_type(_event)
- "news"
+ 'news'
end
def event_path(event)
@@ -58,6 +58,6 @@ def event_url(event)
private
def url_helper_parameter(event)
- event["journable_id"]
+ event['journable_id']
end
end
diff --git a/app/models/activities/project_activity_provider.rb b/app/models/activities/project_activity_provider.rb
index 3ca1eb6f0c64..a8c2edcea4df 100644
--- a/app/models/activities/project_activity_provider.rb
+++ b/app/models/activities/project_activity_provider.rb
@@ -27,14 +27,14 @@
#++
class Activities::ProjectActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "project_attributes",
+ activity_provider_for type: 'project_attributes',
permission: :view_project
def event_query_projection
[
- projection_statement(journals_table, :journable_id, "project_id"),
- projection_statement(projects_table, :identifier, "project_identifier"),
- projection_statement(projects_table, :name, "project_name")
+ projection_statement(journals_table, :journable_id, 'project_id'),
+ projection_statement(projects_table, :identifier, 'project_identifier'),
+ projection_statement(projects_table, :name, 'project_name')
]
end
@@ -45,18 +45,18 @@ def projects_reference_table
end
def project_id_reference_field
- "journable_id"
+ 'journable_id'
end
def event_title(event)
- I18n.t("events.title.project", name: event["project_name"])
+ I18n.t('events.title.project', name: event['project_name'])
end
def event_path(event)
- url_helpers.project_path(event["project_identifier"])
+ url_helpers.project_path(event['project_identifier'])
end
def event_url(event)
- url_helpers.project_url(event["project_identifier"])
+ url_helpers.project_url(event['project_identifier'])
end
end
diff --git a/app/models/activities/wiki_page_activity_provider.rb b/app/models/activities/wiki_page_activity_provider.rb
index 3913de39db65..02adffd2c6d5 100644
--- a/app/models/activities/wiki_page_activity_provider.rb
+++ b/app/models/activities/wiki_page_activity_provider.rb
@@ -27,7 +27,7 @@
#++
class Activities::WikiPageActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "wiki_edits",
+ activity_provider_for type: 'wiki_edits',
permission: :view_wiki_edits
def extend_event_query(query)
@@ -37,9 +37,9 @@ def extend_event_query(query)
def event_query_projection
[
- projection_statement(wikis_table, :project_id, "project_id"),
- projection_statement(wiki_pages_table, :title, "wiki_title"),
- projection_statement(wiki_pages_table, :slug, "wiki_slug")
+ projection_statement(wikis_table, :project_id, 'project_id'),
+ projection_statement(wiki_pages_table, :title, 'wiki_title'),
+ projection_statement(wiki_pages_table, :slug, 'wiki_slug')
]
end
@@ -54,7 +54,7 @@ def event_title(event)
end
def event_type(_event)
- "wiki-page"
+ 'wiki-page'
end
def event_path(event)
@@ -76,6 +76,6 @@ def wikis_table
end
def url_helper_parameter(event)
- [event["project_id"], event["wiki_slug"]]
+ [event['project_id'], event['wiki_slug']]
end
end
diff --git a/app/models/activities/work_package_activity_provider.rb b/app/models/activities/work_package_activity_provider.rb
index 32d9c6444efc..6832c38ca2d4 100644
--- a/app/models/activities/work_package_activity_provider.rb
+++ b/app/models/activities/work_package_activity_provider.rb
@@ -29,7 +29,7 @@
#++
class Activities::WorkPackageActivityProvider < Activities::BaseActivityProvider
- activity_provider_for type: "work_packages",
+ activity_provider_for type: 'work_packages',
permission: :view_work_packages
def extend_event_query(query)
@@ -39,10 +39,10 @@ def extend_event_query(query)
def event_query_projection
[
- activity_journal_projection_statement(:subject, "subject"),
- activity_journal_projection_statement(:project_id, "project_id"),
- projection_statement(statuses_table, :is_closed, "status_closed"),
- projection_statement(types_table, :name, "type_name")
+ activity_journal_projection_statement(:subject, 'subject'),
+ activity_journal_projection_statement(:project_id, 'project_id'),
+ projection_statement(statuses_table, :is_closed, 'status_closed'),
+ projection_statement(types_table, :name, 'type_name')
]
end
@@ -53,30 +53,30 @@ def self.work_package_title(id, subject, type_name)
protected
def event_title(event)
- self.class.work_package_title(event["journable_id"],
- event["subject"],
- event["type_name"])
+ self.class.work_package_title(event['journable_id'],
+ event['subject'],
+ event['type_name'])
end
def event_type(event)
- event["status_closed"] ? "work_package-closed" : "work_package-edit"
+ event['status_closed'] ? 'work_package-closed' : 'work_package-edit'
end
def event_path(event)
- url_helpers.work_package_path(event["journable_id"])
+ url_helpers.work_package_path(event['journable_id'])
end
def event_url(event)
- url_helpers.work_package_url(event["journable_id"],
+ url_helpers.work_package_url(event['journable_id'],
anchor: notes_anchor(event))
end
private
def notes_anchor(event)
- version = event["version"].to_i
+ version = event['version'].to_i
- version > 1 ? "note-#{version - 1}" : ""
+ version > 1 ? "note-#{version - 1}" : ''
end
def types_table
diff --git a/app/models/announcement.rb b/app/models/announcement.rb
index b437e5150110..bcb4033fb372 100644
--- a/app/models/announcement.rb
+++ b/app/models/announcement.rb
@@ -1,6 +1,6 @@
class Announcement < ApplicationRecord
scope :active, -> { where(active: true) }
- scope :current, -> { where("show_until >= ?", Date.today) }
+ scope :current, -> { where('show_until >= ?', Date.today) }
validates :show_until, presence: true
@@ -19,7 +19,7 @@ def active_and_current?
end
def self.create_default_announcement
- Announcement.create text: "Announcement",
+ Announcement.create text: 'Announcement',
show_until: Date.today + 14.days,
active: false
end
diff --git a/app/models/anonymous_user.rb b/app/models/anonymous_user.rb
index 441bd8e39ec6..0e9b38598e4b 100644
--- a/app/models/anonymous_user.rb
+++ b/app/models/anonymous_user.rb
@@ -31,7 +31,7 @@ class AnonymousUser < User
# There should be only one AnonymousUser in the database
def validate_unique_anonymous_user
- errors.add :base, "An anonymous user already exists." if AnonymousUser.any?
+ errors.add :base, 'An anonymous user already exists.' if AnonymousUser.any?
end
def available_custom_fields
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
index 989735200798..377478f960c6 100644
--- a/app/models/application_record.rb
+++ b/app/models/application_record.rb
@@ -30,7 +30,7 @@ def read_attribute_for_validation(attribute)
# Returns the timestamp of the most recently updated value
def self.most_recently_changed(*record_classes)
queries = record_classes.map do |clz|
- column_name = clz.send(:timestamp_attributes_for_update_in_model)&.first || "updated_at"
+ column_name = clz.send(:timestamp_attributes_for_update_in_model)&.first || 'updated_at'
"(SELECT MAX(#{column_name}) AS max_updated_at FROM #{clz.table_name})"
end
.join(" UNION ")
diff --git a/app/models/associations/groupable.rb b/app/models/associations/groupable.rb
index 396fcd677d81..936af89aca86 100644
--- a/app/models/associations/groupable.rb
+++ b/app/models/associations/groupable.rb
@@ -29,7 +29,7 @@
module Associations::Groupable
def self.included(base)
base.has_and_belongs_to_many :groups,
- foreign_key: "user_id",
+ foreign_key: 'user_id',
join_table: "#{base.table_name_prefix}group_users#{base.table_name_suffix}",
after_remove: ->(user, group) { group.user_removed(user) }
end
diff --git a/app/models/attribute_help_text.rb b/app/models/attribute_help_text.rb
index 342d0774eccb..0f44ebc99541 100644
--- a/app/models/attribute_help_text.rb
+++ b/app/models/attribute_help_text.rb
@@ -78,5 +78,5 @@ def self.available_attributes
end
end
-require "attribute_help_text/work_package"
-require "attribute_help_text/project"
+require 'attribute_help_text/work_package'
+require 'attribute_help_text/project'
diff --git a/app/models/attribute_help_text/project.rb b/app/models/attribute_help_text/project.rb
index c17dc9fd8a6f..6423c353ce40 100644
--- a/app/models/attribute_help_text/project.rb
+++ b/app/models/attribute_help_text/project.rb
@@ -39,7 +39,7 @@ def self.available_attributes
attributes[field.attribute_name] = field.name
end
- attributes["members"] = I18n.t(:label_member_plural)
+ attributes['members'] = I18n.t(:label_member_plural)
attributes
end
diff --git a/app/models/attribute_help_text/work_package.rb b/app/models/attribute_help_text/work_package.rb
index 37dff8e30ded..5d67d2d683c9 100644
--- a/app/models/attribute_help_text/work_package.rb
+++ b/app/models/attribute_help_text/work_package.rb
@@ -31,12 +31,12 @@ def self.available_attributes
attributes = ::Type.translated_work_package_form_attributes
# Start and finish dates are joined into a single field for non-milestones
- attributes.delete "start_date"
- attributes.delete "due_date"
+ attributes.delete 'start_date'
+ attributes.delete 'due_date'
# Status and project are currently special attribute that we need to add
- attributes["status"] = WorkPackage.human_attribute_name "status"
- attributes["project"] = WorkPackage.human_attribute_name "project"
+ attributes['status'] = WorkPackage.human_attribute_name 'status'
+ attributes['project'] = WorkPackage.human_attribute_name 'project'
attributes
end
diff --git a/app/models/capabilities/scopes/default.rb b/app/models/capabilities/scopes/default.rb
index 756647227a8f..0bc58f20a1ca 100644
--- a/app/models/capabilities/scopes/default.rb
+++ b/app/models/capabilities/scopes/default.rb
@@ -47,7 +47,7 @@ def default
SQL
unscoped # prevent triggering the default scope again
- .select("capabilities.*")
+ .select('capabilities.*')
.from(capabilities_sql)
end
diff --git a/app/models/capability.rb b/app/models/capability.rb
index 457f93e6cb57..ba25d79c728c 100644
--- a/app/models/capability.rb
+++ b/app/models/capability.rb
@@ -34,7 +34,7 @@ class Capability < ApplicationRecord
default_scope { default }
- belongs_to :context, class_name: "Project"
+ belongs_to :context, class_name: 'Project'
belongs_to :principal
attribute :action, :text, default: nil
diff --git a/app/models/category.rb b/app/models/category.rb
index cd53e8468ce3..a5ddc8c3bd04 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -28,7 +28,7 @@
class Category < ApplicationRecord
belongs_to :project
- belongs_to :assigned_to, class_name: "Principal"
+ belongs_to :assigned_to, class_name: 'Principal'
has_many :work_packages, dependent: :nullify
validates :name,
diff --git a/app/models/change.rb b/app/models/change.rb
index 416cd420c7cd..175e2a497cca 100644
--- a/app/models/change.rb
+++ b/app/models/change.rb
@@ -49,6 +49,6 @@ def from_path
end
def init_path
- self.path ||= ""
+ self.path ||= ''
end
end
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 648a90179ab7..5aca757d752b 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -30,31 +30,31 @@ class Changeset < ApplicationRecord
belongs_to :repository
has_one :project, through: :repository
belongs_to :user
- has_many :file_changes, class_name: "Change", dependent: :delete_all
+ has_many :file_changes, class_name: 'Change', dependent: :delete_all
has_and_belongs_to_many :work_packages
acts_as_journalized timestamp: :committed_on
acts_as_event title: Proc.new { |o|
- "#{I18n.t(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? "" : (": " + o.short_comments))
+ "#{I18n.t(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))
},
description: :long_comments,
datetime: :committed_on,
url: Proc.new { |o|
{
- controller: "/repositories",
- action: "revision",
+ controller: '/repositories',
+ action: 'revision',
project_id: o.repository.project_id,
rev: o.identifier
}
},
author: Proc.new { |o| o.author }
- acts_as_searchable columns: "comments",
+ acts_as_searchable columns: 'comments',
include: { repository: :project },
references: [:repositories],
project_key: "#{Repository.table_name}.project_id",
- date_column: "committed_on"
+ date_column: 'committed_on'
validates :repository_id, :revision, :committed_on, :commit_date, presence: true
validates :revision, uniqueness: { scope: :repository_id }
@@ -94,7 +94,7 @@ def format_identifier
end
def author
- user || committer.to_s.split("<").first
+ user || committer.to_s.split('<').first
end
# Delegate to a Repository's log encoding
@@ -132,12 +132,12 @@ def scan_comment_for_work_package_ids
return if comments.blank?
# keywords used to reference work packages
- ref_keywords = Setting.commit_ref_keywords.downcase.split(",").map(&:strip)
- ref_keywords_any = ref_keywords.delete("*")
+ ref_keywords = Setting.commit_ref_keywords.downcase.split(',').map(&:strip)
+ ref_keywords_any = ref_keywords.delete('*')
# keywords used to fix work packages
- fix_keywords = Setting.commit_fix_keywords.downcase.split(",").map(&:strip)
+ fix_keywords = Setting.commit_fix_keywords.downcase.split(',').map(&:strip)
- kw_regexp = (ref_keywords + fix_keywords).map { |kw| Regexp.escape(kw) }.join("|")
+ kw_regexp = (ref_keywords + fix_keywords).map { |kw| Regexp.escape(kw) }.join('|')
referenced_work_packages = []
@@ -179,12 +179,12 @@ def text_tag
# Returns the previous changeset
def previous
- @previous ||= Changeset.where(["id < ? AND repository_id = ?", id, repository_id]).order(Arel.sql("id DESC")).first
+ @previous ||= Changeset.where(['id < ? AND repository_id = ?', id, repository_id]).order(Arel.sql('id DESC')).first
end
# Returns the next changeset
def next
- @next ||= Changeset.where(["id > ? AND repository_id = ?", id, repository_id]).order(Arel.sql("id ASC")).first
+ @next ||= Changeset.where(['id > ? AND repository_id = ?', id, repository_id]).order(Arel.sql('id ASC')).first
end
# Creates a new Change from it's common parameters
@@ -284,32 +284,32 @@ def assign_openproject_user_from_comitter
def self.to_utf8(str, encoding)
return str if str.nil?
- str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding)
+ str.force_encoding('ASCII-8BIT') if str.respond_to?(:force_encoding)
if str.empty?
- str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
+ str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
return str
end
- normalized_encoding = encoding.presence || "UTF-8"
+ normalized_encoding = encoding.presence || 'UTF-8'
if str.respond_to?(:force_encoding)
- if normalized_encoding.upcase == "UTF-8"
- str.force_encoding("UTF-8")
+ if normalized_encoding.upcase == 'UTF-8'
+ str.force_encoding('UTF-8')
unless str.valid_encoding?
- str = str.encode("US-ASCII", invalid: :replace,
- undef: :replace, replace: "?").encode("UTF-8")
+ str = str.encode('US-ASCII', invalid: :replace,
+ undef: :replace, replace: '?').encode('UTF-8')
end
else
str.force_encoding(normalized_encoding)
- str = str.encode("UTF-8", invalid: :replace,
- undef: :replace, replace: "?")
+ str = str.encode('UTF-8', invalid: :replace,
+ undef: :replace, replace: '?')
end
else
- txtar = ""
+ txtar = ''
begin
- txtar += str.encode("UTF-8", normalized_encoding)
+ txtar += str.encode('UTF-8', normalized_encoding)
rescue Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError
txtar += $!.success
- str = "?" + $!.failed[1, $!.failed.length]
+ str = '?' + $!.failed[1, $!.failed.length]
retry
rescue StandardError
txtar += $!.success
diff --git a/app/models/color.rb b/app/models/color.rb
index c9152ce4ad34..ea84db8aca35 100644
--- a/app/models/color.rb
+++ b/app/models/color.rb
@@ -29,10 +29,10 @@
class Color < ApplicationRecord
include ::Colors::HexColor
- self.table_name = "colors"
+ self.table_name = 'colors'
has_many :planning_element_types,
- class_name: "Type",
+ class_name: 'Type',
dependent: :nullify
before_validation :normalize_hexcode
diff --git a/app/models/colors/hex_color.rb b/app/models/colors/hex_color.rb
index 9ee6db0b71d2..76fdfd2d5098 100644
--- a/app/models/colors/hex_color.rb
+++ b/app/models/colors/hex_color.rb
@@ -3,7 +3,7 @@ module HexColor
##
# Returns the best contrasting color, either white or black
# depending on the overall brightness.
- def contrasting_color(light_color: "#FFFFFF", dark_color: "#333333")
+ def contrasting_color(light_color: '#FFFFFF', dark_color: '#333333')
if bright?
dark_color
else
@@ -15,11 +15,11 @@ def contrasting_color(light_color: "#FFFFFF", dark_color: "#333333")
# Get the fill style for this color.
# If the color is light, use a dark font.
# Otherwise, use a white font.
- def color_styles(light_color: "#FFFFFF", dark_color: "#333333")
+ def color_styles(light_color: '#FFFFFF', dark_color: '#333333')
if bright?
- { color: dark_color, "background-color": hexcode }
+ { color: dark_color, 'background-color': hexcode }
else
- { color: light_color, "background-color": hexcode }
+ { color: light_color, 'background-color': hexcode }
end
end
@@ -53,7 +53,7 @@ def brightness_yiq
# Splits the hexcode into rbg color array
def rgb_colors
hexcode
- .delete("#") # Remove trailing #
+ .delete('#') # Remove trailing #
.scan(/../) # Pair hex chars
.map(&:hex) # to int
end
@@ -82,7 +82,7 @@ def lighten(amount)
# and the given opacity
def blend(mix_value, opacity)
r, g, b = rgb_modify { |channel| (channel * opacity) + (mix_value * (1 - opacity)) }
- "#%02x%02x%02x" % { r:, g:, b: }
+ '#%02x%02x%02x' % { r:, g:, b: }
end
# rubocop:disable Metrics/AbcSize
@@ -91,7 +91,7 @@ def normalize_hexcode
self.hexcode = hexcode.strip.upcase
- unless hexcode.starts_with? "#"
+ unless hexcode.starts_with? '#'
self.hexcode = "##{hexcode}"
end
diff --git a/app/models/comment.rb b/app/models/comment.rb
index b69674f62731..7cfc6e4e7ab6 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -28,7 +28,7 @@
class Comment < ApplicationRecord
belongs_to :commented, polymorphic: true, counter_cache: true
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
validates :commented, :author, :comments, presence: true
diff --git a/app/models/custom_action.rb b/app/models/custom_action.rb
index 0d3f1f70c544..5911c20f8ade 100644
--- a/app/models/custom_action.rb
+++ b/app/models/custom_action.rb
@@ -29,15 +29,15 @@
class CustomAction < ApplicationRecord
validates :name, length: { maximum: 255, minimum: 1 }
serialize :actions, coder: CustomActions::Actions::Serializer
- has_and_belongs_to_many :status_conditions, class_name: "Status"
- has_and_belongs_to_many :role_conditions, class_name: "Role"
- has_and_belongs_to_many :type_conditions, class_name: "Type"
- has_and_belongs_to_many :project_conditions, class_name: "Project"
+ has_and_belongs_to_many :status_conditions, class_name: 'Status'
+ has_and_belongs_to_many :role_conditions, class_name: 'Role'
+ has_and_belongs_to_many :type_conditions, class_name: 'Type'
+ has_and_belongs_to_many :project_conditions, class_name: 'Project'
after_save :persist_conditions
attribute :conditions
- define_attribute_method "conditions"
+ define_attribute_method 'conditions'
acts_as_list
diff --git a/app/models/custom_actions/actions/custom_field.rb b/app/models/custom_actions/actions/custom_field.rb
index cd48728e0dc8..dd2298f5b298 100644
--- a/app/models/custom_actions/actions/custom_field.rb
+++ b/app/models/custom_actions/actions/custom_field.rb
@@ -76,21 +76,21 @@ def self.create_subclass(custom_field)
def self.strategy(custom_field)
case custom_field.field_format
- when "string"
+ when 'string'
CustomActions::Actions::Strategies::String
- when "text"
+ when 'text'
CustomActions::Actions::Strategies::Text
- when "int"
+ when 'int'
CustomActions::Actions::Strategies::Integer
- when "float"
+ when 'float'
CustomActions::Actions::Strategies::Float
- when "date"
+ when 'date'
CustomActions::Actions::Strategies::Date
- when "bool"
+ when 'bool'
CustomActions::Actions::Strategies::Boolean
- when "user"
+ when 'user'
CustomActions::Actions::Strategies::UserCustomField
- when "list", "version"
+ when 'list', 'version'
CustomActions::Actions::Strategies::AssociatedCustomField
end
end
diff --git a/app/models/custom_actions/actions/notify.rb b/app/models/custom_actions/actions/notify.rb
index 96c20d56552a..64718f8b78c5 100644
--- a/app/models/custom_actions/actions/notify.rb
+++ b/app/models/custom_actions/actions/notify.rb
@@ -32,13 +32,13 @@ class CustomActions::Actions::Notify < CustomActions::Actions::Base
def apply(work_package)
comment = principals.where(id: values).map do |p|
prefix = if p.is_a?(User)
- "user"
+ 'user'
else
- "group"
+ 'group'
end
"#{prefix}##{p.id}"
- end.join(", ")
+ end.join(', ')
work_package.journal_notes = comment
end
diff --git a/app/models/custom_actions/actions/project.rb b/app/models/custom_actions/actions/project.rb
index 45f304eb8ec3..34ead5f534ff 100644
--- a/app/models/custom_actions/actions/project.rb
+++ b/app/models/custom_actions/actions/project.rb
@@ -48,7 +48,7 @@ def priority
def associated
::Project
.select(:id, :name)
- .order(Arel.sql("LOWER(name)"))
+ .order(Arel.sql('LOWER(name)'))
.map { |u| [u.id, u.name] }
end
end
diff --git a/app/models/custom_actions/actions/responsible.rb b/app/models/custom_actions/actions/responsible.rb
index 78c3efc83b17..334ab95da454 100644
--- a/app/models/custom_actions/actions/responsible.rb
+++ b/app/models/custom_actions/actions/responsible.rb
@@ -27,9 +27,9 @@
#++
class CustomActions::Actions::Responsible < CustomActions::Actions::Base
- include CustomActions::Actions::Strategies::MeAssociated
+ include CustomActions::Actions::Strategies::Associated
- def available_principles
+ def associated
User
.not_locked
.select(:id, :firstname, :lastname, :type)
@@ -37,10 +37,6 @@ def available_principles
.map { |u| [u.id, u.name] }
end
- def apply(work_package)
- work_package.responsible_id = transformed_value(values.first)
- end
-
def required?
false
end
diff --git a/app/models/custom_actions/actions/strategies/associated.rb b/app/models/custom_actions/actions/strategies/associated.rb
index 83401b99de49..9b2e97a52807 100644
--- a/app/models/custom_actions/actions/strategies/associated.rb
+++ b/app/models/custom_actions/actions/strategies/associated.rb
@@ -38,7 +38,7 @@ def allowed_values
if required?
options
else
- options.unshift(value: nil, label: I18n.t("placeholders.default"))
+ options.unshift(value: nil, label: I18n.t('placeholders.default'))
end
end
end
@@ -52,7 +52,7 @@ def type
end
def associated
- raise "Not implemented error"
+ raise 'Not implemented error'
end
def validate(errors)
diff --git a/app/models/custom_actions/actions/strategies/date.rb b/app/models/custom_actions/actions/strategies/date.rb
index 7193ce36ad5b..12328963991a 100644
--- a/app/models/custom_actions/actions/strategies/date.rb
+++ b/app/models/custom_actions/actions/strategies/date.rb
@@ -45,7 +45,7 @@ def apply(work_package)
private
def date_to_apply
- if values.first == "%CURRENT_DATE%"
+ if values.first == '%CURRENT_DATE%'
Date.today
else
values.first
@@ -54,7 +54,7 @@ def date_to_apply
def to_date_or_nil(value)
case value
- when nil, "%CURRENT_DATE%"
+ when nil, '%CURRENT_DATE%'
value
else
value.to_date
diff --git a/app/models/custom_actions/actions/strategies/me_associated.rb b/app/models/custom_actions/actions/strategies/me_associated.rb
index 7ae0a30c42d1..88439593d469 100644
--- a/app/models/custom_actions/actions/strategies/me_associated.rb
+++ b/app/models/custom_actions/actions/strategies/me_associated.rb
@@ -30,7 +30,7 @@ module CustomActions::Actions::Strategies::MeAssociated
include ::CustomActions::Actions::Strategies::Associated
def associated
- me_value = [current_user_value_key, I18n.t("custom_actions.actions.assigned_to.executing_user_value")]
+ me_value = [current_user_value_key, I18n.t('custom_actions.actions.assigned_to.executing_user_value')]
[me_value] + available_principles
end
@@ -58,7 +58,7 @@ def transformed_value(val)
end
def current_user_value_key
- "current_user".freeze
+ 'current_user'.freeze
end
def has_me_value?
diff --git a/app/models/custom_actions/conditions/project.rb b/app/models/custom_actions/conditions/project.rb
index a13596839c19..8325a48721ea 100644
--- a/app/models/custom_actions/conditions/project.rb
+++ b/app/models/custom_actions/conditions/project.rb
@@ -37,7 +37,7 @@ def associated
::Project
.active
.select(:id, :name)
- .order(Arel.sql("LOWER(name)"))
+ .order(Arel.sql('LOWER(name)'))
.map { |u| [u.id, u.name] }
end
end
diff --git a/app/models/custom_field/order_statements.rb b/app/models/custom_field/order_statements.rb
index 3c96ec5cf178..9a2964d5528f 100644
--- a/app/models/custom_field/order_statements.rb
+++ b/app/models/custom_field/order_statements.rb
@@ -32,31 +32,31 @@ module CustomField::OrderStatements
# Returns false, if the custom field can not be used for sorting.
def order_statements
case field_format
- when "list"
+ when 'list'
if multi_value?
[select_custom_values_joined_options_as_group]
else
[select_custom_option_position]
end
- when "string", "text", "date", "bool"
+ when 'string', 'text', 'date', 'bool'
if multi_value?
[select_custom_values_as_group]
else
[coalesce_select_custom_value_as_string]
end
- when "int", "float"
+ when 'int', 'float'
# Make the database cast values into numeric
# Postgresql will raise an error if a value can not be casted!
# CustomValue validations should ensure that it doesn't occur
[select_custom_value_as_decimal]
- when "user"
+ when 'user'
[
- order_by_user_sql("lastname"),
- order_by_user_sql("firstname"),
- order_by_user_sql("id")
+ order_by_user_sql('lastname'),
+ order_by_user_sql('firstname'),
+ order_by_user_sql('id')
]
- when "version"
- [order_by_version_sql("name")]
+ when 'version'
+ [order_by_version_sql('name')]
end
end
@@ -65,7 +65,7 @@ def order_statements
def null_handling(asc)
return unless %w[int float].include?(field_format)
- null_direction = asc ? "FIRST" : "LAST"
+ null_direction = asc ? 'FIRST' : 'LAST'
Arel.sql("NULLS #{null_direction}")
end
@@ -73,7 +73,7 @@ def null_handling(asc)
# which differ for multi-value select fields,
# because in this case we do want the primary CV values
def group_by_statement
- return order_statements unless field_format == "list"
+ return order_statements unless field_format == 'list'
if multi_value?
# We want to return the internal IDs in the case of grouping
diff --git a/app/models/custom_option.rb b/app/models/custom_option.rb
index c32b738908f8..78dee7d07b9b 100644
--- a/app/models/custom_option.rb
+++ b/app/models/custom_option.rb
@@ -47,7 +47,7 @@ def to_s
def assure_at_least_one_option
return if CustomOption.where(custom_field_id:).where.not(id:).count > 0
- errors.add(:base, I18n.t(:"activerecord.errors.models.custom_field.at_least_one_custom_option"))
+ errors.add(:base, I18n.t(:'activerecord.errors.models.custom_field.at_least_one_custom_option'))
throw :abort
end
diff --git a/app/models/custom_style.rb b/app/models/custom_style.rb
index 8e0603b2e177..38d1cbffd234 100644
--- a/app/models/custom_style.rb
+++ b/app/models/custom_style.rb
@@ -8,7 +8,7 @@ class CustomStyle < ApplicationRecord
class << self
def current
RequestStore.fetch(:current_custom_style) do
- custom_style = CustomStyle.order(Arel.sql("created_at DESC")).first
+ custom_style = CustomStyle.order(Arel.sql('created_at DESC')).first
if custom_style.nil?
return nil
else
@@ -35,7 +35,7 @@ def digest
image = send(name)
image&.remove!
- update_columns(name => nil, updated_at: Time.zone.now)
+ update_column name, nil
end
end
end
diff --git a/app/models/custom_value/bool_strategy.rb b/app/models/custom_value/bool_strategy.rb
index 57311a4246a4..33d29a0e4064 100644
--- a/app/models/custom_value/bool_strategy.rb
+++ b/app/models/custom_value/bool_strategy.rb
@@ -68,6 +68,6 @@ def validate_type_of_value; end
def present?(val)
# can't use :blank? safely, because false.blank? == true
# can't use :present? safely, because false.present? == false
- !val.nil? && val != ""
+ !val.nil? && val != ''
end
end
diff --git a/app/models/custom_value/format_strategy.rb b/app/models/custom_value/format_strategy.rb
index e473970f5b52..96fe59f8b1a4 100644
--- a/app/models/custom_value/format_strategy.rb
+++ b/app/models/custom_value/format_strategy.rb
@@ -40,7 +40,7 @@ def initialize(custom_value)
# Returns the value of the CustomValue in a typed fashion (i.e. not as the string
# that is used for representation in the database)
def typed_value
- raise "SubclassResponsibility"
+ raise 'SubclassResponsibility'
end
# Returns the value of the CustomValue formatted to a string
@@ -61,7 +61,7 @@ def parse_value(val)
# Validates the type of the custom field and returns a symbol indicating the validation error
# if an error occurred; returns nil if no error occurred
def validate_type_of_value
- raise "SubclassResponsibility"
+ raise 'SubclassResponsibility'
end
private
diff --git a/app/models/day.rb b/app/models/day.rb
index 8e4874682f38..d0c43ba587fb 100644
--- a/app/models/day.rb
+++ b/app/models/day.rb
@@ -31,14 +31,14 @@ class Day < ApplicationRecord
has_many :non_working_days,
inverse_of: false,
- class_name: "NonWorkingDay",
+ class_name: 'NonWorkingDay',
foreign_key: :date,
primary_key: :date,
dependent: nil
attribute :date, :date, default: nil
attribute :day_of_week, :integer, default: nil
- attribute :working, :boolean, default: "t"
+ attribute :working, :boolean, default: 't'
delegate :name, to: :week_day, allow_nil: true
diff --git a/app/models/deleted_user.rb b/app/models/deleted_user.rb
index 3685dbe3a9f1..bdc89365e3dc 100644
--- a/app/models/deleted_user.rb
+++ b/app/models/deleted_user.rb
@@ -3,7 +3,7 @@ class DeletedUser < User
# There should be only one DeletedUser in the database
def validate_unique_deleted_user
- errors.add :base, "A DeletedUser already exists." if DeletedUser.any?
+ errors.add :base, 'A DeletedUser already exists.' if DeletedUser.any?
end
def self.first
@@ -17,7 +17,7 @@ def builtin?; true end
def admin; false end
- def name(*_args); I18n.t("user.deleted") end
+ def name(*_args); I18n.t('user.deleted') end
def mail; nil end
diff --git a/app/models/enabled_module.rb b/app/models/enabled_module.rb
index 3fab8e33157c..9a43bf251bda 100644
--- a/app/models/enabled_module.rb
+++ b/app/models/enabled_module.rb
@@ -40,12 +40,12 @@ class EnabledModule < ApplicationRecord
# after_create callback used to do things when a module is enabled
def module_enabled
case name
- when "wiki"
+ when 'wiki'
# Create a wiki with a default start page
if project && project.wiki.nil?
- Wiki.create(project:, start_page: "Wiki")
+ Wiki.create(project:, start_page: 'Wiki')
end
- when "repository"
+ when 'repository'
if project &&
project.repository.nil? &&
Setting.repositories_automatic_managed_vendor.present?
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index 06f510a2d21b..bcfbb5983dde 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -50,7 +50,7 @@ def show_banners?
end
def set_current_token
- token = EnterpriseToken.order(Arel.sql("created_at DESC")).first
+ token = EnterpriseToken.order(Arel.sql('created_at DESC')).first
if token&.token_object
token
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index b6e1f6f4b65c..2dde4762825c 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -32,7 +32,7 @@ class Enumeration < ApplicationRecord
belongs_to :project, optional: true
acts_as_list scope: 'type = \'#{type}\''
- acts_as_tree order: "position ASC"
+ acts_as_tree order: 'position ASC'
before_save :unmark_old_default_value, if: :became_default_value?
before_destroy :check_integrity
@@ -66,7 +66,7 @@ def self.default
# it's type. STI subclasses will automatically add their own
# types to the finder.
if descends_from_active_record?
- where(is_default: true, type: "Enumeration").first
+ where(is_default: true, type: 'Enumeration').first
else
# STI classes are
where(is_default: true).first
@@ -129,7 +129,7 @@ def to_s; name end
# Does the +new+ Hash override the previous Enumeration?
def self.overriding_change?(new, previous)
- if same_active_state?(new["active"], previous.active) && same_custom_values?(new, previous)
+ if same_active_state?(new['active'], previous.active) && same_custom_values?(new, previous)
false
else
true
@@ -140,8 +140,8 @@ def self.overriding_change?(new, previous)
def self.same_custom_values?(new, previous)
previous.custom_field_values.each do |custom_value|
if new &&
- new["custom_field_values"] &&
- custom_value.value != new["custom_field_values"][custom_value.custom_field_id.to_s]
+ new['custom_field_values'] &&
+ custom_value.value != new['custom_field_values'][custom_value.custom_field_id.to_s]
return false
end
end
@@ -151,7 +151,7 @@ def self.same_custom_values?(new, previous)
# Are the new and previous fields equal?
def self.same_active_state?(new, previous)
- new = new == "1"
+ new = new == '1'
new == previous
end
diff --git a/app/models/exports/concerns/csv.rb b/app/models/exports/concerns/csv.rb
index d8229338021f..0f7c96197dee 100644
--- a/app/models/exports/concerns/csv.rb
+++ b/app/models/exports/concerns/csv.rb
@@ -54,7 +54,7 @@ def success(serialized)
.new format: :csv,
title: csv_export_filename,
content: serialized,
- mime_type: "text/csv"
+ mime_type: 'text/csv'
end
# fetch all headers
@@ -63,7 +63,7 @@ def csv_headers
# because of
# https://support.microsoft.com/en-us/help/323626/-sylk-file-format-is-not-valid-error-message-when-you-open-file
- if headers[0].start_with?("ID")
+ if headers[0].start_with?('ID')
headers[0] = headers[0].downcase
end
@@ -78,7 +78,7 @@ def csv_row(record)
end
def format_csv(record, attribute)
- format_attribute(record, attribute, :csv, array_separator: "; ")
+ format_attribute(record, attribute, :csv, array_separator: '; ')
end
def csv_export_filename
diff --git a/app/models/exports/exporter.rb b/app/models/exports/exporter.rb
index b06f614c2446..1aae11aaa61c 100644
--- a/app/models/exports/exporter.rb
+++ b/app/models/exports/exporter.rb
@@ -51,9 +51,9 @@ def self.key
def sane_filename(name)
parts = name.split /(?<=.)\.(?=[^.])(?!.*\.[^.])/m
- parts.map! { |s| s.gsub /[^a-z0-9-]+/i, "_" }
+ parts.map! { |s| s.gsub /[^a-z0-9-]+/i, '_' }
- parts.join "."
+ parts.join '.'
end
# Run the export, yielding the result of the render output
diff --git a/app/models/exports/formatters/custom_field.rb b/app/models/exports/formatters/custom_field.rb
index 5815fb2a18ff..e0900c3baa6f 100644
--- a/app/models/exports/formatters/custom_field.rb
+++ b/app/models/exports/formatters/custom_field.rb
@@ -2,14 +2,14 @@ module Exports
module Formatters
class CustomField < Default
def self.apply?(attribute, _export_format)
- attribute.start_with?("cf_")
+ attribute.start_with?('cf_')
end
##
# Takes a WorkPackage and an attribute and returns the value to be exported.
def retrieve_value(object)
custom_field = find_custom_field(object)
- return "" if custom_field.nil?
+ return '' if custom_field.nil?
format_for_export(object, custom_field)
end
@@ -22,10 +22,10 @@ def retrieve_value(object)
# - For long text values, output the plain value
def format_for_export(object, custom_field)
case custom_field.field_format
- when "bool"
+ when 'bool'
value = object.typed_custom_value_for(custom_field)
value == nil ? false : value
- when "text"
+ when 'text'
object.typed_custom_value_for(custom_field)
else
object.formatted_custom_value_for(custom_field)
@@ -35,7 +35,7 @@ def format_for_export(object, custom_field)
##
# Finds a custom field from the attribute identifier
def find_custom_field(object)
- id = attribute.to_s.sub("cf_", "").to_i
+ id = attribute.to_s.sub('cf_', '').to_i
object.available_custom_fields.detect { |cf| cf.id == id }
end
end
diff --git a/app/models/exports/formatters/default.rb b/app/models/exports/formatters/default.rb
index 93f2b8fae49e..1b25bcc91782 100644
--- a/app/models/exports/formatters/default.rb
+++ b/app/models/exports/formatters/default.rb
@@ -33,11 +33,11 @@ def format_value(value, options)
when Time, DateTime, ActiveSupport::TimeWithZone
format_time value
when Array
- value.join options.fetch(:array_separator, ", ")
+ value.join options.fetch(:array_separator, ', ')
when nil
# ruby >=2.7.1 will return a frozen string for nil.to_s which will cause an error when e.g. trying to
# force an encoding
- ""
+ ''
else
value.to_s
end
diff --git a/app/models/forum.rb b/app/models/forum.rb
index f59d608c6959..287f368ae742 100644
--- a/app/models/forum.rb
+++ b/app/models/forum.rb
@@ -31,11 +31,11 @@ class Forum < ApplicationRecord
has_many :topics, -> {
where("#{Message.table_name}.parent_id IS NULL")
.order("#{Message.table_name}.sticky DESC")
- }, class_name: "Message"
+ }, class_name: 'Message'
has_many :messages, -> {
order("#{Message.table_name}.sticky DESC")
}, dependent: :destroy
- belongs_to :last_message, class_name: "Message"
+ belongs_to :last_message, class_name: 'Message'
acts_as_list scope: :project_id
acts_as_watchable permission: :view_messages
diff --git a/app/models/global_role.rb b/app/models/global_role.rb
index d829da2edd4c..972a626e7764 100644
--- a/app/models/global_role.rb
+++ b/app/models/global_role.rb
@@ -29,6 +29,6 @@
class GlobalRole < Role
def self.givable
super
- .where(type: "GlobalRole")
+ .where(type: 'GlobalRole')
end
end
diff --git a/app/models/group.rb b/app/models/group.rb
index a1cb415fd930..66c5cc605d2e 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -65,7 +65,7 @@ def to_s
private
def uniqueness_of_name
- groups_with_name = Group.where("lastname = ? AND id <> ?", name, id || 0).count
+ groups_with_name = Group.where('lastname = ? AND id <> ?', name, id || 0).count
if groups_with_name > 0
errors.add :name, :taken
end
diff --git a/app/models/issue_priority.rb b/app/models/issue_priority.rb
index a159030f6007..77172bff75ae 100644
--- a/app/models/issue_priority.rb
+++ b/app/models/issue_priority.rb
@@ -27,7 +27,7 @@
#++
class IssuePriority < Enumeration
- has_many :work_packages, foreign_key: "priority_id"
+ has_many :work_packages, foreign_key: 'priority_id'
belongs_to :color
OptionName = :enumeration_work_package_priorities
@@ -37,7 +37,7 @@ def self.colored?
end
def color_label
- I18n.t("prioritiies.edit.priority_color_text")
+ I18n.t('prioritiies.edit.priority_color_text')
end
def option_name
diff --git a/app/models/journable/historic_active_record_relation.rb b/app/models/journable/historic_active_record_relation.rb
index 2282061bfab3..885ec86d163a 100644
--- a/app/models/journable/historic_active_record_relation.rb
+++ b/app/models/journable/historic_active_record_relation.rb
@@ -76,12 +76,12 @@ def initialize(relation, timestamp:)
def pluck(*column_names)
column_names.map! do |column_name|
case column_name
- when :id, "id"
- "journals.journable_id"
- when :created_at, "created_at"
- "journables.created_at"
- when :updated_at, "updated_at"
- "journals.updated_at"
+ when :id, 'id'
+ 'journals.journable_id'
+ when :created_at, 'created_at'
+ 'journables.created_at'
+ when :updated_at, 'updated_at'
+ 'journals.updated_at'
else
if model.column_names_missing_in_journal.include?(column_name.to_s)
Rails.logger.warn "Cannot pluck column `#{column_name}` because this attribute is not journalized," \
diff --git a/app/models/journable/with_historic_attributes.rb b/app/models/journable/with_historic_attributes.rb
index 63a1c7aced3d..98ee689f0192 100644
--- a/app/models/journable/with_historic_attributes.rb
+++ b/app/models/journable/with_historic_attributes.rb
@@ -251,8 +251,8 @@ def changes_at_timestamp(timestamp)
::Acts::Journalized::JournableDiffer.association_changes(
historic_journable,
__getobj__,
- "custom_values",
- "custom_field",
+ 'custom_values',
+ 'custom_field',
:custom_field_id,
:value
)
diff --git a/app/models/journable/with_historic_attributes/loader.rb b/app/models/journable/with_historic_attributes/loader.rb
index c0b8f146982c..f4e8ca6221b9 100644
--- a/app/models/journable/with_historic_attributes/loader.rb
+++ b/app/models/journable/with_historic_attributes/loader.rb
@@ -59,9 +59,9 @@ def load_custom_values(journalized = journables)
journalized.map(&:journal_id)
rescue NoMethodError
raise ArgumentError,
- "The provided journalized items do not have a journal_id included. " \
- "Please load them via any of the Journable::Timestamps#at_timestamp method. " \
- "ie: WorkPackage.at_timestamp(1.day.ago) or WorkPackage.find(1).at_timestamp(1.day.ago)"
+ 'The provided journalized items do not have a journal_id included. ' \
+ 'Please load them via any of the Journable::Timestamps#at_timestamp method. ' \
+ 'ie: WorkPackage.at_timestamp(1.day.ago) or WorkPackage.find(1).at_timestamp(1.day.ago)'
end
customizable_journals_by_journal_id = load_customizable_journals_by_journal_id(journal_ids)
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 5760be8a3059..c41a6d787f97 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -63,7 +63,6 @@ class Journal < ApplicationRecord
work_package_children_changed_times
work_package_related_changed_times
working_days_changed
- default_attribute_written
system_update
].freeze
diff --git a/app/models/journal/associated_journal.rb b/app/models/journal/associated_journal.rb
index 706ddfd39ce3..9b582e89477c 100644
--- a/app/models/journal/associated_journal.rb
+++ b/app/models/journal/associated_journal.rb
@@ -31,6 +31,6 @@
class Journal::AssociatedJournal < ApplicationRecord
self.abstract_class = true
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
belongs_to :journal
end
diff --git a/app/models/journal/attachable_journal.rb b/app/models/journal/attachable_journal.rb
index 43a721b8b210..94c183e8a32c 100644
--- a/app/models/journal/attachable_journal.rb
+++ b/app/models/journal/attachable_journal.rb
@@ -27,7 +27,7 @@
#++
class Journal::AttachableJournal < Journal::AssociatedJournal
- self.table_name = "attachable_journals"
+ self.table_name = 'attachable_journals'
belongs_to :attachment
end
diff --git a/app/models/journal/attachment_journal.rb b/app/models/journal/attachment_journal.rb
index 9f2e6f42a9e0..ebdae91e7d0c 100644
--- a/app/models/journal/attachment_journal.rb
+++ b/app/models/journal/attachment_journal.rb
@@ -27,5 +27,5 @@
#++
class Journal::AttachmentJournal < Journal::BaseJournal
- self.table_name = "attachment_journals"
+ self.table_name = 'attachment_journals'
end
diff --git a/app/models/journal/base_journal.rb b/app/models/journal/base_journal.rb
index 8f7f28041d81..9bb5568e5487 100644
--- a/app/models/journal/base_journal.rb
+++ b/app/models/journal/base_journal.rb
@@ -30,7 +30,7 @@ class Journal::BaseJournal < ApplicationRecord
self.abstract_class = true
has_one :journal, as: :data, inverse_of: :data, dependent: :destroy
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
def journaled_attributes
attributes.symbolize_keys.select { |k, _| self.class.journaled_attributes.include? k }
diff --git a/app/models/journal/changeset_journal.rb b/app/models/journal/changeset_journal.rb
index 6413c97b1e43..179780f3b80d 100644
--- a/app/models/journal/changeset_journal.rb
+++ b/app/models/journal/changeset_journal.rb
@@ -27,5 +27,5 @@
#++
class Journal::ChangesetJournal < Journal::BaseJournal
- self.table_name = "changeset_journals"
+ self.table_name = 'changeset_journals'
end
diff --git a/app/models/journal/customizable_journal.rb b/app/models/journal/customizable_journal.rb
index 49a5179625a7..959bf02217fb 100644
--- a/app/models/journal/customizable_journal.rb
+++ b/app/models/journal/customizable_journal.rb
@@ -27,7 +27,7 @@
#++
class Journal::CustomizableJournal < Journal::AssociatedJournal
- self.table_name = "customizable_journals"
+ self.table_name = 'customizable_journals'
belongs_to :custom_field
diff --git a/app/models/journal/message_journal.rb b/app/models/journal/message_journal.rb
index eb764928a8e1..f835de254933 100644
--- a/app/models/journal/message_journal.rb
+++ b/app/models/journal/message_journal.rb
@@ -27,7 +27,7 @@
#++
class Journal::MessageJournal < Journal::BaseJournal
- self.table_name = "message_journals"
+ self.table_name = 'message_journals'
belongs_to :forum
has_one :project, through: :forum
diff --git a/app/models/journal/news_journal.rb b/app/models/journal/news_journal.rb
index 1c0d62f29690..559b6e6a1ebc 100644
--- a/app/models/journal/news_journal.rb
+++ b/app/models/journal/news_journal.rb
@@ -27,7 +27,7 @@
#++
class Journal::NewsJournal < Journal::BaseJournal
- self.table_name = "news_journals"
+ self.table_name = 'news_journals'
belongs_to :project
end
diff --git a/app/models/journal/project_journal.rb b/app/models/journal/project_journal.rb
index 3b3212505f50..cbcedd6f59c1 100644
--- a/app/models/journal/project_journal.rb
+++ b/app/models/journal/project_journal.rb
@@ -27,5 +27,5 @@
#++
class Journal::ProjectJournal < Journal::BaseJournal
- self.table_name = "project_journals"
+ self.table_name = 'project_journals'
end
diff --git a/app/models/journal/storable_journal.rb b/app/models/journal/storable_journal.rb
index 94d7524fb07a..0daf7f10bb35 100644
--- a/app/models/journal/storable_journal.rb
+++ b/app/models/journal/storable_journal.rb
@@ -29,7 +29,7 @@
#++
class Journal::StorableJournal < Journal::AssociatedJournal
- self.table_name = "storages_file_links_journals"
+ self.table_name = 'storages_file_links_journals'
- belongs_to :file_link, class_name: "Storages::FileLink"
+ belongs_to :file_link, class_name: 'Storages::FileLink'
end
diff --git a/app/models/journal/timestamps.rb b/app/models/journal/timestamps.rb
index 50f3aa85e39e..a40d2ac8f455 100644
--- a/app/models/journal/timestamps.rb
+++ b/app/models/journal/timestamps.rb
@@ -70,7 +70,7 @@ def at_timestamp(timestamp)
timestamp = timestamp.to_time if timestamp.kind_of? Timestamp
timestamp = timestamp.in_time_zone if timestamp.kind_of? DateTime
- where(["validity_period @> timestamp with time zone ?", timestamp])
+ where(['validity_period @> timestamp with time zone ?', timestamp])
end
end
end
diff --git a/app/models/journal/wiki_page_journal.rb b/app/models/journal/wiki_page_journal.rb
index 45cf69c63fc6..3859989f989c 100644
--- a/app/models/journal/wiki_page_journal.rb
+++ b/app/models/journal/wiki_page_journal.rb
@@ -27,9 +27,9 @@
#++
class Journal::WikiPageJournal < Journal::BaseJournal
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
- self.table_name = "wiki_page_journals"
+ self.table_name = 'wiki_page_journals'
# The project does not change over the course of a wiki page lifetime
delegate :project, to: :journal
diff --git a/app/models/journal/work_package_journal.rb b/app/models/journal/work_package_journal.rb
index bc4b0f9bccf0..5c37b7fa0c6c 100644
--- a/app/models/journal/work_package_journal.rb
+++ b/app/models/journal/work_package_journal.rb
@@ -27,9 +27,9 @@
#++
class Journal::WorkPackageJournal < Journal::BaseJournal
- self.table_name = "work_package_journals"
+ self.table_name = 'work_package_journals'
belongs_to :project
- belongs_to :assigned_to, class_name: "Principal"
- belongs_to :responsible, class_name: "Principal"
+ belongs_to :assigned_to, class_name: 'Principal'
+ belongs_to :responsible, class_name: 'Principal'
end
diff --git a/app/models/ldap_auth_source.rb b/app/models/ldap_auth_source.rb
index a2a4920b6ac9..fe3673fc0788 100644
--- a/app/models/ldap_auth_source.rb
+++ b/app/models/ldap_auth_source.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "net/ldap"
+require 'net/ldap'
class LdapAuthSource < ApplicationRecord
class Error < ::StandardError; end
@@ -180,11 +180,11 @@ def with_connection
def test_connection
unless authenticate_dn(account, account_password)
raise LdapAuthSource::Error,
- I18n.t("ldap_auth_sources.ldap_error", error_message: I18n.t("ldap_auth_sources.ldap_auth_failed"))
+ I18n.t('ldap_auth_sources.ldap_error', error_message: I18n.t('ldap_auth_sources.ldap_auth_failed'))
end
rescue Net::LDAP::Error => e
raise LdapAuthSource::Error,
- I18n.t("ldap_auth_sources.ldap_error", error_message: e.to_s)
+ I18n.t('ldap_auth_sources.ldap_error', error_message: e.to_s)
end
def get_user_attributes_from_ldap_entry(entry)
@@ -210,13 +210,13 @@ def mapped_attributes(entry)
# Return the attributes needed for the LDAP search.
#
def search_attributes
- ["dn", attr_login, attr_firstname, attr_lastname, attr_mail, attr_admin].compact
+ ['dn', attr_login, attr_firstname, attr_lastname, attr_mail, attr_admin].compact
end
##
# Returns the filter object used for searching
def default_filter
- object_filter = Net::LDAP::Filter.eq("objectClass", "*")
+ object_filter = Net::LDAP::Filter.eq('objectClass', '*')
parsed_filter_string || object_filter
end
diff --git a/app/models/mail_handler/user_creator.rb b/app/models/mail_handler/user_creator.rb
index b6952828b758..eb001f241526 100644
--- a/app/models/mail_handler/user_creator.rb
+++ b/app/models/mail_handler/user_creator.rb
@@ -41,7 +41,7 @@ def create_user_from_email(email)
nil
end
else
- logger.error "failed to create User: no FROM address found"
+ logger.error 'failed to create User: no FROM address found'
nil
end
end
@@ -64,10 +64,10 @@ def new_user_from_attributes(email_address, fullname = nil)
end
def user_initialization_attributes(email_address, fullname = nil)
- names = fullname.blank? ? email_address.gsub(/@.*\z/, "").split(".") : fullname.split
+ names = fullname.blank? ? email_address.gsub(/@.*\z/, '').split('.') : fullname.split
firstname = names.shift
- lastname = names.join(" ")
- lastname = "-" if lastname.blank?
+ lastname = names.join(' ')
+ lastname = '-' if lastname.blank?
{
mail: email_address,
@@ -80,13 +80,13 @@ def user_initialization_attributes(email_address, fullname = nil)
def assign_fallback_attributes(user, errors)
if errors.any?
user.login = "user#{SecureRandom.hex(6)}" if errors[:login].present?
- user.firstname = "-" if errors[:firstname].present?
- user.lastname = "-" if errors[:lastname].present?
+ user.firstname = '-' if errors[:firstname].present?
+ user.lastname = '-' if errors[:lastname].present?
end
end
def extract_addr_and_name_from_email(email)
- from = email.header["from"].to_s
+ from = email.header['from'].to_s
addr = from
name = nil
if m = from.match(/\A"?(.+?)"?\s+<(.+@.+)>\z/)
diff --git a/app/models/members/scopes/assignable.rb b/app/models/members/scopes/assignable.rb
index eecdec9fd7a8..9aa7d0382eaa 100644
--- a/app/models/members/scopes/assignable.rb
+++ b/app/models/members/scopes/assignable.rb
@@ -42,8 +42,8 @@ def assignable
def assignable_permission_exists
RolePermission
- .where("role_permissions.role_id = roles.id")
- .where(permission: "work_package_assigned")
+ .where('role_permissions.role_id = roles.id')
+ .where(permission: 'work_package_assigned')
.arel
.exists
end
diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb
index 6ca7377944c3..89b6e38922f9 100644
--- a/app/models/menu_item.rb
+++ b/app/models/menu_item.rb
@@ -27,10 +27,10 @@
#++
class MenuItem < ApplicationRecord
- belongs_to :parent, class_name: "MenuItem", optional: true
+ belongs_to :parent, class_name: 'MenuItem', optional: true
has_many :children, -> {
- order("id ASC")
- }, class_name: "MenuItem", dependent: :destroy, foreign_key: :parent_id
+ order('id ASC')
+ }, class_name: 'MenuItem', dependent: :destroy, foreign_key: :parent_id
serialize :options, type: Hash
diff --git a/app/models/menu_items/wiki_menu_item.rb b/app/models/menu_items/wiki_menu_item.rb
index 14a84a89bd81..f480aebc3b39 100644
--- a/app/models/menu_items/wiki_menu_item.rb
+++ b/app/models/menu_items/wiki_menu_item.rb
@@ -27,12 +27,12 @@
#++
class MenuItems::WikiMenuItem < MenuItem
- belongs_to :wiki, foreign_key: "navigatable_id"
+ belongs_to :wiki, foreign_key: 'navigatable_id'
scope :main_items, ->(wiki_id) {
where(navigatable_id: wiki_id, parent_id: nil)
.includes(:children)
- .order(Arel.sql("title ASC"))
+ .order(Arel.sql('title ASC'))
}
def slug
diff --git a/app/models/message.rb b/app/models/message.rb
index c6551361e031..002e083f6880 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -31,32 +31,32 @@ class Message < ApplicationRecord
belongs_to :forum
has_one :project, through: :forum
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
acts_as_tree counter_cache: :replies_count, order: "#{Message.table_name}.created_at ASC"
acts_as_attachable after_add: :attachments_changed,
after_remove: :attachments_changed,
add_on_new_permission: :add_messages,
add_on_persisted_permission: :edit_messages
- belongs_to :last_reply, class_name: "Message"
+ belongs_to :last_reply, class_name: 'Message'
acts_as_journalized
acts_as_event title: Proc.new { |o| "#{o.forum.name}: #{o.subject}" },
description: :content,
- type: Proc.new { |o| o.parent_id.nil? ? "message" : "reply" },
+ type: Proc.new { |o| o.parent_id.nil? ? 'message' : 'reply' },
url: (Proc.new do |o|
msg = o
if msg.parent_id.nil?
{ id: msg.id }
else
{ id: msg.parent_id, r: msg.id, anchor: "message-#{msg.id}" }
- end.reverse_merge controller: "/messages", action: "show", forum_id: msg.forum_id
+ end.reverse_merge controller: '/messages', action: 'show', forum_id: msg.forum_id
end)
- acts_as_searchable columns: ["subject", "content"],
+ acts_as_searchable columns: ['subject', 'content'],
include: { forum: :project },
references: [:forums],
- project_key: "project_id",
+ project_key: 'project_id',
date_column: "#{table_name}.created_at"
acts_as_watchable
@@ -84,7 +84,7 @@ def visible?(user = User.current)
# Can not reply to a locked topic
def validate_unlocked_root
- errors.add :base, "Topic is locked" if root.locked? && self != root
+ errors.add :base, 'Topic is locked' if root.locked? && self != root
end
def set_sticked_on_date
@@ -108,7 +108,7 @@ def reset_counters
end
def sticky=(arg)
- write_attribute :sticky, (arg == true || arg.to_s == "1" ? 1 : 0)
+ write_attribute :sticky, (arg == true || arg.to_s == '1' ? 1 : 0)
end
def sticky?
diff --git a/app/models/news.rb b/app/models/news.rb
index 202723aee466..e4b84568e47c 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -28,7 +28,7 @@
class News < ApplicationRecord
belongs_to :project
- belongs_to :author, class_name: "User"
+ belongs_to :author, class_name: 'User'
has_many :comments, -> {
order(:created_at)
}, as: :commented, dependent: :delete_all
@@ -39,7 +39,7 @@ class News < ApplicationRecord
acts_as_journalized
- acts_as_event url: Proc.new { |o| { controller: "/news", action: "show", id: o.id } }
+ acts_as_event url: Proc.new { |o| { controller: '/news', action: 'show', id: o.id } }
acts_as_searchable columns: %W[#{table_name}.title #{table_name}.summary #{table_name}.description],
include: :project,
@@ -61,7 +61,7 @@ def visible?(user = User.current)
end
def description=(val)
- super(val.presence || "")
+ super(val.presence || '')
end
# returns latest news for projects visible by user
diff --git a/app/models/notification.rb b/app/models/notification.rb
index f38a59e1dfdc..f7d623140e4a 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -46,8 +46,8 @@ class Notification < ApplicationRecord
enum reason: REASONS,
_prefix: true
- belongs_to :recipient, class_name: "User"
- belongs_to :actor, class_name: "User"
+ belongs_to :recipient, class_name: 'User'
+ belongs_to :actor, class_name: 'User'
belongs_to :project
belongs_to :journal
belongs_to :resource, polymorphic: true
diff --git a/app/models/notification_settings/scopes/applicable.rb b/app/models/notification_settings/scopes/applicable.rb
index 40d3693fed80..c2eb0ce49062 100644
--- a/app/models/notification_settings/scopes/applicable.rb
+++ b/app/models/notification_settings/scopes/applicable.rb
@@ -37,7 +37,7 @@ module Applicable
# rubocop:disable Metrics/AbcSize
def applicable(project)
global_notifications = NotificationSetting.arel_table
- project_notifications = NotificationSetting.arel_table.alias("project_settings")
+ project_notifications = NotificationSetting.arel_table.alias('project_settings')
subselect = global_notifications
.where(global_notifications[:project_id].eq(nil))
diff --git a/app/models/notifications/scopes/visible.rb b/app/models/notifications/scopes/visible.rb
index 53b5393b99cc..7fa11294e831 100644
--- a/app/models/notifications/scopes/visible.rb
+++ b/app/models/notifications/scopes/visible.rb
@@ -38,7 +38,7 @@ module Visible
# As currently only notifications for work packages exist, the implementation is work package specific.
def visible(user)
recipient(user)
- .where(resource_type: "WorkPackage", resource_id: WorkPackage.visible(user).select(:id))
+ .where(resource_type: 'WorkPackage', resource_id: WorkPackage.visible(user).select(:id))
end
end
end
diff --git a/app/models/oauth_client.rb b/app/models/oauth_client.rb
index adee82bac331..d79bb046413c 100644
--- a/app/models/oauth_client.rb
+++ b/app/models/oauth_client.rb
@@ -30,6 +30,6 @@ class OAuthClient < ApplicationRecord
belongs_to :integration, polymorphic: true
def redirect_uri
- File.join(Rails.application.root_url, "oauth_clients", client_id, "callback")
+ File.join(Rails.application.root_url, 'oauth_clients', client_id, 'callback')
end
end
diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb
index 68d61fe64b8c..496f7f409611 100644
--- a/app/models/permitted_params.rb
+++ b/app/models/permitted_params.rb
@@ -187,13 +187,8 @@ def settings
end
def user(additional_params = [])
- if params[:user].present?
- permitted_params = params.require(:user).permit(*self.class.permitted_attributes[:user] + additional_params)
- permitted_params.merge(custom_field_values(:user))
- else
- # This happens on the Profile page for LDAP user, no "user" hash is sent.
- {}.merge(custom_field_values(:user, required: false))
- end
+ permitted_params = params.require(:user).permit(*self.class.permitted_attributes[:user] + additional_params)
+ permitted_params.merge(custom_field_values(:user))
end
def placeholder_user
diff --git a/app/models/principal.rb b/app/models/principal.rb
index 1afda9a0e7a4..e9a5d568b7b5 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -42,29 +42,29 @@ class Principal < ApplicationRecord
has_one :preference,
dependent: :destroy,
- class_name: "UserPreference",
- foreign_key: "user_id",
+ class_name: 'UserPreference',
+ foreign_key: 'user_id',
inverse_of: :user
- has_many :members, foreign_key: "user_id", dependent: :destroy, inverse_of: :principal
+ has_many :members, foreign_key: 'user_id', dependent: :destroy, inverse_of: :principal
has_many :memberships,
-> {
includes(:project, :roles)
.merge(Member.of_any_project.or(Member.global))
.where(["projects.active = ? OR members.project_id IS NULL", true])
- .order(Arel.sql("projects.name ASC"))
+ .order(Arel.sql('projects.name ASC'))
},
inverse_of: :principal,
dependent: :nullify,
- class_name: "Member",
- foreign_key: "user_id"
+ class_name: 'Member',
+ foreign_key: 'user_id'
has_many :work_package_shares,
-> { where(entity_type: WorkPackage.name) },
inverse_of: :principal,
dependent: :delete_all,
- class_name: "Member",
- foreign_key: "user_id"
+ class_name: 'Member',
+ foreign_key: 'user_id'
has_many :projects, through: :memberships
- has_many :categories, foreign_key: "assigned_to_id", dependent: :nullify, inverse_of: :assigned_to
+ has_many :categories, foreign_key: 'assigned_to_id', dependent: :nullify, inverse_of: :assigned_to
has_paper_trail
@@ -106,8 +106,8 @@ class Principal < ApplicationRecord
scope :within_group, ->(group, positive = true) {
group_id = group.is_a?(Group) ? [group.id] : Array(group).map(&:to_i)
- sql_condition = group_id.any? ? "WHERE gu.group_id IN (?)" : ""
- sql_not = positive ? "" : "NOT"
+ sql_condition = group_id.any? ? 'WHERE gu.group_id IN (?)' : ''
+ sql_not = positive ? '' : 'NOT'
sql_query = [
"#{User.table_name}.id #{sql_not} IN " \
@@ -190,10 +190,10 @@ def type_condition(table = arel_table)
# Make sure we don't try to insert NULL values (see #4632)
def set_default_empty_values
- self.login ||= ""
- self.firstname ||= ""
- self.lastname ||= ""
- self.mail ||= ""
+ self.login ||= ''
+ self.firstname ||= ''
+ self.lastname ||= ''
+ self.mail ||= ''
true
end
end
diff --git a/app/models/principals/scopes/like.rb b/app/models/principals/scopes/like.rb
index c194ec51050d..b2910e133229 100644
--- a/app/models/principals/scopes/like.rb
+++ b/app/models/principals/scopes/like.rb
@@ -42,14 +42,11 @@ def like(query)
s = "%#{query.to_s.downcase.strip.tr(',', '')}%"
- sql = <<~SQL
- LOWER(login) LIKE :s
- OR unaccent(LOWER(#{firstnamelastname})) LIKE unaccent(:s)
- OR unaccent(LOWER(#{lastnamefirstname})) LIKE unaccent(:s)
- OR LOWER(mail) LIKE :s
- SQL
-
- where([sql, { s: }])
+ where(['LOWER(login) LIKE :s OR ' +
+ "LOWER(#{firstnamelastname}) LIKE :s OR " +
+ "LOWER(#{lastnamefirstname}) LIKE :s OR " +
+ 'LOWER(mail) LIKE :s',
+ { s: }])
.order(:type, :login, :lastname, :firstname, :mail)
end
end
diff --git a/app/models/principals/scopes/ordered_by_name.rb b/app/models/principals/scopes/ordered_by_name.rb
index c72bab93d725..7a211f0813fe 100644
--- a/app/models/principals/scopes/ordered_by_name.rb
+++ b/app/models/principals/scopes/ordered_by_name.rb
@@ -37,7 +37,7 @@ module OrderedByName
# @desc [Boolean] Whether the sortation should be reversed
# @return [ActiveRecord::Relation] A scope of sorted principals
def ordered_by_name(desc: false)
- direction = desc ? "DESC" : "ASC"
+ direction = desc ? 'DESC' : 'ASC'
order_case = Arel.sql <<~SQL
CASE
@@ -56,7 +56,7 @@ def user_concat_sql
when :firstname_lastname
"concat_ws(' ', users.firstname, users.lastname)"
when :firstname
- "users.firstname"
+ 'users.firstname'
when :lastname_firstname, :lastname_coma_firstname, :lastname_n_firstname
"concat_ws(' ', users.lastname, users.firstname)"
when :username
diff --git a/app/models/principals/scopes/possible_assignee.rb b/app/models/principals/scopes/possible_assignee.rb
index 2f19ddd21b3d..8332275dec3a 100644
--- a/app/models/principals/scopes/possible_assignee.rb
+++ b/app/models/principals/scopes/possible_assignee.rb
@@ -74,18 +74,18 @@ def on_work_package_user_ids(work_package)
Member
.assignable
.of_work_package(work_package)
- .group("user_id")
+ .group('user_id')
.having(["COUNT(DISTINCT(project_id, entity_type, entity_id, user_id)) = ?", work_package.size])
- .select("user_id")
+ .select('user_id')
end
def on_project_user_ids(project)
Member
.assignable
.of_project(project)
- .group("user_id")
+ .group('user_id')
.having(["COUNT(DISTINCT(project_id, user_id)) = ?", project.size])
- .select("user_id")
+ .select('user_id')
end
end
end
diff --git a/app/models/principals/scopes/possible_member.rb b/app/models/principals/scopes/possible_member.rb
index eef5ff35e87b..7ae000fc899f 100644
--- a/app/models/principals/scopes/possible_member.rb
+++ b/app/models/principals/scopes/possible_member.rb
@@ -42,8 +42,8 @@ module PossibleMember
def possible_member(project)
Queries::Principals::PrincipalQuery
.new(user: ::User.current)
- .where(:member, "!", [project.id])
- .where(:status, "!", [statuses[:locked]])
+ .where(:member, '!', [project.id])
+ .where(:status, '!', [statuses[:locked]])
.results
end
end
diff --git a/app/models/project_role.rb b/app/models/project_role.rb
index 45daaf597db9..f28b2dc712f7 100644
--- a/app/models/project_role.rb
+++ b/app/models/project_role.rb
@@ -29,7 +29,7 @@
class ProjectRole < Role
def self.givable
super
- .where(type: "ProjectRole")
+ .where(type: 'ProjectRole')
end
# Return the builtin 'non member' role. If the role doesn't exist,
@@ -37,10 +37,10 @@ def self.givable
def self.non_member
non_member_role = where(builtin: BUILTIN_NON_MEMBER).first
if non_member_role.nil?
- non_member_role = create(name: "Non member", position: 0) do |role|
+ non_member_role = create(name: 'Non member', position: 0) do |role|
role.builtin = BUILTIN_NON_MEMBER
end
- raise "Unable to create the non-member role." if non_member_role.new_record?
+ raise 'Unable to create the non-member role.' if non_member_role.new_record?
end
non_member_role
end
@@ -50,10 +50,10 @@ def self.non_member
def self.anonymous
anonymous_role = where(builtin: BUILTIN_ANONYMOUS).first
if anonymous_role.nil?
- anonymous_role = create(name: "Anonymous", position: 0) do |role|
+ anonymous_role = create(name: 'Anonymous', position: 0) do |role|
role.builtin = BUILTIN_ANONYMOUS
end
- raise "Unable to create the anonymous role." if anonymous_role.new_record?
+ raise 'Unable to create the anonymous role.' if anonymous_role.new_record?
end
anonymous_role
end
diff --git a/app/models/projects/activity.rb b/app/models/projects/activity.rb
index e0b5f64c3014..e07b6dd97685 100644
--- a/app/models/projects/activity.rb
+++ b/app/models/projects/activity.rb
@@ -44,8 +44,8 @@ def latest_project_activity
def with_latest_activity
Project
- .select("projects.*")
- .select("activity.latest_activity_at")
+ .select('projects.*')
+ .select('activity.latest_activity_at')
.joins("LEFT JOIN (#{latest_activity_sql}) activity ON projects.id = activity.project_id")
end
@@ -58,7 +58,7 @@ def latest_activity_sql
end
def all_activity_provider_union_sql
- latest_project_activity.join(" UNION ALL ")
+ latest_project_activity.join(' UNION ALL ')
end
def build_latest_project_activity_for(on:, chain:, attribute:, project_id_attribute:)
diff --git a/app/models/projects/exports/formatters/status.rb b/app/models/projects/exports/formatters/status.rb
index b138306b3bed..4a086a07b928 100644
--- a/app/models/projects/exports/formatters/status.rb
+++ b/app/models/projects/exports/formatters/status.rb
@@ -36,7 +36,7 @@ def self.apply?(attribute, _export_format)
# Takes a project and returns the localized status code
def format(project, **)
code = project.status_code
- return "" unless code
+ return '' unless code
translate_code code
end
diff --git a/app/models/projects/storage.rb b/app/models/projects/storage.rb
index b10fbe21916a..46a76fd12ea0 100644
--- a/app/models/projects/storage.rb
+++ b/app/models/projects/storage.rb
@@ -42,11 +42,11 @@ def count_required_storage
storage = self.class.with_required_storage.find(id)
{
- "total" => storage.required_disk_space,
- "modules" => {
- "label_work_package_plural" => storage.work_package_required_space,
- "project_module_wiki" => storage.wiki_required_space,
- "label_repository" => storage.repositories_required_space
+ 'total' => storage.required_disk_space,
+ 'modules' => {
+ 'label_work_package_plural' => storage.work_package_required_space,
+ 'project_module_wiki' => storage.wiki_required_space,
+ 'label_repository' => storage.repositories_required_space
}.select { |_, v| v.present? && v.positive? }
}
end
@@ -67,10 +67,10 @@ def with_required_storage
.joins("LEFT JOIN (#{wiki_storage_sql}) wiki ON projects.id = wiki.project_id")
.joins("LEFT JOIN (#{work_package_sql}) wp ON projects.id = wp.project_id")
.joins("LEFT JOIN #{Repository.table_name} repos ON repos.project_id = projects.id")
- .select("projects.*")
- .select("wiki.filesize AS wiki_required_space")
- .select("wp.filesize AS work_package_required_space")
- .select("repos.required_storage_bytes AS repositories_required_space")
+ .select('projects.*')
+ .select('wiki.filesize AS wiki_required_space')
+ .select('wp.filesize AS work_package_required_space')
+ .select('repos.required_storage_bytes AS repositories_required_space')
.select("#{required_disk_space_sum} AS required_disk_space")
end
@@ -83,7 +83,7 @@ def total_projects_size
end
def required_disk_space_sum
- "(COALESCE(wiki.filesize, 0) + COALESCE(wp.filesize, 0) + COALESCE(repos.required_storage_bytes, 0))"
+ '(COALESCE(wiki.filesize, 0) + COALESCE(wp.filesize, 0) + COALESCE(repos.required_storage_bytes, 0))'
end
private
diff --git a/app/models/queries/base_query.rb b/app/models/queries/base_query.rb
index e7c5b6bbc500..45578b4d0eca 100644
--- a/app/models/queries/base_query.rb
+++ b/app/models/queries/base_query.rb
@@ -43,7 +43,7 @@ module Queries::BaseQuery
class_methods do
def model
- @model ||= name.demodulize.gsub("Query", "").constantize
+ @model ||= name.demodulize.gsub('Query', '').constantize
end
def i18n_scope
@@ -74,11 +74,11 @@ def groups
return empty_scope unless valid?
apply_group_by(apply_filters(default_scope))
- .select(group_by.name, Arel.sql("COUNT(*)"))
+ .select(group_by.name, Arel.sql('COUNT(*)'))
end
def group_values
- groups_hash = groups.pluck(group_by.name, Arel.sql("COUNT(*)")).to_h
+ groups_hash = groups.pluck(group_by.name, Arel.sql('COUNT(*)')).to_h
instantiate_group_keys groups_hash
end
@@ -238,7 +238,7 @@ def already_ordered_by_id?(scope)
scope.order_values.any? do |order|
order.respond_to?(:value) && order.value.respond_to?(:relation) &&
order.value.relation.name == self.class.model.table_name &&
- order.value.name == "id"
+ order.value.name == 'id'
end
end
end
diff --git a/app/models/queries/capabilities/capability_query.rb b/app/models/queries/capabilities/capability_query.rb
index deeefb56151f..7b7cfb9dce53 100644
--- a/app/models/queries/capabilities/capability_query.rb
+++ b/app/models/queries/capabilities/capability_query.rb
@@ -36,7 +36,7 @@ def self.model
def results
super
- .reorder("action ASC", "principal_id ASC", "capabilities.context_id ASC")
+ .reorder('action ASC', 'principal_id ASC', 'capabilities.context_id ASC')
end
def default_scope
@@ -53,9 +53,9 @@ def minimum_filters_set
any_required = filters.any? do |filter|
[Queries::Capabilities::Filters::PrincipalIdFilter,
Queries::Capabilities::Filters::ContextFilter,
- Queries::Capabilities::Filters::IdFilter].include?(filter.class) && filter.operator == "="
+ Queries::Capabilities::Filters::IdFilter].include?(filter.class) && filter.operator == '='
end
- errors.add(:filters, I18n.t("activerecord.errors.models.capability.query.filters.minimum")) unless any_required
+ errors.add(:filters, I18n.t('activerecord.errors.models.capability.query.filters.minimum')) unless any_required
end
end
diff --git a/app/models/queries/capabilities/filters/capability_filter.rb b/app/models/queries/capabilities/filters/capability_filter.rb
index ee8a200699c0..09d11b7e3893 100644
--- a/app/models/queries/capabilities/filters/capability_filter.rb
+++ b/app/models/queries/capabilities/filters/capability_filter.rb
@@ -34,6 +34,6 @@ def human_name
end
def where
- operator_strategy.sql_for_field(values, "capabilities", self.class.key)
+ operator_strategy.sql_for_field(values, 'capabilities', self.class.key)
end
end
diff --git a/app/models/queries/filters/base.rb b/app/models/queries/filters/base.rb
index aea58102e7ec..b030df6f5dae 100644
--- a/app/models/queries/filters/base.rb
+++ b/app/models/queries/filters/base.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "queries/operators"
+require 'queries/operators'
class Queries::Filters::Base
include ActiveModel::Validations
@@ -111,7 +111,7 @@ def scope
end
def self.key
- to_s.demodulize.underscore.gsub(/_filter$/, "").to_sym
+ to_s.demodulize.underscore.gsub(/_filter$/, '').to_sym
end
def self.connection
@@ -198,7 +198,7 @@ def validate_inclusion_of_operator
def validate_presence_of_values
if operator_strategy&.requires_value? && (values.nil? || values.compact_blank.empty?)
- errors.add(:values, I18n.t("activerecord.errors.messages.blank"))
+ errors.add(:values, I18n.t('activerecord.errors.messages.blank'))
end
end
diff --git a/app/models/queries/filters/me_value.rb b/app/models/queries/filters/me_value.rb
index bc6492ab824e..1a6aab94fc27 100644
--- a/app/models/queries/filters/me_value.rb
+++ b/app/models/queries/filters/me_value.rb
@@ -27,7 +27,7 @@
#++
class Queries::Filters::MeValue
- KEY = "me".freeze
+ KEY = 'me'.freeze
def id
KEY
diff --git a/app/models/queries/filters/not_existing_filter.rb b/app/models/queries/filters/not_existing_filter.rb
index 6e5ce48a80ad..632ab69c0efa 100644
--- a/app/models/queries/filters/not_existing_filter.rb
+++ b/app/models/queries/filters/not_existing_filter.rb
@@ -48,7 +48,7 @@ def human_name
validate :always_false
def always_false
- errors.add :base, I18n.t(:"activerecord.errors.messages.filter_does_not_exist")
+ errors.add :base, I18n.t(:'activerecord.errors.messages.filter_does_not_exist')
end
# deactivating superclass validation
diff --git a/app/models/queries/filters/shared/any_user_name_attribute_filter.rb b/app/models/queries/filters/shared/any_user_name_attribute_filter.rb
index 02fc3ba6ec8c..effee48b7e61 100644
--- a/app/models/queries/filters/shared/any_user_name_attribute_filter.rb
+++ b/app/models/queries/filters/shared/any_user_name_attribute_filter.rb
@@ -46,18 +46,18 @@ def available_operators
private
def sql_concat_name
- <<-SQL.squish
- LOWER(
- CONCAT(
- users.firstname, ' ', users.lastname,
- ' ',
- users.lastname, ' ', users.firstname,
- ' ',
- users.login,
- ' ',
- users.mail
- )
- )
+ <<-SQL
+ LOWER(
+ CONCAT(
+ users.firstname, ' ', users.lastname,
+ ' ',
+ users.lastname, ' ', users.firstname,
+ ' ',
+ users.login,
+ ' ',
+ users.mail
+ )
+ )
SQL
end
end
diff --git a/app/models/queries/filters/shared/custom_field_filter.rb b/app/models/queries/filters/shared/custom_field_filter.rb
index 92f657747289..762234a142fe 100644
--- a/app/models/queries/filters/shared/custom_field_filter.rb
+++ b/app/models/queries/filters/shared/custom_field_filter.rb
@@ -82,11 +82,11 @@ def from_custom_field!(custom_field:, **)
# Get the subfilter class name for the given custom field
def subfilter_module(custom_field)
case custom_field.field_format
- when "user"
+ when 'user'
:User
- when "list", "version"
+ when 'list', 'version'
:ListOptional
- when "bool"
+ when 'bool'
:Bool
else
:Base
@@ -94,11 +94,11 @@ def subfilter_module(custom_field)
end
def all_custom_fields
- key = ["Queries::Filters::Shared::CustomFieldFilter",
+ key = ['Queries::Filters::Shared::CustomFieldFilter',
custom_field_context.custom_field_class,
- "all_custom_fields"]
+ 'all_custom_fields']
- RequestStore.fetch(key.join("/")) do
+ RequestStore.fetch(key.join('/')) do
custom_field_context.custom_field_class.all.to_a
end
end
diff --git a/app/models/queries/filters/shared/custom_fields/base.rb b/app/models/queries/filters/shared/custom_fields/base.rb
index 86030ed6b3b3..7f0faf751aa2 100644
--- a/app/models/queries/filters/shared/custom_fields/base.rb
+++ b/app/models/queries/filters/shared/custom_fields/base.rb
@@ -81,13 +81,13 @@ def strategies
def type
case custom_field.field_format
- when "float"
+ when 'float'
:float
- when "int"
+ when 'int'
:integer
- when "text"
+ when 'text'
:text
- when "date"
+ when 'date'
:date
else
:string
@@ -110,13 +110,13 @@ def error_messages
messages = errors.full_messages
.join(" #{I18n.t('support.array.sentence_connector')} ")
- human_name + I18n.t(default: " %s", message: messages)
+ human_name + I18n.t(default: ' %s', message: messages)
end
protected
def condition
- operator_strategy.sql_for_field(values_replaced, CustomValue.table_name, "value")
+ operator_strategy.sql_for_field(values_replaced, CustomValue.table_name, 'value')
end
def type_strategy_class
diff --git a/app/models/queries/filters/shared/custom_fields/bool.rb b/app/models/queries/filters/shared/custom_fields/bool.rb
index 78ee68e955f4..e5ca46b4a6ea 100644
--- a/app/models/queries/filters/shared/custom_fields/bool.rb
+++ b/app/models/queries/filters/shared/custom_fields/bool.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
module Queries::Filters::Shared
module CustomFields
diff --git a/app/models/queries/filters/shared/custom_fields/list_optional.rb b/app/models/queries/filters/shared/custom_fields/list_optional.rb
index da8e2b8be56b..826f86c9c5b7 100644
--- a/app/models/queries/filters/shared/custom_fields/list_optional.rb
+++ b/app/models/queries/filters/shared/custom_fields/list_optional.rb
@@ -26,16 +26,16 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
module Queries::Filters::Shared
module CustomFields
class ListOptional < Base
def value_objects
case custom_field.field_format
- when "version"
+ when 'version'
::Version.where(id: values)
- when "list"
+ when 'list'
custom_field.custom_options.where(id: values)
else
super
diff --git a/app/models/queries/filters/shared/custom_fields/user.rb b/app/models/queries/filters/shared/custom_fields/user.rb
index a928b051ea49..2644fdd546b7 100644
--- a/app/models/queries/filters/shared/custom_fields/user.rb
+++ b/app/models/queries/filters/shared/custom_fields/user.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "list_optional"
+require_relative 'list_optional'
module Queries::Filters::Shared
module CustomFields
diff --git a/app/models/queries/filters/shared/group_filter.rb b/app/models/queries/filters/shared/group_filter.rb
index 5356e842ddb5..3c105eeb2ebe 100644
--- a/app/models/queries/filters/shared/group_filter.rb
+++ b/app/models/queries/filters/shared/group_filter.rb
@@ -46,18 +46,18 @@ def type
end
def human_name
- I18n.t("query_fields.member_of_group")
+ I18n.t('query_fields.member_of_group')
end
def where
case operator
- when "="
+ when '='
"users.id IN (#{group_subselect})"
- when "!"
+ when '!'
"users.id NOT IN (#{group_subselect})"
- when "*"
+ when '*'
"users.id IN (#{any_group_subselect})"
- when "!*"
+ when '!*'
"users.id NOT IN (#{any_group_subselect})"
end
end
diff --git a/app/models/queries/filters/shared/me_value_filter.rb b/app/models/queries/filters/shared/me_value_filter.rb
index 4ed3200ce187..272c75338915 100644
--- a/app/models/queries/filters/shared/me_value_filter.rb
+++ b/app/models/queries/filters/shared/me_value_filter.rb
@@ -37,7 +37,7 @@ def values_replaced
if User.current.logged?
vals.push(User.current.id.to_s)
else
- vals.push("0")
+ vals.push('0')
end
end
diff --git a/app/models/queries/filters/shared/parsed_filter.rb b/app/models/queries/filters/shared/parsed_filter.rb
index afa913405dd5..3b59fe986065 100644
--- a/app/models/queries/filters/shared/parsed_filter.rb
+++ b/app/models/queries/filters/shared/parsed_filter.rb
@@ -33,9 +33,9 @@ def type
def where
case operator
- when "="
- value_conditions.join(" OR ")
- when "!"
+ when '='
+ value_conditions.join(' OR ')
+ when '!'
"NOT #{value_conditions.join(' AND NOT ')}"
end
end
diff --git a/app/models/queries/filters/shared/user_blocked_filter.rb b/app/models/queries/filters/shared/user_blocked_filter.rb
index e073adcd96d9..79f80f9a226b 100644
--- a/app/models/queries/filters/shared/user_blocked_filter.rb
+++ b/app/models/queries/filters/shared/user_blocked_filter.rb
@@ -42,7 +42,7 @@ def type
end
def where
- User.blocked_condition(operator == "=")
+ User.blocked_condition(operator == '=')
end
end
diff --git a/app/models/queries/filters/shared/user_name_filter.rb b/app/models/queries/filters/shared/user_name_filter.rb
index 74a3f976512f..88004837ea56 100644
--- a/app/models/queries/filters/shared/user_name_filter.rb
+++ b/app/models/queries/filters/shared/user_name_filter.rb
@@ -43,14 +43,14 @@ def self.key
def where
case operator
- when "="
- ["#{sql_concat_name} IN (:s) OR unaccent(#{sql_concat_name}) IN (:s)", { s: sql_value }]
- when "!"
- ["#{sql_concat_name} NOT IN (:s) AND unaccent(#{sql_concat_name}) NOT IN (:s)", { s: sql_value }]
- when "~", "**"
- ["unaccent(#{sql_concat_name}) LIKE unaccent(:s)", { s: "%#{sql_value}%" }]
- when "!~"
- ["unaccent(#{sql_concat_name}) NOT LIKE unaccent(:s)", { s: "%#{sql_value}%" }]
+ when '='
+ ["#{sql_concat_name} IN (?)", sql_value]
+ when '!'
+ ["#{sql_concat_name} NOT IN (?)", sql_value]
+ when '~', '**'
+ ["#{sql_concat_name} LIKE ?", "%#{sql_value}%"]
+ when '!~'
+ ["#{sql_concat_name} NOT LIKE ?", "%#{sql_value}%"]
end
end
@@ -58,9 +58,9 @@ def where
def sql_value
case operator
- when "=", "!"
- values.map { |val| self.class.connection.quote_string(val.downcase) }.join(",")
- when "**", "~", "!~"
+ when '=', '!'
+ values.map { |val| self.class.connection.quote_string(val.downcase) }.join(',')
+ when '**', '~', '!~'
values.first.downcase
end
end
@@ -68,9 +68,9 @@ def sql_value
def sql_concat_name
case Setting.user_format
when :firstname_lastname
- "LOWER(CONCAT(users.firstname, ' ', users.lastname))"
+ "LOWER(CONCAT(users.firstname, CONCAT(' ', users.lastname)))"
when :firstname
- "LOWER(users.firstname)"
+ 'LOWER(users.firstname)'
when :lastname_firstname, :lastname_coma_firstname
"LOWER(CONCAT(users.lastname, CONCAT(' ', users.firstname)))"
when :lastname_n_firstname
diff --git a/app/models/queries/filters/strategies/boolean_list.rb b/app/models/queries/filters/strategies/boolean_list.rb
index f9fba17b42ad..ce97ffd69892 100644
--- a/app/models/queries/filters/strategies/boolean_list.rb
+++ b/app/models/queries/filters/strategies/boolean_list.rb
@@ -44,8 +44,8 @@ def valid_values!
def operator_map
super_value = super.dup
- super_value["="] = ::Queries::Operators::BooleanEquals
- super_value["!"] = ::Queries::Operators::BooleanNotEquals
+ super_value['='] = ::Queries::Operators::BooleanEquals
+ super_value['!'] = ::Queries::Operators::BooleanNotEquals
super_value
end
diff --git a/app/models/queries/filters/strategies/boolean_list_strict.rb b/app/models/queries/filters/strategies/boolean_list_strict.rb
index f3d093c63a99..0563a59d815e 100644
--- a/app/models/queries/filters/strategies/boolean_list_strict.rb
+++ b/app/models/queries/filters/strategies/boolean_list_strict.rb
@@ -30,7 +30,7 @@ module Queries::Filters::Strategies
class BooleanListStrict < BooleanList
def operator_map
super_value = super.dup
- super_value["="] = ::Queries::Operators::BooleanEqualsStrict
+ super_value['='] = ::Queries::Operators::BooleanEqualsStrict
super_value
end
diff --git a/app/models/queries/filters/strategies/cf_list_optional.rb b/app/models/queries/filters/strategies/cf_list_optional.rb
index f6c5e4e1ca3b..1f8aa1d02099 100644
--- a/app/models/queries/filters/strategies/cf_list_optional.rb
+++ b/app/models/queries/filters/strategies/cf_list_optional.rb
@@ -34,10 +34,10 @@ class CfListOptional < ListOptional
def operator_map
super_value = super.dup
- super_value["&="] = ::Queries::Operators::CustomFields::EqualsAll
- super_value["!"] = ::Queries::Operators::CustomFields::NotEqualsAll
- super_value["!*"] = ::Queries::Operators::NoneOrBlank
- super_value["*"] = ::Queries::Operators::AllAndNonBlank
+ super_value['&='] = ::Queries::Operators::CustomFields::EqualsAll
+ super_value['!'] = ::Queries::Operators::CustomFields::NotEqualsAll
+ super_value['!*'] = ::Queries::Operators::NoneOrBlank
+ super_value['*'] = ::Queries::Operators::AllAndNonBlank
super_value
end
diff --git a/app/models/queries/filters/strategies/cf_numeric.rb b/app/models/queries/filters/strategies/cf_numeric.rb
index 818dfab9b6e2..23b2ba148b89 100644
--- a/app/models/queries/filters/strategies/cf_numeric.rb
+++ b/app/models/queries/filters/strategies/cf_numeric.rb
@@ -32,10 +32,10 @@ module CfNumeric
def operator_map
super_value = super.dup
- super_value["!*"] = Queries::Operators::NoneOrBlank
- super_value["*"] = Queries::Operators::AllAndNonBlank
- super_value[">="] = Queries::Operators::CastedGreaterOrEqual
- super_value["<="] = Queries::Operators::CastedLessOrEqual
+ super_value['!*'] = Queries::Operators::NoneOrBlank
+ super_value['*'] = Queries::Operators::AllAndNonBlank
+ super_value['>='] = Queries::Operators::CastedGreaterOrEqual
+ super_value['<='] = Queries::Operators::CastedLessOrEqual
super_value
end
diff --git a/app/models/queries/filters/strategies/date.rb b/app/models/queries/filters/strategies/date.rb
index 422b26946e82..6b34a2cbb2fb 100644
--- a/app/models/queries/filters/strategies/date.rb
+++ b/app/models/queries/filters/strategies/date.rb
@@ -28,8 +28,8 @@
module Queries::Filters::Strategies
class Date < Queries::Filters::Strategies::Integer
- self.supported_operators = ["t+", "t+", "t", "w", ">t-", "d", "!*"]
- self.default_operator = "t"
+ self.supported_operators = ['t+', 't+', 't', 'w', '>t-', 'd', '!*']
+ self.default_operator = 't'
def validate
if operator == Queries::Operators::OnDate ||
@@ -44,7 +44,7 @@ def validate
def validate_values_all_date
unless values.all? { |value| value.blank? || date?(value) }
- errors.add(:values, I18n.t("activerecord.errors.messages.not_a_date"))
+ errors.add(:values, I18n.t('activerecord.errors.messages.not_a_date'))
end
end
diff --git a/app/models/queries/filters/strategies/date_interval.rb b/app/models/queries/filters/strategies/date_interval.rb
index 307e9d1b7864..2be08d931c5b 100644
--- a/app/models/queries/filters/strategies/date_interval.rb
+++ b/app/models/queries/filters/strategies/date_interval.rb
@@ -28,7 +28,7 @@
module Queries::Filters::Strategies
class DateInterval < Queries::Filters::Strategies::Date
- self.supported_operators = ["<>d"]
- self.default_operator = "<>d"
+ self.supported_operators = ['<>d']
+ self.default_operator = '<>d'
end
end
diff --git a/app/models/queries/filters/strategies/date_time_past.rb b/app/models/queries/filters/strategies/date_time_past.rb
index f7e666874baa..75027841bac9 100644
--- a/app/models/queries/filters/strategies/date_time_past.rb
+++ b/app/models/queries/filters/strategies/date_time_past.rb
@@ -28,8 +28,8 @@
module Queries::Filters::Strategies
class DateTimePast < Queries::Filters::Strategies::Integer
- self.supported_operators = [">t-", "d"]
- self.default_operator = ">t-"
+ self.supported_operators = ['>t-', 'd']
+ self.default_operator = '>t-'
def validate
if operator == Queries::Operators::OnDateTime ||
@@ -44,15 +44,15 @@ def validate
def operator_map
super_value = super.dup
- super_value["=d"] = Queries::Operators::OnDateTime
- super_value["<>d"] = Queries::Operators::BetweenDateTime
+ super_value['=d'] = Queries::Operators::OnDateTime
+ super_value['<>d'] = Queries::Operators::BetweenDateTime
super_value
end
def validate_values_all_datetime
unless values.all? { |value| value.blank? || datetime?(value) }
- errors.add(:values, I18n.t("activerecord.errors.messages.not_a_datetime"))
+ errors.add(:values, I18n.t('activerecord.errors.messages.not_a_datetime'))
end
end
diff --git a/app/models/queries/filters/strategies/integer_list.rb b/app/models/queries/filters/strategies/integer_list.rb
index f00103456a6b..9f4223ad7912 100644
--- a/app/models/queries/filters/strategies/integer_list.rb
+++ b/app/models/queries/filters/strategies/integer_list.rb
@@ -28,11 +28,11 @@
module Queries::Filters::Strategies
class IntegerList < ::Queries::Filters::Strategies::Integer
- self.supported_operators = ["!", "="]
+ self.supported_operators = ['!', '=']
def operator_map
super_value = super.dup
- super_value["="] = ::Queries::Operators::EqualsOr
+ super_value['='] = ::Queries::Operators::EqualsOr
super_value
end
diff --git a/app/models/queries/filters/strategies/integer_list_optional.rb b/app/models/queries/filters/strategies/integer_list_optional.rb
index 708d03b25988..5131409bc22b 100644
--- a/app/models/queries/filters/strategies/integer_list_optional.rb
+++ b/app/models/queries/filters/strategies/integer_list_optional.rb
@@ -28,11 +28,11 @@
module Queries::Filters::Strategies
class IntegerListOptional < ::Queries::Filters::Strategies::Integer
- self.supported_operators = ["=", "!", "*", "!*"]
+ self.supported_operators = ['=', '!', '*', '!*']
def operator_map
super_value = super.dup
- super_value["="] = ::Queries::Operators::EqualsOr
+ super_value['='] = ::Queries::Operators::EqualsOr
super_value
end
diff --git a/app/models/queries/filters/strategies/list.rb b/app/models/queries/filters/strategies/list.rb
index e02720cdc174..e3941b6bd1da 100644
--- a/app/models/queries/filters/strategies/list.rb
+++ b/app/models/queries/filters/strategies/list.rb
@@ -31,12 +31,12 @@ class List < BaseStrategy
delegate :allowed_values,
to: :filter
- self.supported_operators = ["=", "!"]
- self.default_operator = "="
+ self.supported_operators = ['=', '!']
+ self.default_operator = '='
def operator_map
super_value = super.dup
- super_value["="] = ::Queries::Operators::EqualsOr
+ super_value['='] = ::Queries::Operators::EqualsOr
super_value
end
@@ -52,11 +52,11 @@ def validate
end
def valid_values!
- filter.values &= (allowed_values.map(&:last).map(&:to_s) + ["-1"])
+ filter.values &= (allowed_values.map(&:last).map(&:to_s) + ['-1'])
end
def non_valid_values?
- (values.reject(&:blank?) & (allowed_values.map(&:last).map(&:to_s) + ["-1"])) != values.reject(&:blank?)
+ (values.reject(&:blank?) & (allowed_values.map(&:last).map(&:to_s) + ['-1'])) != values.reject(&:blank?)
end
end
end
diff --git a/app/models/queries/filters/strategies/list_all.rb b/app/models/queries/filters/strategies/list_all.rb
index 61da8689e67e..7ce4aa21759f 100644
--- a/app/models/queries/filters/strategies/list_all.rb
+++ b/app/models/queries/filters/strategies/list_all.rb
@@ -32,7 +32,7 @@ class ListAll < List
def operator_map
super_value = super.dup
- super_value["&="] = ::Queries::Operators::EqualsAll
+ super_value['&='] = ::Queries::Operators::EqualsAll
super_value
end
diff --git a/app/models/queries/filters/strategies/list_optional.rb b/app/models/queries/filters/strategies/list_optional.rb
index 3e4f59d3c086..83df263bd72f 100644
--- a/app/models/queries/filters/strategies/list_optional.rb
+++ b/app/models/queries/filters/strategies/list_optional.rb
@@ -28,6 +28,6 @@
module Queries::Filters::Strategies
class ListOptional < List
- self.supported_operators = ["=", "!", "*", "!*"]
+ self.supported_operators = ['=', '!', '*', '!*']
end
end
diff --git a/app/models/queries/filters/strategies/numeric.rb b/app/models/queries/filters/strategies/numeric.rb
index bf4814397f12..7ffe416ccd7e 100644
--- a/app/models/queries/filters/strategies/numeric.rb
+++ b/app/models/queries/filters/strategies/numeric.rb
@@ -29,8 +29,8 @@
module Queries::Filters::Strategies
module Numeric
def self.included(base)
- base.supported_operators = ["=", "!", ">=", "<=", "!*", "*"]
- base.default_operator = "="
+ base.supported_operators = ['=', '!', '>=', '<=', '!*', '*']
+ base.default_operator = '='
end
def validate
diff --git a/app/models/queries/filters/strategies/relation.rb b/app/models/queries/filters/strategies/relation.rb
index a17ea247cc80..e1cbd6f7ce81 100644
--- a/app/models/queries/filters/strategies/relation.rb
+++ b/app/models/queries/filters/strategies/relation.rb
@@ -32,7 +32,7 @@ class Relation < BaseStrategy
to: :filter
# 'children' used to be supported by the API although 'child' would be more fitting.
- self.supported_operators = ::Relation::TYPES.keys + [::Relation::TYPE_PARENT, ::Relation::TYPE_CHILD, "children"]
+ self.supported_operators = ::Relation::TYPES.keys + [::Relation::TYPE_PARENT, ::Relation::TYPE_CHILD, 'children']
self.default_operator = ::Relation::TYPE_RELATES
def validate
diff --git a/app/models/queries/filters/strategies/search.rb b/app/models/queries/filters/strategies/search.rb
index 7fb9a07970c7..deee18bbcb04 100644
--- a/app/models/queries/filters/strategies/search.rb
+++ b/app/models/queries/filters/strategies/search.rb
@@ -28,7 +28,7 @@
module Queries::Filters::Strategies
class Search < BaseStrategy
- self.supported_operators = ["**"]
- self.default_operator = "**"
+ self.supported_operators = ['**']
+ self.default_operator = '**'
end
end
diff --git a/app/models/queries/filters/strategies/string.rb b/app/models/queries/filters/strategies/string.rb
index f5e063ec58d7..d163a2ed1d0e 100644
--- a/app/models/queries/filters/strategies/string.rb
+++ b/app/models/queries/filters/strategies/string.rb
@@ -28,7 +28,7 @@
module Queries::Filters::Strategies
class String < BaseStrategy
- self.supported_operators = ["=", "~", "!", "!~"]
- self.default_operator = "~"
+ self.supported_operators = ['=', '~', '!', '!~']
+ self.default_operator = '~'
end
end
diff --git a/app/models/queries/filters/strategies/text.rb b/app/models/queries/filters/strategies/text.rb
index 057ab43c2d47..981827401d3a 100644
--- a/app/models/queries/filters/strategies/text.rb
+++ b/app/models/queries/filters/strategies/text.rb
@@ -28,7 +28,7 @@
module Queries::Filters::Strategies
class Text < BaseStrategy
- self.supported_operators = ["~", "!~"]
- self.default_operator = "~"
+ self.supported_operators = ['~', '!~']
+ self.default_operator = '~'
end
end
diff --git a/app/models/queries/filters/strategies/validations.rb b/app/models/queries/filters/strategies/validations.rb
index 8c9623270fbc..132236eb8ff0 100644
--- a/app/models/queries/filters/strategies/validations.rb
+++ b/app/models/queries/filters/strategies/validations.rb
@@ -38,7 +38,7 @@ def date?(str)
def validate
unless values.all? { |value| value.blank? || date?(value) }
- errors.add(:values, I18n.t("activerecord.errors.messages.not_a_date"))
+ errors.add(:values, I18n.t('activerecord.errors.messages.not_a_date'))
end
end
diff --git a/app/models/queries/filters/strategies/work_packages/shared_with_user/list_optional.rb b/app/models/queries/filters/strategies/work_packages/shared_with_user/list_optional.rb
index 3252fc0f7d0e..575a57a3dd0a 100644
--- a/app/models/queries/filters/strategies/work_packages/shared_with_user/list_optional.rb
+++ b/app/models/queries/filters/strategies/work_packages/shared_with_user/list_optional.rb
@@ -34,9 +34,9 @@ class ListOptional < ::Queries::Filters::Strategies::List
def operator_map
super.dup.tap do |super_value|
- super_value["="] = ::Queries::Operators::EqualsOr
- super_value["&="] = ::Queries::Operators::EqualsAll
- super_value["*"] = ::Queries::Operators::WorkPackages::SharedWithUser::Any
+ super_value['='] = ::Queries::Operators::EqualsOr
+ super_value['&='] = ::Queries::Operators::EqualsAll
+ super_value['*'] = ::Queries::Operators::WorkPackages::SharedWithUser::Any
end
end
end
diff --git a/app/models/queries/filters/templated_value.rb b/app/models/queries/filters/templated_value.rb
index fc17c3b62c74..ad98a9b4e527 100644
--- a/app/models/queries/filters/templated_value.rb
+++ b/app/models/queries/filters/templated_value.rb
@@ -27,8 +27,8 @@
#++
class Queries::Filters::TemplatedValue
- KEY = "{id}".freeze
- DEPRECATED_KEY = "templated".freeze
+ KEY = '{id}'.freeze
+ DEPRECATED_KEY = 'templated'.freeze
attr_accessor :templated_class
@@ -37,7 +37,7 @@ def initialize(templated_class)
end
def id
- "{id}"
+ '{id}'
end
def name
diff --git a/app/models/queries/group_bys/not_existing_group_by.rb b/app/models/queries/group_bys/not_existing_group_by.rb
index cf2dffebfc67..4e7ea8993ddf 100644
--- a/app/models/queries/group_bys/not_existing_group_by.rb
+++ b/app/models/queries/group_bys/not_existing_group_by.rb
@@ -38,7 +38,7 @@ def self.key
private
def always_false
- errors.add :base, I18n.t(:"activerecord.errors.messages.does_not_exist")
+ errors.add :base, I18n.t(:'activerecord.errors.messages.does_not_exist')
end
end
end
diff --git a/app/models/queries/members/filters/role_filter.rb b/app/models/queries/members/filters/role_filter.rb
index f25ea2442960..cfefd07de63f 100644
--- a/app/models/queries/members/filters/role_filter.rb
+++ b/app/models/queries/members/filters/role_filter.rb
@@ -44,6 +44,6 @@ def joins
end
def where
- operator_strategy.sql_for_field(values, "member_roles", "role_id")
+ operator_strategy.sql_for_field(values, 'member_roles', 'role_id')
end
end
diff --git a/app/models/queries/operators/ago.rb b/app/models/queries/operators/ago.rb
index 5101a2a4cefb..a063d86e0ecb 100644
--- a/app/models/queries/operators/ago.rb
+++ b/app/models/queries/operators/ago.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class Ago < Base
- label "ago"
- set_symbol "t-"
+ label 'ago'
+ set_symbol 't-'
extend DateRangeClauses
diff --git a/app/models/queries/operators/all.rb b/app/models/queries/operators/all.rb
index 2f56ac12f101..e8d8425cae02 100644
--- a/app/models/queries/operators/all.rb
+++ b/app/models/queries/operators/all.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class All < Base
- label "operator_all"
- set_symbol "*"
+ label 'operator_all'
+ set_symbol '*'
require_value false
def self.sql_for_field(_values, db_table, db_field)
diff --git a/app/models/queries/operators/between_date.rb b/app/models/queries/operators/between_date.rb
index 9e9256db3da5..3d718ed823f9 100644
--- a/app/models/queries/operators/between_date.rb
+++ b/app/models/queries/operators/between_date.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class BetweenDate < Base
- label "between"
- set_symbol "<>d"
+ label 'between'
+ set_symbol '<>d'
extend DateRangeClauses
diff --git a/app/models/queries/operators/between_date_time.rb b/app/models/queries/operators/between_date_time.rb
index 8fe2a297124c..cc2b28740579 100644
--- a/app/models/queries/operators/between_date_time.rb
+++ b/app/models/queries/operators/between_date_time.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class BetweenDateTime < Base
- label "between"
- set_symbol "<>d"
+ label 'between'
+ set_symbol '<>d'
extend DatetimeRangeClauses
diff --git a/app/models/queries/operators/boolean_equals.rb b/app/models/queries/operators/boolean_equals.rb
index 0f609a0069e9..c4fc7287e12a 100644
--- a/app/models/queries/operators/boolean_equals.rb
+++ b/app/models/queries/operators/boolean_equals.rb
@@ -28,18 +28,18 @@
module Queries::Operators
class BooleanEquals < Base
- label "equals"
- set_symbol "="
+ label 'equals'
+ set_symbol '='
def self.sql_for_field(values, db_table, db_field)
- sql = ""
+ sql = ''
- if values.include?("f")
+ if values.include?('f')
sql = "#{db_table}.#{db_field} IS NULL OR "
end
sql += "#{db_table}.#{db_field} IN (" +
- values.map { |val| "'#{connection.quote_string(val)}'" }.join(",") + ")"
+ values.map { |val| "'#{connection.quote_string(val)}'" }.join(',') + ')'
sql
end
diff --git a/app/models/queries/operators/boolean_equals_strict.rb b/app/models/queries/operators/boolean_equals_strict.rb
index c8c88b5ba45e..aa91315b468a 100644
--- a/app/models/queries/operators/boolean_equals_strict.rb
+++ b/app/models/queries/operators/boolean_equals_strict.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class BooleanEqualsStrict < Base
- label "equals"
- set_symbol "="
+ label 'equals'
+ set_symbol '='
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} IN (#{values.map { |val| "'#{connection.quote_string(val)}'" }.join(',')})"
diff --git a/app/models/queries/operators/boolean_not_equals.rb b/app/models/queries/operators/boolean_not_equals.rb
index 780118c69696..b7fc475b7eba 100644
--- a/app/models/queries/operators/boolean_not_equals.rb
+++ b/app/models/queries/operators/boolean_not_equals.rb
@@ -28,18 +28,18 @@
module Queries::Operators
class BooleanNotEquals < Base
- label "not_equals"
- set_symbol "!"
+ label 'not_equals'
+ set_symbol '!'
def self.sql_for_field(values, db_table, db_field)
if values.length > 1
raise "Only expected one value here"
end
- if values.include?("t")
- BooleanEquals.sql_for_field(["f"], db_table, db_field)
+ if values.include?('t')
+ BooleanEquals.sql_for_field(['f'], db_table, db_field)
else
- BooleanEquals.sql_for_field(["t"], db_table, db_field)
+ BooleanEquals.sql_for_field(['t'], db_table, db_field)
end
end
end
diff --git a/app/models/queries/operators/casted_greater_or_equal.rb b/app/models/queries/operators/casted_greater_or_equal.rb
index f3998780db41..586dd74b8382 100644
--- a/app/models/queries/operators/casted_greater_or_equal.rb
+++ b/app/models/queries/operators/casted_greater_or_equal.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class CastedGreaterOrEqual < Base
- label "greater_or_equal"
- set_symbol ">="
+ label 'greater_or_equal'
+ set_symbol '>='
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} != '' " +
diff --git a/app/models/queries/operators/casted_less_or_equal.rb b/app/models/queries/operators/casted_less_or_equal.rb
index bc23fd9a145e..b1a2a85a1cc8 100644
--- a/app/models/queries/operators/casted_less_or_equal.rb
+++ b/app/models/queries/operators/casted_less_or_equal.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class CastedLessOrEqual < Base
- label "less_or_equal"
- set_symbol "<="
+ label 'less_or_equal'
+ set_symbol '<='
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} != '' " +
diff --git a/app/models/queries/operators/child.rb b/app/models/queries/operators/child.rb
index 522edb7164b3..68c869ca278a 100644
--- a/app/models/queries/operators/child.rb
+++ b/app/models/queries/operators/child.rb
@@ -28,7 +28,7 @@
module Queries::Operators
class Child < Base
- label "child"
- set_symbol "child"
+ label 'child'
+ set_symbol 'child'
end
end
diff --git a/app/models/queries/operators/children.rb b/app/models/queries/operators/children.rb
index 5df6761409ab..239eb56646ae 100644
--- a/app/models/queries/operators/children.rb
+++ b/app/models/queries/operators/children.rb
@@ -28,7 +28,7 @@
module Queries::Operators
class Children < Base
- label "children"
- set_symbol "children"
+ label 'children'
+ set_symbol 'children'
end
end
diff --git a/app/models/queries/operators/closed_work_packages.rb b/app/models/queries/operators/closed_work_packages.rb
index 7f2a05c2dbf9..7521abea0e3f 100644
--- a/app/models/queries/operators/closed_work_packages.rb
+++ b/app/models/queries/operators/closed_work_packages.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class ClosedWorkPackages < Base
- label "closed_work_packages"
- set_symbol "c"
+ label 'closed_work_packages'
+ set_symbol 'c'
require_value false
def self.sql_for_field(_values, _db_table, _db_field)
diff --git a/app/models/queries/operators/concerns/contains_all_values.rb b/app/models/queries/operators/concerns/contains_all_values.rb
index d766baa7443c..78a2b1cf28c1 100644
--- a/app/models/queries/operators/concerns/contains_all_values.rb
+++ b/app/models/queries/operators/concerns/contains_all_values.rb
@@ -36,7 +36,7 @@ def sql_for_field(values, db_table, db_field)
.first
.split(/\s+/)
.map { |token| "#{db_table}.#{db_field} ILIKE '%#{OpenProject::SqlSanitization.quoted_sanitized_sql_like(token)}%'" }
- .join(" AND ")
+ .join(' AND ')
end
end
end
diff --git a/app/models/queries/operators/contains.rb b/app/models/queries/operators/contains.rb
index a27a8ca65a08..b5a3ef236e7e 100644
--- a/app/models/queries/operators/contains.rb
+++ b/app/models/queries/operators/contains.rb
@@ -30,7 +30,7 @@ module Queries::Operators
class Contains < Base
include Concerns::ContainsAllValues
- label "contains"
- set_symbol "~"
+ label 'contains'
+ set_symbol '~'
end
end
diff --git a/app/models/queries/operators/custom_fields/equals_all.rb b/app/models/queries/operators/custom_fields/equals_all.rb
index 507dc0585dc8..2fc924d71bb6 100644
--- a/app/models/queries/operators/custom_fields/equals_all.rb
+++ b/app/models/queries/operators/custom_fields/equals_all.rb
@@ -29,8 +29,8 @@
module Queries::Operators
module CustomFields
class EqualsAll < ::Queries::Operators::Base
- label "operator_equals_all"
- set_symbol "&="
+ label 'operator_equals_all'
+ set_symbol '&='
def self.sql_for_customized(values, custom_field_id, customized_type, customized_id_join_field)
# code expects strings (e.g. for quoting), but ints would work as well: unify them here
@@ -45,10 +45,10 @@ def self.sql_for_customized(values, custom_field_id, customized_type, customized
"AND value ='#{connection.quote_string(val)}')"
end
- sql.join(" AND ")
+ sql.join(' AND ')
else
# empty set of allowed values produces no result
- "0=1"
+ '0=1'
end
end
end
diff --git a/app/models/queries/operators/custom_fields/not_equals_all.rb b/app/models/queries/operators/custom_fields/not_equals_all.rb
index 159fda5c7536..3d8e0f5af97d 100644
--- a/app/models/queries/operators/custom_fields/not_equals_all.rb
+++ b/app/models/queries/operators/custom_fields/not_equals_all.rb
@@ -42,10 +42,10 @@ def self.sql_for_customized(values, custom_field_id, customized_type, customized
"AND value ='#{connection.quote_string(val)}')"
end
- sql.join(" AND ")
+ sql.join(' AND ')
else
# empty set of allowed values produces no result
- "0=1"
+ '0=1'
end
end
end
diff --git a/app/models/queries/operators/date_range_clauses.rb b/app/models/queries/operators/date_range_clauses.rb
index 158c3a185529..b724634f5420 100644
--- a/app/models/queries/operators/date_range_clauses.rb
+++ b/app/models/queries/operators/date_range_clauses.rb
@@ -50,7 +50,7 @@ def date_range_clause(table, field, from, to)
if to
s << ("#{table}.#{field} <= '%s'" % [quoted_date_from_utc(to)])
end
- s.join(" AND ")
+ s.join(' AND ')
end
def quoted_date_from_utc(value)
diff --git a/app/models/queries/operators/datetime_range_clauses.rb b/app/models/queries/operators/datetime_range_clauses.rb
index f3326c0f8f53..215301a80a2b 100644
--- a/app/models/queries/operators/datetime_range_clauses.rb
+++ b/app/models/queries/operators/datetime_range_clauses.rb
@@ -36,7 +36,7 @@ def datetime_range_clause(table, field, from, to)
if to
s << ("#{table}.#{field} <= '%s'" % [connection.quoted_date(to)])
end
- s.join(" AND ")
+ s.join(' AND ')
end
end
end
diff --git a/app/models/queries/operators/equals.rb b/app/models/queries/operators/equals.rb
index 38555acb54b7..9fac31954f96 100644
--- a/app/models/queries/operators/equals.rb
+++ b/app/models/queries/operators/equals.rb
@@ -28,25 +28,25 @@
module Queries::Operators
class Equals < Base
- label "equals"
- set_symbol "="
+ label 'equals'
+ set_symbol '='
def self.sql_for_field(values, db_table, db_field)
# code expects strings (e.g. for quoting), but ints would work as well: unify them here
values = values.map(&:to_s)
- sql = ""
+ sql = ''
if values.present?
- if values.include?("-1")
+ if values.include?('-1')
sql = "#{db_table}.#{db_field} IS NULL OR "
end
sql += "#{db_table}.#{db_field} IN (" +
- values.map { |val| "'#{connection.quote_string(val)}'" }.join(",") + ")"
+ values.map { |val| "'#{connection.quote_string(val)}'" }.join(',') + ')'
else
# empty set of allowed values produces no result
- sql = "0=1"
+ sql = '0=1'
end
sql
diff --git a/app/models/queries/operators/equals_all.rb b/app/models/queries/operators/equals_all.rb
index 31c4b8fe1d1b..05d3a0dccfd9 100644
--- a/app/models/queries/operators/equals_all.rb
+++ b/app/models/queries/operators/equals_all.rb
@@ -28,7 +28,7 @@
module Queries::Operators
class EqualsAll < Base
- label "operator_equals_all"
- set_symbol "&="
+ label 'operator_equals_all'
+ set_symbol '&='
end
end
diff --git a/app/models/queries/operators/equals_or.rb b/app/models/queries/operators/equals_or.rb
index dae581198716..8058518105ba 100644
--- a/app/models/queries/operators/equals_or.rb
+++ b/app/models/queries/operators/equals_or.rb
@@ -28,6 +28,6 @@
module Queries::Operators
class EqualsOr < Equals
- label "operator_equals_or"
+ label 'operator_equals_or'
end
end
diff --git a/app/models/queries/operators/everywhere.rb b/app/models/queries/operators/everywhere.rb
index 52152bde4315..1eb3164ee222 100644
--- a/app/models/queries/operators/everywhere.rb
+++ b/app/models/queries/operators/everywhere.rb
@@ -28,7 +28,7 @@
module Queries::Operators
class Everywhere < Base
- label "everywhere"
- set_symbol "**"
+ label 'everywhere'
+ set_symbol '**'
end
end
diff --git a/app/models/queries/operators/follows.rb b/app/models/queries/operators/follows.rb
index 53cb5c6f2072..eca302af1e45 100644
--- a/app/models/queries/operators/follows.rb
+++ b/app/models/queries/operators/follows.rb
@@ -28,7 +28,7 @@
module Queries::Operators
class Follows < Base
- label "follows"
+ label 'follows'
set_symbol ::Relation::TYPE_FOLLOWS
end
end
diff --git a/app/models/queries/operators/greater_or_equal.rb b/app/models/queries/operators/greater_or_equal.rb
index 075eb190b34c..2282153cb1ec 100644
--- a/app/models/queries/operators/greater_or_equal.rb
+++ b/app/models/queries/operators/greater_or_equal.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class GreaterOrEqual < Base
- label "greater_or_equal"
- set_symbol ">="
+ label 'greater_or_equal'
+ set_symbol '>='
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} >= #{values.first.to_f}"
diff --git a/app/models/queries/operators/in.rb b/app/models/queries/operators/in.rb
index bf27ff0662d8..444e766dfb71 100644
--- a/app/models/queries/operators/in.rb
+++ b/app/models/queries/operators/in.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class In < Base
- label "in"
- set_symbol "t+"
+ label 'in'
+ set_symbol 't+'
extend DateRangeClauses
diff --git a/app/models/queries/operators/in_less_than.rb b/app/models/queries/operators/in_less_than.rb
index b9ee542a48d2..46c82bdc7346 100644
--- a/app/models/queries/operators/in_less_than.rb
+++ b/app/models/queries/operators/in_less_than.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class InLessThan < Base
- label "in_less_than"
- set_symbol "t+"
+ label 'in_more_than'
+ set_symbol '>t+'
extend DateRangeClauses
diff --git a/app/models/queries/operators/less_or_equal.rb b/app/models/queries/operators/less_or_equal.rb
index f90656a05192..4ce878e9fee8 100644
--- a/app/models/queries/operators/less_or_equal.rb
+++ b/app/models/queries/operators/less_or_equal.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class LessOrEqual < Base
- label "less_or_equal"
- set_symbol "<="
+ label 'less_or_equal'
+ set_symbol '<='
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} <= #{values.first.to_f}"
diff --git a/app/models/queries/operators/less_than_ago.rb b/app/models/queries/operators/less_than_ago.rb
index 44335cd8ac83..30b11bf951e4 100644
--- a/app/models/queries/operators/less_than_ago.rb
+++ b/app/models/queries/operators/less_than_ago.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class LessThanAgo < Base
- label "less_than_ago"
- set_symbol ">t-"
+ label 'less_than_ago'
+ set_symbol '>t-'
extend DateRangeClauses
diff --git a/app/models/queries/operators/more_than_ago.rb b/app/models/queries/operators/more_than_ago.rb
index b157e8fc5f43..bb0ddd508211 100644
--- a/app/models/queries/operators/more_than_ago.rb
+++ b/app/models/queries/operators/more_than_ago.rb
@@ -28,8 +28,8 @@
module Queries::Operators
class MoreThanAgo < Base
- label "more_than_ago"
- set_symbol " "asc")
- query.select(*(["name"] + Setting.enabled_projects_columns).uniq, add_not_existing: false)
+ query.order('lft' => 'asc')
+ query.select(*(['name'] + Setting.enabled_projects_columns).uniq, add_not_existing: false)
yield query
end
@@ -128,7 +128,7 @@ def find_and_update_persisted_query(id, params, user)
end
def new_query(source_query, params, user)
- update_query(Queries::Projects::ProjectQuery.new(source_query.attributes.slice("filters", "orders", "selects")),
+ update_query(Queries::Projects::ProjectQuery.new(source_query.attributes.slice('filters', 'orders', 'selects')),
params,
user)
end
diff --git a/app/models/queries/projects/filters/ancestor_filter.rb b/app/models/queries/projects/filters/ancestor_filter.rb
index 2bd80285f86a..b7c821fbfc14 100644
--- a/app/models/queries/projects/filters/ancestor_filter.rb
+++ b/app/models/queries/projects/filters/ancestor_filter.rb
@@ -32,10 +32,10 @@ module Filters
class AncestorFilter < ::Queries::Projects::Filters::ProjectFilter
def scope
case operator
- when "="
+ when '='
Project
.where(exists_condition.exists)
- when "!"
+ when '!'
Project
.where.not(exists_condition.exists)
else
diff --git a/app/models/queries/projects/filters/latest_activity_at_filter.rb b/app/models/queries/projects/filters/latest_activity_at_filter.rb
index 48f49b51e31d..24f8d7c5dc4c 100644
--- a/app/models/queries/projects/filters/latest_activity_at_filter.rb
+++ b/app/models/queries/projects/filters/latest_activity_at_filter.rb
@@ -46,7 +46,7 @@ def available?
end
def human_name
- I18n.t("activerecord.attributes.project.latest_activity_at")
+ I18n.t('activerecord.attributes.project.latest_activity_at')
end
def where
diff --git a/app/models/queries/projects/filters/name_and_identifier_filter.rb b/app/models/queries/projects/filters/name_and_identifier_filter.rb
index e985895a4952..1b7a5eb16679 100644
--- a/app/models/queries/projects/filters/name_and_identifier_filter.rb
+++ b/app/models/queries/projects/filters/name_and_identifier_filter.rb
@@ -33,19 +33,19 @@ def type
def where
case operator
- when "="
+ when '='
where_equal
- when "!"
+ when '!'
where_not_equal
- when "~", "**"
+ when '~', '**'
where_contains
- when "!~"
+ when '!~'
where_not_contains
end
end
def human_name
- I18n.t("query_fields.name_or_identifier")
+ I18n.t('query_fields.name_or_identifier')
end
def self.key
@@ -66,7 +66,7 @@ def concatenate_with_values(condition, concatenation)
end
def where_equal
- concatenate_with_values("LOWER(projects.identifier) = ? OR LOWER(projects.name) = ?", "OR", &:downcase)
+ concatenate_with_values('LOWER(projects.identifier) = ? OR LOWER(projects.name) = ?', 'OR', &:downcase)
end
def where_not_equal
@@ -74,7 +74,7 @@ def where_not_equal
end
def where_contains
- concatenate_with_values("LOWER(projects.identifier) LIKE ? OR LOWER(projects.name) LIKE ?", "OR") do |value|
+ concatenate_with_values('LOWER(projects.identifier) LIKE ? OR LOWER(projects.name) LIKE ?', 'OR') do |value|
"%#{value.downcase}%"
end
end
diff --git a/app/models/queries/projects/filters/name_filter.rb b/app/models/queries/projects/filters/name_filter.rb
index 92b31b95923b..36416b1d1d67 100644
--- a/app/models/queries/projects/filters/name_filter.rb
+++ b/app/models/queries/projects/filters/name_filter.rb
@@ -33,13 +33,13 @@ def type
def where
case operator
- when "="
+ when '='
["LOWER(projects.name) IN (?)", sql_value]
- when "!"
+ when '!'
["LOWER(projects.name) NOT IN (?)", sql_value]
- when "~", "**"
+ when '~', '**'
["LOWER(projects.name) LIKE ?", "%#{sql_value}%"]
- when "!~"
+ when '!~'
["LOWER(projects.name) NOT LIKE ?", "%#{sql_value}%"]
end
end
@@ -56,9 +56,9 @@ def self.key
def sql_value
case operator
- when "=", "!"
- values.map { |val| self.class.connection.quote_string(val.downcase) }.join(",")
- when "**", "~", "!~"
+ when '=', '!'
+ values.map { |val| self.class.connection.quote_string(val.downcase) }.join(',')
+ when '**', '~', '!~'
values.first.downcase
end
end
diff --git a/app/models/queries/projects/filters/principal_filter.rb b/app/models/queries/projects/filters/principal_filter.rb
index fd78c6c201cf..34c39e35ad7a 100644
--- a/app/models/queries/projects/filters/principal_filter.rb
+++ b/app/models/queries/projects/filters/principal_filter.rb
@@ -40,6 +40,6 @@ def scope
end
def where
- operator_strategy.sql_for_field(values, "members", "user_id")
+ operator_strategy.sql_for_field(values, 'members', 'user_id')
end
end
diff --git a/app/models/queries/projects/filters/project_status_filter.rb b/app/models/queries/projects/filters/project_status_filter.rb
index b46a2e273d3c..3275e74a59d3 100644
--- a/app/models/queries/projects/filters/project_status_filter.rb
+++ b/app/models/queries/projects/filters/project_status_filter.rb
@@ -51,7 +51,7 @@ def self.key
end
def human_name
- I18n.t("js.grid.widgets.project_status.title")
+ I18n.t('js.grid.widgets.project_status.title')
end
end
end
diff --git a/app/models/queries/projects/filters/typeahead_filter.rb b/app/models/queries/projects/filters/typeahead_filter.rb
index 9635055a1902..d2f617c9323a 100644
--- a/app/models/queries/projects/filters/typeahead_filter.rb
+++ b/app/models/queries/projects/filters/typeahead_filter.rb
@@ -36,6 +36,6 @@ def type
end
def human_name
- I18n.t("label_search")
+ I18n.t('label_search')
end
end
diff --git a/app/models/queries/projects/filters/user_action_filter.rb b/app/models/queries/projects/filters/user_action_filter.rb
index 6cef678acfd1..43c6523698e1 100644
--- a/app/models/queries/projects/filters/user_action_filter.rb
+++ b/app/models/queries/projects/filters/user_action_filter.rb
@@ -40,16 +40,16 @@ def type
def where
operator = if operator_class <= ::Queries::Operators::Equals || operator_class <= ::Queries::Operators::EqualsAll
- "IN"
+ 'IN'
elsif operator_class <= ::Queries::Operators::NotEquals
- "NOT IN"
+ 'NOT IN'
else
raise ArgumentError
end
capability_select_queries
.map { |query| "#{Project.table_name}.id #{operator} (#{query.to_sql})" }
- .join(" AND ")
+ .join(' AND ')
end
private
diff --git a/app/models/queries/projects/filters/visible_filter.rb b/app/models/queries/projects/filters/visible_filter.rb
index e5159aa1f61b..d5f23c5b77ba 100644
--- a/app/models/queries/projects/filters/visible_filter.rb
+++ b/app/models/queries/projects/filters/visible_filter.rb
@@ -47,7 +47,7 @@ def scope
def where
# Handled by scope
- "1 = 1"
+ '1 = 1'
end
def type
diff --git a/app/models/queries/projects/orders/custom_field_order.rb b/app/models/queries/projects/orders/custom_field_order.rb
index 29fa1157c932..442eb5fa6b92 100644
--- a/app/models/queries/projects/orders/custom_field_order.rb
+++ b/app/models/queries/projects/orders/custom_field_order.rb
@@ -29,7 +29,7 @@
class Queries::Projects::Orders::CustomFieldOrder < Queries::Orders::Base
self.model = Project.all
- validates :custom_field, presence: { message: I18n.t(:"activerecord.errors.messages.does_not_exist") }
+ validates :custom_field, presence: { message: I18n.t(:'activerecord.errors.messages.does_not_exist') }
def self.key
/cf_(\d+)/
diff --git a/app/models/queries/projects/orders/name_order.rb b/app/models/queries/projects/orders/name_order.rb
index 46bd434e3a1d..291cbf40b9f9 100644
--- a/app/models/queries/projects/orders/name_order.rb
+++ b/app/models/queries/projects/orders/name_order.rb
@@ -34,7 +34,7 @@ def self.key
end
def scope
- super.select("projects.*", "lower(projects.name)")
+ super.select('projects.*', 'lower(projects.name)')
end
def order
diff --git a/app/models/queries/projects/selects/custom_field.rb b/app/models/queries/projects/selects/custom_field.rb
index e7d285c2ce39..1ccd53186a65 100644
--- a/app/models/queries/projects/selects/custom_field.rb
+++ b/app/models/queries/projects/selects/custom_field.rb
@@ -27,7 +27,7 @@
# ++
class Queries::Projects::Selects::CustomField < Queries::Selects::Base
- validates :custom_field, presence: { message: I18n.t(:"activerecord.errors.messages.does_not_exist") }
+ validates :custom_field, presence: { message: I18n.t(:'activerecord.errors.messages.does_not_exist') }
def self.key
/cf_(\d+)/
diff --git a/app/models/queries/projects/selects/default.rb b/app/models/queries/projects/selects/default.rb
index 5b1fa8ced5d7..9a0a93542d45 100644
--- a/app/models/queries/projects/selects/default.rb
+++ b/app/models/queries/projects/selects/default.rb
@@ -30,7 +30,7 @@ class Queries::Projects::Selects::Default < Queries::Selects::Base
KEYS = %i[status_explanation hierarchy name public description].freeze
def self.key
- Regexp.new(KEYS.join("|"))
+ Regexp.new(KEYS.join('|'))
end
def self.all_available
diff --git a/app/models/queries/projects/selects/status.rb b/app/models/queries/projects/selects/status.rb
index 328ded86f6d2..cbd85b3f288f 100644
--- a/app/models/queries/projects/selects/status.rb
+++ b/app/models/queries/projects/selects/status.rb
@@ -32,6 +32,6 @@ def self.key
end
def caption
- I18n.t(:"attributes.status")
+ I18n.t(:'attributes.status')
end
end
diff --git a/app/models/queries/queries/filters/project_identifier_filter.rb b/app/models/queries/queries/filters/project_identifier_filter.rb
index 8403cc79c15a..57b5c37ff830 100644
--- a/app/models/queries/queries/filters/project_identifier_filter.rb
+++ b/app/models/queries/queries/filters/project_identifier_filter.rb
@@ -40,7 +40,7 @@ def joins
end
def where
- operator_strategy.sql_for_field(values, "projects", "identifier")
+ operator_strategy.sql_for_field(values, 'projects', 'identifier')
end
def allowed_values
diff --git a/app/models/queries/relations/filters/involved_filter.rb b/app/models/queries/relations/filters/involved_filter.rb
index 95ddee87e5fe..65f2fe6a5ed8 100644
--- a/app/models/queries/relations/filters/involved_filter.rb
+++ b/app/models/queries/relations/filters/involved_filter.rb
@@ -48,7 +48,7 @@ def self.key
private
def visibility_checked_sql(operator_string, values, visible_sql)
- concatenation = if operator == "="
+ concatenation = if operator == '='
"OR"
else
"AND"
diff --git a/app/models/queries/roles/filters/allows_becoming_assignee_filter.rb b/app/models/queries/roles/filters/allows_becoming_assignee_filter.rb
index 75d158f4c4ad..2c62b8f4a86c 100644
--- a/app/models/queries/roles/filters/allows_becoming_assignee_filter.rb
+++ b/app/models/queries/roles/filters/allows_becoming_assignee_filter.rb
@@ -41,7 +41,7 @@ def where
unassignable_permissions
end
- if operator == "="
+ if operator == '='
["role_permissions.id IN (?)", permission_ids]
else
["role_permissions.id NOT IN (?)", permission_ids]
@@ -60,12 +60,12 @@ def allowed_values
private
def assignable_permissions
- RolePermission.where(permission: "work_package_assigned")
- .select("id")
+ RolePermission.where(permission: 'work_package_assigned')
+ .select('id')
end
def unassignable_permissions
- RolePermission.where.not(permission: "work_package_assigned")
- .select("id")
+ RolePermission.where.not(permission: 'work_package_assigned')
+ .select('id')
end
end
diff --git a/app/models/queries/roles/filters/grantable_filter.rb b/app/models/queries/roles/filters/grantable_filter.rb
index abbeac230ca2..5d1c4af94946 100644
--- a/app/models/queries/roles/filters/grantable_filter.rb
+++ b/app/models/queries/roles/filters/grantable_filter.rb
@@ -39,7 +39,7 @@ def where
[Role::BUILTIN_ANONYMOUS, Role::BUILTIN_NON_MEMBER]
end
- if operator == "="
+ if operator == '='
["roles.builtin IN (?)", db_values]
else
["roles.builtin NOT IN (?)", db_values]
diff --git a/app/models/queries/roles/filters/unit_filter.rb b/app/models/queries/roles/filters/unit_filter.rb
index 21b158ef6a92..0290bd34de28 100644
--- a/app/models/queries/roles/filters/unit_filter.rb
+++ b/app/models/queries/roles/filters/unit_filter.rb
@@ -33,9 +33,9 @@ def type
end
def where
- if operator == "!"
+ if operator == '!'
["roles.type != ?", db_values]
- elsif values.first == "project"
+ elsif values.first == 'project'
["roles.type = ? AND roles.builtin = ?", db_values, Role::NON_BUILTIN]
else
["roles.type = ?", db_values]
@@ -50,7 +50,7 @@ def allowed_values
private
def db_values
- if values.first == "system"
+ if values.first == 'system'
[GlobalRole.name.to_s]
else
[ProjectRole.name.to_s]
diff --git a/app/models/queries/selects/base.rb b/app/models/queries/selects/base.rb
index 223dae6b6da4..8dc937d3154d 100644
--- a/app/models/queries/selects/base.rb
+++ b/app/models/queries/selects/base.rb
@@ -46,7 +46,7 @@ def self.all_available
end
def caption
- model = self.class.name.split("::")[1].singularize.constantize
+ model = self.class.name.split('::')[1].singularize.constantize
model.human_attribute_name(attribute)
end
diff --git a/app/models/queries/selects/not_existing_select.rb b/app/models/queries/selects/not_existing_select.rb
index 2f1e5c3978a5..6fa44ff4b78b 100644
--- a/app/models/queries/selects/not_existing_select.rb
+++ b/app/models/queries/selects/not_existing_select.rb
@@ -36,13 +36,13 @@ def self.key
end
def caption
- I18n.t("activerecord.errors.messages.does_not_exist")
+ I18n.t('activerecord.errors.messages.does_not_exist')
end
private
def always_false
- errors.add :base, I18n.t(:"activerecord.errors.messages.does_not_exist")
+ errors.add :base, I18n.t(:'activerecord.errors.messages.does_not_exist')
end
end
end
diff --git a/app/models/queries/serialization/filters.rb b/app/models/queries/serialization/filters.rb
index 6815939c79d5..368da55df611 100644
--- a/app/models/queries/serialization/filters.rb
+++ b/app/models/queries/serialization/filters.rb
@@ -34,9 +34,9 @@ def load(serialized_filter_hash)
return [] if serialized_filter_hash.nil?
serialized_filter_hash.map do |serialized_filter|
- filter = filter_for(serialized_filter["attribute"], no_memoization: true)
- filter.operator = serialized_filter["operator"]
- filter.values = serialized_filter["values"]
+ filter = filter_for(serialized_filter['attribute'], no_memoization: true)
+ filter.operator = serialized_filter['operator']
+ filter.values = serialized_filter['values']
filter
end
diff --git a/app/models/queries/views/filters/type_filter.rb b/app/models/queries/views/filters/type_filter.rb
index 2e6b32981461..f0a02c469969 100644
--- a/app/models/queries/views/filters/type_filter.rb
+++ b/app/models/queries/views/filters/type_filter.rb
@@ -32,7 +32,7 @@ def type
end
def where
- operator_strategy.sql_for_field(transformed_values, View.table_name, "type")
+ operator_strategy.sql_for_field(transformed_values, View.table_name, 'type')
end
def transformed_values
diff --git a/app/models/queries/work_packages/filter/assigned_to_filter.rb b/app/models/queries/work_packages/filter/assigned_to_filter.rb
index 9c15e3f2c639..3c22f2beb977 100644
--- a/app/models/queries/work_packages/filter/assigned_to_filter.rb
+++ b/app/models/queries/work_packages/filter/assigned_to_filter.rb
@@ -33,7 +33,7 @@ def type
end
def human_name
- WorkPackage.human_attribute_name("assigned_to")
+ WorkPackage.human_attribute_name('assigned_to')
end
def self.key
diff --git a/app/models/queries/work_packages/filter/assignee_or_group_filter.rb b/app/models/queries/work_packages/filter/assignee_or_group_filter.rb
index f7ddf15f4166..f3c0a9b66736 100644
--- a/app/models/queries/work_packages/filter/assignee_or_group_filter.rb
+++ b/app/models/queries/work_packages/filter/assignee_or_group_filter.rb
@@ -40,7 +40,7 @@ def type
end
def human_name
- I18n.t("query_fields.assignee_or_group")
+ I18n.t('query_fields.assignee_or_group')
end
def self.key
@@ -51,7 +51,7 @@ def where
operator_strategy.sql_for_field(
values_replaced,
self.class.model.table_name,
- "assigned_to_id"
+ 'assigned_to_id'
)
end
diff --git a/app/models/queries/work_packages/filter/attachment_base_filter.rb b/app/models/queries/work_packages/filter/attachment_base_filter.rb
index 204bbf2b3e38..83ac1210b484 100644
--- a/app/models/queries/work_packages/filter/attachment_base_filter.rb
+++ b/app/models/queries/work_packages/filter/attachment_base_filter.rb
@@ -61,7 +61,7 @@ def tsv_condition
if condition
"AND #{condition}"
else
- ""
+ ''
end
end
diff --git a/app/models/queries/work_packages/filter/attachment_content_filter.rb b/app/models/queries/work_packages/filter/attachment_content_filter.rb
index 324d4f14fddc..ae3ca27b7aeb 100644
--- a/app/models/queries/work_packages/filter/attachment_content_filter.rb
+++ b/app/models/queries/work_packages/filter/attachment_content_filter.rb
@@ -36,10 +36,10 @@ def name
end
def human_name
- Attachment.human_attribute_name("attachment_content")
+ Attachment.human_attribute_name('attachment_content')
end
def search_column
- "fulltext"
+ 'fulltext'
end
end
diff --git a/app/models/queries/work_packages/filter/attachment_file_name_filter.rb b/app/models/queries/work_packages/filter/attachment_file_name_filter.rb
index 5f7ccb7f8d5a..afc280f16cff 100644
--- a/app/models/queries/work_packages/filter/attachment_file_name_filter.rb
+++ b/app/models/queries/work_packages/filter/attachment_file_name_filter.rb
@@ -36,11 +36,11 @@ def name
end
def human_name
- Attachment.human_attribute_name("attachment_file_name")
+ Attachment.human_attribute_name('attachment_file_name')
end
def search_column
- "file"
+ 'file'
end
def normalization_type
diff --git a/app/models/queries/work_packages/filter/comment_filter.rb b/app/models/queries/work_packages/filter/comment_filter.rb
index f07b64a88e0b..7d3977ffc4cf 100644
--- a/app/models/queries/work_packages/filter/comment_filter.rb
+++ b/app/models/queries/work_packages/filter/comment_filter.rb
@@ -45,7 +45,7 @@ def where_condition
end
def notes_condition
- Queries::Operators::Contains.sql_for_field(values, journal_table, "notes")
+ Queries::Operators::Contains.sql_for_field(values, journal_table, 'notes')
end
def journal_table
diff --git a/app/models/queries/work_packages/filter/custom_field_context.rb b/app/models/queries/work_packages/filter/custom_field_context.rb
index c0f9f777942f..1176173d0f61 100644
--- a/app/models/queries/work_packages/filter/custom_field_context.rb
+++ b/app/models/queries/work_packages/filter/custom_field_context.rb
@@ -52,8 +52,8 @@ def custom_fields(context)
end
def where_subselect_joins(custom_field)
- cf_types_db_table = "custom_fields_types"
- cf_projects_db_table = "custom_fields_projects"
+ cf_types_db_table = 'custom_fields_types'
+ cf_projects_db_table = 'custom_fields_projects'
cv_db_table = CustomValue.table_name
work_package_db_table = WorkPackage.table_name
diff --git a/app/models/queries/work_packages/filter/filter_for_wp_mixin.rb b/app/models/queries/work_packages/filter/filter_for_wp_mixin.rb
index 6b02c0486f30..f597a6128e4e 100644
--- a/app/models/queries/work_packages/filter/filter_for_wp_mixin.rb
+++ b/app/models/queries/work_packages/filter/filter_for_wp_mixin.rb
@@ -32,7 +32,7 @@ def type
end
def allowed_values
- raise NotImplementedError, "There would be too many candidates"
+ raise NotImplementedError, 'There would be too many candidates'
end
def value_objects
@@ -46,11 +46,11 @@ def value_objects
end
def allowed_objects
- raise NotImplementedError, "There would be too many candidates"
+ raise NotImplementedError, 'There would be too many candidates'
end
def available?
- key = "Queries::WorkPackages::Filter::FilterForWpMixin/available"
+ key = 'Queries::WorkPackages::Filter::FilterForWpMixin/available'
RequestStore.fetch(key) do
visible_scope.exists?
diff --git a/app/models/queries/work_packages/filter/filter_on_directed_relations_mixin.rb b/app/models/queries/work_packages/filter/filter_on_directed_relations_mixin.rb
index d3c642a0f698..ec0b6664ff19 100644
--- a/app/models/queries/work_packages/filter/filter_on_directed_relations_mixin.rb
+++ b/app/models/queries/work_packages/filter/filter_on_directed_relations_mixin.rb
@@ -36,9 +36,9 @@ def where
.select(relation_select)
operator = if operator_class <= Queries::Operators::Equals
- "IN"
+ 'IN'
else
- "NOT IN"
+ 'NOT IN'
end
"#{WorkPackage.table_name}.id #{operator} (#{relations_subselect.to_sql})"
diff --git a/app/models/queries/work_packages/filter/filter_on_undirected_relations_mixin.rb b/app/models/queries/work_packages/filter/filter_on_undirected_relations_mixin.rb
index 17192b2ce171..8e33ab3447cd 100644
--- a/app/models/queries/work_packages/filter/filter_on_undirected_relations_mixin.rb
+++ b/app/models/queries/work_packages/filter/filter_on_undirected_relations_mixin.rb
@@ -49,7 +49,7 @@ def operator_and_junction
if operator_class <= Queries::Operators::Equals
%w[IN OR]
else
- ["NOT IN", "AND"]
+ ['NOT IN', 'AND']
end
end
diff --git a/app/models/queries/work_packages/filter/group_filter.rb b/app/models/queries/work_packages/filter/group_filter.rb
index eb8de88d5dcb..9900c0ba25bb 100644
--- a/app/models/queries/work_packages/filter/group_filter.rb
+++ b/app/models/queries/work_packages/filter/group_filter.rb
@@ -40,7 +40,7 @@ def type
end
def human_name
- I18n.t("query_fields.member_of_group")
+ I18n.t('query_fields.member_of_group')
end
def self.key
@@ -61,17 +61,17 @@ def value_objects
def where
operator_for_filtering.sql_for_field(user_ids_for_filtering.map(&:to_s),
WorkPackage.table_name,
- "assigned_to_id")
+ 'assigned_to_id')
end
private
def operator_for_filtering
case operator
- when "*" # Any Role
+ when '*' # Any Role
# Override the operator since we want to find by assigned_to
::Queries::Operators::Equals
- when "!*" # No role
+ when '!*' # No role
# Override the operator since we want to find by assigned_to
::Queries::Operators::NotEquals
else
@@ -81,13 +81,13 @@ def operator_for_filtering
def user_ids_for_filtering
scope = case operator
- when "*", "!*"
+ when '*', '!*'
all_groups
else
all_groups.where(id: values)
end
- scope.joins(:users).pluck(Arel.sql("users_users.id")).uniq.sort
+ scope.joins(:users).pluck(Arel.sql('users_users.id')).uniq.sort
end
def all_groups
diff --git a/app/models/queries/work_packages/filter/milestone_filter.rb b/app/models/queries/work_packages/filter/milestone_filter.rb
index 111cd6fe4cbd..86c94f6ac5dd 100644
--- a/app/models/queries/work_packages/filter/milestone_filter.rb
+++ b/app/models/queries/work_packages/filter/milestone_filter.rb
@@ -38,7 +38,7 @@ def available?
end
def dependency_class
- "::API::V3::Queries::Schemas::BooleanFilterDependencyRepresenter"
+ '::API::V3::Queries::Schemas::BooleanFilterDependencyRepresenter'
end
def where
@@ -50,18 +50,18 @@ def where
end
def positive?
- (operator == "=" && values == [OpenProject::Database::DB_VALUE_TRUE]) ||
- (operator == "!" && values == [OpenProject::Database::DB_VALUE_FALSE])
+ (operator == '=' && values == [OpenProject::Database::DB_VALUE_TRUE]) ||
+ (operator == '!' && values == [OpenProject::Database::DB_VALUE_FALSE])
end
def human_name
- I18n.t("activerecord.attributes.type.is_milestone")
+ I18n.t('activerecord.attributes.type.is_milestone')
end
private
def types
- project.nil? ? ::Type.order(Arel.sql("position")) : project.rolled_up_types
+ project.nil? ? ::Type.order(Arel.sql('position')) : project.rolled_up_types
end
def milestone_subselect
diff --git a/app/models/queries/work_packages/filter/only_subproject_filter.rb b/app/models/queries/work_packages/filter/only_subproject_filter.rb
index 96a9642975fe..dbb9c250986c 100644
--- a/app/models/queries/work_packages/filter/only_subproject_filter.rb
+++ b/app/models/queries/work_packages/filter/only_subproject_filter.rb
@@ -33,7 +33,7 @@ def type
end
def human_name
- I18n.t("query_fields.only_subproject_id")
+ I18n.t('query_fields.only_subproject_id')
end
def self.key
diff --git a/app/models/queries/work_packages/filter/or_filter_for_wp_mixin.rb b/app/models/queries/work_packages/filter/or_filter_for_wp_mixin.rb
index 5b2d49cffed2..7a931177c39c 100644
--- a/app/models/queries/work_packages/filter/or_filter_for_wp_mixin.rb
+++ b/app/models/queries/work_packages/filter/or_filter_for_wp_mixin.rb
@@ -44,7 +44,7 @@ def filters
end
def where
- filters.map(&:where).join(" OR ")
+ filters.map(&:where).join(' OR ')
end
def filter_configurations
diff --git a/app/models/queries/work_packages/filter/principal_loader.rb b/app/models/queries/work_packages/filter/principal_loader.rb
index 310bb8e96eb7..76437edc1196 100644
--- a/app/models/queries/work_packages/filter/principal_loader.rb
+++ b/app/models/queries/work_packages/filter/principal_loader.rb
@@ -34,16 +34,16 @@ def initialize(project)
end
def user_values
- @user_values ||= if principals_by_class["User"].present?
- principals_by_class["User"].map { |_, id| [nil, id.to_s] }
+ @user_values ||= if principals_by_class['User'].present?
+ principals_by_class['User'].map { |_, id| [nil, id.to_s] }
else
[]
end
end
def group_values
- @group_values ||= if principals_by_class["Group"].present?
- principals_by_class["Group"].map { |_, id| [nil, id.to_s] }
+ @group_values ||= if principals_by_class['Group'].present?
+ principals_by_class['Group'].map { |_, id| [nil, id.to_s] }
else
[]
end
diff --git a/app/models/queries/work_packages/filter/project_filter.rb b/app/models/queries/work_packages/filter/project_filter.rb
index ea1cf3f453bf..d57e19facc6f 100644
--- a/app/models/queries/work_packages/filter/project_filter.rb
+++ b/app/models/queries/work_packages/filter/project_filter.rb
@@ -31,7 +31,7 @@ def allowed_values
@allowed_values ||= begin
project_values = []
Project.project_tree(visible_projects) do |p, level|
- prefix = (level > 0 ? (("--" * level) + " ") : "")
+ prefix = (level > 0 ? (('--' * level) + ' ') : '')
project_values << ["#{prefix}#{p.name}", p.id.to_s]
end
diff --git a/app/models/queries/work_packages/filter/relatable_filter.rb b/app/models/queries/work_packages/filter/relatable_filter.rb
index e8e39fed32d7..bb0dba273936 100644
--- a/app/models/queries/work_packages/filter/relatable_filter.rb
+++ b/app/models/queries/work_packages/filter/relatable_filter.rb
@@ -54,7 +54,7 @@ def scope
# 'children' used to be supported by the API although 'child' would be more fitting.
def scope_operator
- if operator == "children"
+ if operator == 'children'
Relation::TYPE_CHILD
else
operator
diff --git a/app/models/queries/work_packages/filter/role_filter.rb b/app/models/queries/work_packages/filter/role_filter.rb
index db34d336c07b..ae26b772af3e 100644
--- a/app/models/queries/work_packages/filter/role_filter.rb
+++ b/app/models/queries/work_packages/filter/role_filter.rb
@@ -40,7 +40,7 @@ def type
end
def human_name
- I18n.t("query_fields.assigned_to_role")
+ I18n.t('query_fields.assigned_to_role')
end
def self.key
@@ -61,7 +61,7 @@ def value_objects
def where
operator_for_filtering.sql_for_field(user_ids_for_filtering.map(&:to_s),
WorkPackage.table_name,
- "assigned_to_id")
+ 'assigned_to_id')
end
private
@@ -72,10 +72,10 @@ def roles
def operator_for_filtering
case operator
- when "*" # Any Role
+ when '*' # Any Role
# Override the operator since we want to find by assigned_to
::Queries::Operators::Equals
- when "!*" # No role
+ when '!*' # No role
# Override the operator since we want to find by assigned_to
::Queries::Operators::NotEquals
else
@@ -84,7 +84,7 @@ def operator_for_filtering
end
def user_ids_for_filtering
- scope = if ["*", "!*"].include?(operator)
+ scope = if ['*', '!*'].include?(operator)
user_ids_for_filtering_scope
elsif project
user_ids_for_filter_project_scope
diff --git a/app/models/queries/work_packages/filter/search_filter.rb b/app/models/queries/work_packages/filter/search_filter.rb
index 854a18a818db..a526c8258eb8 100644
--- a/app/models/queries/work_packages/filter/search_filter.rb
+++ b/app/models/queries/work_packages/filter/search_filter.rb
@@ -30,7 +30,7 @@ class Queries::WorkPackages::Filter::SearchFilter <
Queries::WorkPackages::Filter::WorkPackageFilter
include Queries::WorkPackages::Filter::OrFilterForWpMixin
- CONTAINS_OPERATOR = "~".freeze
+ CONTAINS_OPERATOR = '~'.freeze
CE_FILTERS = [
Queries::WorkPackages::Filter::FilterConfiguration.new(
@@ -68,7 +68,7 @@ def type
end
def human_name
- I18n.t("label_search")
+ I18n.t('label_search')
end
def custom_field_configurations
diff --git a/app/models/queries/work_packages/filter/shared_with_me_filter.rb b/app/models/queries/work_packages/filter/shared_with_me_filter.rb
index d10f85cf8337..763e46a6435f 100644
--- a/app/models/queries/work_packages/filter/shared_with_me_filter.rb
+++ b/app/models/queries/work_packages/filter/shared_with_me_filter.rb
@@ -40,7 +40,7 @@ def available?
end
def dependency_class
- "::API::V3::Queries::Schemas::BooleanFilterDependencyRepresenter"
+ '::API::V3::Queries::Schemas::BooleanFilterDependencyRepresenter'
end
def where
@@ -52,12 +52,12 @@ def where
end
def positive?
- (operator == "=" && values == [OpenProject::Database::DB_VALUE_TRUE]) ||
- (operator == "!" && values == [OpenProject::Database::DB_VALUE_FALSE])
+ (operator == '=' && values == [OpenProject::Database::DB_VALUE_TRUE]) ||
+ (operator == '!' && values == [OpenProject::Database::DB_VALUE_FALSE])
end
def human_name
- I18n.t("query_fields.shared_with_me")
+ I18n.t('query_fields.shared_with_me')
end
private
diff --git a/app/models/queries/work_packages/filter/shared_with_user_filter.rb b/app/models/queries/work_packages/filter/shared_with_user_filter.rb
index cb6f687894e7..cd6f5b6ca023 100644
--- a/app/models/queries/work_packages/filter/shared_with_user_filter.rb
+++ b/app/models/queries/work_packages/filter/shared_with_user_filter.rb
@@ -37,22 +37,22 @@ def available?
def scope
query = visible_shared_work_packages(scoped_to_visible_projects: !querying_for_self?)
- if operator == "="
+ if operator == '='
query = query.where(shared_with_any_of_condition)
- elsif operator == "&="
+ elsif operator == '&='
query = query.where(shared_with_all_of_condition)
end
- WorkPackage.where(id: query.select("work_packages.id").distinct)
+ WorkPackage.where(id: query.select('work_packages.id').distinct)
end
# Conditions handled in +scope+ method
def where
- "1=1"
+ '1=1'
end
def human_name
- I18n.t("query_fields.shared_with_user")
+ I18n.t('query_fields.shared_with_user')
end
def type
@@ -101,7 +101,7 @@ def shared_with_all_of_condition
SQL
end
- where_clauses.join(" AND ")
+ where_clauses.join(' AND ')
end
def querying_for_self?
diff --git a/app/models/queries/work_packages/filter/status_filter.rb b/app/models/queries/work_packages/filter/status_filter.rb
index a92ea2c78f76..71e0ce4b9ccc 100644
--- a/app/models/queries/work_packages/filter/status_filter.rb
+++ b/app/models/queries/work_packages/filter/status_filter.rb
@@ -71,7 +71,7 @@ def joins
private
def all_statuses
- key = "Queries::WorkPackages::Filter::StatusFilter/all_statuses"
+ key = 'Queries::WorkPackages::Filter::StatusFilter/all_statuses'
RequestStore.fetch(key) do
Status.all.to_a.index_by(&:id)
@@ -82,11 +82,11 @@ def operator_strategy
super_value = super
super_value || case operator
- when "o"
+ when 'o'
Queries::Operators::OpenWorkPackages
- when "c"
+ when 'c'
Queries::Operators::ClosedWorkPackages
- when "*"
+ when '*'
Queries::Operators::All
end
end
diff --git a/app/models/queries/work_packages/filter/subject_or_id_filter.rb b/app/models/queries/work_packages/filter/subject_or_id_filter.rb
index f9472f6b5fbc..6bf8e256187a 100644
--- a/app/models/queries/work_packages/filter/subject_or_id_filter.rb
+++ b/app/models/queries/work_packages/filter/subject_or_id_filter.rb
@@ -30,8 +30,8 @@ class Queries::WorkPackages::Filter::SubjectOrIdFilter <
Queries::WorkPackages::Filter::WorkPackageFilter
include Queries::WorkPackages::Filter::OrFilterForWpMixin
- CONTAINS_OPERATOR = "~".freeze
- EQUALS_OPERATOR = "=".freeze
+ CONTAINS_OPERATOR = '~'.freeze
+ EQUALS_OPERATOR = '='.freeze
FILTERS = [
Queries::WorkPackages::Filter::FilterConfiguration.new(
@@ -59,7 +59,7 @@ def type
end
def human_name
- I18n.t("label_subject_or_id")
+ I18n.t('label_subject_or_id')
end
def filter_configurations
diff --git a/app/models/queries/work_packages/filter/subproject_filter.rb b/app/models/queries/work_packages/filter/subproject_filter.rb
index 468d43f289a7..5be76d0f3435 100644
--- a/app/models/queries/work_packages/filter/subproject_filter.rb
+++ b/app/models/queries/work_packages/filter/subproject_filter.rb
@@ -47,7 +47,7 @@ def type
end
def human_name
- I18n.t("query_fields.subproject_id")
+ I18n.t('query_fields.subproject_id')
end
def self.key
@@ -66,7 +66,7 @@ def value_objects
end
def where
- "#{Project.table_name}.id IN (%s)" % ids_for_where.join(",")
+ "#{Project.table_name}.id IN (%s)" % ids_for_where.join(',')
end
protected
diff --git a/app/models/queries/work_packages/filter/text_filter_on_join_mixin.rb b/app/models/queries/work_packages/filter/text_filter_on_join_mixin.rb
index 499328e02915..e401af5efd63 100644
--- a/app/models/queries/work_packages/filter/text_filter_on_join_mixin.rb
+++ b/app/models/queries/work_packages/filter/text_filter_on_join_mixin.rb
@@ -29,12 +29,12 @@
module Queries::WorkPackages::Filter::TextFilterOnJoinMixin
def where
case operator
- when "~"
+ when '~'
"EXISTS (#{where_condition})"
- when "!~"
+ when '!~'
"NOT EXISTS (#{where_condition})"
else
- raise "Unsupported operator"
+ raise 'Unsupported operator'
end
end
end
diff --git a/app/models/queries/work_packages/filter/type_filter.rb b/app/models/queries/work_packages/filter/type_filter.rb
index a692c92956da..9d1e10beb9e5 100644
--- a/app/models/queries/work_packages/filter/type_filter.rb
+++ b/app/models/queries/work_packages/filter/type_filter.rb
@@ -58,6 +58,6 @@ def value_objects
private
def types
- project.nil? ? ::Type.order(Arel.sql("position")) : project.rolled_up_types
+ project.nil? ? ::Type.order(Arel.sql('position')) : project.rolled_up_types
end
end
diff --git a/app/models/queries/work_packages/filter/typeahead_filter.rb b/app/models/queries/work_packages/filter/typeahead_filter.rb
index c7c4c4abd239..94d4f62a31cc 100644
--- a/app/models/queries/work_packages/filter/typeahead_filter.rb
+++ b/app/models/queries/work_packages/filter/typeahead_filter.rb
@@ -44,15 +44,15 @@ def where
end
"(#{conditions.join(' OR ')})"
- end.join(" AND ")
+ end.join(' AND ')
end
def subject_condition(string)
- Queries::Operators::Contains.sql_for_field([string], WorkPackage.table_name, "subject")
+ Queries::Operators::Contains.sql_for_field([string], WorkPackage.table_name, 'subject')
end
def project_name_condition(string)
- Queries::Operators::Contains.sql_for_field([string], Project.table_name, "name")
+ Queries::Operators::Contains.sql_for_field([string], Project.table_name, 'name')
end
def id_condition(string)
diff --git a/app/models/queries/work_packages/filter/version_filter.rb b/app/models/queries/work_packages/filter/version_filter.rb
index 79effbd6f477..7bbce13d97cc 100644
--- a/app/models/queries/work_packages/filter/version_filter.rb
+++ b/app/models/queries/work_packages/filter/version_filter.rb
@@ -38,7 +38,7 @@ def type
end
def human_name
- WorkPackage.human_attribute_name("version")
+ WorkPackage.human_attribute_name('version')
end
def self.key
diff --git a/app/models/queries/work_packages/filter/watcher_filter.rb b/app/models/queries/work_packages/filter/watcher_filter.rb
index 1c12bee7a9f5..696cee8dc024 100644
--- a/app/models/queries/work_packages/filter/watcher_filter.rb
+++ b/app/models/queries/work_packages/filter/watcher_filter.rb
@@ -73,7 +73,7 @@ def view_work_package_watchers_allowed?
def where_any_watcher
db_table = Watcher.table_name
- db_field = "user_id"
+ db_field = 'user_id'
<<-SQL
#{WorkPackage.table_name}.id #{operator == '=' ? 'IN' : 'NOT IN'}
@@ -94,7 +94,7 @@ def where_allowed_watchers
# filter watchers only in projects the user has the permission to view watchers in
sql_parts << where_watcher_in_view_watchers_allowed
- sql_parts.join(" OR ")
+ sql_parts.join(' OR ')
end
def where_self_watcher(user_id)
@@ -124,7 +124,7 @@ def db_table
end
def db_field
- "user_id"
+ 'user_id'
end
def view_watcher_allowed_scoped
diff --git a/app/models/queries/work_packages/filter_serializer.rb b/app/models/queries/work_packages/filter_serializer.rb
index fa6012aac37f..f05f2add3ef6 100644
--- a/app/models/queries/work_packages/filter_serializer.rb
+++ b/app/models/queries/work_packages/filter_serializer.rb
@@ -35,13 +35,13 @@ def self.load(serialized_filter_hash)
# yeah, dunno, but apparently '=' may have been serialized as a Syck::DefaultKey instance...
yaml = serialized_filter_hash
- .gsub("!ruby/object:Syck::DefaultKey {}", '"="')
+ .gsub('!ruby/object:Syck::DefaultKey {}', '"="')
(YAML.load(yaml, permitted_classes: [Symbol, Date]) || {}).each_with_object([]) do |(field, options), array|
options = options.with_indifferent_access
filter = filter_for(field, no_memoization: true)
- filter.operator = options["operator"]
- filter.values = options["values"]
+ filter.operator = options['operator']
+ filter.values = options['values']
array << filter
end
end
diff --git a/app/models/queries/work_packages/selects/custom_field_select.rb b/app/models/queries/work_packages/selects/custom_field_select.rb
index 18446e4b2c15..6f10eedefc5d 100644
--- a/app/models/queries/work_packages/selects/custom_field_select.rb
+++ b/app/models/queries/work_packages/selects/custom_field_select.rb
@@ -62,7 +62,7 @@ def self.instances(context = nil)
else
WorkPackageCustomField.all
end
- .reject { |cf| cf.field_format == "text" }
+ .reject { |cf| cf.field_format == 'text' }
.map { |cf| new(cf) }
end
@@ -100,11 +100,11 @@ def summable_scope(query)
.left_joins(:custom_values)
.where(custom_values: { custom_field: })
.where.not(custom_values: { value: nil })
- .where.not(custom_values: { value: "" })
+ .where.not(custom_values: { value: '' })
end
def summable_select_statement
- if custom_field.field_format == "int"
+ if custom_field.field_format == 'int'
"COALESCE(SUM(value::BIGINT)::BIGINT, 0) #{name}"
else
"COALESCE(ROUND(SUM(value::NUMERIC), 2)::FLOAT, 0.0) #{name}"
diff --git a/app/models/queries/work_packages/selects/manual_sorting_select.rb b/app/models/queries/work_packages/selects/manual_sorting_select.rb
index 8cc86329e3fb..6f1d7560a7ae 100644
--- a/app/models/queries/work_packages/selects/manual_sorting_select.rb
+++ b/app/models/queries/work_packages/selects/manual_sorting_select.rb
@@ -31,7 +31,7 @@ class Queries::WorkPackages::Selects::ManualSortingSelect < Queries::WorkPackage
def initialize
super(:manual_sorting,
- default_order: "asc",
+ default_order: 'asc',
displayable: false,
sortable: "#{OrderedWorkPackage.table_name}.position NULLS LAST, #{WorkPackage.table_name}.id")
end
diff --git a/app/models/queries/work_packages/selects/property_select.rb b/app/models/queries/work_packages/selects/property_select.rb
index 9b716ef8fd85..a1b0bbd21b56 100644
--- a/app/models/queries/work_packages/selects/property_select.rb
+++ b/app/models/queries/work_packages/selects/property_select.rb
@@ -39,7 +39,7 @@ def caption
groupable: false
},
project: {
- association: "project",
+ association: 'project',
sortable: "name",
groupable: "#{WorkPackage.table_name}.project_id"
},
@@ -47,67 +47,67 @@ def caption
sortable: "#{WorkPackage.table_name}.subject"
},
type: {
- association: "type",
+ association: 'type',
sortable: "position",
groupable: "#{WorkPackage.table_name}.type_id"
},
parent: {
- association: "ancestors_relations",
- default_order: "asc",
+ association: 'ancestors_relations',
+ default_order: 'asc',
sortable: false
},
status: {
- association: "status",
+ association: 'status',
sortable: "position",
highlightable: true,
groupable: "#{WorkPackage.table_name}.status_id"
},
priority: {
- association: "priority",
+ association: 'priority',
sortable: "position",
- default_order: "desc",
+ default_order: 'desc',
highlightable: true,
groupable: "#{WorkPackage.table_name}.priority_id"
},
author: {
- association: "author",
+ association: 'author',
sortable: %w(lastname firstname id),
groupable: "#{WorkPackage.table_name}.author_id"
},
assigned_to: {
- association: "assigned_to",
+ association: 'assigned_to',
sortable: %w(lastname firstname id),
groupable: "#{WorkPackage.table_name}.assigned_to_id"
},
responsible: {
- association: "responsible",
+ association: 'responsible',
sortable: %w(lastname firstname id),
groupable: "#{WorkPackage.table_name}.responsible_id"
},
updated_at: {
sortable: "#{WorkPackage.table_name}.updated_at",
- default_order: "desc"
+ default_order: 'desc'
},
category: {
- association: "category",
+ association: 'category',
sortable: "name",
groupable: "#{WorkPackage.table_name}.category_id"
},
version: {
- association: "version",
- sortable: [->(table_name = Version.table_name) { Version.semver_sql(table_name) }, "name"],
- default_order: "ASC",
- null_handling: "NULLS LAST",
+ association: 'version',
+ sortable: [->(table_name = Version.table_name) { Version.semver_sql(table_name) }, 'name'],
+ default_order: 'ASC',
+ null_handling: 'NULLS LAST',
groupable: "#{WorkPackage.table_name}.version_id"
},
start_date: {
sortable: "#{WorkPackage.table_name}.start_date",
- null_handling: "NULLS LAST"
+ null_handling: 'NULLS LAST'
},
due_date: {
highlightable: true,
sortable: "#{WorkPackage.table_name}.due_date",
- null_handling: "NULLS LAST"
+ null_handling: 'NULLS LAST'
},
estimated_hours: {
sortable: "#{WorkPackage.table_name}.estimated_hours",
@@ -128,7 +128,7 @@ def caption
},
created_at: {
sortable: "#{WorkPackage.table_name}.created_at",
- default_order: "desc"
+ default_order: 'desc'
},
duration: {
sortable: "#{WorkPackage.table_name}.duration"
diff --git a/app/models/queries/work_packages/selects/relation_of_type_select.rb b/app/models/queries/work_packages/selects/relation_of_type_select.rb
index 5a7a536b8d79..b7e6b432254c 100644
--- a/app/models/queries/work_packages/selects/relation_of_type_select.rb
+++ b/app/models/queries/work_packages/selects/relation_of_type_select.rb
@@ -42,7 +42,7 @@ def sym
alias :relation_type :sym
def caption
- I18n.t(:"activerecord.attributes.query.relations_of_type_column",
+ I18n.t(:'activerecord.attributes.query.relations_of_type_column',
type: I18n.t(type[:sym_name]).capitalize)
end
diff --git a/app/models/queries/work_packages/selects/relation_to_type_select.rb b/app/models/queries/work_packages/selects/relation_to_type_select.rb
index 3b5c921ceec0..c2cc95651b5c 100644
--- a/app/models/queries/work_packages/selects/relation_to_type_select.rb
+++ b/app/models/queries/work_packages/selects/relation_to_type_select.rb
@@ -39,7 +39,7 @@ def set_name!(type)
end
def caption
- I18n.t(:"activerecord.attributes.query.relations_to_type_column",
+ I18n.t(:'activerecord.attributes.query.relations_to_type_column',
type: type.name)
end
diff --git a/app/models/query.rb b/app/models/query.rb
index 6ec1cfe331b7..da8f9faaea51 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -40,7 +40,7 @@ class Query < ApplicationRecord
has_many :ical_token_query_assignments
has_many :ical_tokens,
through: :ical_token_query_assignments,
- class_name: "Token::ICal"
+ class_name: 'Token::ICal'
# no `dependent: :destroy` as the ical_tokens are destroyed in the following before_destroy callback
# dependent: :destroy is not possible as this would only delete the ical_token_query_assignments
before_destroy :destroy_ical_tokens
@@ -103,7 +103,7 @@ def to_s
def add_default_filter
return if filters.present?
- add_filter("status_id", "o", [""])
+ add_filter('status_id', 'o', [''])
end
def validate_work_package_filters
@@ -259,7 +259,7 @@ def sortable_key_by_column_name
h
end
- { "id" => "#{WorkPackage.table_name}.id" }
+ { 'id' => "#{WorkPackage.table_name}.id" }
.merge(column_sortability)
end
@@ -306,14 +306,14 @@ def sort_criteria=(arg)
if arg.is_a?(Hash)
arg = arg.keys.sort.map { |k| arg[k] }
end
- c = arg.reject { |k, _o| k.to_s.blank? }.slice(0, 3).map { |k, o| [k.to_s, o == "desc" ? o : "asc"] }
+ c = arg.reject { |k, _o| k.to_s.blank? }.slice(0, 3).map { |k, o| [k.to_s, o == 'desc' ? o : 'asc'] }
write_attribute(:sort_criteria, c)
end
def sort_criteria
(read_attribute(:sort_criteria) || []).tap do |criteria|
criteria.map! do |attr, direction|
- attr = "id" if attr == "parent"
+ attr = 'id' if attr == 'parent'
[attr, direction]
end
end
@@ -363,12 +363,12 @@ def group_by_statement
end
def statement
- return "1=0" unless valid?
+ return '1=0' unless valid?
statement_filters
.map { |filter| "(#{filter.where})" }
.compact_blank
- .join(" AND ")
+ .join(' AND ')
end
# Returns the result set
@@ -381,11 +381,11 @@ def results
def work_package_journals(options = {})
Journal.includes(:user)
.where(journable_type: WorkPackage.to_s)
- .joins("INNER JOIN work_packages ON work_packages.id = journals.journable_id")
- .joins("INNER JOIN projects ON work_packages.project_id = projects.id")
- .joins("INNER JOIN users AS authors ON work_packages.author_id = authors.id")
- .joins("INNER JOIN types ON work_packages.type_id = types.id")
- .joins("INNER JOIN statuses ON work_packages.status_id = statuses.id")
+ .joins('INNER JOIN work_packages ON work_packages.id = journals.journable_id')
+ .joins('INNER JOIN projects ON work_packages.project_id = projects.id')
+ .joins('INNER JOIN users AS authors ON work_packages.author_id = authors.id')
+ .joins('INNER JOIN types ON work_packages.type_id = types.id')
+ .joins('INNER JOIN statuses ON work_packages.status_id = statuses.id')
.order(options[:order])
.limit(options[:limit])
.offset(options[:offset])
@@ -402,9 +402,9 @@ def project_limiting_filter
subproject_filter.context = self
subproject_filter.operator = if include_subprojects?
- "*"
+ '*'
else
- "!*"
+ '!*'
end
subproject_filter
end
diff --git a/app/models/query/results.rb b/app/models/query/results.rb
index 246f65ba575f..917732e08eda 100644
--- a/app/models/query/results.rb
+++ b/app/models/query/results.rb
@@ -87,7 +87,7 @@ def sorted_work_packages
end
def order_option
- order_option = [group_by_sort].compact_blank.join(", ")
+ order_option = [group_by_sort].compact_blank.join(', ')
if order_option.blank?
nil
diff --git a/app/models/query/results/group_by.rb b/app/models/query/results/group_by.rb
index b708a802fac0..812d143de158 100644
--- a/app/models/query/results/group_by.rb
+++ b/app/models/query/results/group_by.rb
@@ -98,7 +98,7 @@ def transform_list_custom_field_keys(custom_field, groups)
groups.transform_keys do |key|
if custom_field.multi_value?
- key.split(".").map do |subkey|
+ key.split('.').map do |subkey|
options[subkey].first
end
else
@@ -108,7 +108,7 @@ def transform_list_custom_field_keys(custom_field, groups)
end
def custom_options_for_keys(custom_field, groups)
- keys = groups.keys.map { |k| k.split(".") }
+ keys = groups.keys.map { |k| k.split('.') }
# Because of multi select cfs we might end up having overlapping groups
# (e.g group "1" and group "1.3" and group "3" which represent concatenated ids).
# This can result in us having ids in the keys array multiple times (e.g. ["1", "1", "3", "3"]).
@@ -149,7 +149,7 @@ def group_by_sort(order: true)
direction = order ? order_for_group_by(column) : nil
aliased_group_by_sort_order(alias_name, s, columns_hash, direction)
- end.join(", ")
+ end.join(', ')
end
end
diff --git a/app/models/query/results/sums.rb b/app/models/query/results/sums.rb
index aa221ff00e68..362b885ce958 100644
--- a/app/models/query/results/sums.rb
+++ b/app/models/query/results/sums.rb
@@ -43,10 +43,10 @@ def all_group_sums
return nil unless query.grouped?
sums_by_id = sums_select(true).inject({}) do |result, group_sum|
- result[group_sum["id"]] = {}
+ result[group_sum['id']] = {}
query.summed_up_columns.each do |column|
- result[group_sum["id"]][column] = group_sum[column.name.to_s]
+ result[group_sum['id']][column] = group_sum[column.name.to_s]
end
result
@@ -103,7 +103,7 @@ def sums_callable_joins(grouped)
"LEFT OUTER JOIN (#{c.summable.(query, grouped).to_sql}) #{c.name} ON #{join_condition}"
end
- .join(" ")
+ .join(' ')
end
def sums_work_package_scope_selects(grouped)
diff --git a/app/models/query/sort_criteria.rb b/app/models/query/sort_criteria.rb
index 5f3f2006b025..52720b582b5b 100644
--- a/app/models/query/sort_criteria.rb
+++ b/app/models/query/sort_criteria.rb
@@ -75,8 +75,8 @@ def execute_criterion(criteria)
end
def criteria_with_default_order
- if @criteria.none? { |attribute, _| attribute == "id" }
- @criteria + [["id", false]]
+ if @criteria.none? { |attribute, _| attribute == 'id' }
+ @criteria + [['id', false]]
else
@criteria
end
diff --git a/app/models/relation.rb b/app/models/relation.rb
index 377fae809f4a..cfd1d28845c2 100644
--- a/app/models/relation.rb
+++ b/app/models/relation.rb
@@ -27,25 +27,25 @@
#++
class Relation < ApplicationRecord
- belongs_to :from, class_name: "WorkPackage"
- belongs_to :to, class_name: "WorkPackage"
-
- TYPE_RELATES = "relates".freeze
- TYPE_DUPLICATES = "duplicates".freeze
- TYPE_DUPLICATED = "duplicated".freeze
- TYPE_BLOCKS = "blocks".freeze
- TYPE_BLOCKED = "blocked".freeze
- TYPE_PRECEDES = "precedes".freeze
- TYPE_FOLLOWS = "follows".freeze
- TYPE_INCLUDES = "includes".freeze
- TYPE_PARTOF = "partof".freeze
- TYPE_REQUIRES = "requires".freeze
- TYPE_REQUIRED = "required".freeze
+ belongs_to :from, class_name: 'WorkPackage'
+ belongs_to :to, class_name: 'WorkPackage'
+
+ TYPE_RELATES = 'relates'.freeze
+ TYPE_DUPLICATES = 'duplicates'.freeze
+ TYPE_DUPLICATED = 'duplicated'.freeze
+ TYPE_BLOCKS = 'blocks'.freeze
+ TYPE_BLOCKED = 'blocked'.freeze
+ TYPE_PRECEDES = 'precedes'.freeze
+ TYPE_FOLLOWS = 'follows'.freeze
+ TYPE_INCLUDES = 'includes'.freeze
+ TYPE_PARTOF = 'partof'.freeze
+ TYPE_REQUIRES = 'requires'.freeze
+ TYPE_REQUIRED = 'required'.freeze
# The parent/child relation is maintained separately
# (in WorkPackage and WorkPackageHierarchy) and a relation cannot
# have the type 'parent' but this is abstracted to simplify the code.
- TYPE_PARENT = "parent".freeze
- TYPE_CHILD = "child".freeze
+ TYPE_PARENT = 'parent'.freeze
+ TYPE_CHILD = 'child'.freeze
TYPES = {
TYPE_RELATES => {
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 8445028ef00d..a26c28d4b18c 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -170,8 +170,8 @@ def cat(path, identifier = nil)
delegate :diff, to: :scm
- def diff_format_revisions(cs, cs_to, sep = ":")
- text = ""
+ def diff_format_revisions(cs, cs_to, sep = ':')
+ text = ''
text << (cs_to.format_identifier + sep) if cs_to
text << cs.format_identifier if cs
text
@@ -204,7 +204,7 @@ def find_changeset_by_name(name)
name = name.to_s
return nil if name.blank?
- changesets.where((name.match?(/\A\d*\z/) ? ["revision = ?", name] : ["revision LIKE ?", name + "%"])).first
+ changesets.where((name.match?(/\A\d*\z/) ? ['revision = ?', name] : ['revision LIKE ?', name + '%'])).first
end
def latest_changeset
@@ -220,7 +220,7 @@ def latest_changesets(path, _rev, limit = 10)
.limit(limit)
else
changesets.includes(changeset: :user)
- .where(["path = ?", path.with_leading_slash])
+ .where(['path = ?', path.with_leading_slash])
.order("#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC")
.limit(limit)
.map(&:changeset)
@@ -243,7 +243,7 @@ def committer_ids=(h)
new_user_id = h[committer]
if new_user_id && (new_user_id.to_i != user_id.to_i)
new_user_id = (new_user_id.to_i > 0 ? new_user_id.to_i : nil)
- Changeset.where(["repository_id = ? AND committer = ?", id, committer])
+ Changeset.where(['repository_id = ? AND committer = ?', id, committer])
.update_all("user_id = #{new_user_id.nil? ? 'NULL' : new_user_id}")
end
end
@@ -281,7 +281,7 @@ def find_committer_user(committer)
def repo_log_encoding
encoding = log_encoding.to_s.strip
- encoding.presence || "UTF-8"
+ encoding.presence || 'UTF-8'
end
# Fetches new changesets for all repositories of active projects
@@ -345,7 +345,7 @@ def self.build_scm_class(vendor)
if klass.nil?
raise OpenProject::SCM::Exceptions::RepositoryBuildError.new(
- I18n.t("repositories.errors.disabled_or_unknown_vendor", vendor:)
+ I18n.t('repositories.errors.disabled_or_unknown_vendor', vendor:)
)
else
klass
@@ -359,7 +359,7 @@ def self.set_verified_type!(repository, type)
repository.scm_type = type
else
raise OpenProject::SCM::Exceptions::RepositoryBuildError.new(
- I18n.t("repositories.errors.disabled_or_unknown_type",
+ I18n.t('repositories.errors.disabled_or_unknown_type',
type:,
vendor: repository.vendor)
)
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index f28f1d708bc4..7005ee305d8b 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open_project/scm/adapters/git"
+require 'open_project/scm/adapters/git'
class Repository::Git < Repository
validates :url, presence: true
@@ -40,7 +40,7 @@ def configure(scm_type, _args)
if scm_type == self.class.managed_type
unless manageable?
raise OpenProject::SCM::Exceptions::RepositoryBuildError.new(
- I18n.t("repositories.managed.error_not_manageable")
+ I18n.t('repositories.managed.error_not_manageable')
)
end
@@ -69,7 +69,7 @@ def repository_identifier
end
def repository_type
- "Git"
+ 'Git'
end
##
@@ -84,7 +84,7 @@ def supports_directory_revisions?
end
def repo_log_encoding
- "UTF-8"
+ 'UTF-8'
end
def self.authorization_policy
@@ -112,10 +112,10 @@ def self.format_revision(revision)
def find_changeset_by_name(name)
return nil if name.nil? || name.empty?
- e = changesets.where(["revision = ?", name.to_s]).first
+ e = changesets.where(['revision = ?', name.to_s]).first
return e if e
- changesets.where(["scmid LIKE ?", "#{name}%"]).first
+ changesets.where(['scmid LIKE ?', "#{name}%"]).first
end
# With SCM's that have a sequential commit numbering, redmine is able to be
@@ -127,13 +127,13 @@ def find_changeset_by_name(name)
# The repository can still be fully reloaded by calling #clear_changesets
# before fetching changesets (eg. for offline resync)
def fetch_changesets
- c = changesets.order(Arel.sql("committed_on DESC")).first
+ c = changesets.order(Arel.sql('committed_on DESC')).first
since = (c ? c.committed_on - 7.days : nil)
- revisions = scm.revisions("", nil, nil, all: true, since:, reverse: true)
+ revisions = scm.revisions('', nil, nil, all: true, since:, reverse: true)
return if revisions.nil? || revisions.empty?
- recent_changesets = changesets.where(["committed_on >= ?", since])
+ recent_changesets = changesets.where(['committed_on >= ?', since])
# Clean out revisions that are no longer in git
recent_changesets.each { |c| c.destroy unless revisions.detect { |r| r.scmid.to_s == c.scmid.to_s } }
@@ -173,15 +173,15 @@ def latest_changesets(path, rev, limit = 10)
revisions = scm.revisions(path, nil, rev, limit:, all: false)
return [] if revisions.nil? || revisions.empty?
- changesets.where(["scmid IN (?)", revisions.map!(&:scmid)])
- .order(Arel.sql("committed_on DESC"))
+ changesets.where(['scmid IN (?)', revisions.map!(&:scmid)])
+ .order(Arel.sql('committed_on DESC'))
end
private
def validity_of_local_url
parsed = URI.parse root_url.presence || url
- if parsed.scheme == "ssh"
+ if parsed.scheme == 'ssh'
errors.add :url, :must_not_be_ssh
end
rescue StandardError => e
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 343ac62596c5..9f86b81dccdd 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open_project/scm/adapters/subversion"
+require 'open_project/scm/adapters/subversion'
class Repository::Subversion < Repository
validates :url, presence: true
@@ -40,7 +40,7 @@ def configure(scm_type, _args)
if scm_type == self.class.managed_type
unless manageable?
raise OpenProject::SCM::Exceptions::RepositoryBuildError.new(
- I18n.t("repositories.managed.error_not_manageable")
+ I18n.t('repositories.managed.error_not_manageable')
)
end
@@ -69,7 +69,7 @@ def managed_repo_created
end
def repository_type
- "Subversion"
+ 'Subversion'
end
def supports_directory_revisions?
@@ -77,17 +77,17 @@ def supports_directory_revisions?
end
def repo_log_encoding
- "UTF-8"
+ 'UTF-8'
end
def latest_changesets(path, rev, limit = 10)
revisions = scm.revisions(path, rev, nil, limit:)
- revisions ? changesets.where(revision: revisions.map(&:identifier)).order(Arel.sql("committed_on DESC")).includes(:user) : []
+ revisions ? changesets.where(revision: revisions.map(&:identifier)).order(Arel.sql('committed_on DESC')).includes(:user) : []
end
# Returns a path relative to the url of the repository
def relative_path(path)
- path.gsub(Regexp.new("^/?#{Regexp.escape(relative_url)}/"), "")
+ path.gsub(Regexp.new("^/?#{Regexp.escape(relative_url)}/"), '')
end
def fetch_changesets
@@ -106,7 +106,7 @@ def fetch_changesets
while identifier_from <= scm_revision
# loads changesets by batches of 200
identifier_to = [identifier_from + 199, scm_revision].min
- revisions = scm.revisions("", identifier_to, identifier_from, with_paths: true)
+ revisions = scm.revisions('', identifier_to, identifier_from, with_paths: true)
unless revisions.nil?
revisions.reverse_each do |revision|
transaction do
@@ -139,6 +139,6 @@ def fetch_changesets
# url = file:///var/svn/foo/bar
# => returns /bar
def relative_url
- @relative_url ||= url.gsub(Regexp.new("^#{Regexp.escape(root_url || scm.root_url)}", Regexp::IGNORECASE), "")
+ @relative_url ||= url.gsub(Regexp.new("^#{Regexp.escape(root_url || scm.root_url)}", Regexp::IGNORECASE), '')
end
end
diff --git a/app/models/role.rb b/app/models/role.rb
index fb460ae868c9..6fa1006486da 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -36,13 +36,13 @@ class Role < ApplicationRecord
BUILTIN_WORK_PACKAGE_EDITOR = 5
scope :builtin, ->(*args) {
- compare = "not" if args.first == true
+ compare = 'not' if args.first == true
where("#{compare} builtin = #{NON_BUILTIN}")
}
# Work Package Roles are intentionally visually hidden from users temporarily
- scope :visible, -> { where.not(type: "WorkPackageRole") }
- scope :ordered_by_builtin_and_position, -> { order(Arel.sql("builtin, position")) }
+ scope :visible, -> { where.not(type: 'WorkPackageRole') }
+ scope :ordered_by_builtin_and_position, -> { order(Arel.sql('builtin, position')) }
before_destroy(prepend: true) do
unless deletable?
@@ -87,7 +87,7 @@ def self.givable
Role::BUILTIN_WORK_PACKAGE_EDITOR
]
)
- .order(Arel.sql("position"))
+ .order(Arel.sql('position'))
end
def permissions
diff --git a/app/models/sessions/sql_bypass.rb b/app/models/sessions/sql_bypass.rb
index 4ac66bbfca69..c08a4ec118e1 100644
--- a/app/models/sessions/sql_bypass.rb
+++ b/app/models/sessions/sql_bypass.rb
@@ -74,13 +74,13 @@ def save
private
def user_id
- id = data.with_indifferent_access["user_id"].to_i
+ id = data.with_indifferent_access['user_id'].to_i
id > 0 ? id : nil
end
def insert!
@new_record = false
- connection.update <<~SQL, "Create session"
+ connection.update <<~SQL, 'Create session'
INSERT INTO sessions (session_id, data, user_id, updated_at)
VALUES (
#{connection.quote(session_id)},
@@ -92,7 +92,7 @@ def insert!
end
def update!
- connection.update <<~SQL, "Update session"
+ connection.update <<~SQL, 'Update session'
UPDATE sessions
SET
data=#{connection.quote(self.class.serialize(data))},
diff --git a/app/models/sessions/user_session.rb b/app/models/sessions/user_session.rb
index d54c438f6442..73d943dea433 100644
--- a/app/models/sessions/user_session.rb
+++ b/app/models/sessions/user_session.rb
@@ -31,7 +31,7 @@
# You can still use AR methods to delete records however.
module Sessions
class UserSession < ::ApplicationRecord
- self.table_name = "sessions"
+ self.table_name = 'sessions'
scope :for_user, ->(user) do
user_id = user.is_a?(User) ? user.id : user.to_i
diff --git a/app/models/setting/aliases.rb b/app/models/setting/aliases.rb
index 848edd38ea2f..d78c45154e20 100644
--- a/app/models/setting/aliases.rb
+++ b/app/models/setting/aliases.rb
@@ -34,9 +34,9 @@ module Aliases
# Restore the previous Setting.protocol now replaced by https?
def protocol
if OpenProject::Configuration.https?
- "https"
+ 'https'
else
- "http"
+ 'http'
end
end
end
diff --git a/app/models/status.rb b/app/models/status.rb
index 3b31e1ddcd87..6810953a9153 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -29,10 +29,10 @@
class Status < ApplicationRecord
default_scope { order_by_position }
before_destroy :check_integrity
- has_many :workflows, foreign_key: "old_status_id"
+ has_many :workflows, foreign_key: 'old_status_id'
acts_as_list
- belongs_to :color, class_name: "Color"
+ belongs_to :color, class_name: 'Color'
before_destroy :delete_workflows
@@ -63,10 +63,10 @@ def self.where_default
# Update all the +Issues+ setting their done_ratio to the value of their +Status+
def self.update_work_package_done_ratios
if WorkPackage.use_status_for_done_ratio?
- Status.where(["default_done_ratio >= 0"]).find_each do |status|
+ Status.where(['default_done_ratio >= 0']).find_each do |status|
WorkPackage
- .where(["status_id = ?", status.id])
- .update_all(["done_ratio = ?", status.default_done_ratio])
+ .where(['status_id = ?', status.id])
+ .update_all(['done_ratio = ?', status.default_done_ratio])
end
end
@@ -98,7 +98,7 @@ def is_readonly
##
# Overrides cache key so that changes to EE state are reflected
def cache_key
- super + "/" + can_readonly?.to_s
+ super + '/' + can_readonly?.to_s
end
private
diff --git a/app/models/system_user.rb b/app/models/system_user.rb
index decfe36e7fa5..474de441fc60 100644
--- a/app/models/system_user.rb
+++ b/app/models/system_user.rb
@@ -35,7 +35,7 @@ class SystemUser < User
# There should be only one SystemUser in the database
def validate_unique_system_user
- errors.add :base, "A SystemUser already exists." if SystemUser.any?
+ errors.add :base, 'A SystemUser already exists.' if SystemUser.any?
end
# Overrides a few properties
@@ -43,7 +43,7 @@ def logged?; false end
def builtin?; true end
- def name(*_args); "System" end
+ def name(*_args); 'System' end
def mail; nil end
diff --git a/app/models/timestamp.rb b/app/models/timestamp.rb
index 8abd244f84c5..604f6007fac0 100644
--- a/app/models/timestamp.rb
+++ b/app/models/timestamp.rb
@@ -65,13 +65,13 @@ def parse!
class << self
def substitute_special_shortcut_values(string)
# map now to PT0S
- return "PT0S" if string == "now"
+ return 'PT0S' if string == 'now'
# map 1y to P1Y, 1m to P1M, 1w to P1W, 1d to P1D
# map -1y to P-1Y, -1m to P-1M, -1w to P-1W, -1d to P-1D
# map -1y1d to P-1Y-1D
- units = ["y", "m", "w", "d"]
- sign = "-" if string.start_with?("-")
+ units = ['y', 'm', 'w', 'd']
+ sign = '-' if string.start_with?('-')
substitutions = units.filter_map { |unit| string.scan(/\d+#{unit}/).first&.upcase }
return string if substitutions.empty?
@@ -135,7 +135,7 @@ def relative_date_keyword?
end
def one_day_ago?
- to_s.start_with? "oneDayAgo"
+ to_s.start_with? 'oneDayAgo'
end
def to_s
@@ -177,13 +177,13 @@ def relative_date_keyword_to_time
raise ArgumentError, "This timestamp does not contain a relative date keyword and cannot be represented as Time."
end
- relative_date_keyword, time_part = @timestamp_string.split("@")
+ relative_date_keyword, time_part = @timestamp_string.split('@')
date = case relative_date_keyword
- when "oneDayAgo" then 1.day.ago
- when "lastWorkingDay" then Day.last_working.date || 1.day.ago
- when "oneWeekAgo" then 1.week.ago
- when "oneMonthAgo" then 1.month.ago
+ when 'oneDayAgo' then 1.day.ago
+ when 'lastWorkingDay' then Day.last_working.date || 1.day.ago
+ when 'oneWeekAgo' then 1.week.ago
+ when 'oneMonthAgo' then 1.month.ago
end
Time.zone.parse(time_part, date)
diff --git a/app/models/token/base.rb b/app/models/token/base.rb
index 4b95393a927e..e69b0c4a6c23 100644
--- a/app/models/token/base.rb
+++ b/app/models/token/base.rb
@@ -18,7 +18,7 @@
module Token
class Base < ApplicationRecord
- self.table_name = "tokens"
+ self.table_name = 'tokens'
serialize :data, coder: ::Serializers::IndifferentHashSerializer
# Hashed tokens belong to a user and are unique per type
diff --git a/app/models/token/ical.rb b/app/models/token/ical.rb
index b93c72b19ff1..7d97e6ba903f 100644
--- a/app/models/token/ical.rb
+++ b/app/models/token/ical.rb
@@ -30,7 +30,7 @@ module Token
class ICal < HashedToken
# restrict the usage of one ical token to one query (calendar)
has_one :ical_token_query_assignment, required: true, dependent: :destroy, foreign_key: :ical_token_id,
- class_name: "ICalTokenQueryAssignment", inverse_of: :ical_token
+ class_name: 'ICalTokenQueryAssignment', inverse_of: :ical_token
accepts_nested_attributes_for :ical_token_query_assignment
has_one :query, through: :ical_token_query_assignment
diff --git a/app/models/type.rb b/app/models/type.rb
index 5465bad85bc2..c849e043a432 100644
--- a/app/models/type.rb
+++ b/app/models/type.rb
@@ -46,13 +46,13 @@ def copy_from_type(source_type)
has_and_belongs_to_many :projects
has_and_belongs_to_many :custom_fields,
- class_name: "WorkPackageCustomField",
+ class_name: 'WorkPackageCustomField',
join_table: "#{table_name_prefix}custom_fields_types#{table_name_suffix}",
- association_foreign_key: "custom_field_id"
+ association_foreign_key: 'custom_field_id'
belongs_to :color,
optional: true,
- class_name: "Color"
+ class_name: 'Color'
acts_as_list
@@ -65,7 +65,7 @@ def copy_from_type(source_type)
scopes :milestone
- default_scope { order("position ASC") }
+ default_scope { order('position ASC') }
scope :without_standard, -> {
where(is_standard: false)
diff --git a/app/models/type/attribute_groups.rb b/app/models/type/attribute_groups.rb
index e449d316a23c..d3c924693e05 100644
--- a/app/models/type/attribute_groups.rb
+++ b/app/models/type/attribute_groups.rb
@@ -58,7 +58,7 @@ module Type::AttributeGroups
estimates_and_time: :label_estimates_and_time,
details: :label_details,
other: :label_other,
- children: :"activerecord.attributes.work_package.children"
+ children: :'activerecord.attributes.work_package.children'
}
end
end
diff --git a/app/models/type/attributes.rb b/app/models/type/attributes.rb
index fc7952c146d7..2bf22c0802c8 100644
--- a/app/models/type/attributes.rb
+++ b/app/models/type/attributes.rb
@@ -77,10 +77,10 @@ def add_constraint(attribute, callable)
# @return [Hash{String => Hash}] Map from attribute names to options.
def all_work_package_form_attributes(merge_date: false)
wp_cf_cache_parts = RequestStore.fetch(:wp_cf_max_updated_at_and_count) do
- WorkPackageCustomField.pluck(Arel.sql("max(updated_at), count(id)")).flatten
+ WorkPackageCustomField.pluck(Arel.sql('max(updated_at), count(id)')).flatten
end
- OpenProject::Cache.fetch("all_work_package_form_attributes",
+ OpenProject::Cache.fetch('all_work_package_form_attributes',
*wp_cf_cache_parts,
EXCLUDED.length,
merge_date) do
@@ -134,15 +134,15 @@ def calculate_default_work_package_form_attributes
def skipped_attribute?(key, definition)
# We always want to include the priority even if its required
- return false if key == "priority"
+ return false if key == 'priority'
EXCLUDED.include?(key) || definition[:required]
end
def merge_date_for_form_attributes(attributes)
- attributes["date"] = { required: false, has_default: false }
- attributes.delete "due_date"
- attributes.delete "start_date"
+ attributes['date'] = { required: false, has_default: false }
+ attributes.delete 'due_date'
+ attributes.delete 'start_date'
end
def add_custom_fields_to_form_attributes(attributes)
@@ -157,19 +157,19 @@ def add_custom_fields_to_form_attributes(attributes)
end
def attr_i18n_key(name)
- if name == "percentage_done"
- "done_ratio"
+ if name == 'percentage_done'
+ 'done_ratio'
else
name
end
end
def attr_translate(name)
- if name == "date"
- I18n.t("label_date")
+ if name == 'date'
+ I18n.t('label_date')
else
key = attr_i18n_key(name)
- I18n.t("activerecord.attributes.work_package.#{key}", fallback: false, default: "")
+ I18n.t("activerecord.attributes.work_package.#{key}", fallback: false, default: '')
.presence || I18n.t("attributes.#{key}")
end
end
diff --git a/app/models/type/query_group.rb b/app/models/type/query_group.rb
index caa40011b74f..c5436fc74286 100644
--- a/app/models/type/query_group.rb
+++ b/app/models/type/query_group.rb
@@ -27,7 +27,7 @@
#++
class Type::QueryGroup < Type::FormGroup
- MEMBER_PREFIX = "query_".freeze
+ MEMBER_PREFIX = 'query_'.freeze
def self.query_attribute?(name)
name.to_s.match?(/#{Type::QueryGroup::MEMBER_PREFIX}(\d+)/o)
diff --git a/app/models/user_password.rb b/app/models/user_password.rb
index 20a1618844bb..bcc9db2eac60 100644
--- a/app/models/user_password.rb
+++ b/app/models/user_password.rb
@@ -101,10 +101,10 @@ def salt_and_hash_password!
# Require the implementation to provide a secure comparison
def hash_matches?(_plain)
- raise NotImplementedError, "Must be overridden by subclass"
+ raise NotImplementedError, 'Must be overridden by subclass'
end
def derive_password!(_input)
- raise NotImplementedError, "Must be overridden by subclass"
+ raise NotImplementedError, 'Must be overridden by subclass'
end
end
diff --git a/app/models/user_password/sha1.rb b/app/models/user_password/sha1.rb
index 21d89932d7f1..33ea5afb155c 100644
--- a/app/models/user_password/sha1.rb
+++ b/app/models/user_password/sha1.rb
@@ -54,7 +54,7 @@ def secure_equals?(a, b)
##
# Override the base method to disallow new passwords being generated this way.
def salt_and_hash_password!
- raise ArgumentError, "Do not use UserPassword::SHA1 for new passwords!"
+ raise ArgumentError, 'Do not use UserPassword::SHA1 for new passwords!'
end
##
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index b242b7771cdc..246abb7af12f 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -46,9 +46,9 @@ def method_missing(method_name, *args)
action = key[-1]
case action
- when "?"
+ when '?'
to_boolean send(key[..-2])
- when "="
+ when '='
settings[key[..-2]] = args.first
else
settings[key]
@@ -83,11 +83,11 @@ def comments_sorting
end
def comments_in_reverse_order?
- comments_sorting == "desc"
+ comments_sorting == 'desc'
end
def diff_type
- settings.fetch(:diff_type, "inline")
+ settings.fetch(:diff_type, 'inline')
end
def hide_mail
@@ -120,7 +120,7 @@ def warn_on_leaving_unsaved=(value)
alias :auto_hide_popups :auto_hide_popups?
def comments_in_reverse_order=(value)
- settings[:comments_sorting] = to_boolean(value) ? "desc" : "asc"
+ settings[:comments_sorting] = to_boolean(value) ? 'desc' : 'asc'
end
def theme
@@ -128,7 +128,7 @@ def theme
end
def high_contrast_theme?
- theme.end_with?("high_contrast")
+ theme.end_with?('high_contrast')
end
def time_zone
@@ -152,7 +152,7 @@ def pause_reminders
end
def supported_settings_method?(method_name)
- UserPreferences::Schema.properties.include?(method_name.to_s.gsub(/\?|=\z/, ""))
+ UserPreferences::Schema.properties.include?(method_name.to_s.gsub(/\?|=\z/, ''))
end
private
diff --git a/app/models/user_preferences/schema.rb b/app/models/user_preferences/schema.rb
index 222ffd0bf701..b4d57bee97b2 100644
--- a/app/models/user_preferences/schema.rb
+++ b/app/models/user_preferences/schema.rb
@@ -28,7 +28,7 @@
class UserPreferences::Schema
class << self
- PATH = Rails.root.join("config/schemas/user_preferences.schema.json")
+ PATH = Rails.root.join('config/schemas/user_preferences.schema.json')
class_attribute :extensions,
default: {}
@@ -37,7 +37,7 @@ def schema
@schema ||= begin
json = JSON::parse(File.read(PATH))
extensions.each do |path, extension|
- existing = json.dig(*path.split("/"))
+ existing = json.dig(*path.split('/'))
existing.merge!(extension)
end
@@ -51,7 +51,7 @@ def merge!(path, hash)
end
def properties
- @properties ||= schema.dig("definitions", "UserPreferences", "properties")&.keys || []
+ @properties ||= schema.dig('definitions', 'UserPreferences', 'properties')&.keys || []
end
end
end
diff --git a/app/models/users/scopes/having_reminder_mail_to_send.rb b/app/models/users/scopes/having_reminder_mail_to_send.rb
index 35ffcaede624..b3e6cf3c3398 100644
--- a/app/models/users/scopes/having_reminder_mail_to_send.rb
+++ b/app/models/users/scopes/having_reminder_mail_to_send.rb
@@ -86,7 +86,7 @@ def local_time_join(local_times)
# to Friday.
times_sql = arel_table
.grouping(Arel::Nodes::ValuesList.new(local_times))
- .as("t(today_local, hours, zone, workday)")
+ .as('t(today_local, hours, zone, workday)')
default_timezone = Arel::Nodes::build_quoted(Setting.user_default_timezone.presence)
@@ -160,7 +160,7 @@ def build_local_times(times, zone)
[
local_date,
- local_time.strftime("%H:00:00+00:00"),
+ local_time.strftime('%H:00:00+00:00'),
zone.tzinfo.canonical_zone.name,
workday
]
diff --git a/app/models/users/scopes/with_time_zone.rb b/app/models/users/scopes/with_time_zone.rb
index 2f78a015567d..a29c8253b837 100644
--- a/app/models/users/scopes/with_time_zone.rb
+++ b/app/models/users/scopes/with_time_zone.rb
@@ -47,7 +47,7 @@ def with_time_zone(time_zones)
end
def user_default_time_zone
- Arel::Nodes::build_quoted(Setting.user_default_timezone.presence || "Etc/UTC")
+ Arel::Nodes::build_quoted(Setting.user_default_timezone.presence || 'Etc/UTC')
end
end
end
diff --git a/app/models/versions/project_sharing.rb b/app/models/versions/project_sharing.rb
index 44526ac2b3ca..a20fcc223133 100644
--- a/app/models/versions/project_sharing.rb
+++ b/app/models/versions/project_sharing.rb
@@ -48,7 +48,7 @@ def project_sharing_join
end
def project_sharing_select(versions_table)
- sharing_select = if sharing == "tree"
+ sharing_select = if sharing == 'tree'
project_sharing_tree_select(versions_table)
else
project_sharing_default_select(versions_table)
@@ -58,13 +58,13 @@ def project_sharing_select(versions_table)
sharing_select
.where(sharing_id_condition)
- .as("sharing")
+ .as('sharing')
end
def project_sharing_tree_select(versions_table)
hierarchy_table = Project.arel_table
- roots_table = Project.arel_table.alias("roots")
+ roots_table = Project.arel_table.alias('roots')
roots_join_condition = project_sharing_tree_root_join_condition(roots_table, hierarchy_table)
sharing_select = join_project_and_version(hierarchy_table, versions_table)
@@ -90,7 +90,7 @@ def project_sharing_default_select(versions_table)
def necessary_sharing_fields(sharing_select, projects_table, versions_table)
sharing_select
.project(projects_table[:id],
- versions_table[:id].as("version_id"),
+ versions_table[:id].as('version_id'),
projects_table[:lft],
projects_table[:rgt],
versions_table[:sharing])
@@ -112,13 +112,13 @@ def project_sharing_tree_root_join_condition(roots_table, hierarchy_table)
def project_sharing_join_condition(sharing_table, projects_table)
case self[:sharing]
- when "tree"
+ when 'tree'
project_sharing_tree_join_condition(sharing_table, projects_table)
- when "descendants"
+ when 'descendants'
project_sharing_descendants_join_condition(sharing_table, projects_table)
- when "hierarchy"
+ when 'hierarchy'
project_sharing_hierarchy_join_condition(sharing_table, projects_table)
- when "system"
+ when 'system'
Arel::Nodes::True.new
else
sharing_table[:id].eq(projects_table[:id])
diff --git a/app/models/versions/scopes/shared_with.rb b/app/models/versions/scopes/shared_with.rb
index e3804bfb1552..169762d061cb 100644
--- a/app/models/versions/scopes/shared_with.rb
+++ b/app/models/versions/scopes/shared_with.rb
@@ -59,7 +59,7 @@ def shared_versions_by_tree(project)
includes(:project)
.merge(Project.active)
.where(projects: { id: root.self_and_descendants.select(:id) })
- .where(sharing: "tree")
+ .where(sharing: 'tree')
end
def shared_versions_by_hierarchy_or_descendants(project)
@@ -71,13 +71,13 @@ def shared_versions_by_hierarchy_or_descendants(project)
def shared_versions_by_hierarchy(project)
rolled_up(project)
- .where(sharing: "hierarchy")
+ .where(sharing: 'hierarchy')
end
def shared_versions_by_system
includes(:project)
.merge(Project.active)
- .where(sharing: "system")
+ .where(sharing: 'system')
end
end
end
diff --git a/app/models/watcher.rb b/app/models/watcher.rb
index 104cd741d42f..5109e05cbf86 100644
--- a/app/models/watcher.rb
+++ b/app/models/watcher.rb
@@ -138,7 +138,7 @@ def watchers_of_watchable(watchable, projects, user_ids)
.joins(:watchers)
.joins(:project)
.where(projects: { id: projects.map(&:id) })
- .select("watchers.id")
+ .select('watchers.id')
id_subquery = id_subquery.where(watchers: { user_id: user_ids }) unless user_ids.empty?
diff --git a/app/models/week_day.rb b/app/models/week_day.rb
index 04bae4b84c6d..03b4296efad2 100644
--- a/app/models/week_day.rb
+++ b/app/models/week_day.rb
@@ -22,7 +22,7 @@ def initialize(day:)
end
def name
- day_names = I18n.t("date.day_names")
+ day_names = I18n.t('date.day_names')
day_names[day % 7]
end
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index b2438ae9904f..345b50f2c3b9 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -29,18 +29,18 @@
class Wiki < ApplicationRecord
belongs_to :project
has_many :pages, -> {
- order("title")
- }, class_name: "WikiPage", dependent: :destroy
+ order('title')
+ }, class_name: 'WikiPage', dependent: :destroy
has_many :wiki_menu_items, -> {
- order("name")
- }, class_name: "MenuItems::WikiMenuItem", dependent: :delete_all, foreign_key: "navigatable_id"
- has_many :redirects, class_name: "WikiRedirect", dependent: :delete_all
+ order('name')
+ }, class_name: 'MenuItems::WikiMenuItem', dependent: :delete_all, foreign_key: 'navigatable_id'
+ has_many :redirects, class_name: 'WikiRedirect', dependent: :delete_all
acts_as_watchable permission: :view_wiki_pages
accepts_nested_attributes_for :wiki_menu_items,
allow_destroy: true,
- reject_if: proc { |attr| attr["name"].blank? && attr["title"].blank? }
+ reject_if: proc { |attr| attr['name'].blank? && attr['title'].blank? }
validates :start_page, presence: true
@@ -105,7 +105,7 @@ def self.find_page(title, options = {})
def create_menu_item_for_start_page
wiki_menu_item = wiki_menu_items.find_or_initialize_by(title: start_page) do |item|
- item.name = "wiki"
+ item.name = 'wiki'
end
wiki_menu_item.new_wiki_page = true
wiki_menu_item.index_page = true
diff --git a/app/models/wikis/annotate.rb b/app/models/wikis/annotate.rb
index 2bbf1a8da1f0..d990cb07960e 100644
--- a/app/models/wikis/annotate.rb
+++ b/app/models/wikis/annotate.rb
@@ -41,7 +41,7 @@ def initialize(content)
d.each_slice(3) do |s|
sign = s[0]
line = s[1]
- if sign == "+" && positions[line] && positions[line] != -1 && @lines[positions[line]][0].nil?
+ if sign == '+' && positions[line] && positions[line] != -1 && @lines[positions[line]][0].nil?
@lines[positions[line]][0] = current.version
@lines[positions[line]][1] = current.data.author
end
@@ -49,7 +49,7 @@ def initialize(content)
d.each_slice(3) do |s|
sign = s[0]
line = s[1]
- if sign == "-"
+ if sign == '-'
positions.insert(line, -1)
else
positions[line] = nil
diff --git a/app/models/work_package.rb b/app/models/work_package.rb
index bea6bce410ae..54e7cef76292 100644
--- a/app/models/work_package.rb
+++ b/app/models/work_package.rb
@@ -47,17 +47,17 @@ class WorkPackage < ApplicationRecord
belongs_to :project
belongs_to :type
- belongs_to :status, class_name: "Status"
- belongs_to :author, class_name: "User"
- belongs_to :assigned_to, class_name: "Principal", optional: true
- belongs_to :responsible, class_name: "Principal", optional: true
+ belongs_to :status, class_name: 'Status'
+ belongs_to :author, class_name: 'User'
+ belongs_to :assigned_to, class_name: 'Principal', optional: true
+ belongs_to :responsible, class_name: 'Principal', optional: true
belongs_to :version, optional: true
- belongs_to :priority, class_name: "IssuePriority"
- belongs_to :category, class_name: "Category", optional: true
+ belongs_to :priority, class_name: 'IssuePriority'
+ belongs_to :category, class_name: 'Category', optional: true
has_many :time_entries, dependent: :delete_all
- has_many :file_links, dependent: :delete_all, class_name: "Storages::FileLink", as: :container
+ has_many :file_links, dependent: :delete_all, class_name: 'Storages::FileLink', as: :container
has_many :storages, through: :project
@@ -68,7 +68,7 @@ class WorkPackage < ApplicationRecord
has_and_belongs_to_many :github_pull_requests # rubocop:disable Rails/HasAndBelongsToMany
has_many :members, as: :entity, dependent: :destroy
- has_many :member_principals, through: :members, class_name: "Principal", source: :principal
+ has_many :member_principals, through: :members, class_name: 'Principal', source: :principal
has_many :meeting_agenda_items, dependent: :nullify
# The MeetingAgendaItem has a default order, but the ordered field is not part of the select
@@ -148,7 +148,7 @@ class WorkPackage < ApplicationRecord
acts_as_customizable
- acts_as_searchable columns: ["subject",
+ acts_as_searchable columns: ['subject',
"#{table_name}.description",
{
name: "#{Journal.table_name}.notes",
@@ -157,13 +157,13 @@ class WorkPackage < ApplicationRecord
tsv_columns: [
{
table_name: Attachment.table_name,
- column_name: "fulltext",
+ column_name: 'fulltext',
normalization_type: :text,
scope: -> { Attachment.where(container_type: name).where("container_id = #{table_name}.id") }
},
{
table_name: Attachment.table_name,
- column_name: "file",
+ column_name: 'file',
normalization_type: :filename,
scope: -> { Attachment.where(container_type: name).where("container_id = #{table_name}.id") }
}
@@ -207,15 +207,15 @@ class WorkPackage < ApplicationRecord
prepend Journable::Timestamps
def self.done_ratio_disabled?
- Setting.work_package_done_ratio == "disabled"
+ Setting.work_package_done_ratio == 'disabled'
end
def self.use_status_for_done_ratio?
- Setting.work_package_done_ratio == "status"
+ Setting.work_package_done_ratio == 'status'
end
def self.use_field_for_done_ratio?
- Setting.work_package_done_ratio == "field"
+ Setting.work_package_done_ratio == 'field'
end
# Returns true if usr or current user is allowed to view the work_package
@@ -339,7 +339,7 @@ def type_id=(tid)
def attributes=(new_attributes)
return if new_attributes.nil?
- new_type_id = new_attributes["type_id"] || new_attributes[:type_id]
+ new_type_id = new_attributes['type_id'] || new_attributes[:type_id]
if new_type_id
self.type_id = new_type_id
end
@@ -395,43 +395,43 @@ def self.update_versions_from_hierarchy_change(project)
# Extracted from the ReportsController.
def self.by_type(project)
count_and_group_by project:,
- field: "type_id",
+ field: 'type_id',
joins: ::Type.table_name
end
def self.by_version(project)
count_and_group_by project:,
- field: "version_id",
+ field: 'version_id',
joins: Version.table_name
end
def self.by_priority(project)
count_and_group_by project:,
- field: "priority_id",
+ field: 'priority_id',
joins: IssuePriority.table_name
end
def self.by_category(project)
count_and_group_by project:,
- field: "category_id",
+ field: 'category_id',
joins: Category.table_name
end
def self.by_assigned_to(project)
count_and_group_by project:,
- field: "assigned_to_id",
+ field: 'assigned_to_id',
joins: User.table_name
end
def self.by_responsible(project)
count_and_group_by project:,
- field: "responsible_id",
+ field: 'responsible_id',
joins: User.table_name
end
def self.by_author(project)
count_and_group_by project:,
- field: "author_id",
+ field: 'author_id',
joins: User.table_name
end
@@ -476,10 +476,10 @@ def self.available_custom_fields(work_package)
def self.preload_available_custom_fields(work_packages)
custom_fields = available_custom_fields_from_db(work_packages)
- .select("array_agg(projects.id) available_project_ids",
- "array_agg(types.id) available_type_ids",
- "custom_fields.*")
- .group("custom_fields.id")
+ .select('array_agg(projects.id) available_project_ids',
+ 'array_agg(types.id) available_type_ids',
+ 'custom_fields.*')
+ .group('custom_fields.id')
work_packages.each do |work_package|
RequestStore.store[available_custom_field_key(work_package)] = custom_fields
@@ -537,10 +537,10 @@ def add_time_entry_for(user, attributes)
def time_entry_blank?(attributes)
return true if attributes.nil?
- key = "activity_id"
+ key = 'activity_id'
id = attributes[key]
default_id = if id&.present?
- Enumeration.exists? id:, is_default: true, type: "TimeEntryActivity"
+ Enumeration.exists? id:, is_default: true, type: 'TimeEntryActivity'
else
true
end
diff --git a/app/models/work_package/ancestors.rb b/app/models/work_package/ancestors.rb
index 789817b18cdd..1244217a3b01 100644
--- a/app/models/work_package/ancestors.rb
+++ b/app/models/work_package/ancestors.rb
@@ -78,7 +78,7 @@ def ancestors_by_work_package
.where(descendant_id: @ids)
.includes(:ancestor)
.where(ancestor: { project_id: Project.allowed_to(user, :view_work_packages) })
- .where("generations > 0")
+ .where('generations > 0')
.order(generations: :desc)
.group_by(&:descendant_id)
.transform_values { |hierarchies| hierarchies.map(&:ancestor) }
diff --git a/app/models/work_package/ask_before_destruction.rb b/app/models/work_package/ask_before_destruction.rb
index 123785390035..ce9c4f861e3f 100644
--- a/app/models/work_package/ask_before_destruction.rb
+++ b/app/models/work_package/ask_before_destruction.rb
@@ -42,7 +42,7 @@ def cleanup_action_required_before_destructing?(work_packages)
!associated_to_ask_before_destruction_of(work_packages).empty?
end
- def cleanup_associated_before_destructing_if_required(work_packages, user, to_do = { action: "destroy" })
+ def cleanup_associated_before_destructing_if_required(work_packages, user, to_do = { action: 'destroy' })
cleanup_required = cleanup_action_required_before_destructing?(work_packages)
!cleanup_required ||
diff --git a/app/models/work_package/exports/csv.rb b/app/models/work_package/exports/csv.rb
index bbb01bee2eaf..3ffcd653af24 100644
--- a/app/models/work_package/exports/csv.rb
+++ b/app/models/work_package/exports/csv.rb
@@ -49,7 +49,7 @@ def csv_row(work_package)
row << if work_package.description
work_package.description.squish
else
- ""
+ ''
end
end
end
diff --git a/app/models/work_package/exports/formatters/costs.rb b/app/models/work_package/exports/formatters/costs.rb
index 9ebe5b34852c..11feb47b5e4e 100644
--- a/app/models/work_package/exports/formatters/costs.rb
+++ b/app/models/work_package/exports/formatters/costs.rb
@@ -38,9 +38,9 @@ def format_options
def number_format_string
# [$CUR] makes sure we have an actually working currency format with arbitrary currencies
- curr = "[$CUR]".gsub "CUR", ERB::Util.h(Setting.plugin_costs["costs_currency"])
- format = ERB::Util.h Setting.plugin_costs["costs_currency_format"]
- number = "#,##0.00"
+ curr = "[$CUR]".gsub "CUR", ERB::Util.h(Setting.plugin_costs['costs_currency'])
+ format = ERB::Util.h Setting.plugin_costs['costs_currency_format']
+ number = '#,##0.00'
format.gsub("%n", number).gsub("%u", curr)
end
diff --git a/app/models/work_package/exports/formatters/currency.rb b/app/models/work_package/exports/formatters/currency.rb
index 01e03b090799..857e1f995b92 100644
--- a/app/models/work_package/exports/formatters/currency.rb
+++ b/app/models/work_package/exports/formatters/currency.rb
@@ -33,7 +33,7 @@ def self.apply?(name, export_format)
end
def format_value(value, _options)
- value.nil? || value.zero? ? "" : number_to_currency(value)
+ value.nil? || value.zero? ? '' : number_to_currency(value)
end
end
end
diff --git a/app/models/work_package/exports/formatters/days.rb b/app/models/work_package/exports/formatters/days.rb
index 0a8c8928b9c0..0a732265de4d 100644
--- a/app/models/work_package/exports/formatters/days.rb
+++ b/app/models/work_package/exports/formatters/days.rb
@@ -39,7 +39,7 @@ def format_value(value, _options)
private
def formatted_days(value)
- value.nil? ? "" : "#{value} #{I18n.t('export.units.days')}"
+ value.nil? ? '' : "#{value} #{I18n.t('export.units.days')}"
end
end
end
diff --git a/app/models/work_package/exports/formatters/hours.rb b/app/models/work_package/exports/formatters/hours.rb
index 5b5b415517e8..033175ebe0f5 100644
--- a/app/models/work_package/exports/formatters/hours.rb
+++ b/app/models/work_package/exports/formatters/hours.rb
@@ -39,7 +39,7 @@ def format_value(value, _options)
private
def formatted_hours(value)
- value.nil? ? "" : "#{value} #{I18n.t('export.units.hours')}"
+ value.nil? ? '' : "#{value} #{I18n.t('export.units.hours')}"
end
end
end
diff --git a/app/models/work_package/exports/formatters/spent_units.rb b/app/models/work_package/exports/formatters/spent_units.rb
index befa6f32ce94..df7f05fb3735 100644
--- a/app/models/work_package/exports/formatters/spent_units.rb
+++ b/app/models/work_package/exports/formatters/spent_units.rb
@@ -37,13 +37,13 @@ def format(work_package, **)
values = cost_helper.summarized_cost_entries.map do |kvp|
cost_type = kvp[0]
volume = kvp[1]
- BigDecimal("1.0")
- type_unit = volume.to_d == BigDecimal("1.0") ? cost_type.unit : cost_type.unit_plural
+ BigDecimal('1.0')
+ type_unit = volume.to_d == BigDecimal('1.0') ? cost_type.unit : cost_type.unit_plural
"#{volume} #{type_unit}"
end
return nil if values.empty?
- values.join(", ")
+ values.join(', ')
end
end
end
diff --git a/app/models/work_package/journalized.rb b/app/models/work_package/journalized.rb
index 879fa89fd006..8207f7cae8af 100644
--- a/app/models/work_package/journalized.rb
+++ b/app/models/work_package/journalized.rb
@@ -45,21 +45,21 @@ def self.event_title
def self.event_name
Proc.new do |o|
- I18n.t(o.event_type.underscore, scope: "events")
+ I18n.t(o.event_type.underscore, scope: 'events')
end
end
def self.event_type
Proc.new do |o|
journal = o.last_journal
- t = "work_package"
+ t = 'work_package'
t << if journal && journal.details.empty? && !journal.initial?
- "-note"
+ '-note'
else
status = Status.find_by(id: o.status_id)
- status.try(:is_closed?) ? "-closed" : "-edit"
+ status.try(:is_closed?) ? '-closed' : '-edit'
end
t
end
@@ -77,17 +77,17 @@ def self.event_url
name: JournalizedProcs.event_name,
url: JournalizedProcs.event_url
- register_journal_formatted_fields(:id, "parent_id")
+ register_journal_formatted_fields(:id, 'parent_id')
register_journal_formatted_fields(:fraction,
- "estimated_hours", "derived_estimated_hours",
- "remaining_hours", "derived_remaining_hours")
- register_journal_formatted_fields(:decimal, "done_ratio")
- register_journal_formatted_fields(:diff, "description")
- register_journal_formatted_fields(:schedule_manually, "schedule_manually")
+ 'estimated_hours', 'derived_estimated_hours',
+ 'remaining_hours', 'derived_remaining_hours')
+ register_journal_formatted_fields(:decimal, 'done_ratio')
+ register_journal_formatted_fields(:diff, 'description')
+ register_journal_formatted_fields(:schedule_manually, 'schedule_manually')
register_journal_formatted_fields(:attachment, /attachments_?\d+/)
register_journal_formatted_fields(:custom_field, /custom_fields_\d+/)
- register_journal_formatted_fields(:ignore_non_working_days, "ignore_non_working_days")
- register_journal_formatted_fields(:cause, "cause")
+ register_journal_formatted_fields(:ignore_non_working_days, 'ignore_non_working_days')
+ register_journal_formatted_fields(:cause, 'cause')
register_journal_formatted_fields(:file_link, /file_links_?\d+/)
# Joined
diff --git a/app/models/work_package/pdf_export/attachments.rb b/app/models/work_package/pdf_export/attachments.rb
index d13a032127d7..bcae12e6f367 100644
--- a/app/models/work_package/pdf_export/attachments.rb
+++ b/app/models/work_package/pdf_export/attachments.rb
@@ -26,11 +26,11 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "mini_magick"
+require 'mini_magick'
module WorkPackage::PDFExport::Attachments
def resize_image(file_path)
- tmp_file = Tempfile.new(["temp_image", File.extname(file_path)])
+ tmp_file = Tempfile.new(['temp_image', File.extname(file_path)])
@resized_images = [] if @resized_images.nil?
@resized_images << tmp_file
diff --git a/app/models/work_package/pdf_export/common.rb b/app/models/work_package/pdf_export/common.rb
index 3eea17cd6f17..1590b543d9f2 100644
--- a/app/models/work_package/pdf_export/common.rb
+++ b/app/models/work_package/pdf_export/common.rb
@@ -57,7 +57,7 @@ def success(content)
.new format: :pdf,
title:,
content:,
- mime_type: "application/pdf"
+ mime_type: 'application/pdf'
end
def error(message)
@@ -97,7 +97,7 @@ def get_column_value_cell(work_package, column_name)
end
def get_formatted_value(value, column_name)
- return "" if value.nil?
+ return '' if value.nil?
formatter = formatter_for(column_name, :pdf)
formatter.format_value(value, {})
@@ -105,7 +105,7 @@ def get_formatted_value(value, column_name)
def escape_tags(value)
# only disable html tags, but do not replace html entities
- value.to_s.gsub("<", "<").gsub(">", ">")
+ value.to_s.gsub('<', '<').gsub('>', '>')
end
def get_id_column_cell(work_package, value)
@@ -260,7 +260,7 @@ def make_group_label(group)
if group.blank?
I18n.t(:label_none_parentheses)
elsif group.is_a? Array
- group.join(", ")
+ group.join(', ')
else
group.to_s
end
@@ -299,11 +299,11 @@ def with_attachments?
def build_pdf_filename(base)
suffix = "_#{title_datetime}.pdf"
- "#{truncate(sane_filename(base), length: 255 - suffix.length, escape: false)}#{suffix}".tr(" ", "-")
+ "#{truncate(sane_filename(base), length: 255 - suffix.length, escape: false)}#{suffix}".tr(' ', '-')
end
def title_datetime
- DateTime.now.strftime("%Y-%m-%d_%H-%M")
+ DateTime.now.strftime('%Y-%m-%d_%H-%M')
end
def current_page_nr
diff --git a/app/models/work_package/pdf_export/cover.rb b/app/models/work_package/pdf_export/cover.rb
index bebce1fdf0fa..b67012c1506e 100644
--- a/app/models/work_package/pdf_export/cover.rb
+++ b/app/models/work_package/pdf_export/cover.rb
@@ -75,7 +75,7 @@ def validate_cover_text_color
return nil if color.hexcode.blank?
# pdf hex colors are defined without leading hash
- color.hexcode.sub("#", "")
+ color.hexcode.sub('#', '')
end
def write_hero_title(top, width)
diff --git a/app/models/work_package/pdf_export/markdown.rb b/app/models/work_package/pdf_export/markdown.rb
index 84cd5b1c54ad..7cea0021c56c 100644
--- a/app/models/work_package/pdf_export/markdown.rb
+++ b/app/models/work_package/pdf_export/markdown.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "md_to_pdf/core"
+require 'md_to_pdf/core'
module WorkPackage::PDFExport::Markdown
class MD2PDF
@@ -64,7 +64,7 @@ def handle_mention_html_tag(tag, node, opts)
if tag.text.blank?
#
#
- text = tag.attr("data-text")
+ text = tag.attr('data-text')
if text.present? && !node.next.respond_to?(:string_content) && node.next.string_content != text
return [text_hash(text, opts)]
end
@@ -74,7 +74,7 @@ def handle_mention_html_tag(tag, node, opts)
end
def handle_unknown_inline_html_tag(tag, node, opts)
- result = if tag.name == "mention"
+ result = if tag.name == 'mention'
handle_mention_html_tag(tag, node, opts)
else
# unknown/unsupported html tags eg. hi are ignored
diff --git a/app/models/work_package/pdf_export/overview_table.rb b/app/models/work_package/pdf_export/overview_table.rb
index 65b96886530d..5f5d2c55a0b0 100644
--- a/app/models/work_package/pdf_export/overview_table.rb
+++ b/app/models/work_package/pdf_export/overview_table.rb
@@ -188,7 +188,7 @@ def build_subject_cell(content)
def build_header_row
header_style = styles.overview_table_header_cell
overview_columns_objects.map do |col|
- content = (col.caption || "").upcase
+ content = (col.caption || '').upcase
pdf.make_cell(content, header_style)
end
end
@@ -199,7 +199,7 @@ def build_overview_sum_row(sums)
content = get_formatted_value(sums[col], col.name)
pdf.make_cell(content, sums_style)
end
- sum_row[0] = pdf.make_cell(I18n.t("js.label_sum"), sums_style)
+ sum_row[0] = pdf.make_cell(I18n.t('js.label_sum'), sums_style)
sum_row
end
end
diff --git a/app/models/work_package/pdf_export/page.rb b/app/models/work_package/pdf_export/page.rb
index 868ea15d55f4..2c7aaf3caea8 100644
--- a/app/models/work_package/pdf_export/page.rb
+++ b/app/models/work_package/pdf_export/page.rb
@@ -134,7 +134,7 @@ def total_page_nr_text
if @total_page_nr
"/#{@total_page_nr - (with_cover? ? 1 : 0)}"
else
- ""
+ ''
end
end
end
diff --git a/app/models/work_package/pdf_export/style.rb b/app/models/work_package/pdf_export/style.rb
index c1efef8f07ba..00a0764178b7 100644
--- a/app/models/work_package/pdf_export/style.rb
+++ b/app/models/work_package/pdf_export/style.rb
@@ -38,7 +38,7 @@ def initialize(yml)
end
def page_size
- @styles[:page_size] || "EXECUTIVE"
+ @styles[:page_size] || 'EXECUTIVE'
end
def page_header_offset
@@ -98,7 +98,7 @@ def page_break_threshold
end
def link_color
- @styles.dig(:page, :link_color) || "000000"
+ @styles.dig(:page, :link_color) || '000000'
end
def overview_group_header
@@ -302,8 +302,8 @@ def styles
private
def load_style
- yml = YAML::load_file(File.join(styles_asset_path, "standard.yml"))
- schema = JSON::load_file(File.join(styles_asset_path, "schema.json"))
+ yml = YAML::load_file(File.join(styles_asset_path, 'standard.yml'))
+ schema = JSON::load_file(File.join(styles_asset_path, 'schema.json'))
validate_schema!(yml, schema)
end
diff --git a/app/models/work_package/pdf_export/sums_table.rb b/app/models/work_package/pdf_export/sums_table.rb
index 050eb3790f15..b3556c8ea6d1 100644
--- a/app/models/work_package/pdf_export/sums_table.rb
+++ b/app/models/work_package/pdf_export/sums_table.rb
@@ -45,7 +45,7 @@ def has_summable_column?
def write_sums_title
with_margin(styles.page_heading_margins) do
- pdf.formatted_text([styles.page_heading.merge({ text: I18n.t("js.work_packages.tabs.overview") })])
+ pdf.formatted_text([styles.page_heading.merge({ text: I18n.t('js.work_packages.tabs.overview') })])
end
end
@@ -82,13 +82,13 @@ def build_sums_header_row
row = sums_columns_objects.map do |col|
pdf.make_cell(sums_column_name(col), header_style)
end
- content = query.grouped? ? sums_column_name(query.group_by_column) : ""
+ content = query.grouped? ? sums_column_name(query.group_by_column) : ''
row.unshift pdf.make_cell(content, header_style)
row
end
def sums_column_name(col)
- (col.caption || "").upcase
+ (col.caption || '').upcase
end
def build_sums_group_row(group)
@@ -96,7 +96,7 @@ def build_sums_group_row(group)
end
def build_sums_total_row
- build_sums_row(get_total_sums || {}, I18n.t("js.label_sum"), styles.overview_table_sums_cell)
+ build_sums_row(get_total_sums || {}, I18n.t('js.label_sum'), styles.overview_table_sums_cell)
end
def build_sums_row(sums, label, sums_style)
diff --git a/app/models/work_package/pdf_export/table_of_contents.rb b/app/models/work_package/pdf_export/table_of_contents.rb
index 8295ef560117..848c9d6dfbe0 100644
--- a/app/models/work_package/pdf_export/table_of_contents.rb
+++ b/app/models/work_package/pdf_export/table_of_contents.rb
@@ -48,7 +48,7 @@ def build_toc_data_list_entry(work_package, id_wp_meta_map)
level = [level_path.length, styles.toc_max_depth].min
level_style = styles.toc_item(level)
level_string = "#{level_path.join('.')}. "
- page_nr_string = (id_wp_meta_map[work_package.id][:page_number] || "000").to_s
+ page_nr_string = (id_wp_meta_map[work_package.id][:page_number] || '000').to_s
{ id: work_package.id,
level_string:,
level_string_width: measure_part_width(level_string, level_style),
diff --git a/app/models/work_package/pdf_export/view.rb b/app/models/work_package/pdf_export/view.rb
index cdf583dcacce..4fb8b8728728 100644
--- a/app/models/work_package/pdf_export/view.rb
+++ b/app/models/work_package/pdf_export/view.rb
@@ -49,18 +49,18 @@ def document
@document ||= Prawn::Document.new(options.merge(info:)).tap do |document|
register_fonts! document
- document.set_font document.font("NotoSans")
+ document.set_font document.font('NotoSans')
document.fallback_fonts = fallback_fonts
end
end
def fallback_fonts
- [noto_font_base_path.join("NotoSansSymbols2-Regular.ttf")]
+ [noto_font_base_path.join('NotoSansSymbols2-Regular.ttf')]
end
def register_fonts!(document)
- register_font!("NotoSans", noto_font_base_path, document)
- register_font!("SpaceMono", spacemono_font_base_path, document)
+ register_font!('NotoSans', noto_font_base_path, document)
+ register_font!('SpaceMono', spacemono_font_base_path, document)
end
def register_font!(family, font_path, document)
@@ -93,7 +93,7 @@ def title
end
def apply_font(name: nil, font_style: nil, size: nil)
- name ||= document.font.basename.split("-").first # e.g. NotoSans-Bold => NotoSans
+ name ||= document.font.basename.split('-').first # e.g. NotoSans-Bold => NotoSans
font_opts = {}
font_opts[:style] = font_style if font_style
@@ -106,10 +106,10 @@ def apply_font(name: nil, font_style: nil, size: nil)
private
def noto_font_base_path
- Rails.public_path.join("fonts/noto")
+ Rails.public_path.join('fonts/noto')
end
def spacemono_font_base_path
- Rails.public_path.join("fonts/spacemono")
+ Rails.public_path.join('fonts/spacemono')
end
end
diff --git a/app/models/work_package/pdf_export/work_package_detail.rb b/app/models/work_package/pdf_export/work_package_detail.rb
index 2d4aae33e8e7..215d5ee1ad25 100644
--- a/app/models/work_package/pdf_export/work_package_detail.rb
+++ b/app/models/work_package/pdf_export/work_package_detail.rb
@@ -115,7 +115,7 @@ def attributes_data_by_columns
column_objects
.reject { |column| column.name == :subject }
.map do |column|
- { label: column.caption || "", name: column.name }
+ { label: column.caption || '', name: column.name }
end
end
@@ -137,7 +137,7 @@ def form_configuration_columns(work_package)
def form_key_to_column_entries(form_key, work_package)
if CustomField.custom_field_attribute? form_key
- id = form_key.to_s.sub("custom_field_", "").to_i
+ id = form_key.to_s.sub('custom_field_', '').to_i
cf = CustomField.find_by(id:)
return [] if cf.nil? || cf.formattable?
@@ -165,7 +165,7 @@ def column_entry(column_name)
end
def build_columns_table_cells(attribute_data)
- return ["", ""] if attribute_data.nil?
+ return ['', ''] if attribute_data.nil?
# get work package attribute table cell data: [label, value]
[
diff --git a/app/models/work_package/pdf_export/work_package_list_to_pdf.rb b/app/models/work_package/pdf_export/work_package_list_to_pdf.rb
index c9bb203ab495..d7fe1695edfa 100644
--- a/app/models/work_package/pdf_export/work_package_list_to_pdf.rb
+++ b/app/models/work_package/pdf_export/work_package_list_to_pdf.rb
@@ -37,7 +37,7 @@
# grow beyond limits. Therefore we create multiple smaller PDFs that we finally
# merge do one file.
-require "open3"
+require 'open3'
class WorkPackage::PDFExport::WorkPackageListToPdf < WorkPackage::Exports::QueryExporter
include WorkPackage::PDFExport::Common
@@ -148,7 +148,7 @@ def batch_supported?
@batch_supported =
begin
- _, status = Open3.capture2e("pdfunite", "-h")
+ _, status = Open3.capture2e('pdfunite', '-h')
status.success?
rescue StandardError => e
Rails.logger.error "Failed to test pdfunite version: #{e.message}"
diff --git a/app/models/work_package/time_entries_cleaner.rb b/app/models/work_package/time_entries_cleaner.rb
index 03a2dbec3b53..d904713035fe 100644
--- a/app/models/work_package/time_entries_cleaner.rb
+++ b/app/models/work_package/time_entries_cleaner.rb
@@ -38,17 +38,17 @@ module ClassMethods
def cleanup_time_entries_before_destruction_of(work_packages,
user,
- to_do = { action: "destroy" })
+ to_do = { action: 'destroy' })
return false unless to_do.present?
case to_do[:action]
- when "destroy"
+ when 'destroy'
true
# nothing to do
- when "nullify"
+ when 'nullify'
work_packages = Array(work_packages)
- WorkPackage.update_time_entries(work_packages, "work_package_id = NULL")
- when "reassign"
+ WorkPackage.update_time_entries(work_packages, 'work_package_id = NULL')
+ when 'reassign'
reassign_time_entries_before_destruction_of(work_packages, user, to_do[:reassign_to_id])
else
false
@@ -56,7 +56,7 @@ def cleanup_time_entries_before_destruction_of(work_packages,
end
def update_time_entries(work_packages, action)
- TimeEntry.where(["work_package_id IN (?)", work_packages.map(&:id)]).update_all(action)
+ TimeEntry.where(['work_package_id IN (?)', work_packages.map(&:id)]).update_all(action)
end
def reassign_time_entries_before_destruction_of(work_packages, user, ids)
diff --git a/app/models/work_package_custom_field.rb b/app/models/work_package_custom_field.rb
index d2f84ea2b45e..008b2e3f5b6b 100644
--- a/app/models/work_package_custom_field.rb
+++ b/app/models/work_package_custom_field.rb
@@ -29,10 +29,10 @@
class WorkPackageCustomField < CustomField
has_and_belongs_to_many :projects,
join_table: "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
- foreign_key: "custom_field_id"
+ foreign_key: 'custom_field_id'
has_and_belongs_to_many :types,
join_table: "#{table_name_prefix}custom_fields_types#{table_name_suffix}",
- foreign_key: "custom_field_id"
+ foreign_key: 'custom_field_id'
has_many :work_packages,
through: :custom_values,
source: :customized,
diff --git a/app/models/work_package_role.rb b/app/models/work_package_role.rb
index e5e0cd2f5e6b..855bb594b533 100644
--- a/app/models/work_package_role.rb
+++ b/app/models/work_package_role.rb
@@ -32,7 +32,7 @@
class WorkPackageRole < Role
def self.givable
super
- .where(type: "WorkPackageRole")
+ .where(type: 'WorkPackageRole')
end
def member?
diff --git a/app/models/work_packages/costs.rb b/app/models/work_packages/costs.rb
index ede0e36c1a8c..ff6a8ff1e769 100644
--- a/app/models/work_packages/costs.rb
+++ b/app/models/work_packages/costs.rb
@@ -90,22 +90,22 @@ def move_cost_entries
class_methods do
protected
- def cleanup_cost_entries_before_destruction_of(work_packages, user, to_do = { action: "destroy" })
+ def cleanup_cost_entries_before_destruction_of(work_packages, user, to_do = { action: 'destroy' })
work_packages = Array(work_packages)
return false unless to_do.present?
case to_do[:action]
- when "destroy"
+ when 'destroy'
true
# nothing to do
- when "nullify"
+ when 'nullify'
work_packages.each do |wp|
wp.errors.add(:base, :nullify_is_not_valid_for_cost_entries)
end
false
- when "reassign"
+ when 'reassign'
reassign_cost_entries_before_destruction(work_packages, user, to_do[:reassign_to_id])
else
false
diff --git a/app/models/work_packages/derived_dates.rb b/app/models/work_packages/derived_dates.rb
index f8a74b43f406..df3ba98576bc 100644
--- a/app/models/work_packages/derived_dates.rb
+++ b/app/models/work_packages/derived_dates.rb
@@ -34,7 +34,7 @@ module WorkPackages::DerivedDates
# WorkPackage.include_derived_dates in which case the work package has a
# derived_start_date attribute or it is loaded on calling the method.
def derived_start_date
- derived_date("derived_start_date")
+ derived_date('derived_start_date')
end
# Returns the minimum of the dates of all descendants (start and due date)
@@ -44,7 +44,7 @@ def derived_start_date
# WorkPackage.include_derived_dates in which case the work package has a
# derived_due_date attribute or it is loaded on calling the method.
def derived_due_date
- derived_date("derived_due_date")
+ derived_date('derived_due_date')
end
def derived_start_date=(date)
diff --git a/app/models/work_packages/relations.rb b/app/models/work_packages/relations.rb
index 16bc742a02a4..06a3ed628a0a 100644
--- a/app/models/work_packages/relations.rb
+++ b/app/models/work_packages/relations.rb
@@ -45,7 +45,7 @@ module WorkPackages::Relations
# * to is the followed work package
has_many :follows_relations,
-> { where(relation_type: Relation::TYPE_FOLLOWS) },
- class_name: "Relation",
+ class_name: 'Relation',
foreign_key: :from_id,
autosave: true,
dependent: :nullify,
@@ -57,7 +57,7 @@ module WorkPackages::Relations
# * to is the blocked work package
has_many :blocks_relations,
-> { where(relation_type: Relation::TYPE_BLOCKS) },
- class_name: "Relation",
+ class_name: 'Relation',
foreign_key: :from_id,
autosave: true,
dependent: :nullify,
@@ -69,7 +69,7 @@ module WorkPackages::Relations
# * to is the duplicated work package
has_many :duplicates_relations,
-> { where(relation_type: Relation::TYPE_DUPLICATES) },
- class_name: "Relation",
+ class_name: 'Relation',
foreign_key: :from_id,
autosave: true,
dependent: :nullify,
@@ -81,7 +81,7 @@ module WorkPackages::Relations
# * to is self
has_many :duplicated_relations,
-> { where(relation_type: Relation::TYPE_DUPLICATES) },
- class_name: "Relation",
+ class_name: 'Relation',
foreign_key: :to_id,
autosave: true,
dependent: :nullify,
diff --git a/app/models/work_packages/scopes/for_scheduling.rb b/app/models/work_packages/scopes/for_scheduling.rb
index b8e2d776547a..6d49b76afa39 100644
--- a/app/models/work_packages/scopes/for_scheduling.rb
+++ b/app/models/work_packages/scopes/for_scheduling.rb
@@ -159,7 +159,7 @@ def scheduling_paths_sql(work_packages)
::OpenProject::SqlSanitization
.sanitize "(:id, false, false)",
id: wp.id
- end.join(", ")
+ end.join(', ')
<<~SQL.squish
to_schedule (id, manually) AS (
diff --git a/app/models/work_packages/scopes/include_derived_dates.rb b/app/models/work_packages/scopes/include_derived_dates.rb
index 6d5c206a3168..c09dacca770f 100644
--- a/app/models/work_packages/scopes/include_derived_dates.rb
+++ b/app/models/work_packages/scopes/include_derived_dates.rb
@@ -53,7 +53,7 @@ def derived_dates_join_statement
end
def descendants_alias
- "descendants_work_packages"
+ 'descendants_work_packages'
end
end
end
diff --git a/app/models/work_packages/scopes/include_spent_time.rb b/app/models/work_packages/scopes/include_spent_time.rb
index e2b466941275..4b9a7134e0db 100644
--- a/app/models/work_packages/scopes/include_spent_time.rb
+++ b/app/models/work_packages/scopes/include_spent_time.rb
@@ -36,7 +36,7 @@ def include_spent_time(user, work_package = nil)
scope = left_join_self_and_descendants(user, work_package)
.joins(query.join_sources)
.group(:id)
- .select("SUM(time_entries.hours) AS hours")
+ .select('SUM(time_entries.hours) AS hours')
if work_package
scope.where(id: work_package.id)
@@ -68,7 +68,7 @@ def wp_table
def wp_descendants
# Relies on a table called descendants to exist in the scope
# which is provided by left_join_self_and_descendants
- @wp_descendants ||= wp_table.alias("descendants")
+ @wp_descendants ||= wp_table.alias('descendants')
end
def time_entries_table
diff --git a/app/models/work_packages/scopes/left_join_self_and_descendants.rb b/app/models/work_packages/scopes/left_join_self_and_descendants.rb
index e1210fc44970..529ab6658f82 100644
--- a/app/models/work_packages/scopes/left_join_self_and_descendants.rb
+++ b/app/models/work_packages/scopes/left_join_self_and_descendants.rb
@@ -81,7 +81,7 @@ def hierarchies_table
end
def wp_descendants_table
- @wp_descendants_table ||= wp_table.alias("descendants")
+ @wp_descendants_table ||= wp_table.alias('descendants')
end
end
end
diff --git a/app/models/work_packages/scopes/relatable.rb b/app/models/work_packages/scopes/relatable.rb
index 5190c72be2a3..0d5a4cdcec08 100644
--- a/app/models/work_packages/scopes/relatable.rb
+++ b/app/models/work_packages/scopes/relatable.rb
@@ -326,7 +326,7 @@ def joined_existing_connections(relation_type, ignored_relation:)
unions << existing_relation_of_type_lateral(relation_type, ignored_relation:)
end
- unions.join(" UNION ")
+ unions.join(' UNION ')
end
# rubocop:disable Metrics/PerceivedComplexity
@@ -334,8 +334,8 @@ def existing_relation_of_type_lateral(relation_type, ignored_relation: nil, limi
canonical_type = Relation.canonical_type(relation_type)
is_canonical = canonical_type == relation_type
- true_on_canonical = is_canonical ? "TRUE" : "FALSE"
- false_on_canonical = is_canonical ? "FALSE" : "TRUE"
+ true_on_canonical = is_canonical ? 'TRUE' : 'FALSE'
+ false_on_canonical = is_canonical ? 'FALSE' : 'TRUE'
direction1, direction2 = if is_canonical
%w[from_id to_id]
@@ -344,9 +344,9 @@ def existing_relation_of_type_lateral(relation_type, ignored_relation: nil, limi
end
direction_limit = if limit_direction && is_canonical
- "related.includes_to_relation"
+ 'related.includes_to_relation'
elsif limit_direction
- "related.includes_from_relation"
+ 'related.includes_from_relation'
end
sql = <<~SQL.squish
@@ -400,7 +400,7 @@ def blocklist_condition(relation_type)
when Relation::TYPE_PARENT, Relation::TYPE_CHILD
"NOT includes_hierarchy"
else
- "1 = 1"
+ '1 = 1'
end
end
@@ -419,8 +419,8 @@ def ancestor_or_self_ids_of(work_packages)
def relatable_ensure_single_relation(ignored_relation, work_package)
if ignored_relation && (!ignored_relation.is_a?(Relation) ||
(ignored_relation.from_id != work_package.id && ignored_relation.to_id != work_package.id))
- raise ArgumentError, "only a single relation with from_id or to_id pointing " \
- "to the work package for which relatable is queried for is supported"
+ raise ArgumentError, 'only a single relation with from_id or to_id pointing ' \
+ 'to the work package for which relatable is queried for is supported'
end
end
end
diff --git a/app/models/work_packages/spent_time.rb b/app/models/work_packages/spent_time.rb
index 276105882ff1..73bc257fd50a 100644
--- a/app/models/work_packages/spent_time.rb
+++ b/app/models/work_packages/spent_time.rb
@@ -50,7 +50,7 @@ def spent_hours(user = User.current)
def compute_spent_hours(user)
WorkPackage.include_spent_time(user, self)
- .pluck(Arel.sql("SUM(hours)"))
+ .pluck(Arel.sql('SUM(hours)'))
.first
end
end
diff --git a/app/models/workflow.rb b/app/models/workflow.rb
index 2759ab965a0b..1a3f3dd335dc 100644
--- a/app/models/workflow.rb
+++ b/app/models/workflow.rb
@@ -28,9 +28,9 @@
class Workflow < ApplicationRecord
belongs_to :role
- belongs_to :old_status, class_name: "Status"
- belongs_to :new_status, class_name: "Status"
- belongs_to :type, inverse_of: "workflows"
+ belongs_to :old_status, class_name: 'Status'
+ belongs_to :new_status, class_name: 'Status'
+ belongs_to :type, inverse_of: 'workflows'
validates :role, :old_status, :new_status, presence: true
@@ -38,15 +38,15 @@ class Workflow < ApplicationRecord
def self.count_by_type_and_role
counts = connection
.select_all("SELECT role_id, type_id, count(id) AS c FROM #{Workflow.table_name} GROUP BY role_id, type_id")
- roles = Role.order(Arel.sql("builtin, position"))
- types = ::Type.order(Arel.sql("position"))
+ roles = Role.order(Arel.sql('builtin, position'))
+ types = ::Type.order(Arel.sql('position'))
result = []
types.each do |type|
t = []
roles.each do |role|
- row = counts.detect { |c| c["role_id"].to_s == role.id.to_s && c["type_id"].to_s == type.id.to_s }
- t << [role, (row.nil? ? 0 : row["c"].to_i)]
+ row = counts.detect { |c| c['role_id'].to_s == role.id.to_s && c['type_id'].to_s == type.id.to_s }
+ t << [role, (row.nil? ? 0 : row['c'].to_i)]
end
result << [type, t]
end
@@ -90,7 +90,7 @@ def self.available_statuses(project, user = User.current)
# Copies workflows from source to targets
def self.copy(source_type, source_role, target_types, target_roles)
unless source_type.is_a?(::Type) || source_role.is_a?(Role)
- raise ArgumentError.new("source_type or source_role must be specified")
+ raise ArgumentError.new('source_type or source_role must be specified')
end
target_types = Array(target_types)
@@ -116,7 +116,7 @@ def self.copy_one(source_type, source_role, target_type, target_role)
target_type.is_a?(::Type) && !target_type.new_record? &&
target_role.is_a?(Role) && !target_role.new_record?
- raise ArgumentError.new("arguments can not be nil or unsaved objects")
+ raise ArgumentError.new('arguments can not be nil or unsaved objects')
end
if source_type == target_type && source_role == target_role
diff --git a/app/policies/redirect_policy.rb b/app/policies/redirect_policy.rb
index 9b672373fac2..f6cd265447cc 100644
--- a/app/policies/redirect_policy.rb
+++ b/app/policies/redirect_policy.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "uri"
-require "cgi"
+require 'uri'
+require 'cgi'
# This capsulates the validation of a requested redirect URL.
#
@@ -91,7 +91,7 @@ def preprocess(requested)
# Postprocesses the validated URL
def postprocess(redirect_url)
# Remove basic auth credentials
- redirect_url.userinfo = ""
+ redirect_url.userinfo = ''
if @return_escaped
redirect_url.to_s
@@ -103,7 +103,7 @@ def postprocess(redirect_url)
##
# Avoid paths with references to parent paths
def no_upper_levels
- !@requested_url.path.include? "../"
+ !@requested_url.path.include? '../'
end
##
@@ -143,7 +143,7 @@ def path_not_blacklisted
##
# Requires the redirect URL to reside inside the relative root, when given.
def matches_relative_root
- relative_root = OpenProject::Configuration["rails_relative_url_root"]
+ relative_root = OpenProject::Configuration['rails_relative_url_root']
relative_root.blank? || @requested_url.path.starts_with?(relative_root)
end
end
diff --git a/app/seeders/admin_user_seeder.rb b/app/seeders/admin_user_seeder.rb
index 6a49e7997842..eed6e9d01edd 100644
--- a/app/seeders/admin_user_seeder.rb
+++ b/app/seeders/admin_user_seeder.rb
@@ -31,7 +31,7 @@ def seed_data!
if user.save!(validate: false)
seed_data.store_reference(:openproject_admin, user)
else
- print_error "Seeding admin failed:"
+ print_error 'Seeding admin failed:'
user.errors.full_messages.each do |msg|
print_error " #{msg}"
end
@@ -47,15 +47,15 @@ def lookup_existing_references
end
def not_applicable_message
- "No need to seed an admin as there already is one."
+ 'No need to seed an admin as there already is one.'
end
def new_admin
User.new.tap do |user|
user.admin = true
- user.login = "admin"
+ user.login = 'admin'
user.password = Setting.seed_admin_user_password
- first, last = Setting.seed_admin_user_name.split(" ", 2)
+ first, last = Setting.seed_admin_user_name.split(' ', 2)
user.firstname = first
user.lastname = last
user.mail = Setting.seed_admin_user_mail
diff --git a/app/seeders/basic_data/base_role_seeder.rb b/app/seeders/basic_data/base_role_seeder.rb
index b03d17e4640c..735789e372fa 100644
--- a/app/seeders/basic_data/base_role_seeder.rb
+++ b/app/seeders/basic_data/base_role_seeder.rb
@@ -32,10 +32,10 @@ class BaseRoleSeeder < ModelSeeder
def model_attributes(role_data)
{
type:,
- name: role_data["name"],
- position: role_data["position"],
- permissions: role_data["permissions"].uniq,
- builtin: builtin(role_data["builtin"])
+ name: role_data['name'],
+ position: role_data['position'],
+ permissions: role_data['permissions'].uniq,
+ builtin: builtin(role_data['builtin'])
}
end
@@ -63,8 +63,8 @@ def models_data
end
def update_permissions_with_modules_data(role_data)
- role_reference, role_permissions = role_data.values_at("reference", "permissions")
- role_data["permissions"] =
+ role_reference, role_permissions = role_data.values_at('reference', 'permissions')
+ role_data['permissions'] =
permissions(role_permissions) \
+ permissions_to_add(role_reference) \
- permissions_to_remove(role_reference)
@@ -98,12 +98,12 @@ def permission_changes_by_role
end
def process_modules_permissions_data
- seed_data.each("modules_permissions") do |(_module, module_permissions_data)|
+ seed_data.each('modules_permissions') do |(_module, module_permissions_data)|
module_permissions_data.each do |role_permissions_data|
- role_reference = role_permissions_data["role"]
+ role_reference = role_permissions_data['role']
permission_changes = permission_changes_by_role[role_reference]
- permission_changes[:add].concat(Array(role_permissions_data["add"]))
- permission_changes[:remove].concat(Array(role_permissions_data["remove"]))
+ permission_changes[:add].concat(Array(role_permissions_data['add']))
+ permission_changes[:remove].concat(Array(role_permissions_data['remove']))
end
end
end
diff --git a/app/seeders/basic_data/color_scheme_seeder.rb b/app/seeders/basic_data/color_scheme_seeder.rb
index 3394a9726b54..9e71ebceec25 100644
--- a/app/seeders/basic_data/color_scheme_seeder.rb
+++ b/app/seeders/basic_data/color_scheme_seeder.rb
@@ -28,14 +28,14 @@
module BasicData
class ColorSchemeSeeder < ModelSeeder
self.model_class = Color
- self.seed_data_model_key = "open_color_palette"
+ self.seed_data_model_key = 'open_color_palette'
def applicable?
Color.where(name: %w(grape-0 grape-1)).none?
end
def model_attributes(color_scheme_data)
- color_scheme_data["hexcodes"].map.with_index do |hexcode, i|
+ color_scheme_data['hexcodes'].map.with_index do |hexcode, i|
{
name: "#{color_scheme_data['color']}-#{i}",
hexcode:
diff --git a/app/seeders/basic_data/color_seeder.rb b/app/seeders/basic_data/color_seeder.rb
index d308dfff323f..de66b77bd785 100644
--- a/app/seeders/basic_data/color_seeder.rb
+++ b/app/seeders/basic_data/color_seeder.rb
@@ -28,12 +28,12 @@
module BasicData
class ColorSeeder < ModelSeeder
self.model_class = Color
- self.seed_data_model_key = "colors"
+ self.seed_data_model_key = 'colors'
def model_attributes(color_data)
{
- name: color_data["name"],
- hexcode: color_data["hexcode"]
+ name: color_data['name'],
+ hexcode: color_data['hexcode']
}
end
end
diff --git a/app/seeders/basic_data/global_role_seeder.rb b/app/seeders/basic_data/global_role_seeder.rb
index 7c4fca5efffd..041491b984ce 100644
--- a/app/seeders/basic_data/global_role_seeder.rb
+++ b/app/seeders/basic_data/global_role_seeder.rb
@@ -28,6 +28,6 @@
module BasicData
class GlobalRoleSeeder < BaseRoleSeeder
self.model_class = GlobalRole
- self.seed_data_model_key = "global_roles"
+ self.seed_data_model_key = 'global_roles'
end
end
diff --git a/app/seeders/basic_data/model_seeder.rb b/app/seeders/basic_data/model_seeder.rb
index 9ceb91485d3d..8e1cd4520d42 100644
--- a/app/seeders/basic_data/model_seeder.rb
+++ b/app/seeders/basic_data/model_seeder.rb
@@ -41,14 +41,14 @@ def seed_data!
model_class.transaction do
models_data.each do |model_data|
model = model_class.create!(model_attributes(model_data))
- seed_data.store_reference(model_data["reference"], model)
+ seed_data.store_reference(model_data['reference'], model)
end
end
end
def mapped_models_data
models_data.each_with_object({}) do |model_data, models|
- models[model_data["reference"]] = model_attributes(model_data)
+ models[model_data['reference']] = model_attributes(model_data)
end
end
@@ -70,7 +70,7 @@ def lookup_existing_references
models_data.each do |model_data|
lookup_attributes = model_attributes(model_data).slice(*attribute_names_for_lookups)
if model = model_class.find_by(lookup_attributes)
- seed_data.store_reference(model_data["reference"], model)
+ seed_data.store_reference(model_data['reference'], model)
end
end
end
diff --git a/app/seeders/basic_data/priority_seeder.rb b/app/seeders/basic_data/priority_seeder.rb
index ca67ddea0076..b6eea0b81fdb 100644
--- a/app/seeders/basic_data/priority_seeder.rb
+++ b/app/seeders/basic_data/priority_seeder.rb
@@ -28,14 +28,14 @@
module BasicData
class PrioritySeeder < ModelSeeder
self.model_class = IssuePriority
- self.seed_data_model_key = "priorities"
+ self.seed_data_model_key = 'priorities'
def model_attributes(priority_data)
{
- name: priority_data["name"],
- color_id: color_id(priority_data["color_name"]),
- is_default: true?(priority_data["is_default"]),
- position: priority_data["position"]
+ name: priority_data['name'],
+ color_id: color_id(priority_data['color_name']),
+ is_default: true?(priority_data['is_default']),
+ position: priority_data['position']
}
end
end
diff --git a/app/seeders/basic_data/project_role_seeder.rb b/app/seeders/basic_data/project_role_seeder.rb
index bf58496b2709..a0bb520e59e3 100644
--- a/app/seeders/basic_data/project_role_seeder.rb
+++ b/app/seeders/basic_data/project_role_seeder.rb
@@ -28,12 +28,12 @@
module BasicData
class ProjectRoleSeeder < BaseRoleSeeder
self.model_class = ProjectRole
- self.seed_data_model_key = "project_roles"
+ self.seed_data_model_key = 'project_roles'
def update_permissions_with_modules_data(role_data)
super(role_data)
- role_data["permissions"] += OpenProject::AccessControl.public_permissions.map(&:name)
+ role_data['permissions'] += OpenProject::AccessControl.public_permissions.map(&:name)
end
end
end
diff --git a/app/seeders/basic_data/setting_seeder.rb b/app/seeders/basic_data/setting_seeder.rb
index 8540a8be8b83..bf52df3e0ddd 100644
--- a/app/seeders/basic_data/setting_seeder.rb
+++ b/app/seeders/basic_data/setting_seeder.rb
@@ -49,7 +49,7 @@ def applicable?
end
def not_applicable_message
- "Skipping settings as all settings already exist in the db"
+ 'Skipping settings as all settings already exist in the db'
end
def data
@@ -62,14 +62,14 @@ def data
# to set a default role. The role cannot be specified in the definition as
# that would mean to know the ID upfront.
new_project_user_role_id = seed_data.find_reference(:default_role_project_admin, default: nil).try(:id)
- settings["new_project_user_role_id"] = new_project_user_role_id
+ settings['new_project_user_role_id'] = new_project_user_role_id
# Set the closed status for repository commit references
status_closed = seed_data.find_reference(:default_status_closed, default: nil)
- settings["commit_fix_status_id"] = status_closed.try(:id)
+ settings['commit_fix_status_id'] = status_closed.try(:id)
# Add the current locale to the list of available languages
- settings["available_languages"] = (Setting.available_languages + [I18n.locale.to_s]).uniq.sort
+ settings['available_languages'] = (Setting.available_languages + [I18n.locale.to_s]).uniq.sort
settings.compact
end
@@ -79,7 +79,7 @@ def data
# Set the default language to the current locale
def force_default_language_setting
- default_language_setting = Setting.find_or_initialize_by(name: "default_language")
+ default_language_setting = Setting.find_or_initialize_by(name: 'default_language')
# Need to force the value because it's non-writable if
# OPENPROJECT_DEFAULT_LANGUAGE env var is set.
default_language_setting.set_value!(I18n.locale, force: true)
diff --git a/app/seeders/basic_data/time_entry_activity_seeder.rb b/app/seeders/basic_data/time_entry_activity_seeder.rb
index 002946a63490..438b6337429b 100644
--- a/app/seeders/basic_data/time_entry_activity_seeder.rb
+++ b/app/seeders/basic_data/time_entry_activity_seeder.rb
@@ -28,13 +28,13 @@
module BasicData
class TimeEntryActivitySeeder < ModelSeeder
self.model_class = TimeEntryActivity
- self.seed_data_model_key = "time_entry_activities"
+ self.seed_data_model_key = 'time_entry_activities'
def model_attributes(activity_data)
{
- name: activity_data["name"],
- is_default: true?(activity_data["is_default"]),
- position: activity_data["position"]
+ name: activity_data['name'],
+ is_default: true?(activity_data['is_default']),
+ position: activity_data['position']
}
end
end
diff --git a/app/seeders/basic_data/type_configuration_seeder.rb b/app/seeders/basic_data/type_configuration_seeder.rb
index 4a3f5e04dff9..0fa8f88b5950 100644
--- a/app/seeders/basic_data/type_configuration_seeder.rb
+++ b/app/seeders/basic_data/type_configuration_seeder.rb
@@ -34,8 +34,8 @@ class TypeConfigurationSeeder < Seeder
]
def seed!
- seed_data.each("type_configuration") do |type_configuration_data|
- type = seed_data.find_reference(type_configuration_data["type"])
+ seed_data.each('type_configuration') do |type_configuration_data|
+ type = seed_data.find_reference(type_configuration_data['type'])
query_groups = query_groups(type_configuration_data)
type.update(
attribute_groups: query_groups + type.default_attribute_groups
@@ -46,10 +46,10 @@ def seed!
private
def query_groups(type_configuration_data)
- type_configuration_data["form_configuration"].map do |form_config_attr|
- query = seed_data.find_reference(form_config_attr["query"])
+ type_configuration_data['form_configuration'].map do |form_config_attr|
+ query = seed_data.find_reference(form_config_attr['query'])
query_association = "query_#{query.id}"
- [form_config_attr["group_name"], [query_association.to_sym]]
+ [form_config_attr['group_name'], [query_association.to_sym]]
end
end
end
diff --git a/app/seeders/basic_data/type_seeder.rb b/app/seeders/basic_data/type_seeder.rb
index fd20df8a2b12..e6fff8e0021d 100644
--- a/app/seeders/basic_data/type_seeder.rb
+++ b/app/seeders/basic_data/type_seeder.rb
@@ -28,7 +28,7 @@
module BasicData
class TypeSeeder < ModelSeeder
self.model_class = Type
- self.seed_data_model_key = "types"
+ self.seed_data_model_key = 'types'
self.needs = [
BasicData::ColorSeeder,
BasicData::ColorSchemeSeeder
@@ -36,13 +36,13 @@ class TypeSeeder < ModelSeeder
def model_attributes(type_data)
{
- name: type_data["name"],
- description: "",
- is_default: true?(type_data["is_default"]),
- color_id: color_id(type_data["color_name"]),
- is_in_roadmap: true?(type_data["is_in_roadmap"]),
- is_milestone: true?(type_data["is_milestone"]),
- position: type_data["position"]
+ name: type_data['name'],
+ description: '',
+ is_default: true?(type_data['is_default']),
+ color_id: color_id(type_data['color_name']),
+ is_in_roadmap: true?(type_data['is_in_roadmap']),
+ is_milestone: true?(type_data['is_milestone']),
+ position: type_data['position']
}
end
end
diff --git a/app/seeders/basic_data/work_package_role_seeder.rb b/app/seeders/basic_data/work_package_role_seeder.rb
index f1c09cf8b8a6..af62aef9a995 100644
--- a/app/seeders/basic_data/work_package_role_seeder.rb
+++ b/app/seeders/basic_data/work_package_role_seeder.rb
@@ -28,7 +28,7 @@
module BasicData
class WorkPackageRoleSeeder < BaseRoleSeeder
self.model_class = WorkPackageRole
- self.seed_data_model_key = "work_package_roles"
+ self.seed_data_model_key = 'work_package_roles'
self.attribute_names_for_lookups = %i[builtin]
end
end
diff --git a/app/seeders/basic_data/workflow_seeder.rb b/app/seeders/basic_data/workflow_seeder.rb
index 30e761235528..77e23f35a3d7 100644
--- a/app/seeders/basic_data/workflow_seeder.rb
+++ b/app/seeders/basic_data/workflow_seeder.rb
@@ -36,7 +36,7 @@ class WorkflowSeeder < Seeder
def seed_data!
if any_types_or_statuses_or_workflows_already_configured?
- print_status " *** Skipping types, statuses and workflows as there are already some configured"
+ print_status ' *** Skipping types, statuses and workflows as there are already some configured'
else
seed_statuses
seed_types
@@ -51,12 +51,12 @@ def any_types_or_statuses_or_workflows_already_configured?
end
def seed_statuses
- print_status " ↳ Statuses"
+ print_status ' ↳ Statuses'
BasicData::StatusSeeder.new(seed_data).seed!
end
def seed_types
- print_status " ↳ Types"
+ print_status ' ↳ Types'
BasicData::TypeSeeder.new(seed_data).seed!
end
@@ -82,8 +82,8 @@ def seed_workflows
def workflows
seed_data.lookup(:workflows).map do |workflow_data|
- type = seed_data.find_reference(workflow_data["type"])
- statuses = seed_data.find_references(workflow_data["statuses"])
+ type = seed_data.find_reference(workflow_data['type'])
+ statuses = seed_data.find_references(workflow_data['statuses'])
[type, statuses]
end
end
diff --git a/app/seeders/basic_data_seeder.rb b/app/seeders/basic_data_seeder.rb
index 88f901503563..9cf8317126b5 100644
--- a/app/seeders/basic_data_seeder.rb
+++ b/app/seeders/basic_data_seeder.rb
@@ -31,6 +31,6 @@ def data_seeder_classes
end
def namespace
- "BasicData"
+ 'BasicData'
end
end
diff --git a/app/seeders/composite_seeder.rb b/app/seeders/composite_seeder.rb
index cd51995eecb3..eb8d75d5f716 100644
--- a/app/seeders/composite_seeder.rb
+++ b/app/seeders/composite_seeder.rb
@@ -48,7 +48,7 @@ def data_seeders
end
def data_seeder_classes
- raise NotImplementedError, "has to be implemented by subclasses"
+ raise NotImplementedError, 'has to be implemented by subclasses'
end
def discovered_seeders
@@ -69,7 +69,7 @@ def discovered_seeder_classes
end
def namespace
- raise NotImplementedError, "has to be implemented by subclasses"
+ raise NotImplementedError, 'has to be implemented by subclasses'
end
##
@@ -79,7 +79,7 @@ def include_discovered_class?(discovered_class)
end
def seeder_name(seeder)
- seeder.class.name.split("::").without(namespace).join("::")
+ seeder.class.name.split('::').without(namespace).join('::')
end
def instantiate(seeder_classes)
diff --git a/app/seeders/demo_data/create_attachments.rb b/app/seeders/demo_data/create_attachments.rb
index 8b1a2a267a17..20520853ad05 100644
--- a/app/seeders/demo_data/create_attachments.rb
+++ b/app/seeders/demo_data/create_attachments.rb
@@ -30,7 +30,7 @@
module DemoData::CreateAttachments
def create_attachments!(container, attributes)
- Array(attributes["attachments"]).each do |file_name|
+ Array(attributes['attachments']).each do |file_name|
attachment = container.attachments.build
attachment.author = admin_user
attachment.file = File.new(attachment_path(file_name))
diff --git a/app/seeders/demo_data/global_query_seeder.rb b/app/seeders/demo_data/global_query_seeder.rb
index fc1dcf2abafa..4c918b2387f9 100644
--- a/app/seeders/demo_data/global_query_seeder.rb
+++ b/app/seeders/demo_data/global_query_seeder.rb
@@ -28,7 +28,7 @@
module DemoData
class GlobalQuerySeeder < Seeder
def seed_data!
- print_status " ↳ Creating global queries" do
+ print_status ' ↳ Creating global queries' do
seed_global_queries
end
end
@@ -40,7 +40,7 @@ def applicable?
private
def seed_global_queries
- seed_data.each("global_queries") do |config|
+ seed_data.each('global_queries') do |config|
DemoData::QueryBuilder.new(config, project: nil, user: admin_user, seed_data:).create!
end
end
diff --git a/app/seeders/demo_data/group_seeder.rb b/app/seeders/demo_data/group_seeder.rb
index 476e7a50ef2f..99953ada1503 100644
--- a/app/seeders/demo_data/group_seeder.rb
+++ b/app/seeders/demo_data/group_seeder.rb
@@ -30,7 +30,7 @@ class GroupSeeder < Seeder
include ::DemoData::References
def seed_data!
- print_status " ↳ Creating groups" do
+ print_status ' ↳ Creating groups' do
seed_groups
end
end
@@ -42,9 +42,9 @@ def applicable?
private
def seed_groups
- seed_data.each("groups") do |group_data|
- group = create_group group_data["name"]
- seed_data.store_reference(group_data["reference"], group)
+ seed_data.each('groups') do |group_data|
+ group = create_group group_data['name']
+ seed_data.store_reference(group_data['reference'], group)
end
end
diff --git a/app/seeders/demo_data/overview_seeder.rb b/app/seeders/demo_data/overview_seeder.rb
index 9a615ca72cc5..23153c035555 100644
--- a/app/seeders/demo_data/overview_seeder.rb
+++ b/app/seeders/demo_data/overview_seeder.rb
@@ -6,7 +6,7 @@ class OverviewSeeder < Seeder
def seed_data!
print_status "*** Seeding Overview"
- seed_data.each_data("projects") do |project_data|
+ seed_data.each_data('projects') do |project_data|
overview_data = overview_data(project_data)
next unless overview_data
@@ -14,7 +14,7 @@ def seed_data!
overview = create_overview(overview_data, project_data)
- overview_data.each("widgets") do |widget_config|
+ overview_data.each('widgets') do |widget_config|
build_widget(overview, widget_config)
end
@@ -32,8 +32,8 @@ def applicable?
def demo_projects_exist?
identifiers = []
- seed_data.each_data("projects") do |project_data|
- identifiers << project_data.lookup("identifier")
+ seed_data.each_data('projects') do |project_data|
+ identifiers << project_data.lookup('identifier')
end
identifiers.all? { |identifier| Project.exists?(identifier:) }
@@ -42,47 +42,47 @@ def demo_projects_exist?
def build_widget(overview, widget_config)
create_attachments!(overview, widget_config)
- widget_options = widget_config["options"]
+ widget_options = widget_config['options']
text_with_references(overview, widget_options)
query_id_references(overview, widget_options)
- overview.widgets.build(widget_config.except("attachments"))
+ overview.widgets.build(widget_config.except('attachments'))
end
def find_project(project_data)
- Project.find_by!(identifier: project_data.lookup("identifier"))
+ Project.find_by!(identifier: project_data.lookup('identifier'))
end
def create_overview(overview_data, project_data)
Grids::Overview.create(
- row_count: overview_data.lookup("row_count"),
- column_count: overview_data.lookup("column_count"),
+ row_count: overview_data.lookup('row_count'),
+ column_count: overview_data.lookup('column_count'),
project: find_project(project_data)
)
end
def overview_data(project_data)
- project_data.lookup("project-overview")
+ project_data.lookup('project-overview')
end
def text_with_references(overview, widget_options)
- if widget_options && widget_options["text"]
- widget_options["text"] = with_references(widget_options["text"])
- widget_options["text"] = link_attachments(widget_options["text"], overview.attachments)
+ if widget_options && widget_options['text']
+ widget_options['text'] = with_references(widget_options['text'])
+ widget_options['text'] = link_attachments(widget_options['text'], overview.attachments)
end
end
def query_id_references(_overview, widget_options)
- if widget_options && widget_options["queryId"]
- widget_options["queryId"] = with_references(widget_options["queryId"])
+ if widget_options && widget_options['queryId']
+ widget_options['queryId'] = with_references(widget_options['queryId'])
end
end
def add_permission
Role
.includes(:role_permissions)
- .where(role_permissions: { permission: "edit_project" })
+ .where(role_permissions: { permission: 'edit_project' })
.each do |role|
role.add_permission!(:manage_overview)
end
diff --git a/app/seeders/demo_data/project_seeder.rb b/app/seeders/demo_data/project_seeder.rb
index 5e005120fe83..4c193ab4fc93 100644
--- a/app/seeders/demo_data/project_seeder.rb
+++ b/app/seeders/demo_data/project_seeder.rb
@@ -65,13 +65,13 @@ def project_content_seeder_classes
attr_writer :project
def reset_project
- print_status " -Creating/Resetting project"
+ print_status ' -Creating/Resetting project'
delete_project
create_project
end
def delete_project
- project_to_delete = Project.find_by(identifier: project_data.lookup("identifier"))
+ project_to_delete = Project.find_by(identifier: project_data.lookup('identifier'))
project_to_delete&.destroy
end
@@ -80,7 +80,7 @@ def create_project
end
def set_members
- print_status " -Setting members."
+ print_status ' -Setting members.'
role = seed_data.find_reference(:default_role_project_admin)
@@ -92,43 +92,43 @@ def set_members
end
def set_types
- print_status " -Assigning types."
+ print_status ' -Assigning types.'
- project.types = seed_data.find_references(project_data.lookup("types"))
+ project.types = seed_data.find_references(project_data.lookup('types'))
end
def seed_categories
- print_status " -Creating categories"
+ print_status ' -Creating categories'
- Array(project_data.lookup("categories")).each do |cat_name|
+ Array(project_data.lookup('categories')).each do |cat_name|
project.categories.create name: cat_name
end
end
def seed_news
- print_status " -Creating news."
+ print_status ' -Creating news.'
- project_data.each("news") do |news|
+ project_data.each('news') do |news|
News.create!(project:,
author: admin_user,
- title: news["title"],
- summary: news["summary"],
- description: news["description"])
+ title: news['title'],
+ summary: news['summary'],
+ description: news['description'])
end
end
def seed_queries
- print_status " -Creating queries."
+ print_status ' -Creating queries.'
- Array(project_data.lookup("queries")).each do |config|
+ Array(project_data.lookup('queries')).each do |config|
QueryBuilder.new(config, project:, user: admin_user, seed_data:).create!
end
end
def seed_versions
- print_status " -Creating versions."
+ print_status ' -Creating versions.'
- project_data.each("versions") do |attributes|
+ project_data.each('versions') do |attributes|
VersionBuilder.new(attributes, project:, user: admin_user, seed_data:).create!
end
end
@@ -143,14 +143,14 @@ def seed_project_content
end
def project_attributes
- parent = Project.find_by(identifier: project_data.lookup("parent"))
+ parent = Project.find_by(identifier: project_data.lookup('parent'))
{
- name: project_data.lookup("name"),
- identifier: project_data.lookup("identifier"),
- status_code: project_data.lookup("status_code"),
- status_explanation: project_data.lookup("status_explanation"),
- description: project_data.lookup("description"),
- enabled_module_names: project_data.lookup("modules"),
+ name: project_data.lookup('name'),
+ identifier: project_data.lookup('identifier'),
+ status_code: project_data.lookup('status_code'),
+ status_explanation: project_data.lookup('status_explanation'),
+ description: project_data.lookup('description'),
+ enabled_module_names: project_data.lookup('modules'),
types: Type.all,
parent:
}
diff --git a/app/seeders/demo_data/projects_seeder.rb b/app/seeders/demo_data/projects_seeder.rb
index 13ce66e993aa..5a9dce6ac255 100644
--- a/app/seeders/demo_data/projects_seeder.rb
+++ b/app/seeders/demo_data/projects_seeder.rb
@@ -31,15 +31,15 @@ class ProjectsSeeder < Seeder
# on the seeded project will be lost.
# On the other hand, it won't be applied if there are already existing projects.
def seed_data!
- print_status " ↳ Updating settings"
+ print_status ' ↳ Updating settings'
seed_settings
- seed_data.each_data("projects") do |project_data|
+ seed_data.each_data('projects') do |project_data|
seed_project(project_data)
Setting.demo_projects_available = true
end
- print_status " ↳ Update form configuration with global queries"
+ print_status ' ↳ Update form configuration with global queries'
seed_form_configuration
end
@@ -65,12 +65,12 @@ def seed_form_configuration
end
def seedable_welcome_settings
- welcome = seed_data.lookup("welcome")
+ welcome = seed_data.lookup('welcome')
return {} if welcome.blank?
{
- welcome_title: welcome.lookup("title"),
- welcome_text: welcome.lookup("text"),
+ welcome_title: welcome.lookup('title'),
+ welcome_text: welcome.lookup('text'),
welcome_on_homescreen: 1
}
end
diff --git a/app/seeders/demo_data/query_builder.rb b/app/seeders/demo_data/query_builder.rb
index e9bdc2568691..d99cd17c63de 100644
--- a/app/seeders/demo_data/query_builder.rb
+++ b/app/seeders/demo_data/query_builder.rb
@@ -37,7 +37,7 @@ def initialize(config, project:, user:, seed_data:)
def create!
create_query.tap do |query|
- seed_data.store_reference(config["reference"], query)
+ seed_data.store_reference(config['reference'], query)
end
end
@@ -73,7 +73,7 @@ def create_query
end
def create_view(query)
- type = config.fetch(:module, "work_packages_table")
+ type = config.fetch(:module, 'work_packages_table')
View.create!(
type:,
query:
@@ -81,7 +81,7 @@ def create_view(query)
# Save information that a view has been seeded.
# This information can be used for example in the onboarding tour
- Setting["demo_view_of_type_#{type}_seeded"] = "true"
+ Setting["demo_view_of_type_#{type}_seeded"] = 'true'
end
def set_project!(attr)
diff --git a/app/seeders/demo_data/references.rb b/app/seeders/demo_data/references.rb
index 235047fb5e9b..da890873cee7 100644
--- a/app/seeders/demo_data/references.rb
+++ b/app/seeders/demo_data/references.rb
@@ -67,7 +67,7 @@ def with_references(str)
return str if str.blank?
str.gsub(/##(query|sprint|wp)(\.id)?:[a-z_0-9]+/) do |match|
- tag, reference = match.delete("#").split(":", 2)
+ tag, reference = match.delete('#').split(":", 2)
instance = seed_data.find_reference(reference.to_sym)
if match.include?(".id")
instance.id
@@ -102,11 +102,11 @@ def link_attachments(str, attachments)
def link(tag, instance)
case tag
- when "query"
+ when 'query'
query_link(instance)
- when "sprint"
+ when 'sprint'
sprint_link(instance)
- when "wp"
+ when 'wp'
work_package_link(instance)
else
raise ArgumentError, "cannot create link for #{tag.inspect}"
diff --git a/app/seeders/demo_data/version_builder.rb b/app/seeders/demo_data/version_builder.rb
index d7a4def70448..cf42a4285515 100644
--- a/app/seeders/demo_data/version_builder.rb
+++ b/app/seeders/demo_data/version_builder.rb
@@ -55,14 +55,14 @@ def create_version
def version
version = Version.create!(
- name: config["name"],
- status: config["status"],
- sharing: config["sharing"],
+ name: config['name'],
+ status: config['status'],
+ sharing: config['sharing'],
project:
)
- seed_data.store_reference(config["reference"], version)
+ seed_data.store_reference(config['reference'], version)
- set_wiki! version, config["wiki"]
+ set_wiki! version, config['wiki']
version
end
@@ -70,13 +70,13 @@ def version
def set_wiki!(version, config)
return unless config
- version.wiki_page_title = config["title"]
+ version.wiki_page_title = config['title']
Journal::NotificationConfiguration.with false do
WikiPage.create! wiki: version.project.wiki,
title: version.wiki_page_title,
author: User.admin.first,
- text: with_references(config["content"])
+ text: with_references(config['content'])
end
version.save!
diff --git a/app/seeders/demo_data/wiki_seeder.rb b/app/seeders/demo_data/wiki_seeder.rb
index 47d59317ba31..84ef9764cf92 100644
--- a/app/seeders/demo_data/wiki_seeder.rb
+++ b/app/seeders/demo_data/wiki_seeder.rb
@@ -35,7 +35,7 @@ def initialize(project, project_data)
end
def seed_data!
- text = project_data.lookup("wiki")
+ text = project_data.lookup('wiki')
return if text.blank?
@@ -43,7 +43,7 @@ def seed_data!
text = [{ title: "Wiki", content: text }]
end
- print_status " ↳ Creating wikis"
+ print_status ' ↳ Creating wikis'
Array(text).each do |data|
create_wiki_page!(
@@ -62,7 +62,7 @@ def create_wiki_page!(data, project:, parent: nil)
text: data[:content]
)
- print_status "."
+ print_status '.'
if data[:children]
Array(data[:children]).each do |child_data|
diff --git a/app/seeders/demo_data/work_package_board_seeder.rb b/app/seeders/demo_data/work_package_board_seeder.rb
index 1011df52ee62..f48ecc6b12b3 100644
--- a/app/seeders/demo_data/work_package_board_seeder.rb
+++ b/app/seeders/demo_data/work_package_board_seeder.rb
@@ -39,24 +39,24 @@ def initialize(project, project_data)
def seed_data!
# Seed only for those projects that provide a `kanban` key, i.e. 'demo-project' in standard edition.
- if board_data = project_data.lookup("boards.kanban")
- print_status " ↳ Creating demo status board" do
+ if board_data = project_data.lookup('boards.kanban')
+ print_status ' ↳ Creating demo status board' do
seed_kanban_board(board_data)
end
- Setting.boards_demo_data_available = "true"
+ Setting.boards_demo_data_available = 'true'
end
- if board_data = project_data.lookup("boards.basic")
- print_status " ↳ Creating demo basic board" do
+ if board_data = project_data.lookup('boards.basic')
+ print_status ' ↳ Creating demo basic board' do
seed_basic_board(board_data)
end
end
- if board_data = project_data.lookup("boards.parent_child")
- print_status " ↳ Creating demo parent child board" do
+ if board_data = project_data.lookup('boards.parent_child')
+ print_status ' ↳ Creating demo parent child board' do
seed_parent_child_board(board_data)
end
- Setting.boards_demo_data_available = "true"
+ Setting.boards_demo_data_available = 'true'
end
end
@@ -67,8 +67,8 @@ def seed_kanban_board(board_data)
board =
::Boards::Grid.new(
project:,
- name: board_data.lookup("name"),
- options: { "type" => "action", "attribute" => "status", "highlightingMode" => "priority" },
+ name: board_data.lookup('name'),
+ options: { 'type' => 'action', 'attribute' => 'status', 'highlightingMode' => 'priority' },
widgets:,
column_count: widgets.count,
row_count: 1
@@ -82,20 +82,20 @@ def seed_kanban_board_widgets
Grids::Widget.new start_row: 1, end_row: 2,
start_column: i + 1, end_column: i + 2,
options: { query_id: query.id,
- filters: [{ status: { operator: "=", values: query.filters[0].values } }] },
- identifier: "work_package_query"
+ filters: [{ status: { operator: '=', values: query.filters[0].values } }] },
+ identifier: 'work_package_query'
end
end
def set_board_filters(board, board_data)
- filters_conf = board_data.lookup("filters")
+ filters_conf = board_data.lookup('filters')
return if filters_conf.blank?
board.options[:filters] = []
filters_conf.each do |filter|
- if filter["type"]
- type = seed_data.find_reference(filter["type"])
- board.options[:filters] << { type: { operator: "=", values: [type.id.to_s] } }
+ if filter['type']
+ type = seed_data.find_reference(filter['type'])
+ board.options[:filters] << { type: { operator: '=', values: [type.id.to_s] } }
end
end
end
@@ -113,10 +113,10 @@ def seed_kanban_board_queries
query.name = status.name
# Set filter by this status
- query.add_filter("status_id", "=", [status.id])
+ query.add_filter('status_id', '=', [status.id])
# Set manual sort filter
- query.sort_criteria = [[:manual_sorting, "asc"]]
+ query.sort_criteria = [[:manual_sorting, 'asc']]
query.save!
end
@@ -138,8 +138,8 @@ def seed_basic_board(board_data)
board =
::Boards::Grid.new(
project:,
- name: board_data.lookup("name"),
- options: { "highlightingMode" => "priority" },
+ name: board_data.lookup('name'),
+ options: { 'highlightingMode' => 'priority' },
widgets:,
column_count: widgets.count,
row_count: 1
@@ -152,13 +152,13 @@ def seed_basic_board_widgets(board_data)
Grids::Widget.new start_row: 1, end_row: 2,
start_column: i + 1, end_column: i + 2,
options: { query_id: query.id,
- filters: [{ manualSort: { operator: "ow", values: [] } }] },
- identifier: "work_package_query"
+ filters: [{ manualSort: { operator: 'ow', values: [] } }] },
+ identifier: 'work_package_query'
end
end
def seed_basic_board_queries(board_data)
- lists = board_data.lookup("lists")
+ lists = board_data.lookup('lists')
lists.map do |list|
create_basic_board_query_from_list(list)
end
@@ -171,13 +171,13 @@ def create_basic_board_query_from_list(list)
# Make it public so that new members can see it too
public: true,
include_subprojects: true,
- name: list["name"]
+ name: list['name']
).tap do |query|
# Set manual sort filter
- query.add_filter("manual_sort", "ow", [])
- query.sort_criteria = [[:manual_sorting, "asc"]]
+ query.add_filter('manual_sort', 'ow', [])
+ query.sort_criteria = [[:manual_sorting, 'asc']]
- list["work_packages"].each_with_index do |wp_reference, i|
+ list['work_packages'].each_with_index do |wp_reference, i|
work_package_id = seed_data.find_reference(wp_reference).id
query.ordered_work_packages.build(work_package_id:, position: i)
end
@@ -191,8 +191,8 @@ def seed_parent_child_board(board_data)
board =
::Boards::Grid.new(
project:,
- name: board_data.lookup("name"),
- options: { "type" => "action", "attribute" => "subtasks" },
+ name: board_data.lookup('name'),
+ options: { 'type' => 'action', 'attribute' => 'subtasks' },
widgets:,
column_count: widgets.count,
row_count: 1
@@ -205,8 +205,8 @@ def seed_parent_child_board_widgets
Grids::Widget.new start_row: 1, end_row: 2,
start_column: i + 1, end_column: i + 2,
options: { query_id: query.id,
- filters: [{ parent: { operator: "=", values: query.filters[1].values } }] },
- identifier: "work_package_query"
+ filters: [{ parent: { operator: '=', values: query.filters[1].values } }] },
+ identifier: 'work_package_query'
end
end
@@ -221,10 +221,10 @@ def seed_parent_child_board_queries
query.name = parent.subject
# Set filter by this status
- query.add_filter("parent", "=", [parent.id])
+ query.add_filter('parent', '=', [parent.id])
# Set manual sort filter
- query.sort_criteria = [[:manual_sorting, "asc"]]
+ query.sort_criteria = [[:manual_sorting, 'asc']]
query.save!
end
diff --git a/app/seeders/demo_data/work_package_seeder.rb b/app/seeders/demo_data/work_package_seeder.rb
index 4306149882bc..2f9285436506 100644
--- a/app/seeders/demo_data/work_package_seeder.rb
+++ b/app/seeders/demo_data/work_package_seeder.rb
@@ -50,7 +50,7 @@ def initialize(project, project_data)
end
def seed_data!
- print_status " ↳ Creating work_packages" do
+ print_status ' ↳ Creating work_packages' do
seed_demo_work_packages
set_work_package_relations
end
@@ -63,7 +63,7 @@ def seed_data!
attr_reader :relations_to_create
def seed_demo_work_packages
- project_data.each("work_packages") do |attributes|
+ project_data.each('work_packages') do |attributes|
create_or_update_work_package(attributes)
end
end
@@ -97,18 +97,18 @@ def base_work_package_attributes(attributes)
{
project:,
author: admin_user,
- assigned_to: find_principal(attributes["assigned_to"]),
- subject: attributes["subject"],
- description: attributes["description"],
+ assigned_to: find_principal(attributes['assigned_to']),
+ subject: attributes['subject'],
+ description: attributes['description'],
status: find_status(attributes),
type: find_type(attributes),
priority: IssuePriority.default,
- parent: find_work_package(attributes["parent"])
+ parent: find_work_package(attributes['parent'])
}
end
def create_children!(work_package, attributes)
- Array(attributes["children"]).each do |child_attributes|
+ Array(attributes['children']).each do |child_attributes|
child = create_work_package child_attributes
child.parent = work_package
@@ -125,14 +125,14 @@ def update_description!(work_package)
end
def add_relations_to_create(work_package, attributes)
- Array(attributes["relations"]).each do |relation|
- relation_data = RelationData.new(from: work_package, to_reference: relation["to"], type: relation["type"])
+ Array(attributes['relations']).each do |relation|
+ relation_data = RelationData.new(from: work_package, to_reference: relation['to'], type: relation['type'])
relations_to_create.push(relation_data)
end
end
def memorize_work_package(work_package, attributes)
- project_data.store_reference(attributes["reference"], work_package)
+ project_data.store_reference(attributes['reference'], work_package)
end
def find_work_package(reference)
@@ -144,15 +144,15 @@ def find_principal(reference)
end
def find_status(attributes)
- seed_data.find_reference(attributes["status"].to_sym)
+ seed_data.find_reference(attributes['status'].to_sym)
end
def find_type(attributes)
- seed_data.find_reference(attributes["type"].to_sym)
+ seed_data.find_reference(attributes['type'].to_sym)
end
def set_version!(wp_attr, attributes)
- version = seed_data.find_reference(attributes["version"])
+ version = seed_data.find_reference(attributes['version'])
if version
wp_attr[:version] = version
end
@@ -167,8 +167,8 @@ def time_tracking_attributes(attributes)
end
def set_backlogs_attributes!(wp_attr, attributes)
- wp_attr[:position] = attributes["position"].presence&.to_i
- wp_attr[:story_points] = attributes["story_points"].presence&.to_i
+ wp_attr[:position] = attributes['position'].presence&.to_i
+ wp_attr[:story_points] = attributes['story_points'].presence&.to_i
end
def set_work_package_relations
@@ -212,12 +212,12 @@ def initialize(attributes)
end
def start_date
- days_ahead = attributes["start"] || 0
+ days_ahead = attributes['start'] || 0
Time.zone.today.monday + days_ahead.days
end
def due_date
- all_days.due_date(start_date, attributes["duration"])
+ all_days.due_date(start_date, attributes['duration'])
end
def duration
@@ -231,7 +231,7 @@ def ignore_non_working_days
end
def estimated_hours
- attributes["estimated_hours"]&.to_i
+ attributes['estimated_hours']&.to_i
end
def all_days
diff --git a/app/seeders/demo_data_seeder.rb b/app/seeders/demo_data_seeder.rb
index 006db0ddfeb6..ae49fd673397 100644
--- a/app/seeders/demo_data_seeder.rb
+++ b/app/seeders/demo_data_seeder.rb
@@ -35,6 +35,6 @@ def data_seeder_classes
end
def namespace
- "DemoData"
+ 'DemoData'
end
end
diff --git a/app/seeders/development_data/custom_fields_seeder.rb b/app/seeders/development_data/custom_fields_seeder.rb
index 355a4ccf40ef..1ddc976e29d3 100644
--- a/app/seeders/development_data/custom_fields_seeder.rb
+++ b/app/seeders/development_data/custom_fields_seeder.rb
@@ -28,10 +28,10 @@ module DevelopmentData
class CustomFieldsSeeder < Seeder
def seed_data!
CustomField.transaction do
- print_status " ↳ Creating custom fields..."
+ print_status ' ↳ Creating custom fields...'
cfs = create_cfs!
- print_status " ↳ Creating types for linking CFs"
+ print_status ' ↳ Creating types for linking CFs'
create_types!(cfs)
end
end
@@ -43,14 +43,14 @@ def all_cfs
def create_types!(cfs)
# Create ALL CFs types
non_req_cfs = cfs.reject(&:is_required).map(&:attribute_name)
- type = FactoryBot.build :type, name: "All CFS"
- extend_group(type, ["Custom fields", non_req_cfs])
+ type = FactoryBot.build :type, name: 'All CFS'
+ extend_group(type, ['Custom fields', non_req_cfs])
type.save!
# Create type
req_cfs = cfs.select(&:is_required).map(&:attribute_name)
- type_req = FactoryBot.build :type, name: "Required CF"
- extend_group(type_req, ["Custom fields", req_cfs])
+ type_req = FactoryBot.build :type, name: 'Required CF'
+ extend_group(type_req, ['Custom fields', req_cfs])
type_req.save!
end
@@ -60,34 +60,34 @@ def create_cfs!
# create some custom fields and add them to the project
(all_cfs - %w(list multilist intrange)).each do |type|
cfs << CustomField.create!(name: "CF DEV #{type}",
- type: "WorkPackageCustomField",
+ type: 'WorkPackageCustomField',
is_required: false,
field_format: type)
end
cfs << CustomField.create!(name: "CF DEV list",
is_required: false,
- type: "WorkPackageCustomField",
- possible_values: ["A", "B", "C"],
- field_format: "list")
+ type: 'WorkPackageCustomField',
+ possible_values: ['A', 'B', 'C'],
+ field_format: 'list')
cfs << CustomField.create!(name: "CF DEV multilist",
- type: "WorkPackageCustomField",
+ type: 'WorkPackageCustomField',
is_required: false,
multi_value: true,
- possible_values: ["Foo", "Bar", "Bla"],
- field_format: "list")
+ possible_values: ['Foo', 'Bar', 'Bla'],
+ field_format: 'list')
cfs << CustomField.create!(name: "CF DEV required text",
- type: "WorkPackageCustomField",
+ type: 'WorkPackageCustomField',
is_required: true,
- field_format: "text")
+ field_format: 'text')
cfs << CustomField.create!(name: "CF DEV intrange",
- type: "WorkPackageCustomField",
+ type: 'WorkPackageCustomField',
min_length: 2,
max_length: 5,
- field_format: "int")
+ field_format: 'int')
cfs
end
diff --git a/app/seeders/development_data/projects_seeder.rb b/app/seeders/development_data/projects_seeder.rb
index 8ee201e14fab..70bbe10ade47 100644
--- a/app/seeders/development_data/projects_seeder.rb
+++ b/app/seeders/development_data/projects_seeder.rb
@@ -30,20 +30,20 @@ module DevelopmentData
class ProjectsSeeder < Seeder
def seed_data!
# We are relying on the default_projects_modules setting to set the desired project modules
- print_status " ↳ Creating development projects..."
+ print_status ' ↳ Creating development projects...'
- print_status " -Creating/Resetting development projects"
+ print_status ' -Creating/Resetting development projects'
projects = reset_projects
- print_status " -Setting members."
+ print_status ' -Setting members.'
set_members(projects)
- print_status " -Creating versions."
+ print_status ' -Creating versions.'
seed_versions(projects)
- print_status " -Linking custom fields."
+ print_status ' -Linking custom fields.'
- link_custom_fields(projects.detect { |p| p.identifier == "dev-custom-fields" })
+ link_custom_fields(projects.detect { |p| p.identifier == 'dev-custom-fields' })
end
def applicable?
@@ -59,8 +59,8 @@ def reset_projects
project_identifiers.map do |id|
project = Project.new project_data(id)
- if id == "dev-large-child"
- project.parent_id = Project.find_by(identifier: "dev-large").id
+ if id == 'dev-large-child'
+ project.parent_id = Project.find_by(identifier: 'dev-large').id
end
project.save!
@@ -80,15 +80,15 @@ def set_members(projects)
end
def seed_versions(projects)
- version_data = seed_data.lookup("projects.scrum-project.versions")
+ version_data = seed_data.lookup('projects.scrum-project.versions')
return unless version_data.is_a? Array
projects.each do |project|
version_data.each do |attributes|
project.versions.create!(
- name: attributes["name"],
- status: attributes["status"],
- sharing: attributes["sharing"]
+ name: attributes['name'],
+ status: attributes['status'],
+ sharing: attributes['sharing']
)
end
end
@@ -109,7 +109,7 @@ def project_data(identifier)
end
def project_name(identifier)
- _dev, *parts = identifier.split("-")
+ _dev, *parts = identifier.split('-')
"[dev] #{parts.join(' ').capitalize}"
end
diff --git a/app/seeders/development_data/shared_work_packages_seeder.rb b/app/seeders/development_data/shared_work_packages_seeder.rb
index b7e215af68df..5bfccbcc581d 100644
--- a/app/seeders/development_data/shared_work_packages_seeder.rb
+++ b/app/seeders/development_data/shared_work_packages_seeder.rb
@@ -31,12 +31,12 @@
module DevelopmentData
class SharedWorkPackagesSeeder < Seeder
def seed_data!
- print_status " ↳ Creating development work packages..."
+ print_status ' ↳ Creating development work packages...'
- print_status " -Creating/Resetting development work packages"
+ print_status ' -Creating/Resetting development work packages'
reset_work_packages
- print_status " -Sharing work packages"
+ print_status ' -Sharing work packages'
share_work_packages
end
@@ -49,7 +49,7 @@ def applicable?
private
def work_package_subjects
- ["[dev] Save Gotham", "[dev] Defeat Bane", "[dev] Find Waldo", "[dev] Organize game night"]
+ ['[dev] Save Gotham', '[dev] Defeat Bane', '[dev] Find Waldo', '[dev] Organize game night']
end
def reset_work_packages
@@ -77,7 +77,7 @@ def work_package_attributes
{
project:,
author:,
- subject: "[dev] Save Gotham",
+ subject: '[dev] Save Gotham',
reference: :save_gotham,
description: "Gotham is in trouble. It's your job to save it!",
status: seed_data.find_reference(:default_status_new),
@@ -87,9 +87,9 @@ def work_package_attributes
{
project:,
author:,
- subject: "[dev] Defeat Bane",
+ subject: '[dev] Defeat Bane',
reference: :defeat_bane,
- description: "Must be stopped before Gotham is doomed.",
+ description: 'Must be stopped before Gotham is doomed.',
status: seed_data.find_reference(:default_status_new),
type: seed_data.find_reference(:default_type_task),
priority: seed_data.find_reference(:default_priority_immediate, :default_priority_high)
@@ -97,19 +97,19 @@ def work_package_attributes
{
project:,
author:,
- subject: "[dev] Find Waldo",
+ subject: '[dev] Find Waldo',
reference: :find_waldo,
status: seed_data.find_reference(:default_status_new),
type: seed_data.find_reference(:default_type_task),
- description: "This one is tricky!",
+ description: 'This one is tricky!',
priority: IssuePriority.default
},
{
project:,
author:,
- subject: "[dev] Organize game night",
+ subject: '[dev] Organize game night',
reference: :organize_game_night,
- description: "Find a time that suits everyone.",
+ description: 'Find a time that suits everyone.',
status: seed_data.find_reference(:default_status_in_progress),
type: seed_data.find_reference(:default_type_task),
priority: IssuePriority.default
diff --git a/app/seeders/development_data/users_seeder.rb b/app/seeders/development_data/users_seeder.rb
index 374dfeae9a64..eb49625a5069 100644
--- a/app/seeders/development_data/users_seeder.rb
+++ b/app/seeders/development_data/users_seeder.rb
@@ -31,12 +31,12 @@
module DevelopmentData
class UsersSeeder < Seeder
def seed_data!
- print_status "Seeding development users ..."
+ print_status 'Seeding development users ...'
user_names.each do |login|
user = new_user login.to_s
if login == :admin_de
- user.language = "de"
+ user.language = 'de'
user.admin = true
end
@@ -58,7 +58,7 @@ def applicable?
def seed_users_disabled?
off_values = %w[off false no 0]
- off_values.include? ENV.fetch("OP_DEV_USER_SEEDER_ENABLED", nil)
+ off_values.include? ENV.fetch('OP_DEV_USER_SEEDER_ENABLED', nil)
end
def user_names
@@ -77,7 +77,7 @@ def new_user(login)
user.login = login
user.password = login
user.firstname = login.humanize
- user.lastname = "DEV user"
+ user.lastname = 'DEV user'
user.mail = "#{login}@example.net"
user.status = User.statuses[:active]
user.language = I18n.locale.to_s
diff --git a/app/seeders/development_data_seeder.rb b/app/seeders/development_data_seeder.rb
index a7a9b3fad34b..366e740e9826 100644
--- a/app/seeders/development_data_seeder.rb
+++ b/app/seeders/development_data_seeder.rb
@@ -38,6 +38,6 @@ def data_seeder_classes
end
def namespace
- "DevelopmentData"
+ 'DevelopmentData'
end
end
diff --git a/app/seeders/env_data/ldap_seeder.rb b/app/seeders/env_data/ldap_seeder.rb
index ef5003523f8d..aded93e586bd 100644
--- a/app/seeders/env_data/ldap_seeder.rb
+++ b/app/seeders/env_data/ldap_seeder.rb
@@ -28,17 +28,17 @@
module EnvData
class LdapSeeder < Seeder
def seed_data!
- print_status " ↳ Creating LDAP connection" do
+ print_status ' ↳ Creating LDAP connection' do
Setting.seed_ldap.each do |name, options|
ldap = LdapAuthSource.find_or_initialize_by(name:)
print_ldap_status(ldap)
upsert_settings(ldap, options)
- update_filters(ldap, options["groupfilter"])
+ update_filters(ldap, options['groupfilter'])
end
end
- print_status " ↳ Synchronizing LDAP connections" do
+ print_status ' ↳ Synchronizing LDAP connections' do
LdapGroups::SynchronizationJob.perform_now
end
end
@@ -51,24 +51,24 @@ def applicable?
# rubocop:disable Metrics/AbcSize
def upsert_settings(ldap, options)
- ldap.host = options["host"]
- ldap.port = options["port"]
+ ldap.host = options['host']
+ ldap.port = options['port']
- ldap.tls_mode = options["security"]
- ldap.verify_peer = ActiveRecord::Type::Boolean.new.deserialize options.fetch("tls_verify", true)
- ldap.onthefly_register = ActiveRecord::Type::Boolean.new.deserialize options.fetch("sync_users", false)
- ldap.tls_certificate_string = options["tls_certificate"].presence
+ ldap.tls_mode = options['security']
+ ldap.verify_peer = ActiveRecord::Type::Boolean.new.deserialize options.fetch('tls_verify', true)
+ ldap.onthefly_register = ActiveRecord::Type::Boolean.new.deserialize options.fetch('sync_users', false)
+ ldap.tls_certificate_string = options['tls_certificate'].presence
- ldap.filter_string = options["filter"].presence
- ldap.base_dn = options["basedn"]
- ldap.account = options["binduser"]
- ldap.account_password = options["bindpassword"]
+ ldap.filter_string = options['filter'].presence
+ ldap.base_dn = options['basedn']
+ ldap.account = options['binduser']
+ ldap.account_password = options['bindpassword']
- ldap.attr_login = options["login_mapping"].presence
- ldap.attr_firstname = options["firstname_mapping"].presence
- ldap.attr_lastname = options["lastname_mapping"].presence
- ldap.attr_mail = options["mail_mapping"].presence
- ldap.attr_admin = options["admin_mapping"].presence
+ ldap.attr_login = options['login_mapping'].presence
+ ldap.attr_firstname = options['firstname_mapping'].presence
+ ldap.attr_lastname = options['lastname_mapping'].presence
+ ldap.attr_mail = options['mail_mapping'].presence
+ ldap.attr_admin = options['admin_mapping'].presence
ldap.save!
end
@@ -86,10 +86,10 @@ def upsert_existing_filters(ldap, filters)
filter = ::LdapGroups::SynchronizedFilter.find_or_initialize_by(ldap_auth_source: ldap, name:)
print_ldap_status(filter)
- filter.group_name_attribute = options.fetch("group_attribute", "dn")
- filter.sync_users = ActiveRecord::Type::Boolean.new.deserialize options.fetch("sync_users", false)
- filter.filter_string = options["filter"]
- filter.base_dn = options["base"]
+ filter.group_name_attribute = options.fetch('group_attribute', 'dn')
+ filter.sync_users = ActiveRecord::Type::Boolean.new.deserialize options.fetch('sync_users', false)
+ filter.filter_string = options['filter']
+ filter.base_dn = options['base']
filter.save!
end
@@ -102,7 +102,7 @@ def remove_not_found_filters(ldap, names)
return unless not_found.exists?
- not_found_names = not_found.pluck(:name).join(", ")
+ not_found_names = not_found.pluck(:name).join(', ')
print_status " - Removing LDAP filter #{not_found_names} no longer present in ENV"
not_found.destroy_all
diff --git a/app/seeders/env_data_seeder.rb b/app/seeders/env_data_seeder.rb
index b12ee6ebd964..ebf8748c7715 100644
--- a/app/seeders/env_data_seeder.rb
+++ b/app/seeders/env_data_seeder.rb
@@ -32,6 +32,6 @@ def data_seeder_classes
end
def namespace
- "EnvData"
+ 'EnvData'
end
end
diff --git a/app/seeders/root_seeder.rb b/app/seeders/root_seeder.rb
index 840fe59b85e1..e95fb44f0a4c 100644
--- a/app/seeders/root_seeder.rb
+++ b/app/seeders/root_seeder.rb
@@ -43,7 +43,7 @@ def initialize(seed_development_data: Rails.env.development?, raise_on_unknown_l
# Returns the demo data in the default language.
def seed_data
@seed_data ||= begin
- raise "cannot generate demo seed data without setting locale first" unless @locale_set
+ raise 'cannot generate demo seed data without setting locale first' unless @locale_set
Source::SeedDataLoader.get_data
end
@@ -56,6 +56,7 @@ def translated_seed_data_for(*keys)
end
def seed_data!
+ reset_active_record!
set_locale! do
print_status "*** Seeding for locale: '#{I18n.locale}'"
prepare_seed! do
@@ -90,7 +91,7 @@ def load_available_seeders
end
def load_engine_seeders(engine)
- engine.root.glob("app/seeders/**/*.rb")
+ engine.root.glob('app/seeders/**/*.rb')
.each { |file| require file }
end
@@ -98,6 +99,18 @@ def rails_engines
::Rails::Engine.subclasses.map(&:instance)
end
+ ##
+ # Clears some schema caches and column information.
+ def reset_active_record!
+ ActiveRecord::Base
+ .descendants
+ .reject(&:abstract_class?)
+ .each do |klass|
+ klass.connection.schema_cache.clear!
+ klass.reset_column_information
+ end
+ end
+
def set_locale!
I18n.with_locale(desired_lang) do
@locale_set = true
@@ -113,13 +126,13 @@ def prepare_seed!
ActionMailer::Base.perform_deliveries = false
# Avoid asynchronous DeliverWorkPackageCreatedJob
- previous_execution_mode = Rails.configuration.good_job.execution_mode
- Rails.configuration.good_job.execution_mode = :inline
+ previous_delay_jobs = Delayed::Worker.delay_jobs
+ Delayed::Worker.delay_jobs = false
yield
ensure
ActionMailer::Base.perform_deliveries = previous_perform_deliveries
- Rails.configuration.good_job.execution_mode = previous_execution_mode
+ Delayed::Worker.delay_jobs = previous_delay_jobs
end
def seed_basic_data
@@ -128,23 +141,23 @@ def seed_basic_data
end
def seed_admin_user
- print_status "*** Seeding admin user"
+ print_status '*** Seeding admin user'
AdminUserSeeder.new(seed_data).seed!
end
def seed_demo_data
- print_status "*** Seeding demo data"
+ print_status '*** Seeding demo data'
DemoDataSeeder.new(seed_data).seed!
end
def seed_env_data
- print_status "*** Seeding data from environment variables"
+ print_status '*** Seeding data from environment variables'
EnvDataSeeder.new(seed_data).seed!
end
def seed_development_data
- print_status "*** Seeding development data"
- require "factory_bot"
+ print_status '*** Seeding development data'
+ require 'factory_bot'
# Load FactoryBot factories
begin
::FactoryBot.find_definitions
@@ -163,7 +176,7 @@ def seed_plugins_data
end
def desired_lang
- desired_lang = ENV.fetch("OPENPROJECT_SEED_LOCALE", Setting.default_language)
+ desired_lang = ENV.fetch('OPENPROJECT_SEED_LOCALE', Setting.default_language)
if Redmine::I18n.all_languages.exclude?(desired_lang)
if raise_on_unknown_language
diff --git a/app/seeders/source/seed_data.rb b/app/seeders/source/seed_data.rb
index aefb3aad5615..82540ce6a9fe 100644
--- a/app/seeders/source/seed_data.rb
+++ b/app/seeders/source/seed_data.rb
@@ -119,7 +119,7 @@ def each_data(path)
attr_reader :data, :registry
def fetch(path)
- keys = path.to_s.split(".")
+ keys = path.to_s.split('.')
data.dig(*keys)
end
end
diff --git a/app/seeders/source/seed_data_loader.rb b/app/seeders/source/seed_data_loader.rb
index b946c2504bb5..110da80ca60e 100644
--- a/app/seeders/source/seed_data_loader.rb
+++ b/app/seeders/source/seed_data_loader.rb
@@ -38,7 +38,7 @@ class Source::SeedDataLoader
class << self
def get_data(edition: nil, only: nil)
- edition ||= OpenProject::Configuration["edition"]
+ edition ||= OpenProject::Configuration['edition']
loader = new(seed_name: edition, only:)
loader.seed_data
end
@@ -46,7 +46,7 @@ def get_data(edition: nil, only: nil)
attr_reader :seed_name, :locale, :only
- def initialize(seed_name: "standard", locale: I18n.locale, only: nil)
+ def initialize(seed_name: 'standard', locale: I18n.locale, only: nil)
@seed_name = seed_name
@locale = locale
@only = only
@@ -67,7 +67,7 @@ def translated_seed_files_content
private
def seed_files
- Source::SeedFile.with_names(seed_name, "common")
+ Source::SeedFile.with_names(seed_name, 'common')
end
def translate_seed_file(seed_file)
diff --git a/app/seeders/source/seed_file.rb b/app/seeders/source/seed_file.rb
index 310975b6c46f..39795fa76479 100644
--- a/app/seeders/source/seed_file.rb
+++ b/app/seeders/source/seed_file.rb
@@ -42,7 +42,7 @@ def with_names(*names)
def find_all_seed_files
Pathname
- .glob("{modules/*/,}app/seeders/*.yml")
+ .glob('{modules/*/,}app/seeders/*.yml')
.map { |seed_file_path| new(seed_file_path) }
.freeze
end
diff --git a/app/seeders/source/translate.rb b/app/seeders/source/translate.rb
index 9228257f036e..6fa7ba02cdb3 100644
--- a/app/seeders/source/translate.rb
+++ b/app/seeders/source/translate.rb
@@ -29,8 +29,8 @@
#++
module Source::Translate
- I18N_PREFIX = "seeds"
- TRANSLATABLE_PREFIX = "t_"
+ I18N_PREFIX = 'seeds'
+ TRANSLATABLE_PREFIX = 't_'
TRANSLATABLE_PREFIX_PATTERN = /^#{TRANSLATABLE_PREFIX}/
def translate(hash, i18n_key)
@@ -45,7 +45,7 @@ def translatable?(key)
module_function :translatable?
def remove_translatable_prefix(key)
- key.gsub(TRANSLATABLE_PREFIX_PATTERN, "")
+ key.gsub(TRANSLATABLE_PREFIX_PATTERN, '')
end
module_function :remove_translatable_prefix
diff --git a/app/services/api/parse_resource_params_service.rb b/app/services/api/parse_resource_params_service.rb
index 02c388a24c57..d726fb1e49fe 100644
--- a/app/services/api/parse_resource_params_service.rb
+++ b/app/services/api/parse_resource_params_service.rb
@@ -41,7 +41,7 @@ def initialize(user, model: nil, representer: nil)
elsif model
deduce_representer(model)
else
- raise "Representer not defined"
+ raise 'Representer not defined'
end
end
diff --git a/app/services/api/v3/parse_query_params_service.rb b/app/services/api/v3/parse_query_params_service.rb
index 487abb47a1bb..31926ef53367 100644
--- a/app/services/api/v3/parse_query_params_service.rb
+++ b/app/services/api/v3/parse_query_params_service.rb
@@ -134,8 +134,8 @@ def filters_from_params(params)
def filter_from_params(filter)
attribute = filter.keys.first # there should only be one attribute per filter
- operator = filter[attribute]["operator"]
- values = Array(filter[attribute]["values"])
+ operator = filter[attribute]['operator']
+ values = Array(filter[attribute]['values'])
ar_attribute = convert_filter_attribute attribute, append_id: true
{ field: ar_attribute,
@@ -159,16 +159,16 @@ def highlighted_attributes_from_params(params)
return if highlighted_attributes.blank?
highlighted_attributes.map do |href|
- attr = href.split("/").last
+ attr = href.split('/').last
convert_attribute(attr)
end
end
def boolearize(value)
case value
- when "true"
+ when 'true'
true
- when "false"
+ when 'false'
false
end
end
@@ -201,7 +201,7 @@ def parse_sorting_from_json(json)
when Array
[order.first, order.last]
when String
- order.split(":")
+ order.split(':')
end
[convert_attribute(attribute), direction]
diff --git a/app/services/api/v3/work_package_collection_from_query_params_service.rb b/app/services/api/v3/work_package_collection_from_query_params_service.rb
index ffba34045dce..a0936e484dad 100644
--- a/app/services/api/v3/work_package_collection_from_query_params_service.rb
+++ b/app/services/api/v3/work_package_collection_from_query_params_service.rb
@@ -39,7 +39,7 @@ def call(params = {})
WorkPackageCollectionFromQueryService
.new(query, current_user, scope:)
- .call(params, valid_subset: params["valid_subset"].present?)
+ .call(params, valid_subset: params['valid_subset'].present?)
end
private
diff --git a/app/services/api/v3/work_package_collection_from_query_service.rb b/app/services/api/v3/work_package_collection_from_query_service.rb
index 56bbc5655cb9..092da189d547 100644
--- a/app/services/api/v3/work_package_collection_from_query_service.rb
+++ b/app/services/api/v3/work_package_collection_from_query_service.rb
@@ -78,7 +78,7 @@ def representer
def calculate_resulting_params(provided_params)
calculate_default_params
- .merge(provided_params.slice("offset", "pageSize").symbolize_keys)
+ .merge(provided_params.slice('offset', 'pageSize').symbolize_keys)
.tap do |params|
if query.manually_sorted?
params[:query_id] = query.id
@@ -91,7 +91,7 @@ def calculate_resulting_params(provided_params)
params[:pageSize] = pageSizeParam(params)
end
- params[:select] = nested_from_csv(provided_params["select"]) if provided_params["select"]
+ params[:select] = nested_from_csv(provided_params['select']) if provided_params['select']
end
end
diff --git a/app/services/attachments/clamav_service.rb b/app/services/attachments/clamav_service.rb
index cbd51517abe2..d069d0d8a5db 100644
--- a/app/services/attachments/clamav_service.rb
+++ b/app/services/attachments/clamav_service.rb
@@ -51,7 +51,7 @@ def clamav_client_options(scan_mode, connection_target)
when :clamav_socket
{ unix_socket: connection_target }
when :clamav_host
- tcp_host, tcp_port = connection_target.split(":")
+ tcp_host, tcp_port = connection_target.split(':')
{ tcp_host:, tcp_port: }
else
raise ArgumentError.new("Unknown clamav scan mode #{scan_mode}")
diff --git a/app/services/attachments/create_service.rb b/app/services/attachments/create_service.rb
index 761d832827cf..08276784c530 100644
--- a/app/services/attachments/create_service.rb
+++ b/app/services/attachments/create_service.rb
@@ -72,10 +72,10 @@ def error_wrapped_call
log_attachment_saving_error(e)
message =
- if e&.class&.to_s == "Errno::EACCES"
- I18n.t("api_v3.errors.unable_to_create_attachment_permissions")
+ if e&.class&.to_s == 'Errno::EACCES'
+ I18n.t('api_v3.errors.unable_to_create_attachment_permissions')
else
- I18n.t("api_v3.errors.unable_to_create_attachment")
+ I18n.t('api_v3.errors.unable_to_create_attachment')
end
raise message
end
diff --git a/app/services/authentication/omniauth_service.rb b/app/services/authentication/omniauth_service.rb
index 51bcdf2dbf66..88f987cb1a00 100644
--- a/app/services/authentication/omniauth_service.rb
+++ b/app/services/authentication/omniauth_service.rb
@@ -265,7 +265,7 @@ def build_omniauth_hash_to_user_attributes
# Remove any nil values to avoid
# overriding existing attributes
- attribute_map.reject! { |_, value| value.nil? || value == "" }
+ attribute_map.reject! { |_, value| value.nil? || value == '' }
Rails.logger.debug { "Mapped auth_hash user attributes #{attribute_map.inspect}" }
attribute_map
@@ -285,7 +285,7 @@ def identity_url_from_omniauth
# Try to provide some context of the auth_hash in case of errors
def auth_uid
hash = auth_hash || {}
- hash.dig(:info, :uid) || hash.dig(:uid) || "unknown"
+ hash.dig(:info, :uid) || hash.dig(:uid) || 'unknown'
end
end
end
diff --git a/app/services/authorization/project_query.rb b/app/services/authorization/project_query.rb
index ec764d6d6d8e..a04e3850b6e1 100644
--- a/app/services/authorization/project_query.rb
+++ b/app/services/authorization/project_query.rb
@@ -95,11 +95,11 @@ def self.role_permissions_table
end
def self.permission_roles_table
- Role.arel_table.alias("permission_roles")
+ Role.arel_table.alias('permission_roles')
end
def self.assigned_roles_table
- Role.arel_table.alias("assigned_roles")
+ Role.arel_table.alias('assigned_roles')
end
def self.role_has_permission_and_is_assigned(user, action)
diff --git a/app/services/authorization/query_transformation_visitor.rb b/app/services/authorization/query_transformation_visitor.rb
index ba174b1130ae..da75df339f68 100644
--- a/app/services/authorization/query_transformation_visitor.rb
+++ b/app/services/authorization/query_transformation_visitor.rb
@@ -91,7 +91,7 @@ def visit_Arel_Nodes_And(ast)
end
def method_missing(name, *args, &)
- super unless name.to_s.start_with?("visit_")
+ super unless name.to_s.start_with?('visit_')
end
def replace_if_equals(ast, key = nil)
diff --git a/app/services/authorization/user_allowed_query.rb b/app/services/authorization/user_allowed_query.rb
index f492a1772a98..5102d455d920 100644
--- a/app/services/authorization/user_allowed_query.rb
+++ b/app/services/authorization/user_allowed_query.rb
@@ -107,14 +107,14 @@ def self.no_membership_and_non_member_role_condition
def self.anonymous_user_condition
users_table[:type]
- .eq("AnonymousUser")
+ .eq('AnonymousUser')
.and(roles_table[:builtin].eq(Role::BUILTIN_ANONYMOUS))
end
def self.member_or_public_project_condition(id_equal)
roles_table
.grouping(users_table[:type]
- .eq("User")
+ .eq('User')
.and(id_equal.or(no_membership_and_non_member_role_condition)))
.or(anonymous_user_condition)
end
diff --git a/app/services/authorization/user_allowed_service.rb b/app/services/authorization/user_allowed_service.rb
index 4da4874db7b8..e6bbf77aff03 100644
--- a/app/services/authorization/user_allowed_service.rb
+++ b/app/services/authorization/user_allowed_service.rb
@@ -157,7 +157,7 @@ def project_authorization_cache
end
def normalize_action(action)
- if action.is_a?(Hash) && action[:controller] && action[:controller].to_s.starts_with?("/")
+ if action.is_a?(Hash) && action[:controller] && action[:controller].to_s.starts_with?('/')
action = action.dup
action[:controller] = action[:controller][1..]
end
diff --git a/app/services/base_type_service.rb b/app/services/base_type_service.rb
index e04135346b36..c5729d03b7ec 100644
--- a/app/services/base_type_service.rb
+++ b/app/services/base_type_service.rb
@@ -112,7 +112,7 @@ def after_type_save(_params, _options)
def transform_attribute_groups(groups)
groups.map do |group|
- if group["type"] == "query"
+ if group['type'] == 'query'
transform_query_group(group)
else
transform_attribute_group(group)
@@ -122,21 +122,21 @@ def transform_attribute_groups(groups)
def transform_attribute_group(group)
name =
- if group["key"]
- group["key"].to_sym
+ if group['key']
+ group['key'].to_sym
else
- group["name"]
+ group['name']
end
[
name,
- group["attributes"].pluck("key")
+ group['attributes'].pluck('key')
]
end
def transform_query_group(group)
- name = group["name"]
- props = JSON.parse group["query"]
+ name = group['name']
+ props = JSON.parse group['query']
query = Query.new_default(name: "Embedded table: #{name}")
@@ -175,7 +175,7 @@ def active_custom_field_ids
type.attribute_groups.each do |group|
group.members.each do |attribute|
if CustomField.custom_field_attribute? attribute
- active_cf_ids << attribute.gsub(/^custom_field_/, "").to_i
+ active_cf_ids << attribute.gsub(/^custom_field_/, '').to_i
end
end
end
diff --git a/app/services/copy/concerns/copy_attachments.rb b/app/services/copy/concerns/copy_attachments.rb
index 1a4c47488648..ba22146b68e2 100644
--- a/app/services/copy/concerns/copy_attachments.rb
+++ b/app/services/copy/concerns/copy_attachments.rb
@@ -39,9 +39,9 @@ def attachment_copy_attributes(source, to_id)
source
.dup
.attributes
- .except("file")
- .merge("author_id" => user.id,
- "container_id" => to_id)
+ .except('file')
+ .merge('author_id' => user.id,
+ 'container_id' => to_id)
end
def update_references(attachment_source:, attachment_target:, model_source:, model_target:, references:)
diff --git a/app/services/copy/dependency.rb b/app/services/copy/dependency.rb
index 57b11bd6f04a..9076775914ef 100644
--- a/app/services/copy/dependency.rb
+++ b/app/services/copy/dependency.rb
@@ -38,7 +38,7 @@ class Dependency < ::BaseServices::BaseCallable
##
# Identifier of this dependency to include/exclude
def self.identifier
- name.demodulize.gsub("DependentService", "").underscore
+ name.demodulize.gsub('DependentService', '').underscore
end
##
diff --git a/app/services/grids/copy/widgets_dependent_service.rb b/app/services/grids/copy/widgets_dependent_service.rb
index 4ad2a74c9796..aef95704ff0c 100644
--- a/app/services/grids/copy/widgets_dependent_service.rb
+++ b/app/services/grids/copy/widgets_dependent_service.rb
@@ -63,7 +63,7 @@ def duplicate_widget(widget, new_grid, params)
# Provide a human readable name for the widget
def widget_model_name(widget)
- I18n.t("grids.label_widget_in_grid", grid_name: widget.grid.to_s)
+ I18n.t('grids.label_widget_in_grid', grid_name: widget.grid.to_s)
end
def map_references(widget, params)
diff --git a/app/services/groups/update_service.rb b/app/services/groups/update_service.rb
index 5cc7bd526de7..c2c526c60f94 100644
--- a/app/services/groups/update_service.rb
+++ b/app/services/groups/update_service.rb
@@ -72,7 +72,7 @@ def member_roles_to_prune(users)
MemberRole
.includes(member: :member_roles)
- .where(inherited_from: model.members.joins(:member_roles).select("member_roles.id"))
+ .where(inherited_from: model.members.joins(:member_roles).select('member_roles.id'))
.where(members: { user_id: users.map(&:id) })
end
diff --git a/app/services/members/concerns/role_assignment.rb b/app/services/members/concerns/role_assignment.rb
index 9de2a625b0a9..bff823c726f0 100644
--- a/app/services/members/concerns/role_assignment.rb
+++ b/app/services/members/concerns/role_assignment.rb
@@ -36,7 +36,7 @@ def set_attributes(params)
end
def assign_roles(params)
- raise ArgumentError, "Cannot handle changing `roles`. Use role_ids instead." if model.persisted? && params.key?(:roles)
+ raise ArgumentError, 'Cannot handle changing `roles`. Use role_ids instead.' if model.persisted? && params.key?(:roles)
return unless params[:role_ids]
diff --git a/app/services/oauth/persist_application_service.rb b/app/services/oauth/persist_application_service.rb
index 6f25e567c39e..a545a4b7837e 100644
--- a/app/services/oauth/persist_application_service.rb
+++ b/app/services/oauth/persist_application_service.rb
@@ -52,7 +52,7 @@ def set_defaults
return if application.owner_id
application.owner = current_user
- application.owner_type = "User"
+ application.owner_type = 'User'
end
def set_secret_and_id
diff --git a/app/services/oauth_clients/set_attributes_service.rb b/app/services/oauth_clients/set_attributes_service.rb
index 16c9a439bc94..10f26aa90664 100644
--- a/app/services/oauth_clients/set_attributes_service.rb
+++ b/app/services/oauth_clients/set_attributes_service.rb
@@ -37,7 +37,7 @@ def set_attributes(params)
def replace_client_secret_with_nil(params)
cloned_param = params.clone
- if cloned_param[:client_secret] == ""
+ if cloned_param[:client_secret] == ''
cloned_param.merge!(client_secret: nil)
end
diff --git a/app/services/params_to_query_service.rb b/app/services/params_to_query_service.rb
index 5be1c02c9c89..710695141848 100644
--- a/app/services/params_to_query_service.rb
+++ b/app/services/params_to_query_service.rb
@@ -100,8 +100,8 @@ def parse_filters_from_json(json)
filters.each do |filter|
attribute = filter.keys.first # there should only be one attribute per filter
ar_attribute = convert_attribute attribute, append_id: true
- operators[ar_attribute] = filter[attribute]["operator"]
- values[ar_attribute] = filter[attribute]["values"]
+ operators[ar_attribute] = filter[attribute]['operator']
+ values[ar_attribute] = filter[attribute]['values']
end
{
diff --git a/app/services/parse_schema_filter_params_service.rb b/app/services/parse_schema_filter_params_service.rb
index 4e446c608d60..d748838ceed6 100644
--- a/app/services/parse_schema_filter_params_service.rb
+++ b/app/services/parse_schema_filter_params_service.rb
@@ -55,20 +55,20 @@ def call(filter)
private
def check_error_in_filter(filter)
- if !filter.first["id"]
+ if !filter.first['id']
:id_filter_required
- elsif filter.first["id"]["operator"] != "="
+ elsif filter.first['id']['operator'] != '='
:unsupported_operator
- elsif filter.first["id"]["values"].any? { |id_string| !id_string.match(/\d+-\d+/) }
+ elsif filter.first['id']['values'].any? { |id_string| !id_string.match(/\d+-\d+/) }
:invalid_values
end
end
def parse_ids(filter)
- ids_string = filter.first["id"]["values"]
+ ids_string = filter.first['id']['values']
ids_string.map do |id_string|
- id_string.split("-")
+ id_string.split('-')
end
end
diff --git a/app/services/principals/replace_references_service.rb b/app/services/principals/replace_references_service.rb
index 945460b1789c..e960a3856a4b 100644
--- a/app/services/principals/replace_references_service.rb
+++ b/app/services/principals/replace_references_service.rb
@@ -53,7 +53,7 @@ def rewrite_active_models(from, to)
def rewrite_custom_value(from, to)
CustomValue
- .where(custom_field_id: CustomField.where(field_format: "user"))
+ .where(custom_field_id: CustomField.where(field_format: 'user'))
.where(value: from.id.to_s)
.update_all(value: to.id.to_s)
end
@@ -71,7 +71,7 @@ def rewrite_default_journals(from, to)
def rewrite_customizable_journals(from, to)
Journal::CustomizableJournal
.joins(:custom_field)
- .where(custom_fields: { field_format: "user" })
+ .where(custom_fields: { field_format: 'user' })
.where(value: from.id.to_s)
.update_all(value: to.id.to_s)
end
diff --git a/app/services/projects/copy/boards_dependent_service.rb b/app/services/projects/copy/boards_dependent_service.rb
index 91fc678e4398..5364e9c3a007 100644
--- a/app/services/projects/copy/boards_dependent_service.rb
+++ b/app/services/projects/copy/boards_dependent_service.rb
@@ -29,7 +29,7 @@
module Projects::Copy
class BoardsDependentService < Dependency
def self.human_name
- I18n.t(:"boards.label_boards")
+ I18n.t(:'boards.label_boards')
end
def source_count
diff --git a/app/services/projects/copy/categories_dependent_service.rb b/app/services/projects/copy/categories_dependent_service.rb
index 35043718b43d..8d3692d054ca 100644
--- a/app/services/projects/copy/categories_dependent_service.rb
+++ b/app/services/projects/copy/categories_dependent_service.rb
@@ -29,7 +29,7 @@
module Projects::Copy
class CategoriesDependentService < Dependency
def self.human_name
- I18n.t(:"projects.copy.work_package_categories")
+ I18n.t(:'projects.copy.work_package_categories')
end
def source_count
@@ -42,7 +42,7 @@ def copy_dependency(params:)
category_id_map = {}
source.categories.find_each do |category|
- new_category = target.categories.create category.attributes.dup.except("id", "project_id")
+ new_category = target.categories.create category.attributes.dup.except('id', 'project_id')
category_id_map[category.id] = new_category.id
end
diff --git a/app/services/projects/copy/forums_dependent_service.rb b/app/services/projects/copy/forums_dependent_service.rb
index dbfcf52ae47b..377e2f1d137e 100644
--- a/app/services/projects/copy/forums_dependent_service.rb
+++ b/app/services/projects/copy/forums_dependent_service.rb
@@ -41,11 +41,11 @@ def source_count
def copy_dependency(params:)
source.forums.find_each do |forum|
new_forum = Forum.new
- new_forum.attributes = forum.attributes.dup.except("id",
- "project_id",
- "topics_count",
- "messages_count",
- "last_message_id")
+ new_forum.attributes = forum.attributes.dup.except('id',
+ 'project_id',
+ 'topics_count',
+ 'messages_count',
+ 'last_message_id')
copy_topics(forum, new_forum)
new_forum.project = target
@@ -54,16 +54,16 @@ def copy_dependency(params:)
end
def copy_topics(board, new_forum)
- topics = board.topics.where("parent_id is NULL")
+ topics = board.topics.where('parent_id is NULL')
topics.each do |topic|
new_topic = Message.new
- new_topic.attributes = topic.attributes.dup.except("id",
- "forum_id",
- "author_id",
- "replies_count",
- "last_reply_id",
- "created_at",
- "updated_at")
+ new_topic.attributes = topic.attributes.dup.except('id',
+ 'forum_id',
+ 'author_id',
+ 'replies_count',
+ 'last_reply_id',
+ 'created_at',
+ 'updated_at')
new_topic.forum = new_forum
new_topic.author_id = topic.author_id
new_forum.topics << new_topic
diff --git a/app/services/projects/copy/members_dependent_service.rb b/app/services/projects/copy/members_dependent_service.rb
index 564c5fc5837a..b9d392c5bc19 100644
--- a/app/services/projects/copy/members_dependent_service.rb
+++ b/app/services/projects/copy/members_dependent_service.rb
@@ -29,7 +29,7 @@
module Projects::Copy
class MembersDependentService < Dependency
def self.human_name
- I18n.t(:"projects.copy.members")
+ I18n.t(:'projects.copy.members')
end
def source_count
@@ -54,7 +54,7 @@ def create_membership(member)
return if role_ids.empty?
attributes = member
- .attributes.dup.except("id", "project_id", "created_at", "updated_at")
+ .attributes.dup.except('id', 'project_id', 'created_at', 'updated_at')
.merge(role_ids:,
project: target,
# This is magic for now. The settings has been set before in the Projects::CopyService
diff --git a/app/services/projects/copy/overview_dependent_service.rb b/app/services/projects/copy/overview_dependent_service.rb
index 5cdb9c56db81..0198a5dd3f9e 100644
--- a/app/services/projects/copy/overview_dependent_service.rb
+++ b/app/services/projects/copy/overview_dependent_service.rb
@@ -29,7 +29,7 @@
module Projects::Copy
class OverviewDependentService < Dependency
def self.human_name
- I18n.t(:"projects.copy.overviews")
+ I18n.t(:'projects.copy.overviews')
end
protected
diff --git a/app/services/projects/copy/queries_dependent_service.rb b/app/services/projects/copy/queries_dependent_service.rb
index 098bc3a10a34..711f309b21a0 100644
--- a/app/services/projects/copy/queries_dependent_service.rb
+++ b/app/services/projects/copy/queries_dependent_service.rb
@@ -29,7 +29,7 @@
module Projects::Copy
class QueriesDependentService < Dependency
def self.human_name
- I18n.t(:"projects.copy.queries")
+ I18n.t(:'projects.copy.queries')
end
def source_count
diff --git a/app/services/projects/copy/versions_dependent_service.rb b/app/services/projects/copy/versions_dependent_service.rb
index 7f5a9009e63e..72696002c96d 100644
--- a/app/services/projects/copy/versions_dependent_service.rb
+++ b/app/services/projects/copy/versions_dependent_service.rb
@@ -41,7 +41,7 @@ def source_count
def copy_dependency(params:)
version_id_map = {}
source.versions.each do |source_version|
- version = target.versions.create source_version.attributes.dup.except("id", "project_id", "created_at", "updated_at")
+ version = target.versions.create source_version.attributes.dup.except('id', 'project_id', 'created_at', 'updated_at')
version_id_map[source_version.id] = version.id
end
diff --git a/app/services/projects/copy/wiki_dependent_service.rb b/app/services/projects/copy/wiki_dependent_service.rb
index 98e0973e0ec0..406aad145f79 100644
--- a/app/services/projects/copy/wiki_dependent_service.rb
+++ b/app/services/projects/copy/wiki_dependent_service.rb
@@ -46,7 +46,7 @@ def copy_dependency(params:)
# Check that the source project has a wiki first
return if source.wiki.nil?
- target.wiki = target.build_wiki(source.wiki.attributes.dup.except("id", "project_id"))
+ target.wiki = target.build_wiki(source.wiki.attributes.dup.except('id', 'project_id'))
target.wiki.wiki_menu_items.delete_all
copy_wiki_pages(params)
@@ -115,7 +115,7 @@ def copy_wiki_menu_items
source.wiki.wiki_menu_items.each do |item|
new_item = MenuItems::WikiMenuItem.new
- new_item.attributes = item.attributes.dup.except("id", "wiki_id", "parent_id")
+ new_item.attributes = item.attributes.dup.except('id', 'wiki_id', 'parent_id')
new_item.wiki = target.wiki
(wiki_menu_items_map[item.id] = new_item.reload) if new_item.save
end
diff --git a/app/services/projects/copy/wiki_page_attachments_dependent_service.rb b/app/services/projects/copy/wiki_page_attachments_dependent_service.rb
index aed171452417..d4cf31fa83f4 100644
--- a/app/services/projects/copy/wiki_page_attachments_dependent_service.rb
+++ b/app/services/projects/copy/wiki_page_attachments_dependent_service.rb
@@ -31,11 +31,11 @@ class WikiPageAttachmentsDependentService < Dependency
include ::Projects::Copy::NoCopier
def self.human_name
- I18n.t(:"projects.copy.wiki_page_attachments")
+ I18n.t(:'projects.copy.wiki_page_attachments')
end
def source_count
- source.wiki && source.wiki.pages.joins(:attachments).count("attachments.id")
+ source.wiki && source.wiki.pages.joins(:attachments).count('attachments.id')
end
end
end
diff --git a/app/services/projects/copy/work_package_attachments_dependent_service.rb b/app/services/projects/copy/work_package_attachments_dependent_service.rb
index f9754e73fad0..f9d2ce27b4c5 100644
--- a/app/services/projects/copy/work_package_attachments_dependent_service.rb
+++ b/app/services/projects/copy/work_package_attachments_dependent_service.rb
@@ -31,11 +31,11 @@ class WorkPackageAttachmentsDependentService < Dependency
include ::Projects::Copy::NoCopier
def self.human_name
- I18n.t(:"projects.copy.work_package_attachments")
+ I18n.t(:'projects.copy.work_package_attachments')
end
def source_count
- source.work_packages.joins(:attachments).count("attachments.id")
+ source.work_packages.joins(:attachments).count('attachments.id')
end
end
end
diff --git a/app/services/projects/copy/work_packages_dependent_service.rb b/app/services/projects/copy/work_packages_dependent_service.rb
index 15a3d6fc97a3..6763e43eefb9 100644
--- a/app/services/projects/copy/work_packages_dependent_service.rb
+++ b/app/services/projects/copy/work_packages_dependent_service.rb
@@ -60,12 +60,12 @@ def source_work_packages
source
.work_packages
.includes(:custom_values, :version, :assigned_to, :responsible)
- .order_by_ancestors("asc")
- .order("id ASC")
+ .order_by_ancestors('asc')
+ .order('id ASC')
end
def copy_work_packages(to_copy)
- user_cf_ids = WorkPackageCustomField.where(field_format: "user").pluck(:id)
+ user_cf_ids = WorkPackageCustomField.where(field_format: 'user').pluck(:id)
to_copy.inject({}) do |work_packages_map, wp|
parent_id = work_packages_map[wp.parent_id] || wp.parent_id
@@ -115,7 +115,7 @@ def copy_relations(source_wp, new_wp_id, work_packages_map)
Relation.create(source_relation
.attributes
- .except("id", "from_id", "to_id")
+ .except('id', 'from_id', 'to_id')
.merge(to_id:, from_id:))
end
end
diff --git a/app/services/projects/gantt_query_generator_service.rb b/app/services/projects/gantt_query_generator_service.rb
index c9a757055785..ad6c3864b3ab 100644
--- a/app/services/projects/gantt_query_generator_service.rb
+++ b/app/services/projects/gantt_query_generator_service.rb
@@ -53,7 +53,7 @@ def default_gantt_query
milestone_ids = Type.milestone.pluck(:id).map(&:to_s)
if milestone_ids.any?
- default_with_filter.merge!("f" => [{ "n" => "type", "o" => "=", "v" => milestone_ids }])
+ default_with_filter.merge!('f' => [{ 'n' => 'type', 'o' => '=', 'v' => milestone_ids }])
end
JSON.dump(default_with_filter)
@@ -69,22 +69,22 @@ def call
params = params_from_settings.dup
# Delete the parent filter
- params["f"] =
- if params["f"]
- params["f"].reject { |filter| filter["n"] == "project" }
+ params['f'] =
+ if params['f']
+ params['f'].reject { |filter| filter['n'] == 'project' }
else
[]
end
# Ensure grouped by project
- params["g"] = "project"
- params["hi"] = false
+ params['g'] = 'project'
+ params['hi'] = false
# Ensure timeline visible
- params["tv"] = true
+ params['tv'] = true
# Add the parent filter
- params["f"] << { "n" => "project", "o" => "=", "v" => selected_project_ids }
+ params['f'] << { 'n' => 'project', 'o' => '=', 'v' => selected_project_ids }
params.to_json
end
diff --git a/app/services/projects/set_attributes_service.rb b/app/services/projects/set_attributes_service.rb
index 54f1570bd857..0394c8d3756e 100644
--- a/app/services/projects/set_attributes_service.rb
+++ b/app/services/projects/set_attributes_service.rb
@@ -41,10 +41,10 @@ def set_attributes(params)
def set_default_attributes(attributes)
attribute_keys = attributes.keys.map(&:to_s)
- set_default_public(attribute_keys.include?("public"))
- set_default_module_names(attribute_keys.include?("enabled_module_names"))
- set_default_types(attribute_keys.include?("types") || attribute_keys.include?("type_ids"))
- set_default_active_work_package_custom_fields(attribute_keys.include?("work_package_custom_fields"))
+ set_default_public(attribute_keys.include?('public'))
+ set_default_module_names(attribute_keys.include?('enabled_module_names'))
+ set_default_types(attribute_keys.include?('types') || attribute_keys.include?('type_ids'))
+ set_default_active_work_package_custom_fields(attribute_keys.include?('work_package_custom_fields'))
end
def set_default_public(provided)
@@ -77,7 +77,7 @@ def set_status_code(status_code)
# set an arbitrary status code first to get rails internal into correct state
model.status_code = first_not_set_code
# hack into rails internals to set faulty code
- code_attributes = model.instance_variable_get(:@attributes)["status_code"]
+ code_attributes = model.instance_variable_get(:@attributes)['status_code']
code_attributes.instance_variable_set(:@value_before_type_cast, status_code)
code_attributes.instance_variable_set(:@value, status_code)
else
diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb
index e7e658eb491e..1d04e3f0b4cb 100644
--- a/app/services/projects/update_service.rb
+++ b/app/services/projects/update_service.rb
@@ -59,7 +59,7 @@ def touch_on_custom_values_update
end
def notify_on_identifier_renamed
- return unless memoized_changes["identifier"]
+ return unless memoized_changes['identifier']
OpenProject::Notifications.send(OpenProject::Events::PROJECT_RENAMED, project: model)
end
@@ -73,7 +73,7 @@ def only_custom_values_updated?
end
def update_wp_versions_on_parent_change
- return unless memoized_changes["parent_id"]
+ return unless memoized_changes['parent_id']
WorkPackage.update_versions_from_hierarchy_change(model)
end
diff --git a/app/services/queries/copy/filters_mapper.rb b/app/services/queries/copy/filters_mapper.rb
index bd912b9559ab..f54338dcdf16 100644
--- a/app/services/queries/copy/filters_mapper.rb
+++ b/app/services/queries/copy/filters_mapper.rb
@@ -62,7 +62,7 @@ def map_api_filter_hash(filter)
subhash = filter[name]
ar_name = ::API::Utilities::QueryFiltersNameConverter.to_ar_name(name, refer_to_ids: true)
- subhash["values"] = mapped_values(ar_name, subhash["values"])
+ subhash['values'] = mapped_values(ar_name, subhash['values'])
end
def map_filter_class(filter)
diff --git a/app/services/queries/projects/project_queries/set_attributes_service.rb b/app/services/queries/projects/project_queries/set_attributes_service.rb
index 8df3a0b28b24..cde9ef948a48 100644
--- a/app/services/queries/projects/project_queries/set_attributes_service.rb
+++ b/app/services/queries/projects/project_queries/set_attributes_service.rb
@@ -59,7 +59,7 @@ def set_default_order
def set_default_filter
return if model.filters.any?
- model.where("active", "=", OpenProject::Database::DB_VALUE_TRUE)
+ model.where('active', '=', OpenProject::Database::DB_VALUE_TRUE)
end
def set_default_selects
@@ -92,6 +92,6 @@ def set_select(selects)
end
def default_columns
- (["name"] + Setting.enabled_projects_columns).uniq
+ (['name'] + Setting.enabled_projects_columns).uniq
end
end
diff --git a/app/services/reports/assignee_report.rb b/app/services/reports/assignee_report.rb
index 27a8b8422b6f..aeef8424d858 100644
--- a/app/services/reports/assignee_report.rb
+++ b/app/services/reports/assignee_report.rb
@@ -28,11 +28,11 @@
class Reports::AssigneeReport < Reports::Report
def self.report_type
- "assigned_to"
+ 'assigned_to'
end
def field
- @field ||= "assigned_to_id"
+ @field ||= 'assigned_to_id'
end
def rows
diff --git a/app/services/reports/author_report.rb b/app/services/reports/author_report.rb
index 123d9afee0db..987b2bff09c2 100644
--- a/app/services/reports/author_report.rb
+++ b/app/services/reports/author_report.rb
@@ -28,11 +28,11 @@
class Reports::AuthorReport < Reports::Report
def self.report_type
- "author"
+ 'author'
end
def field
- "author_id"
+ 'author_id'
end
def rows
diff --git a/app/services/reports/category_report.rb b/app/services/reports/category_report.rb
index 12b5a392c01e..3bb9d2a82804 100644
--- a/app/services/reports/category_report.rb
+++ b/app/services/reports/category_report.rb
@@ -28,11 +28,11 @@
class Reports::CategoryReport < Reports::Report
def self.report_type
- "category"
+ 'category'
end
def field
- "category_id"
+ 'category_id'
end
def rows
diff --git a/app/services/reports/priority_report.rb b/app/services/reports/priority_report.rb
index 2b7dace84d66..3cddf516b5f7 100644
--- a/app/services/reports/priority_report.rb
+++ b/app/services/reports/priority_report.rb
@@ -28,11 +28,11 @@
class Reports::PriorityReport < Reports::Report
def self.report_type
- "priority"
+ 'priority'
end
def field
- "priority_id"
+ 'priority_id'
end
def rows
diff --git a/app/services/reports/report.rb b/app/services/reports/report.rb
index 1dd1225fe11d..c0fbc83d2ef0 100644
--- a/app/services/reports/report.rb
+++ b/app/services/reports/report.rb
@@ -32,7 +32,7 @@ def initialize(project)
end
def self.report_type
- "default"
+ 'default'
end
def report_type
diff --git a/app/services/reports/reports_service.rb b/app/services/reports/reports_service.rb
index 810f736687ce..e7bf9fe7d5f0 100644
--- a/app/services/reports/reports_service.rb
+++ b/app/services/reports/reports_service.rb
@@ -50,7 +50,7 @@ def self.has_report_for?(report_type)
add_report Reports::VersionReport
def initialize(project)
- raise "You must provide a project to report upon" unless project&.is_a?(Project)
+ raise 'You must provide a project to report upon' unless project&.is_a?(Project)
@project = project
end
diff --git a/app/services/reports/responsible_report.rb b/app/services/reports/responsible_report.rb
index c9994d72ddc8..6f4347cfb0cd 100644
--- a/app/services/reports/responsible_report.rb
+++ b/app/services/reports/responsible_report.rb
@@ -28,11 +28,11 @@
class Reports::ResponsibleReport < Reports::Report
def self.report_type
- "responsible"
+ 'responsible'
end
def field
- @field ||= "responsible_id"
+ @field ||= 'responsible_id'
end
def rows
diff --git a/app/services/reports/subproject_report.rb b/app/services/reports/subproject_report.rb
index a74189dd8141..071007aa3be1 100644
--- a/app/services/reports/subproject_report.rb
+++ b/app/services/reports/subproject_report.rb
@@ -28,11 +28,11 @@
class Reports::SubprojectReport < Reports::Report
def self.report_type
- "subproject"
+ 'subproject'
end
def field
- "project_id"
+ 'project_id'
end
def rows
diff --git a/app/services/reports/type_report.rb b/app/services/reports/type_report.rb
index 3f565f788e20..f365017c6bb6 100644
--- a/app/services/reports/type_report.rb
+++ b/app/services/reports/type_report.rb
@@ -28,11 +28,11 @@
class Reports::TypeReport < Reports::Report
def self.report_type
- "type"
+ 'type'
end
def field
- @field || "type_id"
+ @field || 'type_id'
end
def rows
diff --git a/app/services/reports/version_report.rb b/app/services/reports/version_report.rb
index 11bb990c3e75..5bddb4f1ce0a 100644
--- a/app/services/reports/version_report.rb
+++ b/app/services/reports/version_report.rb
@@ -28,11 +28,11 @@
class Reports::VersionReport < Reports::Report
def self.report_type
- "version"
+ 'version'
end
def field
- @field ||= "version_id"
+ @field ||= 'version_id'
end
def rows
diff --git a/app/services/scm/checkout_instructions_service.rb b/app/services/scm/checkout_instructions_service.rb
index 90510fbded94..94e885d05bc4 100644
--- a/app/services/scm/checkout_instructions_service.rb
+++ b/app/services/scm/checkout_instructions_service.rb
@@ -56,13 +56,13 @@ def checkout_command
##
# Returns the checkout base URL as defined in settings.
def checkout_base_url
- checkout_settings["base_url"]
+ checkout_settings['base_url']
end
##
# Returns the instructions defined in the settings.
def instructions
- checkout_settings["text"].presence ||
+ checkout_settings['text'].presence ||
I18n.t("repositories.checkout.default_instructions.#{repository.vendor}")
end
@@ -89,7 +89,7 @@ def available?
end
def checkout_enabled?
- checkout_settings["enabled"].to_i > 0
+ checkout_settings['enabled'].to_i > 0
end
def supported_but_not_enabled?
diff --git a/app/services/scm/create_managed_repository_service.rb b/app/services/scm/create_managed_repository_service.rb
index ecbd1fc5b919..126b35e2aa66 100644
--- a/app/services/scm/create_managed_repository_service.rb
+++ b/app/services/scm/create_managed_repository_service.rb
@@ -55,11 +55,11 @@ def call
false
rescue Errno::EACCES
- @rejected = I18n.t("repositories.errors.path_permission_failed",
+ @rejected = I18n.t('repositories.errors.path_permission_failed',
path: repository.root_url)
false
rescue SystemCallError => e
- @rejected = I18n.t("repositories.errors.filesystem_access_failed",
+ @rejected = I18n.t('repositories.errors.filesystem_access_failed',
message: e.message)
false
rescue OpenProject::SCM::Exceptions::SCMError => e
@@ -70,6 +70,6 @@ def call
##
# Returns the error symbol
def localized_rejected_reason
- @rejected ||= I18n.t("repositories.errors.not_manageable")
+ @rejected ||= I18n.t('repositories.errors.not_manageable')
end
end
diff --git a/app/services/scm/delete_managed_repository_service.rb b/app/services/scm/delete_managed_repository_service.rb
index 13809f04d12d..49a070e125f2 100644
--- a/app/services/scm/delete_managed_repository_service.rb
+++ b/app/services/scm/delete_managed_repository_service.rb
@@ -65,7 +65,7 @@ def delete_local_repository
true
rescue SystemCallError => e
- @rejected = I18n.t("repositories.errors.managed_delete_local",
+ @rejected = I18n.t('repositories.errors.managed_delete_local',
path: repository.root_url,
error_message: e.message)
false
@@ -74,6 +74,6 @@ def delete_local_repository
##
# Returns the error symbol
def localized_rejected_reason
- @rejected ||= I18n.t("repositories.errors.managed_delete")
+ @rejected ||= I18n.t('repositories.errors.managed_delete')
end
end
diff --git a/app/services/scm/repository_factory_service.rb b/app/services/scm/repository_factory_service.rb
index de682a8fd45a..d4071a52719f 100644
--- a/app/services/scm/repository_factory_service.rb
+++ b/app/services/scm/repository_factory_service.rb
@@ -66,7 +66,7 @@ def build_temporary
end
def build_error
- I18n.t("repositories.errors.build_failed", reason: @build_failed_msg)
+ I18n.t('repositories.errors.build_failed', reason: @build_failed_msg)
end
private
diff --git a/app/services/set_localization_service.rb b/app/services/set_localization_service.rb
index 21a933568e44..013aeab942b2 100644
--- a/app/services/set_localization_service.rb
+++ b/app/services/set_localization_service.rb
@@ -94,6 +94,6 @@ def find_language_or_prefix(language)
return nil unless language
language = language.to_s.downcase
- find_language(language) || find_language(language.split("-").first)
+ find_language(language) || find_language(language.split('-').first)
end
end
diff --git a/app/services/update_projects_types_service.rb b/app/services/update_projects_types_service.rb
index 94ff181aab4f..6484698a8c35 100644
--- a/app/services/update_projects_types_service.rb
+++ b/app/services/update_projects_types_service.rb
@@ -33,7 +33,7 @@ def call(type_ids)
if types_missing?(type_ids)
project.errors.add(:types,
:in_use_by_work_packages,
- types: missing_types(type_ids).map(&:name).join(", "))
+ types: missing_types(type_ids).map(&:name).join(', '))
false
else
update_project_types(type_ids)
diff --git a/app/services/user_preferences/update_service.rb b/app/services/user_preferences/update_service.rb
index 10595fa169cf..016cd2ca5d64 100644
--- a/app/services/user_preferences/update_service.rb
+++ b/app/services/user_preferences/update_service.rb
@@ -60,8 +60,8 @@ def persist_notifications
.map { |item| item.merge(user_id: model.user_id) }
.partition { |setting| setting[:project_id].nil? }
- global_ids = upsert_notifications(global, %i[user_id], "project_id IS NULL")
- project_ids = upsert_notifications(project, %i[user_id project_id], "project_id IS NOT NULL")
+ global_ids = upsert_notifications(global, %i[user_id], 'project_id IS NULL')
+ project_ids = upsert_notifications(project, %i[user_id project_id], 'project_id IS NOT NULL')
global_ids + project_ids
end
diff --git a/app/services/user_search_service.rb b/app/services/user_search_service.rb
index 1d4569ca0788..d23d9885d8ab 100644
--- a/app/services/user_search_service.rb
+++ b/app/services/user_search_service.rb
@@ -31,11 +31,11 @@ class UserSearchService
attr_reader :users_only, :project
SEARCH_SCOPES = [
- "project_id",
- "ids",
- "group_id",
- "status",
- "name"
+ 'project_id',
+ 'ids',
+ 'group_id',
+ 'status',
+ 'name'
]
def initialize(params, users_only: false)
@@ -58,7 +58,7 @@ def search
end
def ids_search(scope)
- ids = params[:ids].split(",")
+ ids = params[:ids].split(',')
scope.where(id: ids)
end
@@ -68,21 +68,21 @@ def query_search(scope)
c = ARCondition.new
case params[:status]
- when "blocked"
+ when 'blocked'
@status = :blocked
scope = scope.blocked
- when "all"
+ when 'all'
@status = :all
# No scope change necessary
else
@status = params[:status] ? params[:status].to_i : User.statuses[:active]
scope = scope.not_blocked if users_only && @status == User.statuses[:active]
- c << ["status = ?", @status]
+ c << ['status = ?', @status]
end
if params[:name].present?
name = "%#{params[:name].strip.downcase}%"
- c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?", name, name, name,
+ c << ['LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?', name, name, name,
name]
end
diff --git a/app/services/users/create_service.rb b/app/services/users/create_service.rb
index 947c4458f5c7..c0cc59f50c6d 100644
--- a/app/services/users/create_service.rb
+++ b/app/services/users/create_service.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "work_packages/create_contract"
-require "concerns/user_invitation"
+require 'work_packages/create_contract'
+require 'concerns/user_invitation'
module Users
class CreateService < ::BaseServices::Create
diff --git a/app/services/users/login_service.rb b/app/services/users/login_service.rb
index 243677d9bf60..c70d247f930c 100644
--- a/app/services/users/login_service.rb
+++ b/app/services/users/login_service.rb
@@ -66,11 +66,11 @@ def set_autologin_cookie
# The autologin expiry is checked on validating the token
# but still expire the cookie to avoid unnecessary retries
expires: expires_on,
- path: OpenProject::Configuration["autologin_cookie_path"],
+ path: OpenProject::Configuration['autologin_cookie_path'],
secure: OpenProject::Configuration.https?,
httponly: true
}
- cookies[OpenProject::Configuration["autologin_cookie_name"]] = cookie_options
+ cookies[OpenProject::Configuration['autologin_cookie_name']] = cookie_options
end
def successful_login
diff --git a/app/services/users/register_user_service.rb b/app/services/users/register_user_service.rb
index 647b5adcdbf9..00754fd900c2 100644
--- a/app/services/users/register_user_service.rb
+++ b/app/services/users/register_user_service.rb
@@ -63,7 +63,7 @@ def call
def ensure_provider_not_limited!
if limited_provider?(user) && Setting::SelfRegistration.disabled?
name = provider_name(user)
- ServiceResult.failure(result: user, message: I18n.t("account.error_self_registration_limited_provider", name:))
+ ServiceResult.failure(result: user, message: I18n.t('account.error_self_registration_limited_provider', name:))
end
end
@@ -72,7 +72,7 @@ def ensure_provider_not_limited!
# for non-invited users
def ensure_registration_allowed!
if Setting::SelfRegistration.disabled?
- ServiceResult.failure(result: user, message: I18n.t("account.error_self_registration_disabled"))
+ ServiceResult.failure(result: user, message: I18n.t('account.error_self_registration_disabled'))
end
end
diff --git a/app/services/users/replace_mentions_service.rb b/app/services/users/replace_mentions_service.rb
index ffe7d84a7d3d..632444431dad 100644
--- a/app/services/users/replace_mentions_service.rb
+++ b/app/services/users/replace_mentions_service.rb
@@ -204,7 +204,7 @@ def hash_replace(source, from, to)
regexp_replace(
source,
search,
- "user#%i ",
+ 'user#%i ',
values
)
end
diff --git a/app/services/users/set_attributes_service.rb b/app/services/users/set_attributes_service.rb
index 92b5c90d00cd..e8179f9f9c2b 100644
--- a/app/services/users/set_attributes_service.rb
+++ b/app/services/users/set_attributes_service.rb
@@ -80,7 +80,7 @@ def assign_default_language
# are longer than 30 characters they will be trimmed to 27 characters and an
# ellipsis will be appended.
def placeholder_name(email)
- first, last = email.split("@").map { |name| trim_name(name) }
+ first, last = email.split('@').map { |name| trim_name(name) }
[first, "@#{last}"]
end
diff --git a/app/services/versions/set_attributes_service.rb b/app/services/versions/set_attributes_service.rb
index 22293ee0e31f..6e9fd7a29b1f 100644
--- a/app/services/versions/set_attributes_service.rb
+++ b/app/services/versions/set_attributes_service.rb
@@ -33,8 +33,8 @@ class SetAttributesService < ::BaseServices::SetAttributes
def set_default_attributes(*)
return unless model.new_record?
- model.sharing ||= "none"
- model.status ||= "open"
+ model.sharing ||= 'none'
+ model.status ||= 'open'
end
end
end
diff --git a/app/services/views/global_create_service.rb b/app/services/views/global_create_service.rb
index 1dfec30d44fe..6d56649ba4e0 100644
--- a/app/services/views/global_create_service.rb
+++ b/app/services/views/global_create_service.rb
@@ -55,6 +55,6 @@ def view_params(call)
end
def view_type
- raise "Implement me"
+ raise 'Implement me'
end
end
diff --git a/app/services/wiki_pages/copy_service.rb b/app/services/wiki_pages/copy_service.rb
index 5942f08e4102..118b62e8553e 100644
--- a/app/services/wiki_pages/copy_service.rb
+++ b/app/services/wiki_pages/copy_service.rb
@@ -80,7 +80,7 @@ def writable_attributes
def copy_wiki_page_attachments(copy)
copy_attachments(
- "WikiPage",
+ 'WikiPage',
from: model,
to: copy,
references: %i[text]
diff --git a/app/services/work_packages/bulk/bulked_service.rb b/app/services/work_packages/bulk/bulked_service.rb
index 9e932f93a953..beeb44449d79 100644
--- a/app/services/work_packages/bulk/bulked_service.rb
+++ b/app/services/work_packages/bulk/bulked_service.rb
@@ -43,7 +43,7 @@ def call(params)
# This is not an all or nothing service. We currently accept that
# one work package might be moved while another one fails.
# Personally, I'd rather wrap it in a transaction.
- send_notifications = params[:send_notification] == "1"
+ send_notifications = params[:send_notification] == '1'
without_context_transaction(send_notifications:) do
bulk(params)
end
diff --git a/app/services/work_packages/bulk/copy_service.rb b/app/services/work_packages/bulk/copy_service.rb
index b72aed6ca504..e18707f89e0e 100644
--- a/app/services/work_packages/bulk/copy_service.rb
+++ b/app/services/work_packages/bulk/copy_service.rb
@@ -84,7 +84,7 @@ def alter_work_package(work_package, attributes)
work_package
.descendants
- .order_by_ancestors("asc")
+ .order_by_ancestors('asc')
.each do |wp|
copied = copy_with_updated_parent_id(wp, attributes, ancestors)
diff --git a/app/services/work_packages/copy_service.rb b/app/services/work_packages/copy_service.rb
index 7234c33591e6..3b8fd7f50dca 100644
--- a/app/services/work_packages/copy_service.rb
+++ b/app/services/work_packages/copy_service.rb
@@ -77,14 +77,14 @@ def copied_attributes(work_package, override)
attributes = work_package
.attributes
.slice(*writable_work_package_attributes(work_package))
- .merge("parent_id" => work_package.parent_id,
- "custom_field_values" => work_package.custom_value_attributes)
+ .merge('parent_id' => work_package.parent_id,
+ 'custom_field_values' => work_package.custom_value_attributes)
.merge(overwritten_attributes)
- if overwritten_attributes.has_key?("start_date") &&
- overwritten_attributes.has_key?("due_date") &&
- !overwritten_attributes.has_key?("duration")
- attributes.delete("duration")
+ if overwritten_attributes.has_key?('start_date') &&
+ overwritten_attributes.has_key?('due_date') &&
+ !overwritten_attributes.has_key?('duration')
+ attributes.delete('duration')
end
attributes
@@ -106,7 +106,7 @@ def copy_watchers(copied)
def copy_work_package_attachments(copy)
copy_attachments(
- "WorkPackage",
+ 'WorkPackage',
from: work_package,
to: copy,
references: %i[description]
diff --git a/app/services/work_packages/exports/schedule_service.rb b/app/services/work_packages/exports/schedule_service.rb
index cd873c2e99a8..921441054e17 100644
--- a/app/services/work_packages/exports/schedule_service.rb
+++ b/app/services/work_packages/exports/schedule_service.rb
@@ -61,7 +61,7 @@ def serialize_query(query)
def serialize_query_props(query)
query.attributes.tap do |attributes|
- attributes["filters"] = Queries::WorkPackages::FilterSerializer.dump(query.attributes["filters"])
+ attributes['filters'] = Queries::WorkPackages::FilterSerializer.dump(query.attributes['filters'])
end
end
end
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rb
index 15c21a1d5dfb..aef4758227ba 100644
--- a/app/services/work_packages/set_attributes_service.rb
+++ b/app/services/work_packages/set_attributes_service.rb
@@ -66,7 +66,6 @@ def set_calculated_attributes(attributes)
update_project_dependent_attributes
reassign_invalid_status_if_type_changed
set_templated_description
- set_cause_for_readonly_attributes
end
def derivable_attribute
@@ -417,12 +416,4 @@ def parent_due_later_than_start?
(due && !start) || ((due && start) && (due > start))
end
-
- def set_cause_for_readonly_attributes
- return unless work_package.changes.keys.intersect?(%w(created_at updated_at author))
-
- work_package.journal_cause = {
- "type" => "default_attribute_written"
- }
- end
end
diff --git a/app/services/work_packages/shared/all_days.rb b/app/services/work_packages/shared/all_days.rb
index 1f3a6d9e5cc6..84fbe1d49e9d 100644
--- a/app/services/work_packages/shared/all_days.rb
+++ b/app/services/work_packages/shared/all_days.rb
@@ -38,14 +38,14 @@ def duration(start_date, due_date)
def start_date(due_date, duration)
return nil unless due_date && duration
- raise ArgumentError, "duration must be strictly positive" if duration.is_a?(Integer) && duration <= 0
+ raise ArgumentError, 'duration must be strictly positive' if duration.is_a?(Integer) && duration <= 0
due_date - duration + 1
end
def due_date(start_date, duration)
return nil unless start_date && duration
- raise ArgumentError, "duration must be strictly positive" if duration.is_a?(Integer) && duration <= 0
+ raise ArgumentError, 'duration must be strictly positive' if duration.is_a?(Integer) && duration <= 0
start_date + duration - 1
end
diff --git a/app/services/work_packages/shared/working_days.rb b/app/services/work_packages/shared/working_days.rb
index e11907157c91..aec6da4785b9 100644
--- a/app/services/work_packages/shared/working_days.rb
+++ b/app/services/work_packages/shared/working_days.rb
@@ -89,7 +89,7 @@ def non_working?(date)
private
def assert_strictly_positive_duration(duration)
- raise ArgumentError, "duration must be strictly positive" if duration.is_a?(Integer) && duration <= 0
+ raise ArgumentError, 'duration must be strictly positive' if duration.is_a?(Integer) && duration <= 0
end
def latest_working_day(date)
@@ -114,7 +114,7 @@ def assert_some_working_week_days_exist
return if @working_week_days_exist
if working_week_days.all? { |working| working == false }
- raise "cannot have all week days as non-working days"
+ raise 'cannot have all week days as non-working days'
end
@working_week_days_exist = true
diff --git a/app/services/work_packages/update_ancestors/loader.rb b/app/services/work_packages/update_ancestors/loader.rb
index 908d43b19b50..d7974858e2f1 100644
--- a/app/services/work_packages/update_ancestors/loader.rb
+++ b/app/services/work_packages/update_ancestors/loader.rb
@@ -50,7 +50,7 @@ def leaves_of(queried_work_package)
@leaves ||= Hash.new do |hash, wp|
hash[wp] = replaced_related_of(wp, :leaves) do |leaf|
# Mimic work package by implementing the closed? interface
- leaf.send(:"closed?=", leaf.is_closed)
+ leaf.send(:'closed?=', leaf.is_closed)
end
end
diff --git a/app/services/workflows/bulk_update_service.rb b/app/services/workflows/bulk_update_service.rb
index 39ce29d932f7..10c67ec7480a 100644
--- a/app/services/workflows/bulk_update_service.rb
+++ b/app/services/workflows/bulk_update_service.rb
@@ -62,8 +62,8 @@ def build_workflows(status_transitions)
role:,
old_status: status_map[status_id.to_i],
new_status: status_map[new_status_id.to_i],
- author: options_include(options, "author"),
- assignee: options_include(options, "assignee"))
+ author: options_include(options, 'author'),
+ assignee: options_include(options, 'assignee'))
end
end
@@ -88,6 +88,6 @@ def status_map
end
def options_include(options, string)
- options.is_a?(Array) && options.include?(string) && !options.include?("always")
+ options.is_a?(Array) && options.include?(string) && !options.include?('always')
end
end
diff --git a/app/uploaders/direct_fog_uploader.rb b/app/uploaders/direct_fog_uploader.rb
index 0dadbe1b1d88..ceeba259503e 100644
--- a/app/uploaders/direct_fog_uploader.rb
+++ b/app/uploaders/direct_fog_uploader.rb
@@ -1,4 +1,4 @@
-require_relative "fog_file_uploader"
+require_relative 'fog_file_uploader'
class DirectFogUploader < FogFileUploader
include CarrierWaveDirect::Uploader
@@ -56,14 +56,14 @@ def extra_fog_hash_attributes(uploader:)
return {} unless include_content_type?(uploader)
{
- "Content-Type": uploader.fog_attributes[:"Content-Type"]
+ 'Content-Type': uploader.fog_attributes[:'Content-Type']
}
end
private
def include_content_type?(uploader)
- uploader.will_include_content_type && uploader.fog_attributes.include?(:"Content-Type")
+ uploader.will_include_content_type && uploader.fog_attributes.include?(:'Content-Type')
end
def direct_fog_hash_uploader(attachment, success_action_redirect, success_action_status)
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index 62db04ecfe0d..712ee656b019 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -93,7 +93,7 @@ def delete_old_tmp_file(_dummy)
module ClassMethods
def cache_dir
- @cache_dir ||= File.join(Dir.tmpdir, "op_uploaded_files")
+ @cache_dir ||= File.join(Dir.tmpdir, 'op_uploaded_files')
end
end
end
diff --git a/app/uploaders/fog_file_uploader.rb b/app/uploaders/fog_file_uploader.rb
index 9349402b6b33..72045c68ab00 100644
--- a/app/uploaders/fog_file_uploader.rb
+++ b/app/uploaders/fog_file_uploader.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "carrierwave/storage/fog"
+require 'carrierwave/storage/fog'
class FogFileUploader < CarrierWave::Uploader::Base
include FileUploader
@@ -64,7 +64,7 @@ def fog_attributes
return super if content_type.blank?
- super.merge "Content-Type": content_type
+ super.merge 'Content-Type': content_type
end
##
diff --git a/app/uploaders/local_file_uploader.rb b/app/uploaders/local_file_uploader.rb
index a3e3fb90eab7..0e43004706cc 100644
--- a/app/uploaders/local_file_uploader.rb
+++ b/app/uploaders/local_file_uploader.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "fileutils"
+require 'fileutils'
class LocalFileUploader < CarrierWave::Uploader::Base
include FileUploader
diff --git a/app/validators/json_validator.rb b/app/validators/json_validator.rb
index c9aeeae94ab9..96f501ca6f39 100644
--- a/app/validators/json_validator.rb
+++ b/app/validators/json_validator.rb
@@ -65,19 +65,19 @@ def schema(record, schema = nil)
end
def add_error(record, error)
- data_pointer, type, schema = error.values_at("data_pointer", "type", "schema")
- path = data_pointer.split("/", 3)[1..]
+ data_pointer, type, schema = error.values_at('data_pointer', 'type', 'schema')
+ path = data_pointer.split('/', 3)[1..]
case type
- when "required"
+ when 'required'
add_blank_error(record, error, path)
- when "null", "string", "boolean", "integer", "number", "array", "object"
+ when 'null', 'string', 'boolean', 'integer', 'number', 'array', 'object'
add_type_mismatch_error(record, path, type)
- when "schema"
+ when 'schema'
add_schema_violated_error(record, path)
- when "format"
- add_format_error(record, path, schema.fetch("format"))
- when "enum"
+ when 'format'
+ add_format_error(record, path, schema.fetch('format'))
+ when 'enum'
add_enum_error(record, path)
else
add_invalid_error(record, path)
@@ -85,13 +85,13 @@ def add_error(record, error)
end
def add_blank_error(record, error, path)
- keys = error.dig("details", "missing_keys")
+ keys = error.dig('details', 'missing_keys')
keys.each do |key|
if path.nil?
record.errors.add(key, :blank)
else
- record.errors.add(path[0], :blank_nested, property: (path[1..] + [key]).join("/"))
+ record.errors.add(path[0], :blank_nested, property: (path[1..] + [key]).join('/'))
end
end
end
diff --git a/app/validators/secure_context_uri_validator.rb b/app/validators/secure_context_uri_validator.rb
index 8eb2df613a4e..a76bb140ecbf 100644
--- a/app/validators/secure_context_uri_validator.rb
+++ b/app/validators/secure_context_uri_validator.rb
@@ -51,8 +51,8 @@ def validate_each(contract, attribute, value)
end
def self.secure_context_uri?(uri)
- return true if uri.scheme == "https" # https is always safe
- return true if uri.host == "localhost" # Simple localhost
+ return true if uri.scheme == 'https' # https is always safe
+ return true if uri.host == 'localhost' # Simple localhost
return true if /\.localhost\.?$/.match?(uri.host) # i.e. 'foo.localhost' or 'foo.localhost.'
# Check for loopback interface. The constructor can throw an exception for non IP addresses.
diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb
index 812927a7166d..73a8238c41ab 100644
--- a/app/validators/url_validator.rb
+++ b/app/validators/url_validator.rb
@@ -8,7 +8,7 @@ def validate_each(record, attribute, value)
if url.nil?
record.errors.add(attribute, :invalid_url)
elsif !allowed_protocols.include?(url.scheme)
- record.errors.add(attribute, :invalid_url_scheme, allowed_schemes: allowed_protocols.join(", "))
+ record.errors.add(attribute, :invalid_url_scheme, allowed_schemes: allowed_protocols.join(', '))
end
end
diff --git a/app/views/account/_footer.html.erb b/app/views/account/_footer.html.erb
index 5e9581443443..bd0de28b4d1f 100644
--- a/app/views/account/_footer.html.erb
+++ b/app/views/account/_footer.html.erb
@@ -3,6 +3,6 @@
<% if footer = registration_footer %>
<%= footer %>
<% end %>
- <%= styled_button_tag t(:button_create), class: 'button_no-margin -primary -with-icon icon-checkmark spot-action-bar--action' %>
+ <%= styled_button_tag t(:button_create), class: 'button_no-margin -highlight -with-icon icon-checkmark spot-action-bar--action' %>
diff --git a/app/views/account/_login.html.erb b/app/views/account/_login.html.erb
index f14f204318f0..05d3b052839b 100644
--- a/app/views/account/_login.html.erb
+++ b/app/views/account/_login.html.erb
@@ -77,7 +77,7 @@ See COPYRIGHT and LICENSE files for more details.
+ value="<%=t(:button_login)%>" class="button -highlight button_no-margin" tabindex="1" />
diff --git a/app/views/account/_password_login_form.html.erb b/app/views/account/_password_login_form.html.erb
index b40d8496fb78..53e6283775ef 100644
--- a/app/views/account/_password_login_form.html.erb
+++ b/app/views/account/_password_login_form.html.erb
@@ -55,10 +55,11 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= submit_tag t(:button_login),
- name: :login,
- class: 'button -primary button_no-margin',
- data: { disable_with: t(:label_loading) } %>
+
<% end %>
+ data-modal-class-name="registration-modal -highlight">
<% @user ||= User.new %>
<%= render partial: '/account/register' %>
diff --git a/app/views/account/consent.html.erb b/app/views/account/consent.html.erb
index 854a18edaae8..6a5548fa8825 100644
--- a/app/views/account/consent.html.erb
+++ b/app/views/account/consent.html.erb
@@ -36,7 +36,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= form_tag(account_confirm_consent_path, method: :post, class: "form -wide-labels") do %>
<%= render partial: 'user_consent_check' %>
diff --git a/app/views/account/password_recovery.html.erb b/app/views/account/password_recovery.html.erb
index e2caa6d63f9a..2dabec0e329f 100644
--- a/app/views/account/password_recovery.html.erb
+++ b/app/views/account/password_recovery.html.erb
@@ -48,5 +48,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb
index f124715ef1af..4e570b8f8e81 100644
--- a/app/views/account/register.html.erb
+++ b/app/views/account/register.html.erb
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
+ data-modal-class-name="registration-modal -highlight">
<% @user ||= User.new %>
<%= render partial: '/account/register' %>
diff --git a/app/views/activities/menu.html.erb b/app/views/activities/menu.html.erb
index 7d53b57a0a96..1da1d1d78efb 100644
--- a/app/views/activities/menu.html.erb
+++ b/app/views/activities/menu.html.erb
@@ -27,7 +27,7 @@
<%= hidden_field_tag('user_id', params[:user_id]) if params[:user_id].present? %>
<%= hidden_field_tag('from', params[:from]) if params[:from].present? %>
<%= submit_tag t(:button_apply),
- class: 'button -small -primary',
+ class: 'button -small -highlight',
name: nil %>
<% end %>
diff --git a/app/views/admin/backups/reset_token.html.erb b/app/views/admin/backups/reset_token.html.erb
index 91b8977b3af8..2abc3be990af 100644
--- a/app/views/admin/backups/reset_token.html.erb
+++ b/app/views/admin/backups/reset_token.html.erb
@@ -69,7 +69,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag '', class: '-primary', disabled: true do
+ <%= styled_button_tag '', class: '-highlight', disabled: true do
concat content_tag :i, '', class: "button--icon icon-#{icon}"
concat content_tag :span, t("backup.reset_token.action_#{action}"), class: 'button--text'
end %>
diff --git a/app/views/admin/backups/show.html.erb b/app/views/admin/backups/show.html.erb
index c17f8d8a0ffe..071e15aea84d 100644
--- a/app/views/admin/backups/show.html.erb
+++ b/app/views/admin/backups/show.html.erb
@@ -36,7 +36,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
link_to(
{ action: 'reset_token' },
- class: 'button -primary',
+ class: 'button -alt-highlight',
aria: {label: label},
title: label
) do
@@ -52,7 +52,7 @@ See COPYRIGHT and LICENSE files for more details.
link_to(
{ action: 'delete_token' },
method: :post,
- class: 'button -primary',
+ class: 'button -alt-highlight',
aria: {label: label},
title: label
) do
diff --git a/app/views/admin/plugins.html.erb b/app/views/admin/plugins.html.erb
index 5ad7fe0851f0..2343204c7d44 100644
--- a/app/views/admin/plugins.html.erb
+++ b/app/views/admin/plugins.html.erb
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_administration), t(:label_plugins) %>
-<%= toolbar title: t(:label_plugins) %>
+<%= toolbar title: t(:label_modules_and_plugins) %>
<% if @plugins.any? %>
@@ -88,6 +88,5 @@ See COPYRIGHT and LICENSE files for more details.
<% else %>
- <%= no_results_box display_action: true,
- action_url: OpenProject::Static::Links.url_for(:integrations) %>
+ <%= no_results_box %>
<% end %>
diff --git a/app/views/admin/settings/aggregation_settings/show.html.erb b/app/views/admin/settings/aggregation_settings/show.html.erb
index 2e7fc0b2b362..dbd45c84e3f4 100644
--- a/app/views/admin/settings/aggregation_settings/show.html.erb
+++ b/app/views/admin/settings/aggregation_settings/show.html.erb
@@ -47,5 +47,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/api_settings/show.html.erb b/app/views/admin/settings/api_settings/show.html.erb
index 1f3e78ea358b..c2b2a97efe50 100644
--- a/app/views/admin/settings/api_settings/show.html.erb
+++ b/app/views/admin/settings/api_settings/show.html.erb
@@ -39,14 +39,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= t(:setting_apiv3_max_page_instructions_html) %>
-
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/attachments_settings/show.html.erb b/app/views/admin/settings/attachments_settings/show.html.erb
index 2b4cac263e6f..d4b4570fc11f 100644
--- a/app/views/admin/settings/attachments_settings/show.html.erb
+++ b/app/views/admin/settings/attachments_settings/show.html.erb
@@ -46,5 +46,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/authentication_settings/show.html.erb b/app/views/admin/settings/authentication_settings/show.html.erb
index afe95a411bea..a64f210f8f10 100644
--- a/app/views/admin/settings/authentication_settings/show.html.erb
+++ b/app/views/admin/settings/authentication_settings/show.html.erb
@@ -132,5 +132,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to t(:label_ldap_authentication), {controller: '/ldap_auth_sources', action: 'index'}, class: 'icon icon-server-key' %>
<% end %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/date_format_settings/show.html.erb b/app/views/admin/settings/date_format_settings/show.html.erb
index f4be58a351c4..9f3e79b44e42 100644
--- a/app/views/admin/settings/date_format_settings/show.html.erb
+++ b/app/views/admin/settings/date_format_settings/show.html.erb
@@ -64,5 +64,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/experimental_settings/show.html.erb b/app/views/admin/settings/experimental_settings/show.html.erb
index 99fb53c6018f..4ce41f32a1ef 100644
--- a/app/views/admin/settings/experimental_settings/show.html.erb
+++ b/app/views/admin/settings/experimental_settings/show.html.erb
@@ -48,7 +48,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_save),
- class: '-primary -with-icon icon-checkmark',
+ class: '-highlight -with-icon icon-checkmark',
data: {
confirm: t("settings.experimental.save_confirmation")
} %>
diff --git a/app/views/admin/settings/general_settings/show.html.erb b/app/views/admin/settings/general_settings/show.html.erb
index 9c5bd2ca856b..0c0aac2d1f51 100644
--- a/app/views/admin/settings/general_settings/show.html.erb
+++ b/app/views/admin/settings/general_settings/show.html.erb
@@ -83,5 +83,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= setting_check_box :welcome_on_homescreen %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/icalendar_settings/show.html.erb b/app/views/admin/settings/icalendar_settings/show.html.erb
index 238c654a051a..518f84d4193f 100644
--- a/app/views/admin/settings/icalendar_settings/show.html.erb
+++ b/app/views/admin/settings/icalendar_settings/show.html.erb
@@ -44,5 +44,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/incoming_mails_settings/show.html.erb b/app/views/admin/settings/incoming_mails_settings/show.html.erb
index 690ea3f3a510..779cb84a904c 100644
--- a/app/views/admin/settings/incoming_mails_settings/show.html.erb
+++ b/app/views/admin/settings/incoming_mails_settings/show.html.erb
@@ -47,5 +47,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/languages_settings/show.html.erb b/app/views/admin/settings/languages_settings/show.html.erb
index 5d7f1de8e979..9646f9f00f63 100644
--- a/app/views/admin/settings/languages_settings/show.html.erb
+++ b/app/views/admin/settings/languages_settings/show.html.erb
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_save),
- class: '-primary -with-icon icon-checkmark',
+ class: '-highlight -with-icon icon-checkmark',
disabled: !Setting.available_languages_writable?
%>
<% end %>
diff --git a/app/views/admin/settings/mail_notifications_settings/show.html.erb b/app/views/admin/settings/mail_notifications_settings/show.html.erb
index ecf4e2ad6afe..d7851ff20687 100644
--- a/app/views/admin/settings/mail_notifications_settings/show.html.erb
+++ b/app/views/admin/settings/mail_notifications_settings/show.html.erb
@@ -85,7 +85,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end unless OpenProject::Configuration['email_delivery_configuration'] == 'legacy' %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% if @deliveries %>
diff --git a/app/views/admin/settings/projects_settings/show.html.erb b/app/views/admin/settings/projects_settings/show.html.erb
index b81e0a93a2dd..7aa2f0dbd842 100644
--- a/app/views/admin/settings/projects_settings/show.html.erb
+++ b/app/views/admin/settings/projects_settings/show.html.erb
@@ -100,5 +100,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/repositories_settings/show.html.erb b/app/views/admin/settings/repositories_settings/show.html.erb
index ae0b5f907479..b6c6cdf0ef76 100644
--- a/app/views/admin/settings/repositories_settings/show.html.erb
+++ b/app/views/admin/settings/repositories_settings/show.html.erb
@@ -136,5 +136,5 @@ See COPYRIGHT and LICENSE files for more details.
disabled: !Setting.commit_logtime_enabled?,
container_class: '-middle' %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/show_plugin.html.erb b/app/views/admin/settings/show_plugin.html.erb
index a71d7bb630f8..c1bc59753092 100644
--- a/app/views/admin/settings/show_plugin.html.erb
+++ b/app/views/admin/settings/show_plugin.html.erb
@@ -30,6 +30,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_form_tag({controller: '/admin/settings', action: 'update_plugin' }) do %>
<%= render partial: @partial, locals: {settings: @settings}%>
- <%= styled_submit_tag t(:button_apply), class: '-primary' %>
+ <%= styled_submit_tag t(:button_apply), class: '-highlight' %>
<% end %>
diff --git a/app/views/admin/settings/users_settings/show.html.erb b/app/views/admin/settings/users_settings/show.html.erb
index 28359cedad8e..cb0faf1d4671 100644
--- a/app/views/admin/settings/users_settings/show.html.erb
+++ b/app/views/admin/settings/users_settings/show.html.erb
@@ -105,5 +105,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/virus_scanning_settings/show.html.erb b/app/views/admin/settings/virus_scanning_settings/show.html.erb
index 15a4fc77c6be..b177363e74ba 100644
--- a/app/views/admin/settings/virus_scanning_settings/show.html.erb
+++ b/app/views/admin/settings/virus_scanning_settings/show.html.erb
@@ -65,5 +65,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'av_form', locals: { selected: Setting.antivirus_scan_mode } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/admin/settings/work_packages_settings/show.html.erb b/app/views/admin/settings/work_packages_settings/show.html.erb
index a0826dff7ea9..6ffc38f88cc2 100644
--- a/app/views/admin/settings/work_packages_settings/show.html.erb
+++ b/app/views/admin/settings/work_packages_settings/show.html.erb
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
} %>
<% if EnterpriseToken.allows_to? :conditional_highlighting %>
-
<% end %>
- <%= submit_tag t(:button_apply), class: 'button -primary' %>
+ <%= submit_tag t(:button_apply), class: 'button -highlight' %>
<%= link_to t(:button_cancel), project_settings_categories_path(@project), class: 'button' %>
<% end %>
diff --git a/app/views/categories/edit.html.erb b/app/views/categories/edit.html.erb
index 6cbc6aff4986..ad6e532836a0 100644
--- a/app/views/categories/edit.html.erb
+++ b/app/views/categories/edit.html.erb
@@ -29,5 +29,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: Category.model_name.human %>
<%= labelled_tabular_form_for @category, as: :category do |f| %>
<%= render partial: 'categories/form', locals: { f: f } %>
- <%= f.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/categories/new.html.erb b/app/views/categories/new.html.erb
index 683d5d4f82df..aaa02e7a9f07 100644
--- a/app/views/categories/new.html.erb
+++ b/app/views/categories/new.html.erb
@@ -29,5 +29,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_work_package_category_new) %>
<%= labelled_tabular_form_for [@project, @category], as: :category do |f| %>
<%= render partial: 'categories/form', locals: { f: f } %>
- <%= f.button t(:button_create), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_create), class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/colors/_form.html.erb b/app/views/colors/_form.html.erb
index 182c71e26975..3d4cb7ae788b 100644
--- a/app/views/colors/_form.html.erb
+++ b/app/views/colors/_form.html.erb
@@ -64,5 +64,5 @@ See COPYRIGHT and LICENSE files for more details.
-<%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+<%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), colors_path, class: 'button -with-icon icon-cancel' %>
diff --git a/app/views/colors/confirm_destroy.html.erb b/app/views/colors/confirm_destroy.html.erb
index d61560857c9b..e66e15b680b1 100644
--- a/app/views/colors/confirm_destroy.html.erb
+++ b/app/views/colors/confirm_destroy.html.erb
@@ -47,6 +47,6 @@ See COPYRIGHT and LICENSE files for more details.
- <%= submit_tag t(:button_delete), class: 'button -primary' %>
+ <%= submit_tag t(:button_delete), class: 'button -highlight' %>
<%= link_to t(:button_cancel), colors_path, class: 'button' %>
<% end %>
diff --git a/app/views/colors/index.html.erb b/app/views/colors/index.html.erb
index 9ab599846318..06dee2929b6b 100644
--- a/app/views/colors/index.html.erb
+++ b/app/views/colors/index.html.erb
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_color_plural) do %>
<%= link_to new_color_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t('.label_new_color')},
title: t('.label_new_color')} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builder
index 8faa7a4afe6c..a4681450af54 100644
--- a/app/views/common/feed.atom.builder
+++ b/app/views/common/feed.atom.builder
@@ -35,7 +35,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title truncate_single_line(@title, length: 100)
xml.link "rel" => "self", "href" => url_for(only_path: false)
xml.link "rel" => "alternate", "href" => url_for(only_path: false, format: nil, key: nil)
- xml.id url_for(controller: "/homescreen", action: :index, only_path: false)
+ xml.id url_for(controller: '/homescreen', action: :index, only_path: false)
xml.updated(updated_time.xmlschema)
xml.author { xml.name Setting.app_title }
xml.generator(uri: OpenProject::Info.url) { xml.text! OpenProject::Info.app_name }
diff --git a/app/views/common/upsale.html.erb b/app/views/common/upsale.html.erb
index 503f19ece9dd..956dae8ecbf6 100644
--- a/app/views/common/upsale.html.erb
+++ b/app/views/common/upsale.html.erb
@@ -49,7 +49,7 @@
<% end %>
<%= link_to(OpenProject::Static::Links.links[:pricing][:href],
- { class: 'button -primary',
+ { class: 'button -highlight',
aria: {label: t('admin.enterprise.buttons.upgrade')},
target: '_blank',
title: t('admin.enterprise.buttons.upgrade')}) do %>
diff --git a/app/views/custom_actions/edit.html.erb b/app/views/custom_actions/edit.html.erb
index 8497d6473bbd..cc30bcac8f8b 100644
--- a/app/views/custom_actions/edit.html.erb
+++ b/app/views/custom_actions/edit.html.erb
@@ -36,5 +36,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @custom_action do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/custom_actions/index.html.erb b/app/views/custom_actions/index.html.erb
index 198a980abfd6..102406b6f627 100644
--- a/app/views/custom_actions/index.html.erb
+++ b/app/views/custom_actions/index.html.erb
@@ -2,7 +2,7 @@
<%= toolbar title: t('custom_actions.plural') do %>
<%= link_to new_custom_action_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: { label: t('custom_actions.new') },
title: t('custom_actions.new') } do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/custom_actions/new.html.erb b/app/views/custom_actions/new.html.erb
index a836500870ea..a0111056ccc4 100644
--- a/app/views/custom_actions/new.html.erb
+++ b/app/views/custom_actions/new.html.erb
@@ -36,5 +36,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @custom_action do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/custom_fields/edit.html.erb b/app/views/custom_fields/edit.html.erb
index 9281171675d5..563354707b13 100644
--- a/app/views/custom_fields/edit.html.erb
+++ b/app/views/custom_fields/edit.html.erb
@@ -44,5 +44,5 @@ See COPYRIGHT and LICENSE files for more details.
url: custom_field_path(@custom_field),
html: {method: :put, id: 'custom_field_form'} do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/custom_fields/index.html.erb b/app/views/custom_fields/index.html.erb
index 8b87fbce3438..0466c66b52ab 100644
--- a/app/views/custom_fields/index.html.erb
+++ b/app/views/custom_fields/index.html.erb
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_custom_field_plural) do %>
<%= link_to new_custom_field_path(type: selected_tab(custom_fields_tabs)[:name]),
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_custom_field_new)},
title: t(:label_custom_field_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/custom_fields/new.html.erb b/app/views/custom_fields/new.html.erb
index 38820445911d..7bfb0bae8230 100644
--- a/app/views/custom_fields/new.html.erb
+++ b/app/views/custom_fields/new.html.erb
@@ -43,5 +43,5 @@ See COPYRIGHT and LICENSE files for more details.
html: {id: 'custom_field_form', class: "-wide-labels"} do |f| %>
<%= render partial: 'form', locals: { f: f } %>
<%= hidden_field_tag 'type', @custom_field.type %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/custom_styles/_inline_css.erb b/app/views/custom_styles/_inline_css.erb
index 7ab9ebb63089..4e2ca2f2af2f 100644
--- a/app/views/custom_styles/_inline_css.erb
+++ b/app/views/custom_styles/_inline_css.erb
@@ -37,14 +37,16 @@ See COPYRIGHT and LICENSE files for more details.
<% if design_color.variable == "main-menu-border-color" %>
--main-menu-border-width: 1px;
<% end %>
- <% if design_color.variable == "primary-button-color" %>
- --primary-button-color--major1: <%= design_color.darken 0.18 %>;
+ <% if design_color.variable == "alternative-color" %>
+ --button--alt-highlight-background-hover-color: <%= design_color.darken 0.18 %>;
<% end %>
- <% if design_color.variable == "accent-color" %>
- --accent-color--major1: <%= design_color.darken 0.2 %>;
- --accent-color--major2: <%= design_color.darken 0.4 %>;
- --accent-color--minor1: <%= design_color.lighten 0.8 %>;
- --accent-color--minor2: <%= design_color.lighten 0.6 %>;
+ <% if design_color.variable == "primary-color" %>
+ --primary-color--minor1: <%= design_color.lighten 0.3 %>;
+ --primary-color--minor2: <%= design_color.lighten 0.6 %>;
+ --primary-color--minor3: <%= design_color.lighten 0.8 %>;
+ --primary-color--major1: <%= design_color.darken 0.2 %>;
+ --primary-color--major2: <%= design_color.darken 0.4 %>;
+ --primary-color--major3: <%= design_color.darken 0.6 %>;
<% end %>
<% end %>
}
diff --git a/app/views/custom_styles/_inline_css_logo.erb b/app/views/custom_styles/_inline_css_logo.erb
index 9ac46c69ed8a..8059da75e50b 100644
--- a/app/views/custom_styles/_inline_css_logo.erb
+++ b/app/views/custom_styles/_inline_css_logo.erb
@@ -32,7 +32,6 @@ See COPYRIGHT and LICENSE files for more details.
<%
logo_url = asset_path("logo_openproject_white_big.png")
high_contrast_logo_url = asset_path("logo_openproject.png")
- high_contrast_bim_logo_url = asset_path("bim/logo_openproject_bim_big_coloured.png")
if apply_custom_styles?
if CustomStyle.current.logo.present?
@@ -48,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
}
.op-logo--link_high_contrast {
- background-image: url(<%= OpenProject::Configuration.bim? ? high_contrast_bim_logo_url : high_contrast_logo_url %>);
+ background-image: url(<%= high_contrast_logo_url %>);
}
<% end %>
diff --git a/app/views/custom_styles/_primer_color_mapping.erb b/app/views/custom_styles/_primer_color_mapping.erb
index 424b9edb4199..0286ded552bf 100644
--- a/app/views/custom_styles/_primer_color_mapping.erb
+++ b/app/views/custom_styles/_primer_color_mapping.erb
@@ -8,10 +8,9 @@
/* Override Primer variable to ensure compatibility with currently
configured design outside of high contrast mode */
[data-color-mode]:not([data-light-theme=light_high_contrast]) {
- --color-accent-fg: var(--accent-color) !important;
- --control-checked-bgColor-rest: var(--control-checked-color) !important;
- --button-primary-bgColor-rest: var(--button--primary-background-color) !important;
- --button-primary-bgColor-hover: var(--button--primary-background-hover-color) !important;
+ --color-accent-fg: var(--content-link-color) !important;
+ --button-primary-bgColor-rest: var(--button--alt-highlight-background-color); !important;
+ --button-primary-bgColor-hover: var(--button--alt-highlight-background-hover-color) !important;
}
[data-light-theme=light_high_contrast]{
--avatar-border-color: var(--color-avatar-border);
@@ -42,13 +41,15 @@
--main-menu-fieldset-header-color: var(--color-fg-subtle) !important;
--main-menu-border-width: 1px;
--button--border-color: var(--color-border-default);
- --button--primary-background-hover-color: var(--color-btn-primary-hover-bg);
- --button--primary-background-color: var(--color-btn-primary-bg);
+ --button--alt-highlight-background-hover-color: var(--color-btn-primary-hover-bg);
+ --button--alt-highlight-background-color: var(--color-btn-primary-bg);
--button--active-border-color: var(--color-border-default);
--button--background-hover-color: var(--color-btn-hover-bg);
--button--background-color: var(--color-btn-bg);
- --accent-color: var(--color-accent-fg);
- --primary-button-color: var(--color-btn-primary-bg);
+ --button--highlight-background-color: var(--color-btn-primary-bg);
+ --button--highlight-background-hover-color: var(--color-btn-primary-hover-bg);
+ --content-link-color: var(--color-accent-fg);
+ --alternative-color: var(--color-btn-primary-bg);
--status-selector-border-color: var(--button--border-color);
--link-text-decoration: underline;
}
diff --git a/app/views/doorkeeper/authorizations/new.html.erb b/app/views/doorkeeper/authorizations/new.html.erb
index 4b9ec3090f7b..e8cb1f739c1f 100644
--- a/app/views/doorkeeper/authorizations/new.html.erb
+++ b/app/views/doorkeeper/authorizations/new.html.erb
@@ -34,7 +34,7 @@
<%= hidden_field_tag :scope, @pre_auth.scope %>
<%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
<%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
- <%= submit_tag t('oauth.authorization_dialog.authorize'), class: "button -primary -expand" %>
+ <%= submit_tag t('oauth.authorization_dialog.authorize'), class: "button -highlight -expand" %>
<% end %>
<%= form_tag oauth_authorization_path, method: :delete do %>
diff --git a/app/views/enterprises/_form.html.erb b/app/views/enterprises/_form.html.erb
index 2da2486690f3..087ea215e4d3 100644
--- a/app/views/enterprises/_form.html.erb
+++ b/app/views/enterprises/_form.html.erb
@@ -19,7 +19,7 @@
spellcheck: false %>
- <%= styled_button_tag t(:button_save), id: 'token-submit-button', class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), id: 'token-submit-button', class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), { action: :show }, class: 'button -with-icon icon-cancel' %>
<% end %>
<% end %>
diff --git a/app/views/enumerations/destroy.html.erb b/app/views/enumerations/destroy.html.erb
index a7c8958518d7..587b6a1291a3 100644
--- a/app/views/enumerations/destroy.html.erb
+++ b/app/views/enumerations/destroy.html.erb
@@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_submit_tag t(:button_apply), class: '-primary' %>
+ <%= styled_submit_tag t(:button_apply), class: '-highlight' %>
<%= link_to t(:button_cancel), { controller: '/enumerations', action: 'index' },
class: 'button' %>
<% end %>
diff --git a/app/views/enumerations/edit.html.erb b/app/views/enumerations/edit.html.erb
index ade18a3f67b4..2b23d1887b8e 100644
--- a/app/views/enumerations/edit.html.erb
+++ b/app/views/enumerations/edit.html.erb
@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @enumeration do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
<%= styled_form_tag(enumeration_path(@enumeration), method: :delete) do %>
diff --git a/app/views/enumerations/new.html.erb b/app/views/enumerations/new.html.erb
index 0f919ce7ee41..324203a1f22e 100644
--- a/app/views/enumerations/new.html.erb
+++ b/app/views/enumerations/new.html.erb
@@ -32,5 +32,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= breadcrumb_toolbar t(:label_enumeration_new) %>
<%= labelled_tabular_form_for @enumeration do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb
index 59d724ea6697..58cdd8a90048 100644
--- a/app/views/forums/edit.html.erb
+++ b/app/views/forums/edit.html.erb
@@ -30,6 +30,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for [@project, @forum] do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= f.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), project_forums_path(@project), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index 2f0d761762a5..d3add7f3a478 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to(new_project_forum_path(@project),
{ aria: { label: t(:label_forum_new) },
title: t(:label_forum_new),
- class: 'button -primary' }) do %>
+ class: 'button -alt-highlight' }) do %>
<%= op_icon('button--icon icon-add') %>
<%= t('activerecord.models.forum') %>
<% end %>
diff --git a/app/views/forums/new.html.erb b/app/views/forums/new.html.erb
index c17d6bc30a73..b46a46476b5f 100644
--- a/app/views/forums/new.html.erb
+++ b/app/views/forums/new.html.erb
@@ -31,6 +31,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for [@project, @forum] do |f| %>
<%= render partial: 'form', locals: {f: f} %>
- <%= f.button t(:button_create), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_create), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), project_forums_path(@project), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index cc1136287572..eed48f95f43e 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'messages/form', locals: {f: f} %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), '', class: 'cancel-add-message-button button -with-icon icon-cancel' %>
<% csp_onclick('jQuery("#add-message").hide();', '.cancel-add-message-button') %>
<% end %>
@@ -50,7 +50,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if authorize_for(:messages, :new) %>
<%= link_to({controller: '/messages', action: 'new', forum_id: @forum},
- {class: 'add-message-button button -primary',
+ {class: 'add-message-button button -alt-highlight',
aria: {label: t(:label_message_new)},
title: t(:label_message_new)}) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/groups/_general.html.erb b/app/views/groups/_general.html.erb
index 06238c28cab2..597256d4f5cf 100644
--- a/app/views/groups/_general.html.erb
+++ b/app/views/groups/_general.html.erb
@@ -29,5 +29,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @group, url: group_path(@group), html: {method: :put}, as: :group do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb
index 03364ee2adc1..cbb4dd062039 100644
--- a/app/views/groups/_memberships.html.erb
+++ b/app/views/groups/_memberships.html.erb
@@ -95,7 +95,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= submit_tag t(:button_change), class: 'button -primary -small' %>
+ <%= submit_tag t(:button_change), class: 'button -highlight -small' %>
<%= link_to_function t(:button_cancel), "jQuery('#member-#{membership.id}-roles').show(); jQuery('#member-#{membership.id}-roles-form').hide();",
class: 'button -small' %>
@@ -146,7 +146,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labeled_check_box_tags 'membership[role_ids][]', roles %>
- <%= styled_button_tag t(:button_add), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_add), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
<% end %>
diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb
index cb511e6762d4..32fd094c0e8b 100644
--- a/app/views/groups/_users.html.erb
+++ b/app/views/groups/_users.html.erb
@@ -62,7 +62,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_add),
- class: '-primary -with-icon icon-checkmark' %>
+ class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb
index e0894b0a9918..5a6c29f31355 100644
--- a/app/views/groups/index.html.erb
+++ b/app/views/groups/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_group_plural) do %>
<%= link_to new_group_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_group_new)},
title: t(:label_group_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/groups/new.html.erb b/app/views/groups/new.html.erb
index ef6c1e256e03..b4bbdf816a4c 100644
--- a/app/views/groups/new.html.erb
+++ b/app/views/groups/new.html.erb
@@ -33,5 +33,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for(@group) do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= f.button t(:button_create), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_create), class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/homescreen/blocks/_projects.html.erb b/app/views/homescreen/blocks/_projects.html.erb
index f8cfc7ebf327..59d6dc83d78e 100644
--- a/app/views/homescreen/blocks/_projects.html.erb
+++ b/app/views/homescreen/blocks/_projects.html.erb
@@ -19,7 +19,7 @@
<% if User.current.allowed_globally?(:add_project) %>
<%= link_to new_project_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_project_new)},
title: t(:label_project_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/homescreen/blocks/_upsale.html.erb b/app/views/homescreen/blocks/_upsale.html.erb
index 5acad4a2b83b..826cec5ced76 100644
--- a/app/views/homescreen/blocks/_upsale.html.erb
+++ b/app/views/homescreen/blocks/_upsale.html.erb
@@ -30,7 +30,7 @@
<% end %>
<%= link_to(OpenProject::Static::Links.links[:pricing][:href],
- class: 'button -primary',
+ class: 'button -highlight',
target: '_blank',
rel: 'noopener') do %>
<%= spot_icon('enterprise-addons') %>
@@ -38,6 +38,6 @@
<% end %>
<% if current_user.admin? %>
- <%= link_to t('js.admin.enterprise.upsale.button_start_trial'), enterprise_path, class: 'button -primary' %>
+ <%= link_to t('js.admin.enterprise.upsale.button_start_trial'), enterprise_path, class: 'button -alt-highlight' %>
<% end %>
diff --git a/app/views/homescreen/blocks/_users.html.erb b/app/views/homescreen/blocks/_users.html.erb
index 2bc2b31a58f4..26f040708c1e 100644
--- a/app/views/homescreen/blocks/_users.html.erb
+++ b/app/views/homescreen/blocks/_users.html.erb
@@ -15,7 +15,7 @@
<% if User.current.admin? %>
- <%= link_to new_user_path, class: 'button -primary' do %>
+ <%= link_to new_user_path, class: 'button -alt-highlight' do %>
<%= op_icon('button--icon icon-add') %>
<%= t(:label_invite_user) %>
<% end %>
diff --git a/app/views/individual_principals/_memberships.html.erb b/app/views/individual_principals/_memberships.html.erb
index ae758fff8472..e931d16e6180 100644
--- a/app/views/individual_principals/_memberships.html.erb
+++ b/app/views/individual_principals/_memberships.html.erb
@@ -104,7 +104,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= submit_tag t(:button_change), class: 'memberships--edit-submit-button button -primary -small' %>
+
<%= submit_tag t(:button_change), class: 'memberships--edit-submit-button button -highlight -small' %>
<%= link_to_function t(:button_cancel),
"jQuery('.member-#{membership.id}--edit-toggle-item').toggle();",
class: 'button -small' %>
@@ -164,7 +164,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labeled_check_box_tags 'membership[role_ids][]', roles %>
- <%= styled_button_tag t(:button_add), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_add), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
<% end %>
diff --git a/app/views/ldap_auth_sources/edit.html.erb b/app/views/ldap_auth_sources/edit.html.erb
index 11c9bd88faad..2751fdb4cc28 100644
--- a/app/views/ldap_auth_sources/edit.html.erb
+++ b/app/views/ldap_auth_sources/edit.html.erb
@@ -34,6 +34,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @ldap_auth_source do |f| %>
<%= render partial: 'form', locals: { f: f } %>
<% unless @ldap_auth_source.seeded_from_env? %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
<% end %>
diff --git a/app/views/ldap_auth_sources/index.html.erb b/app/views/ldap_auth_sources/index.html.erb
index cf2501c8cf5c..6e4495f8bee3 100644
--- a/app/views/ldap_auth_sources/index.html.erb
+++ b/app/views/ldap_auth_sources/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_ldap_auth_source_plural) do %>
<%= link_to({ action: 'new' },
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_ldap_auth_source_new)},
title: t(:label_ldap_auth_source_new)}) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/ldap_auth_sources/new.html.erb b/app/views/ldap_auth_sources/new.html.erb
index 9440a214ac01..b16c9cb4057e 100644
--- a/app/views/ldap_auth_sources/new.html.erb
+++ b/app/views/ldap_auth_sources/new.html.erb
@@ -33,5 +33,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @ldap_auth_source, as: :ldap_auth_source do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/members/_autocomplete_for_member.html.erb b/app/views/members/_autocomplete_for_member.html.erb
index 7b1dd229b007..6152432580a4 100644
--- a/app/views/members/_autocomplete_for_member.html.erb
+++ b/app/views/members/_autocomplete_for_member.html.erb
@@ -64,6 +64,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_add),
id: 'member-add-submit',
- class: 'button -primary -with-icon icon-checkmark',
+ class: 'button -highlight -with-icon icon-checkmark',
style: roles.any? && (principals.any? && principals.size <= 20) ? "": "display:none" %>
<%= link_to I18n.t('button_cancel'), '', class: 'button -with-icon icon-cancel hide-member-form-button', role: 'button' %>
diff --git a/app/views/members/_member_form.html.erb b/app/views/members/_member_form.html.erb
index 4831a7138396..53f64796c646 100644
--- a/app/views/members/_member_form.html.erb
+++ b/app/views/members/_member_form.html.erb
@@ -94,7 +94,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.button t(:button_add),
- class: 'button -primary -with-icon icon-checkmark',
+ class: 'button -highlight -with-icon icon-checkmark',
id: 'add-member--submit-button' %>
diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb
index 887edb8f3190..b5ceb1997125 100644
--- a/app/views/messages/edit.html.erb
+++ b/app/views/messages/edit.html.erb
@@ -39,7 +39,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= f.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), topic_path(@message), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb
index c46bfac6ed85..c28a1623eb8e 100644
--- a/app/views/messages/new.html.erb
+++ b/app/views/messages/new.html.erb
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= f.button t(:button_create), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_create), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), project_forum_path(@project, @forum), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index 885cd475b28f..1d8957ab75db 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -145,7 +145,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= f.button t(:button_submit), class: 'button -primary -primary -with-icon icon-checkmark' %>
+ <%= f.button t(:button_submit), class: 'button -highlight -highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index db4116c03a2d..ab609a78f434 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -49,31 +49,19 @@ See COPYRIGHT and LICENSE files for more details.
<% login_via_provider = !!@user.identity_url %>
- <% login_via_ldap = !!@user.ldap_auth_source_id %>
- <%= f.text_field :firstname, required: true, container_class: '-middle', disabled: login_via_provider || login_via_ldap %>
+ <%= f.text_field :firstname, required: true, container_class: '-middle', disabled: login_via_provider %>
<% if login_via_provider %>
<%= t('user.text_change_disabled_for_provider_login') %>
<% end %>
- <% if login_via_ldap %>
- <%= t('user.text_change_disabled_for_ldap_login') %>
- <% end %>
- <%= f.text_field :lastname, required: true, container_class: '-middle', disabled: login_via_provider || login_via_ldap %>
+ <%= f.text_field :lastname, required: true, container_class: '-middle', disabled: login_via_provider %>
<% if login_via_provider %>
<%= t('user.text_change_disabled_for_provider_login') %>
<% end %>
- <% if login_via_ldap %>
- <%= t('user.text_change_disabled_for_ldap_login') %>
- <% end %>
-
-
- <%= f.text_field :mail, required: true, container_class: '-middle', disabled: login_via_ldap %>
- <% if login_via_ldap %>
- <%= t('user.text_change_disabled_for_ldap_login') %>
- <% end %>
+ <%= f.text_field :mail, required: true, container_class: '-middle' %>
<%= fields_for :pref, @user.pref, builder: TabularFormBuilder, lang: current_language do |pref_fields| %>
<%= pref_fields.check_box :hide_mail %>
@@ -85,5 +73,5 @@ See COPYRIGHT and LICENSE files for more details.
locals: { form: f, all_fields: true, only_required: false, input_size: '-middle' } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/my/password.html.erb b/app/views/my/password.html.erb
index 9fd43c65af52..f5c1057d333f 100644
--- a/app/views/my/password.html.erb
+++ b/app/views/my/password.html.erb
@@ -40,5 +40,5 @@ See COPYRIGHT and LICENSE files for more details.
locals: { show_user_name: !!(defined? show_user_name) ? show_user_name : nil,
input_size: :middle } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/my/settings.html.erb b/app/views/my/settings.html.erb
index 39563fd12ef7..b0d30f73ab6a 100644
--- a/app/views/my/settings.html.erb
+++ b/app/views/my/settings.html.erb
@@ -41,5 +41,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'users/preferences', locals: { input_size: :middle } %>
<%= call_hook(:view_my_settings, user: @user, form: f) %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb
index 2ad405f686ba..75333d3ddcc0 100644
--- a/app/views/news/edit.html.erb
+++ b/app/views/news/edit.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @news, html: { id: 'news-form' } do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), news_path(@news), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb
index a0ddb1dfc774..0b6000e1374e 100644
--- a/app/views/news/index.html.erb
+++ b/app/views/news/index.html.erb
@@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if managable %>
<%= link_to new_project_news_path(@project),
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
id: 'new_news_link',
aria: {label: t(:label_news_new)},
title: t(:label_news_new)} do %>
diff --git a/app/views/news/new.html.erb b/app/views/news/new.html.erb
index a9e0ee02f289..4153de7dd07c 100644
--- a/app/views/news/new.html.erb
+++ b/app/views/news/new.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for [@project, @news], html: { id: 'news-form' } do |f| %>
<%= render partial: 'news/form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel), project_news_index_path(@project), class: 'button -with-icon icon-cancel' %>
<% end %>
diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb
index dda0aad9e40f..4514b93ca7e8 100644
--- a/app/views/news/show.html.erb
+++ b/app/views/news/show.html.erb
@@ -59,7 +59,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for @news, html: { id: 'news-form' } do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<%= link_to_function t(:button_cancel), 'jQuery("#edit-news").hide()', class: 'button -with-icon icon-cancel'%>
<% end %>
@@ -103,7 +103,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= wikitoolbar_for 'comment_comments', preview_context: preview_context(@news) %>
- <%= submit_tag t(:button_add_comment), class: 'button -primary' %>
+ <%= submit_tag t(:button_add_comment), class: 'button -highlight' %>
<% end %>
<% end %>
diff --git a/app/views/oauth/applications/edit.html.erb b/app/views/oauth/applications/edit.html.erb
index db35803c9adb..c56fe48382e8 100644
--- a/app/views/oauth/applications/edit.html.erb
+++ b/app/views/oauth/applications/edit.html.erb
@@ -39,6 +39,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/oauth/applications/index.html.erb b/app/views/oauth/applications/index.html.erb
index 20f3c4c732c6..47cb78921c1f 100644
--- a/app/views/oauth/applications/index.html.erb
+++ b/app/views/oauth/applications/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t('oauth.application.plural'), title_class: 'no-padding-bottom' do %>
<%= link_to new_oauth_application_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
title: t('oauth.application.new')} do %>
<%= op_icon('button--icon icon-add') %>
<%= t(:button_add) %>
diff --git a/app/views/oauth/applications/new.html.erb b/app/views/oauth/applications/new.html.erb
index c208d363ebcd..1ee51f8ec9ff 100644
--- a/app/views/oauth/applications/new.html.erb
+++ b/app/views/oauth/applications/new.html.erb
@@ -42,6 +42,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/onboarding/_configuration_modal.html.erb b/app/views/onboarding/_configuration_modal.html.erb
index fd68e8b055a4..5ccd69bb4a5f 100644
--- a/app/views/onboarding/_configuration_modal.html.erb
+++ b/app/views/onboarding/_configuration_modal.html.erb
@@ -52,7 +52,7 @@ See COPYRIGHT and LICENSE files for more details.
dynamic-content-modal-close-button
title=<%= t(:button_close) %>
><%= t(:button_close) %>
- <%= styled_button_tag t(:button_save), class: 'button_no-margin -primary -with-icon icon-checkmark spot-action-bar--action' %>
+ <%= styled_button_tag t(:button_save), class: 'button_no-margin -highlight -with-icon icon-checkmark spot-action-bar--action' %>
<% end %>
diff --git a/app/views/placeholder_users/_general.html.erb b/app/views/placeholder_users/_general.html.erb
index 2a46d38c7c92..bafa6138d063 100644
--- a/app/views/placeholder_users/_general.html.erb
+++ b/app/views/placeholder_users/_general.html.erb
@@ -36,5 +36,5 @@ See COPYRIGHT and LICENSE files for more details.
as: :placeholder_user do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/placeholder_users/deletion_info.html.erb b/app/views/placeholder_users/deletion_info.html.erb
index bd1ff038554c..f21bd7365b50 100644
--- a/app/views/placeholder_users/deletion_info.html.erb
+++ b/app/views/placeholder_users/deletion_info.html.erb
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag '', class: '-primary', disabled: true do
+ <%= styled_button_tag '', class: '-highlight', disabled: true do
concat content_tag :i, '', class: 'button--icon icon-delete'
concat content_tag :span, t(:button_delete), class: 'button--text'
end %>
diff --git a/app/views/placeholder_users/index.html.erb b/app/views/placeholder_users/index.html.erb
index 541b8a89ab72..6e3b83a1cc95 100644
--- a/app/views/placeholder_users/index.html.erb
+++ b/app/views/placeholder_users/index.html.erb
@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_placeholder_user_plural), title_class: 'no-padding-bottom' do %>
<%= link_to new_placeholder_user_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: { label: t(:label_placeholder_user_new) },
title: t(:label_placeholder_user_new) } do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/placeholder_users/new.html.erb b/app/views/placeholder_users/new.html.erb
index b8f1a4e4dffd..8d0a09cd206a 100644
--- a/app/views/placeholder_users/new.html.erb
+++ b/app/views/placeholder_users/new.html.erb
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'form', locals: { f: f, placeholder_user: @placeholder_user } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
- <%= styled_button_tag t(:button_create_and_continue), name: 'continue', class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create_and_continue), name: 'continue', class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/projects/_toolbar.html.erb b/app/views/projects/_toolbar.html.erb
index d31df7c88e3c..49fba78032ef 100644
--- a/app/views/projects/_toolbar.html.erb
+++ b/app/views/projects/_toolbar.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if User.current.allowed_in_project?(:add_subprojects, @project) %>
<%= link_to new_project_path(parent_id: @project.id),
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_subproject_new)},
title: t(:label_subproject_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/projects/destroy_info.html.erb b/app/views/projects/destroy_info.html.erb
index b1b8adbb862d..4f5191b94d2b 100644
--- a/app/views/projects/destroy_info.html.erb
+++ b/app/views/projects/destroy_info.html.erb
@@ -56,7 +56,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag title: t(:button_delete), class: '-primary', disabled: true do
+ <%= styled_button_tag title: t(:button_delete), class: '-highlight', disabled: true do
concat content_tag :i, '', class: 'button--icon icon-delete'
concat content_tag :span, t(:button_delete), class: 'button--text'
end %>
diff --git a/app/views/projects/identifier/show.html.erb b/app/views/projects/identifier/show.html.erb
index 7c59b32a8ec3..ff4b7ecabe62 100644
--- a/app/views/projects/identifier/show.html.erb
+++ b/app/views/projects/identifier/show.html.erb
@@ -49,11 +49,11 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.text_field :identifier %>
- <%= f.submit t(:button_update), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= f.submit t(:button_update), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to project_settings_general_path(@project), class: 'button' do %>
- <%= op_icon('button--icon icon-cancel') %>
+ <%= op_icon('button--icon icon-cancel') %>
<%= t(:button_cancel) %>
<% end %>
diff --git a/app/views/projects/settings/categories/show.html.erb b/app/views/projects/settings/categories/show.html.erb
index be486d0a4c87..69d2edca9210 100644
--- a/app/views/projects/settings/categories/show.html.erb
+++ b/app/views/projects/settings/categories/show.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to_if_authorized({ controller: '/categories', action: 'new', project_id: @project },
{ aria: { label: t(:label_work_package_category_new) },
title: t(:label_work_package_category_new),
- class: 'button -primary'}) do %>
+ class: 'button -alt-highlight'}) do %>
<%= op_icon('icon-add button--icon') %>
<%= t('activerecord.models.category') %>
<% end %>
diff --git a/app/views/projects/settings/custom_fields/show.html.erb b/app/views/projects/settings/custom_fields/show.html.erb
index 6c8e10459d8c..abe34a478c83 100644
--- a/app/views/projects/settings/custom_fields/show.html.erb
+++ b/app/views/projects/settings/custom_fields/show.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if current_user.admin? %>
<%= link_to new_custom_field_path(type: 'WorkPackageCustomField'),
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_custom_field_new)},
title: t(:label_custom_field_new)} do %>
<%= op_icon('button--icon icon-add') %>
@@ -56,7 +56,7 @@ See COPYRIGHT and LICENSE files for more details.
} %>
- <%= form.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= form.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
<% else %>
diff --git a/app/views/projects/settings/modules/show.html.erb b/app/views/projects/settings/modules/show.html.erb
index 817bb422b0de..769130a8dac1 100644
--- a/app/views/projects/settings/modules/show.html.erb
+++ b/app/views/projects/settings/modules/show.html.erb
@@ -39,5 +39,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: "form",
locals: { form: form } %>
- <%= form.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+ <%= form.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/projects/settings/repository/_submit.html.erb b/app/views/projects/settings/repository/_submit.html.erb
index e7b640c461c3..8e6d4a114d6a 100644
--- a/app/views/projects/settings/repository/_submit.html.erb
+++ b/app/views/projects/settings/repository/_submit.html.erb
@@ -1,4 +1,4 @@
-
+
<%= op_icon('button--icon icon-checkmark') %>
<%= is_creation_form ? t(:button_create) : t(:button_save) %>
diff --git a/app/views/projects/settings/types/_form.html.erb b/app/views/projects/settings/types/_form.html.erb
index fa127d467080..b753f390d078 100644
--- a/app/views/projects/settings/types/_form.html.erb
+++ b/app/views/projects/settings/types/_form.html.erb
@@ -110,5 +110,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
diff --git a/app/views/projects/settings/versions/show.html.erb b/app/views/projects/settings/versions/show.html.erb
index 84c6f7498a92..2cdf798b8c49 100644
--- a/app/views/projects/settings/versions/show.html.erb
+++ b/app/views/projects/settings/versions/show.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if current_user.allowed_in_project?(:manage_versions, @project) %>
<%= link_to_if_authorized({ controller: '/versions', action: 'new', project_id: @project },
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_version_new)},
title: t(:label_version_new)}) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erb
index e583ab76cb06..86291b1a6db6 100644
--- a/app/views/repositories/committers.html.erb
+++ b/app/views/repositories/committers.html.erb
@@ -75,12 +75,12 @@ See COPYRIGHT and LICENSE files for more details.
<% end -%>
-
+
- <%= submit_tag t(:button_update), class: 'button -primary' %>
+ <%= submit_tag t(:button_update), class: 'button -highlight' %>
<%= link_to project_settings_repository_path(@project.id), class: 'button' do %>
<%= t(:button_cancel) %>
<% end %>
diff --git a/app/views/repositories/destroy_info.html.erb b/app/views/repositories/destroy_info.html.erb
index df9adc05c824..090f2db5812d 100644
--- a/app/views/repositories/destroy_info.html.erb
+++ b/app/views/repositories/destroy_info.html.erb
@@ -51,7 +51,7 @@ See COPYRIGHT and LICENSE files for more details.
method: :delete,
title: t(:button_delete),
disabled: true,
- class: '-primary' do %>
+ class: '-highlight' do %>
<%= op_icon('button--icon icon-delete') %>
<%= t(:button_delete) %>
<% end %>
@@ -93,3 +93,4 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
+
diff --git a/app/views/repositories/revisions.html.erb b/app/views/repositories/revisions.html.erb
index c3b608a0179b..f198ce94364e 100644
--- a/app/views/repositories/revisions.html.erb
+++ b/app/views/repositories/revisions.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= text_field_tag :rev, @rev, size: 8, placeholder: t(:label_revision) %>
- <%= submit_tag 'OK', class: 'button -primary' %>
+ <%= submit_tag 'OK', class: 'button -highlight' %>
<% end %>
<% end %>
diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb
index 26d4fe75c5a7..15b4b57c5ebe 100644
--- a/app/views/roles/index.html.erb
+++ b/app/views/roles/index.html.erb
@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: Role.model_name.human(count: 2) do %>
<%= link_to({ action: 'new'},
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_role_new)},
title: t(:label_role_new)}) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/roles/report.html.erb b/app/views/roles/report.html.erb
index 0be64fbdca8a..1d74b0c708c5 100644
--- a/app/views/roles/report.html.erb
+++ b/app/views/roles/report.html.erb
@@ -118,5 +118,5 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/statuses/edit.html.erb b/app/views/statuses/edit.html.erb
index cfcdca7a0276..d5165dcbfa17 100644
--- a/app/views/statuses/edit.html.erb
+++ b/app/views/statuses/edit.html.erb
@@ -33,5 +33,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for(@status) do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/statuses/index.html.erb b/app/views/statuses/index.html.erb
index 359efef2da88..3c18dc2691a7 100644
--- a/app/views/statuses/index.html.erb
+++ b/app/views/statuses/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_work_package_status_plural) do %>
<%= link_to new_status_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t(:label_work_package_status_new)},
title: t(:label_work_package_status_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/statuses/new.html.erb b/app/views/statuses/new.html.erb
index a33c1274f87e..bbf8a50f696c 100644
--- a/app/views/statuses/new.html.erb
+++ b/app/views/statuses/new.html.erb
@@ -33,5 +33,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= labelled_tabular_form_for(@status) do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/types/form/_form_configuration.html.erb b/app/views/types/form/_form_configuration.html.erb
index 4d458baaa429..e7d671d58e72 100644
--- a/app/views/types/form/_form_configuration.html.erb
+++ b/app/views/types/form/_form_configuration.html.erb
@@ -71,6 +71,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(@type.new_record? ? :button_create : :button_save),
data: { disable_with: t(@type.new_record? ? :button_create : :button_save) },
- class: 'form-configuration--save -primary -with-icon icon-checkmark' %>
+ class: 'form-configuration--save -highlight -with-icon icon-checkmark' %>
diff --git a/app/views/types/form/_projects.html.erb b/app/views/types/form/_projects.html.erb
index db8349d0431b..1758232e7a57 100644
--- a/app/views/types/form/_projects.html.erb
+++ b/app/views/types/form/_projects.html.erb
@@ -55,6 +55,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(@type.new_record? ? :button_create : :button_save),
- class: '-primary -with-icon icon-checkmark' %>
+ class: '-highlight -with-icon icon-checkmark' %>
diff --git a/app/views/types/form/_settings.html.erb b/app/views/types/form/_settings.html.erb
index 1e170049953c..8a784ab50e3b 100644
--- a/app/views/types/form/_settings.html.erb
+++ b/app/views/types/form/_settings.html.erb
@@ -70,6 +70,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(@type.new_record? ? :button_create : :button_save),
- class: '-primary -with-icon icon-checkmark' %>
+ class: '-highlight -with-icon icon-checkmark' %>
diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb
index d54eef893a95..b0db4a085f39 100644
--- a/app/views/types/index.html.erb
+++ b/app/views/types/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_work_package_types) do %>
<%= link_to new_type_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: { label: t(:label_type_new) },
title: t(:label_type_new)} do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb
index b818d5a8fb1e..f80127338136 100644
--- a/app/views/users/_general.html.erb
+++ b/app/views/users/_general.html.erb
@@ -54,5 +54,5 @@ See COPYRIGHT and LICENSE files for more details.
as: :user do |f| %>
<%= render partial: 'form', locals: { f: f } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/users/_toolbar.html.erb b/app/views/users/_toolbar.html.erb
index 1dae67593a6d..a7c07cd796e1 100644
--- a/app/views/users/_toolbar.html.erb
+++ b/app/views/users/_toolbar.html.erb
@@ -35,9 +35,9 @@ See COPYRIGHT and LICENSE files for more details.
<% if current_user.allowed_globally?(:create_user) %>
- <%= form_for(@user,
- url: { action: :resend_invitation },
- method: :post) do |_form| %>
+ <%= form_for(@user, html: { class: 'toolbar-item' },
+ url: { action: :resend_invitation },
+ method: :post) do |_form| %>
<%= op_icon('button--icon icon-mail1') %>
<%= t(:label_send_invitation) %>
@@ -47,13 +47,12 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<% if current_user.admin? %>
<% unless current_user.id == @user.id %>
-
- <%= form_for @user,
- :url => { :action => :change_status },
- :method => :post do %>
- <%= change_user_status_buttons(@user) %>
- <% end %>
-
+ <%= form_for @user, html: { class: 'toolbar-item hidden-for-tablet' }, :url => { :action => :change_status },
+ :method => :post do %>
+
+ <%= change_user_status_buttons(@user) %>
+
+ <% end %>
<% end %>
<% if Setting.users_deletable_by_admins? %>
diff --git a/app/views/users/change_status_info.html.erb b/app/views/users/change_status_info.html.erb
index 63801b7a14a2..a0b2a46d6f94 100644
--- a/app/views/users/change_status_info.html.erb
+++ b/app/views/users/change_status_info.html.erb
@@ -61,7 +61,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag '', class: '-primary' do %>
+ <%= styled_button_tag '', class: '-highlight' do %>
<%= op_icon('button--icon icon-checkmark') %>
<%= new_status %>
<% end %>
diff --git a/app/views/users/deletion_info.html.erb b/app/views/users/deletion_info.html.erb
index 65d493bb966e..4ba19e1e411f 100644
--- a/app/views/users/deletion_info.html.erb
+++ b/app/views/users/deletion_info.html.erb
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_button_tag '', class: '-primary', disabled: true do
+ <%= styled_button_tag '', class: '-highlight', disabled: true do
concat content_tag :i, '', class: 'button--icon icon-delete'
concat content_tag :span, t(:button_delete), class: 'button--text'
end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 0e5b25f666bf..d218a1056662 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -38,12 +38,12 @@ See COPYRIGHT and LICENSE files for more details.
<% users_info = user_limit && content_tag(:div) do %>
<%= t(:label_enterprise_active_users, current: OpenProject::Enterprise.active_user_count, limit: user_limit) %>
-
<%= t(:button_upgrade) %>
+
<%= t(:button_upgrade) %>
<% end %>
<%= toolbar title: t(:label_user_plural), title_class: 'no-padding-bottom', subtitle: users_info do %>
<%= link_to new_user_path,
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: { label: t(:label_user_new) },
title: t(:label_user_new) } do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index 09a6e9bba2e0..e465e2152d57 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -46,7 +46,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'simple_form', locals: { f: f, auth_sources: @ldap_auth_sources, user: @user } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
- <%= styled_button_tag t(:button_create_and_continue), name: 'continue', class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create_and_continue), name: 'continue', class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/versions/_roadmap_filter.html.erb b/app/views/versions/_roadmap_filter.html.erb
index 1c916e23c48a..3dcf17f18cb6 100644
--- a/app/views/versions/_roadmap_filter.html.erb
+++ b/app/views/versions/_roadmap_filter.html.erb
@@ -33,7 +33,7 @@
- <%= submit_tag t(:button_apply), class: 'button -small -primary', name: nil %>
+ <%= submit_tag t(:button_apply), class: 'button -small -alt-highlight', name: nil %>
<% end %>
diff --git a/app/views/versions/edit.html.erb b/app/views/versions/edit.html.erb
index 5dbc0a1bfde0..051e25fbfb8c 100644
--- a/app/views/versions/edit.html.erb
+++ b/app/views/versions/edit.html.erb
@@ -35,5 +35,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'form', locals: { f: f,
project: @project } %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index a969a046db73..c47dc3bc1e6d 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= toolbar title: t(:label_roadmap) do %>
<%= link_to_if_authorized({ controller: '/versions', action: 'new', project_id: @project },
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: { label: t(:label_version_new) },
title: t(:label_version_new) }) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/versions/new.html.erb b/app/views/versions/new.html.erb
index 5a10dfe48dbd..80fb1b4467be 100644
--- a/app/views/versions/new.html.erb
+++ b/app/views/versions/new.html.erb
@@ -35,5 +35,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'versions/form', locals: { f: f,
project: @project } %>
- <%= styled_button_tag t(:button_create), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_create), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/wiki/_page_form.html.erb b/app/views/wiki/_page_form.html.erb
index 9b55008f36fc..c3211e91b5d3 100644
--- a/app/views/wiki/_page_form.html.erb
+++ b/app/views/wiki/_page_form.html.erb
@@ -36,7 +36,7 @@
placeholder: t(:text_what_did_you_change_click_to_add_comment) %>
-<%= f.button t(:button_save), class: 'button -primary -with-icon icon-checkmark' %>
+<%= f.button t(:button_save), class: 'button -highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel),
{ controller: '/wiki', action: 'show', project_id: @project, id: (@page.new_record? ? nil : @page) },
diff --git a/app/views/wiki/destroy.html.erb b/app/views/wiki/destroy.html.erb
index 280d92e2d613..dad0c99bb911 100644
--- a/app/views/wiki/destroy.html.erb
+++ b/app/views/wiki/destroy.html.erb
@@ -59,7 +59,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= submit_tag t(:button_apply), class: 'button -primary' %>
+ <%= submit_tag t(:button_apply), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
{ controller: '/wiki', action: 'show', project_id: @project, id: @page },
class: 'button' %>
diff --git a/app/views/wiki/edit_parent_page.html.erb b/app/views/wiki/edit_parent_page.html.erb
index 090661698a28..b9549b8b74a6 100644
--- a/app/views/wiki/edit_parent_page.html.erb
+++ b/app/views/wiki/edit_parent_page.html.erb
@@ -47,5 +47,5 @@ See COPYRIGHT and LICENSE files for more details.
}
));
<% end -%>
- <%= submit_tag t(:button_save), class: 'button -primary' %>
+ <%= submit_tag t(:button_save), class: 'button -highlight' %>
<% end %>
diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb
index fb6f7e464be5..081993f21bd5 100644
--- a/app/views/wiki/history.html.erb
+++ b/app/views/wiki/history.html.erb
@@ -159,7 +159,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= submit_tag t(:label_view_diff), class: 'button -primary -small' if show_diff %>
+ <%= submit_tag t(:label_view_diff), class: 'button -highlight -small' if show_diff %>
<%= pagination_links_full @versions %>
<% end %>
diff --git a/app/views/wiki/rename.html.erb b/app/views/wiki/rename.html.erb
index 617f5e98e2c9..674597a208df 100644
--- a/app/views/wiki/rename.html.erb
+++ b/app/views/wiki/rename.html.erb
@@ -39,5 +39,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.check_box :redirect_existing_links %>
- <%= submit_tag t(:button_rename), class: 'button -primary' %>
+ <%= submit_tag t(:button_rename), class: 'button -highlight' %>
<% end %>
diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb
index 413d66c847cb..e6fc7a40cf9c 100644
--- a/app/views/wiki/show.html.erb
+++ b/app/views/wiki/show.html.erb
@@ -44,7 +44,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if @page && User.current.allowed_in_project?(:edit_wiki_pages, @project) %>
<%= link_to({controller: '/wiki', action: 'new_child', project_id: @project.identifier, id: @page},
- { class: 'button -primary',
+ { class: 'button -alt-highlight',
aria: {label: t('wiki.index.no_results_content_text')},
title: t('wiki.index.no_results_content_text')}) do %>
<%= op_icon('button--icon icon-add') %>
diff --git a/app/views/wiki_menu_items/edit.html.erb b/app/views/wiki_menu_items/edit.html.erb
index 8be0870396af..ee74b41bd285 100644
--- a/app/views/wiki_menu_items/edit.html.erb
+++ b/app/views/wiki_menu_items/edit.html.erb
@@ -61,7 +61,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_save), method: :post,
- class: '-primary -with-icon icon-checkmark' %>
+ class: '-highlight -with-icon icon-checkmark' %>
<%= link_to t(:button_cancel),
{controller: '/wiki', action: 'show', project_id: @project, id: @page_title},
class: 'button -with-icon icon-cancel'%>
diff --git a/app/views/wiki_menu_items/select_main_menu_item.html.erb b/app/views/wiki_menu_items/select_main_menu_item.html.erb
index 9633769b0e86..84f3f538eb3d 100644
--- a/app/views/wiki_menu_items/select_main_menu_item.html.erb
+++ b/app/views/wiki_menu_items/select_main_menu_item.html.erb
@@ -41,5 +41,5 @@ See COPYRIGHT and LICENSE files for more details.
id: 'main-menu-item-select' } %>
- <%= submit_tag t(:button_save), class: 'button -primary' %>
+ <%= submit_tag t(:button_save), class: 'button -highlight' %>
<% end %>
diff --git a/app/views/work_packages/bulk/destroy.html.erb b/app/views/work_packages/bulk/destroy.html.erb
index aa79633e2060..f829be428340 100644
--- a/app/views/work_packages/bulk/destroy.html.erb
+++ b/app/views/work_packages/bulk/destroy.html.erb
@@ -80,7 +80,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
- <%= styled_button_tag title: t(:button_delete), class: '-primary' do
+ <%= styled_button_tag title: t(:button_delete), class: '-highlight' do
concat content_tag :i, '', class: 'button--icon icon-delete'
concat content_tag :span, t(:button_delete), class: 'button--text'
end %>
diff --git a/app/views/work_packages/bulk/edit.html.erb b/app/views/work_packages/bulk/edit.html.erb
index f1b4c9c099ef..871a98d09f5f 100644
--- a/app/views/work_packages/bulk/edit.html.erb
+++ b/app/views/work_packages/bulk/edit.html.erb
@@ -188,5 +188,5 @@ See COPYRIGHT and LICENSE files for more details.
<%= send_notification_option %>
-
<%= styled_button_tag t(:button_submit), class: '-primary -with-icon icon-checkmark' %>
+
<%= styled_button_tag t(:button_submit), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
diff --git a/app/views/work_packages/moves/new.html.erb b/app/views/work_packages/moves/new.html.erb
index f1edbadcd240..b8a64e400860 100644
--- a/app/views/work_packages/moves/new.html.erb
+++ b/app/views/work_packages/moves/new.html.erb
@@ -184,11 +184,11 @@ See COPYRIGHT and LICENSE files for more details.
<% if @copy %>
<%= hidden_field_tag("copy") %>
- <%= styled_submit_tag t(:button_copy), class: '-primary' %>
- <%= styled_submit_tag t(:button_copy_and_follow), name: 'follow', class: '-primary' %>
+ <%= styled_submit_tag t(:button_copy), class: '-highlight' %>
+ <%= styled_submit_tag t(:button_copy_and_follow), name: 'follow', class: '-highlight' %>
<% else %>
- <%= styled_submit_tag t(:button_move), class: '-primary' %>
- <%= styled_submit_tag t(:button_move_and_follow), name: 'follow', class: '-primary' %>
+ <%= styled_submit_tag t(:button_move), class: '-highlight' %>
+ <%= styled_submit_tag t(:button_move_and_follow), name: 'follow', class: '-highlight' %>
<% end %>
<% end %>
<% content_for :header_tags do %>
diff --git a/app/views/workflows/_form.html.erb b/app/views/workflows/_form.html.erb
index 9b952ab16a1f..aa2f80fb8901 100644
--- a/app/views/workflows/_form.html.erb
+++ b/app/views/workflows/_form.html.erb
@@ -90,3 +90,4 @@ See COPYRIGHT and LICENSE files for more details.
+
diff --git a/app/views/workflows/copy.html.erb b/app/views/workflows/copy.html.erb
index 8c549e6b68b6..0418e3df6747 100644
--- a/app/views/workflows/copy.html.erb
+++ b/app/views/workflows/copy.html.erb
@@ -75,5 +75,5 @@ See COPYRIGHT and LICENSE files for more details.
- <%= styled_submit_tag t(:button_copy), class: '-primary' %>
+ <%= styled_submit_tag t(:button_copy), class: '-highlight' %>
<% end %>
diff --git a/app/views/workflows/edit.html.erb b/app/views/workflows/edit.html.erb
index 973380bac305..db349e7a27e5 100644
--- a/app/views/workflows/edit.html.erb
+++ b/app/views/workflows/edit.html.erb
@@ -56,7 +56,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= submit_tag t(:button_edit), name: nil, accesskey: accesskey(:edit), class: 'button -small -primary' %>
+ <%= submit_tag t(:button_edit), name: nil, accesskey: accesskey(:edit), class: 'button -small -highlight' %>
@@ -79,7 +79,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: 'form', locals: { name: 'assignee', workflows: @workflows['assignee'] } %>
<% end %>
- <%= styled_button_tag t(:button_save), class: '-primary -with-icon icon-checkmark' %>
+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>
<% end %>
<% end %>
diff --git a/app/workers/application_job.rb b/app/workers/application_job.rb
index 44643a51945d..de6bccc0067e 100644
--- a/app/workers/application_job.rb
+++ b/app/workers/application_job.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "active_job"
+require 'active_job'
class ApplicationJob < ActiveJob::Base
include ::JobStatus::ApplicationJobWithStatus
@@ -92,10 +92,6 @@ def reload_mailer_settings!
Setting.reload_mailer_settings!
end
- def job_scheduled_at
- GoodJob::Job.where(id: job_id).pick(:scheduled_at)
- end
-
private
def prepare_job_context
diff --git a/app/workers/attachments/cleanup_uncontainered_job.rb b/app/workers/attachments/cleanup_uncontainered_job.rb
index 5b0dc599ef53..729fd37231be 100644
--- a/app/workers/attachments/cleanup_uncontainered_job.rb
+++ b/app/workers/attachments/cleanup_uncontainered_job.rb
@@ -26,9 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class Attachments::CleanupUncontaineredJob < ApplicationJob
+class Attachments::CleanupUncontaineredJob < Cron::CronJob
queue_with_priority :low
+ # runs at 10:03 pm
+ self.cron_expression = '03 22 * * *'
+
def perform
Attachment
.where(container: nil)
@@ -47,7 +50,7 @@ def too_old
attachment_table = Attachment.arel_table
attachment_table[:created_at]
- .lteq(Time.zone.now - OpenProject::Configuration.attachments_grace_period.minutes)
+ .lteq(Time.now - OpenProject::Configuration.attachments_grace_period.minutes)
.to_sql
end
end
diff --git a/app/workers/attachments/extract_fulltext_job.rb b/app/workers/attachments/extract_fulltext_job.rb
index a9379778bd87..b00d13c4bb46 100644
--- a/app/workers/attachments/extract_fulltext_job.rb
+++ b/app/workers/attachments/extract_fulltext_job.rb
@@ -67,7 +67,7 @@ def init
def update
Attachment
.where(id: @attachment_id)
- .update_all(["fulltext = ?, fulltext_tsv = to_tsvector(?, ?), file_tsv = to_tsvector(?, ?)",
+ .update_all(['fulltext = ?, fulltext_tsv = to_tsvector(?, ?), file_tsv = to_tsvector(?, ?)',
@text,
@language,
OpenProject::FullTextSearch.normalize_text(@text),
diff --git a/app/workers/attachments/virus_rescan_job.rb b/app/workers/attachments/virus_rescan_job.rb
index 7b568eb0416a..76a5400a4ff8 100644
--- a/app/workers/attachments/virus_rescan_job.rb
+++ b/app/workers/attachments/virus_rescan_job.rb
@@ -34,7 +34,7 @@ def perform
return unless Setting::VirusScanning.enabled?
User.execute_as(User.system) do
- OpenProject::Mutex.with_advisory_lock(Attachment, "virus_rescan") do
+ OpenProject::Mutex.with_advisory_lock(Attachment, 'virus_rescan') do
Attachment.status_rescan.find_each do |attachment|
scan_attachment(attachment)
rescue StandardError => e
@@ -48,7 +48,7 @@ def perform
def redirect_status
path = ApplicationController.helpers.admin_quarantined_attachments_path
payload = redirect_payload(path)
- html = I18n.t("settings.antivirus.remaining_scan_complete_html",
+ html = I18n.t('settings.antivirus.remaining_scan_complete_html',
file_count: I18n.t(:label_x_files, count: Attachment.status_quarantined.count))
upsert_status(
diff --git a/app/workers/attachments/virus_scan_job.rb b/app/workers/attachments/virus_scan_job.rb
index bbcf757670c9..a6988b0ae503 100644
--- a/app/workers/attachments/virus_scan_job.rb
+++ b/app/workers/attachments/virus_scan_job.rb
@@ -40,7 +40,7 @@ def perform(attachment)
return unless attachment.status_uploaded?
User.execute_as(User.system) do
- OpenProject::Mutex.with_advisory_lock_transaction(attachment, "virus_scan") do
+ OpenProject::Mutex.with_advisory_lock_transaction(attachment, 'virus_scan') do
scan_attachment(attachment)
end
end
@@ -84,11 +84,11 @@ def handle_virus_response(attachment, virus_name)
def delete_attachment(attachment)
container = attachment.container
attachment.destroy!
- create_journal(container, I18n.t("antivirus_scan.deleted_message", filename: attachment.filename))
+ create_journal(container, I18n.t('antivirus_scan.deleted_message', filename: attachment.filename))
end
def quarantine_attachment(attachment)
- create_journal(attachment.container, I18n.t("antivirus_scan.quarantined_message", filename: attachment.filename))
+ create_journal(attachment.container, I18n.t('antivirus_scan.quarantined_message', filename: attachment.filename))
attachment.update!(status: :quarantined)
end
diff --git a/app/workers/concerns/scheduled_job.rb b/app/workers/concerns/scheduled_job.rb
new file mode 100644
index 000000000000..8c7516a31ec5
--- /dev/null
+++ b/app/workers/concerns/scheduled_job.rb
@@ -0,0 +1,41 @@
+# OpenProject is an open source project management software.
+# Copyright (C) 2010-2022 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+
+module ScheduledJob
+ extend ActiveSupport::Concern
+
+ class_methods do
+ ##
+ # Is there a job scheduled?
+ def scheduled?
+ delayed_job_query.exists?
+ end
+
+ def delayed_job_query
+ Delayed::Job.where('handler LIKE ?', "%job_class: #{name}%")
+ end
+ end
+end
diff --git a/app/workers/copy_project_job.rb b/app/workers/copy_project_job.rb
index b983393537dc..27b2018b7bfd 100644
--- a/app/workers/copy_project_job.rb
+++ b/app/workers/copy_project_job.rb
@@ -68,7 +68,7 @@ def perform(user_id:,
end
rescue StandardError => e
logger.error { "Failed to finish copy project job: #{e} #{e.message}" }
- errors = [I18n.t("copy_project.failed_internal")]
+ errors = [I18n.t('copy_project.failed_internal')]
failure_status_update
ProjectMailer.copy_project_failed(user, source_project, target_project_name, errors).deliver_later
end
@@ -98,12 +98,12 @@ def successful_status_update
end
upsert_status status: :success,
- message: I18n.t("copy_project.succeeded", target_project_name: target_project.name),
+ message: I18n.t('copy_project.succeeded', target_project_name: target_project.name),
payload:
end
def failure_status_update
- message = I18n.t("copy_project.failed", source_project_name: source_project.name)
+ message = I18n.t('copy_project.failed', source_project_name: source_project.name)
if errors
message << ": #{errors.join("\n")}"
@@ -150,11 +150,11 @@ def create_project_copy
rescue ActiveRecord::RecordNotFound => e
logger.error("Entity missing: #{e.message} #{e.backtrace.join("\n")}")
rescue StandardError => e
- logger.error("Encountered an error when trying to copy project " \
+ logger.error('Encountered an error when trying to copy project ' \
"'#{source_project_id}' : #{e.message} #{e.backtrace.join("\n")}")
ensure
unless errors.empty?
- logger.error("Encountered an errors while trying to copy related objects for " \
+ logger.error('Encountered an errors while trying to copy related objects for ' \
"project '#{source_project_id}': #{errors.inspect}")
end
end
diff --git a/app/workers/cron/clear_old_sessions_job.rb b/app/workers/cron/clear_old_sessions_job.rb
index 8c50a5b8e531..e53494d626d3 100644
--- a/app/workers/cron/clear_old_sessions_job.rb
+++ b/app/workers/cron/clear_old_sessions_job.rb
@@ -27,11 +27,14 @@
#++
module Cron
- class ClearOldSessionsJob < ApplicationJob
+ class ClearOldSessionsJob < CronJob
include ::RakeJob
+ # runs at 1:15 nightly
+ self.cron_expression = '15 1 * * *'
+
def perform
- super("db:sessions:expire", 7)
+ super('db:sessions:expire', 7)
end
end
end
diff --git a/app/workers/cron/clear_tmp_cache_job.rb b/app/workers/cron/clear_tmp_cache_job.rb
index 17d78e6cfd2d..8ac9a6c21016 100644
--- a/app/workers/cron/clear_tmp_cache_job.rb
+++ b/app/workers/cron/clear_tmp_cache_job.rb
@@ -27,11 +27,14 @@
#++
module Cron
- class ClearTmpCacheJob < ApplicationJob
+ class ClearTmpCacheJob < CronJob
include ::RakeJob
+ # runs at 02:45 sundays
+ self.cron_expression = '45 2 * * 7'
+
def perform
- super("tmp:cache:clear")
+ super('tmp:cache:clear')
end
end
end
diff --git a/app/workers/cron/clear_uploaded_files_job.rb b/app/workers/cron/clear_uploaded_files_job.rb
index 5086ea9dc3e9..458615f98b07 100644
--- a/app/workers/cron/clear_uploaded_files_job.rb
+++ b/app/workers/cron/clear_uploaded_files_job.rb
@@ -27,11 +27,14 @@
#++
module Cron
- class ClearUploadedFilesJob < ApplicationJob
+ class ClearUploadedFilesJob < CronJob
include ::RakeJob
+ # Runs 23pm fridays
+ self.cron_expression = '0 23 * * 5'
+
def perform
- super("attachments:clear")
+ super('attachments:clear')
end
end
end
diff --git a/spec/services/projects/create_service_integration_spec.rb b/app/workers/cron/cron_job.rb
similarity index 53%
rename from spec/services/projects/create_service_integration_spec.rb
rename to app/workers/cron/cron_job.rb
index d1b13119ed5d..a2afe9f260d6 100644
--- a/spec/services/projects/create_service_integration_spec.rb
+++ b/app/workers/cron/cron_job.rb
@@ -26,46 +26,50 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "spec_helper"
+module Cron
+ class CronJob < ApplicationJob
+ class_attribute :cron_expression
-RSpec.describe Projects::CreateService, "integration", type: :model do
- let(:instance) { described_class.new(user:) }
- let(:new_project) { service_result.result }
- let(:service_result) { instance.call(**attributes) }
+ # List of registered jobs, requires eager load in dev(!)
+ class_attribute :registered_jobs, default: []
- before do
- login_as(user)
- end
+ include ScheduledJob
- describe "writing created_at timestamp" do
- shared_let(:user) { create(:admin) }
+ class << self
+ ##
+ # Register new job class(es)
+ def register!(*job_classes)
+ Array(job_classes).each do |clz|
+ raise ArgumentError, "Needs to be subclass of ::Cron::CronJob" unless clz.ancestors.include?(self)
- let(:created_at) { 11.days.ago }
+ registered_jobs << clz
+ end
+ end
- let(:attributes) do
- {
- name: "test",
- created_at:,
- }
- end
+ def schedule_registered_jobs!
+ registered_jobs.each do |job_class|
+ job_class.ensure_scheduled!
+ end
+ end
- context "when enabled", with_settings: { apiv3_write_readonly_attributes: true } do
- it "updates the timestamps correctly" do
- expect(service_result)
- .to be_success
+ ##
+ # Ensure the job is scheduled unless it is already
+ def ensure_scheduled!
+ # Ensure scheduled only once
+ return if scheduled?
- new_project.reload
- expect(new_project.created_at).to be_within(1.second).of created_at
+ Rails.logger.info { "Scheduling #{name} recurrent background job." }
+ set(cron: cron_expression).perform_later
end
- end
- context "when disabled", with_settings: { apiv3_write_readonly_attributes: false } do
- it "rejects the creation" do
- expect(service_result)
- .not_to be_success
+ ##
+ # Remove the scheduled job, if any
+ def remove
+ delayed_job&.destroy
+ end
- expect(new_project.errors.symbols_for(:created_at))
- .to contain_exactly(:error_readonly)
+ def delayed_job
+ delayed_job_query.first
end
end
end
diff --git a/app/workers/exports/cleanup_outdated_job.rb b/app/workers/exports/cleanup_outdated_job.rb
index ad081368538a..cc0d4c598b8b 100644
--- a/app/workers/exports/cleanup_outdated_job.rb
+++ b/app/workers/exports/cleanup_outdated_job.rb
@@ -35,7 +35,7 @@ def self.perform_after_grace
def perform
Export
- .where("created_at <= ?", Time.current - OpenProject::Configuration.attachments_grace_period.minutes)
+ .where('created_at <= ?', Time.current - OpenProject::Configuration.attachments_grace_period.minutes)
.destroy_all
end
end
diff --git a/app/workers/exports/export_job.rb b/app/workers/exports/export_job.rb
index 7b805fc15e66..c3c5165535ef 100644
--- a/app/workers/exports/export_job.rb
+++ b/app/workers/exports/export_job.rb
@@ -1,4 +1,4 @@
-require "active_storage/filename"
+require 'active_storage/filename'
module Exports
class ExportJob < ::ApplicationJob
@@ -90,7 +90,7 @@ def store_from_string(export, export_result)
end
def with_tempfile(title, content)
- name_parts = [title[0..title.rindex(".") - 1], title[title.rindex(".")..]]
+ name_parts = [title[0..title.rindex('.') - 1], title[title.rindex('.')..]]
Tempfile.create(name_parts, encoding: content.encoding) do |file|
file.write content
@@ -104,19 +104,19 @@ def store_attachment(container, file, export_result)
call = Attachments::CreateService
.bypass_whitelist(user: User.current)
- .call(container:, file:, filename:, description: "")
+ .call(container:, file:, filename:, description: '')
call.on_success do
download_url = ::API::V3::Utilities::PathHelper::ApiV3Path.attachment_content(call.result.id)
upsert_status status: :success,
- message: I18n.t("export.succeeded"),
+ message: I18n.t('export.succeeded'),
payload: download_payload(download_url)
end
call.on_failure do
upsert_status status: :failure,
- message: I18n.t("export.failed", message: call.message)
+ message: I18n.t('export.failed', message: call.message)
end
end
end
diff --git a/app/workers/ldap/synchronization_job.rb b/app/workers/ldap/synchronization_job.rb
index a100d5b87898..e584179d931e 100644
--- a/app/workers/ldap/synchronization_job.rb
+++ b/app/workers/ldap/synchronization_job.rb
@@ -27,7 +27,10 @@
#++
module Ldap
- class SynchronizationJob < ApplicationJob
+ class SynchronizationJob < ::Cron::CronJob
+ # Run once per night at 11:30pm
+ self.cron_expression = '30 23 * * *'
+
def perform
run_user_sync
end
diff --git a/app/workers/mails/deliver_job.rb b/app/workers/mails/deliver_job.rb
index 5520973a911b..638fa27bad84 100644
--- a/app/workers/mails/deliver_job.rb
+++ b/app/workers/mails/deliver_job.rb
@@ -55,7 +55,7 @@ def deliver_mail
# To be implemented by subclasses.
# Returns a Mail::Message, or nil if no message should be sent.
def render_mail
- raise NotImplementedError, "SubclassResponsibility"
+ raise NotImplementedError, 'SubclassResponsibility'
end
def build_mail
diff --git a/app/workers/mails/watcher_added_job.rb b/app/workers/mails/watcher_added_job.rb
index 75039dc846d8..d3f53260398d 100644
--- a/app/workers/mails/watcher_added_job.rb
+++ b/app/workers/mails/watcher_added_job.rb
@@ -30,6 +30,6 @@ class Mails::WatcherAddedJob < Mails::WatcherJob
private
def action
- "added"
+ 'added'
end
end
diff --git a/app/workers/mails/watcher_job.rb b/app/workers/mails/watcher_job.rb
index 719157488e9c..6eee3ae40797 100644
--- a/app/workers/mails/watcher_job.rb
+++ b/app/workers/mails/watcher_job.rb
@@ -71,6 +71,6 @@ def self_watching?
end
def action
- raise NotImplementedError, "subclass responsibility"
+ raise NotImplementedError, 'subclass responsibility'
end
end
diff --git a/app/workers/mails/watcher_removed_job.rb b/app/workers/mails/watcher_removed_job.rb
index a1be42f12faa..6148551762f2 100644
--- a/app/workers/mails/watcher_removed_job.rb
+++ b/app/workers/mails/watcher_removed_job.rb
@@ -36,6 +36,6 @@ def perform(watcher_attributes, watcher_changer)
private
def action
- "removed"
+ 'removed'
end
end
diff --git a/app/workers/mails/work_package_shared_job.rb b/app/workers/mails/work_package_shared_job.rb
index eebae90c37e8..2fa52f3a4802 100644
--- a/app/workers/mails/work_package_shared_job.rb
+++ b/app/workers/mails/work_package_shared_job.rb
@@ -67,8 +67,8 @@ def newly_invited_group_user_member_ids(work_package_member:)
.joins(:member_roles)
.references(:member_roles)
.where(principal: work_package_member.principal.users)
- .group("members.id")
+ .group('members.id')
.having("COUNT(*) = 1")
- .select("members.id")
+ .select('members.id')
end
end
diff --git a/app/workers/notifications/schedule_date_alerts_notifications_job.rb b/app/workers/notifications/schedule_date_alerts_notifications_job.rb
index 525a0473bddf..43c5bd810bd4 100644
--- a/app/workers/notifications/schedule_date_alerts_notifications_job.rb
+++ b/app/workers/notifications/schedule_date_alerts_notifications_job.rb
@@ -28,11 +28,15 @@
module Notifications
# Creates date alert jobs for users whose local time is 1:00 am.
- class ScheduleDateAlertsNotificationsJob < ApplicationJob
+ class ScheduleDateAlertsNotificationsJob < Cron::CronJob
+ # runs every quarter of an hour, so 00:00, 00:15,..., 15:30, 15:45, 16:00, ...
+ self.cron_expression = '*/15 * * * *'
+
def perform
return unless EnterpriseToken.allows_to?(:date_alerts)
- Service.new(times_from_scheduled_to_execution).call
+ service = Service.new(times_from_scheduled_to_execution)
+ service.call
end
# Returns times from scheduled execution time to current time in 15 minutes
@@ -53,7 +57,7 @@ def times_from_scheduled_to_execution
end
def scheduled_time
- job_scheduled_at.then { |t| t.change(min: t.min / 15 * 15) }
+ self.class.delayed_job.run_at.then { |t| t.change(min: t.min / 15 * 15) }
end
end
end
diff --git a/app/workers/notifications/schedule_date_alerts_notifications_job/service.rb b/app/workers/notifications/schedule_date_alerts_notifications_job/service.rb
index fb11bc3cea52..b52ebe0650f3 100644
--- a/app/workers/notifications/schedule_date_alerts_notifications_job/service.rb
+++ b/app/workers/notifications/schedule_date_alerts_notifications_job/service.rb
@@ -61,7 +61,7 @@ def executing_at_1am_for_timezone?(time_zone)
def is_1am?(time, time_zone)
local_time = time.in_time_zone(time_zone)
- local_time.strftime("%H:%M") == "01:00"
+ local_time.strftime('%H:%M') == '01:00'
end
def users_at_1am_with_notification_settings
diff --git a/app/workers/notifications/schedule_reminder_mails_job.rb b/app/workers/notifications/schedule_reminder_mails_job.rb
index 0c17199d1c79..0932594fbda0 100644
--- a/app/workers/notifications/schedule_reminder_mails_job.rb
+++ b/app/workers/notifications/schedule_reminder_mails_job.rb
@@ -27,13 +27,18 @@
#++
module Notifications
- class ScheduleReminderMailsJob < ApplicationJob
+ class ScheduleReminderMailsJob < Cron::CronJob
+ # runs every quarter of an hour, so 00:00, 00:15...
+ self.cron_expression = '*/15 * * * *'
+
def perform
- User.having_reminder_mail_to_send(job_scheduled_at)
- .pluck(:id)
- .each do |user_id|
+ User.having_reminder_mail_to_send(run_at).pluck(:id).each do |user_id|
Mails::ReminderJob.perform_later(user_id)
end
end
+
+ def run_at
+ self.class.delayed_job.run_at
+ end
end
end
diff --git a/app/workers/oauth/cleanup_job.rb b/app/workers/oauth/cleanup_job.rb
index f08ea238262a..3295cb0e82b4 100644
--- a/app/workers/oauth/cleanup_job.rb
+++ b/app/workers/oauth/cleanup_job.rb
@@ -27,13 +27,16 @@
#++
module OAuth
- class CleanupJob < ApplicationJob
+ class CleanupJob < ::Cron::CronJob
include ::RakeJob
+ # runs at 1:52 nightly
+ self.cron_expression = '52 1 * * *'
+
queue_with_priority :low
def perform
- super("doorkeeper:db:cleanup")
+ super('doorkeeper:db:cleanup')
end
end
end
diff --git a/app/workers/paper_trail_audits/cleanup_job.rb b/app/workers/paper_trail_audits/cleanup_job.rb
index c593ab4c93e4..634f240c7641 100644
--- a/app/workers/paper_trail_audits/cleanup_job.rb
+++ b/app/workers/paper_trail_audits/cleanup_job.rb
@@ -27,11 +27,14 @@
#++
module PaperTrailAudits
- class CleanupJob < ApplicationJob
+ class CleanupJob < ::Cron::CronJob
+ # runs at 4:03 on Saturday
+ self.cron_expression = '3 4 * * 6'
+
# Clean any paper trails older than 60 days
def perform
::PaperTrailAudit
- .where("created_at < ?", 60.days.ago)
+ .where('created_at < ?', 60.days.ago)
.delete_all
end
end
diff --git a/app/workers/projects/delete_project_job.rb b/app/workers/projects/delete_project_job.rb
index 305134c61b14..34787de4db4c 100644
--- a/app/workers/projects/delete_project_job.rb
+++ b/app/workers/projects/delete_project_job.rb
@@ -43,7 +43,7 @@ def execute(project:)
"#{service_call.message}")
end
rescue StandardError => e
- OpenProject.logger.error("Encountered an error when trying to delete project " \
+ OpenProject.logger.error('Encountered an error when trying to delete project ' \
"'#{project}' : #{e.message} #{e.backtrace.join("\n")}")
end
end
diff --git a/app/workers/projects/export_job.rb b/app/workers/projects/export_job.rb
index 08d649580fce..28d4ebb012c2 100644
--- a/app/workers/projects/export_job.rb
+++ b/app/workers/projects/export_job.rb
@@ -1,4 +1,4 @@
-require "active_storage/filename"
+require 'active_storage/filename'
module Projects
class ExportJob < ::Exports::ExportJob
diff --git a/db/migrate/20240306154735_create_good_job_labels_index.rb b/app/workers/projects/reorder_hierarchy_job.rb
similarity index 54%
rename from db/migrate/20240306154735_create_good_job_labels_index.rb
rename to app/workers/projects/reorder_hierarchy_job.rb
index cbfc68793565..eafa3ed0efd5 100644
--- a/db/migrate/20240306154735_create_good_job_labels_index.rb
+++ b/app/workers/projects/reorder_hierarchy_job.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
@@ -28,21 +26,46 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class CreateGoodJobLabelsIndex < ActiveRecord::Migration[7.1]
- disable_ddl_transaction!
+module Projects
+ class ReorderHierarchyJob < ApplicationJob
+ def perform
+ Rails.logger.info { "Resorting siblings by name in the project's nested set." }
+ Project.transaction { reorder! }
+ end
- def change
- reversible do |dir|
- dir.up do
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels)
- add_index :good_jobs, :labels, using: :gin, where: "(labels IS NOT NULL)",
- name: :index_good_jobs_on_labels, algorithm: :concurrently
- end
- end
+ private
+
+ def reorder!
+ # Reorder the project roots
+ reorder_siblings Project.roots
+
+ # Reorder every project hierarchy
+ Project
+ .where(id: unique_parent_ids)
+ .find_each { |project| reorder_siblings(project.children) }
+ end
+
+ def unique_parent_ids
+ Project
+ .where.not(parent_id: nil)
+ .select(:parent_id)
+ .distinct
+ end
+
+ def reorder_siblings(siblings)
+ return unless siblings.many?
+
+ # Resort children manually
+ sorted = siblings.sort_by { |project| project.name.downcase }
+
+ # Get the current first child
+ first = siblings.first
- dir.down do
- if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels)
- remove_index :good_jobs, name: :index_good_jobs_on_labels
+ sorted.each_with_index do |child, i|
+ if i == 0
+ child.move_to_left_of(first) unless child == first
+ else
+ child.move_to_right_of(sorted[i - 1])
end
end
end
diff --git a/app/workers/rake_job.rb b/app/workers/rake_job.rb
index a86cf73635a7..dfeb57477aa8 100644
--- a/app/workers/rake_job.rb
+++ b/app/workers/rake_job.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require "rake"
+require 'rake'
##
# Invoke a rake task while safely loading the tasks only once
diff --git a/app/workers/scm/create_local_repository_job.rb b/app/workers/scm/create_local_repository_job.rb
index 109799ef4a77..3ccdb62a9a34 100644
--- a/app/workers/scm/create_local_repository_job.rb
+++ b/app/workers/scm/create_local_repository_job.rb
@@ -38,7 +38,7 @@ def self.ensure_not_existing!(repository)
# Cowardly refusing to override existing local repository
if File.directory?(repository.root_url)
raise OpenProject::SCM::Exceptions::SCMError.new(
- I18n.t("repositories.errors.exists_on_filesystem")
+ I18n.t('repositories.errors.exists_on_filesystem')
)
end
end
diff --git a/app/workers/scm/create_remote_repository_job.rb b/app/workers/scm/create_remote_repository_job.rb
index d72aff9ce9de..17e85b8d86c7 100644
--- a/app/workers/scm/create_remote_repository_job.rb
+++ b/app/workers/scm/create_remote_repository_job.rb
@@ -39,12 +39,12 @@ def perform(repository)
super(repository)
response = send_request(repository_request.merge(action: :create))
- repository.root_url = response["path"]
- repository.url = response["url"]
+ repository.root_url = response['path']
+ repository.url = response['url']
unless repository.save
raise OpenProject::SCM::Exceptions::SCMError.new(
- I18n.t("repositories.errors.remote_save_failed")
+ I18n.t('repositories.errors.remote_save_failed')
)
end
end
diff --git a/app/workers/scm/relocate_repository_job.rb b/app/workers/scm/relocate_repository_job.rb
index c00fbc238327..f60627962936 100644
--- a/app/workers/scm/relocate_repository_job.rb
+++ b/app/workers/scm/relocate_repository_job.rb
@@ -50,8 +50,8 @@ def relocate_remote
action: :relocate,
old_identifier: File.basename(repository.root_url)
))
- repository.root_url = response["path"]
- repository.url = response["url"]
+ repository.root_url = response['path']
+ repository.url = response['url']
unless repository.save
Rails.logger.error("Could not relocate the remote repository " \
diff --git a/app/workers/scm/remote_repository_job.rb b/app/workers/scm/remote_repository_job.rb
index 25fddd5891d8..8f7360f2460f 100644
--- a/app/workers/scm/remote_repository_job.rb
+++ b/app/workers/scm/remote_repository_job.rb
@@ -34,7 +34,7 @@
# creation and deletion of repositories BOTH on the database and filesystem.
# Until then, a synchronous process is more failsafe.
-require "net/http"
+require 'net/http'
class SCM::RemoteRepositoryJob < ApplicationJob
attr_reader :repository
@@ -49,11 +49,11 @@ def perform(repository)
# Submits the request to the configured managed remote as JSON.
def send_request(request)
uri = repository.class.managed_remote
- req = ::Net::HTTP::Post.new(uri, "Content-Type" => "application/json")
+ req = ::Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
req.body = request.to_json
http = Net::HTTP.new(uri.host, uri.port)
- http.use_ssl = uri.scheme == "https"
+ http.use_ssl = uri.scheme == 'https'
http.verify_mode = configured_verification
response = http.request(req)
@@ -61,9 +61,9 @@ def send_request(request)
unless response.is_a? ::Net::HTTPSuccess
raise OpenProject::SCM::Exceptions::SCMError.new(
- I18n.t("repositories.errors.remote_call_failed",
+ I18n.t('repositories.errors.remote_call_failed',
code: response.code,
- message: info["message"])
+ message: info['message'])
)
end
@@ -74,7 +74,7 @@ def try_to_parse_response(body)
JSON.parse(body)
rescue JSON::JSONError => e
raise OpenProject::SCM::Exceptions::SCMError.new(
- I18n.t("repositories.errors.remote_invalid_response")
+ I18n.t('repositories.errors.remote_invalid_response')
)
end
diff --git a/app/workers/work_packages/apply_working_days_change_job.rb b/app/workers/work_packages/apply_working_days_change_job.rb
index feff945dc083..db79c3c43019 100644
--- a/app/workers/work_packages/apply_working_days_change_job.rb
+++ b/app/workers/work_packages/apply_working_days_change_job.rb
@@ -27,12 +27,8 @@
#++
class WorkPackages::ApplyWorkingDaysChangeJob < ApplicationJob
- include JobConcurrency
queue_with_priority :above_normal
-
- good_job_control_concurrency_with(
- total_limit: 1
- )
+ include ::ScheduledJob
def perform(user_id:, previous_working_days:, previous_non_working_days:)
user = User.find(user_id)
diff --git a/app/workers/work_packages/bulk_copy_job.rb b/app/workers/work_packages/bulk_copy_job.rb
index 7ad99e4328ca..cee69afb9bd7 100644
--- a/app/workers/work_packages/bulk_copy_job.rb
+++ b/app/workers/work_packages/bulk_copy_job.rb
@@ -39,7 +39,7 @@ def success_message
end
def failure_message
- I18n.t("work_packages.bulk.copy_failed")
+ I18n.t('work_packages.bulk.copy_failed')
end
end
end
diff --git a/app/workers/work_packages/bulk_move_job.rb b/app/workers/work_packages/bulk_move_job.rb
index 5929f47adca1..abeb0897162b 100644
--- a/app/workers/work_packages/bulk_move_job.rb
+++ b/app/workers/work_packages/bulk_move_job.rb
@@ -39,7 +39,7 @@ def success_message
end
def failure_message
- I18n.t("work_packages.bulk.move_failed")
+ I18n.t('work_packages.bulk.move_failed')
end
end
end
diff --git a/app/workers/work_packages/export_job.rb b/app/workers/work_packages/export_job.rb
index 1653ba317b9a..9480accda02d 100644
--- a/app/workers/work_packages/export_job.rb
+++ b/app/workers/work_packages/export_job.rb
@@ -1,11 +1,11 @@
-require "active_storage/filename"
+require 'active_storage/filename'
module WorkPackages
class ExportJob < ::Exports::ExportJob
self.model = WorkPackage
def title
- I18n.t("export.your_work_packages_export")
+ I18n.t('export.your_work_packages_export')
end
private
@@ -15,7 +15,7 @@ def prepare!
end
def set_query_props(query, query_attributes)
- filters = query_attributes.delete("filters")
+ filters = query_attributes.delete('filters')
filters = Queries::WorkPackages::FilterSerializer.load(filters)
query.tap do |q|
diff --git a/bin/check-worker-liveness b/bin/check-worker-liveness
index 7d02aff9ff47..fe248d9dfb66 100755
--- a/bin/check-worker-liveness
+++ b/bin/check-worker-liveness
@@ -13,7 +13,7 @@ FAIL_COUNT_FILE=/tmp/.liveness-check-fail-count.op
#
# This checks across all workers and can't tell if it's only this worker in particular
# that doesn't seem to be doing anything.
-UNPROCESSED_COUNT=`psql -d ${DATABASE_URL%%\?*} -c "select count(*) from good_jobs where finished_at is null and scheduled_at < (now() - interval '15 minutes');" | tail -n +3 | head -n1 | tr -d ' '`
+UNPROCESSED_COUNT=`psql -d ${DATABASE_URL%%\?*} -c "select count(*) from delayed_jobs where locked_by is null and run_at < (now() - interval '15 minutes');" | tail -n +3 | head -n1 | tr -d ' '`
echo "unprocessed: $UNPROCESSED_COUNT"
@@ -25,7 +25,7 @@ if [ "$UNPROCESSED_COUNT" = "0" ]; then
exit 0
else
- MIN_RUN_AT=`psql -d ${DATABASE_URL%%\?*} -c "select scheduled_at from good_jobs where finished_at is null and cron_key is null and scheduled_at is not null and scheduled_at < (now() - interval '1 minutes') order by scheduled_at asc limit 1;" | tail -n +3 | head -n1`
+ MIN_RUN_AT=`psql -d ${DATABASE_URL%%\?*} -c "select run_at from delayed_jobs where locked_by is null and cron is null and run_at is not null and run_at < (now() - interval '1 minutes') order by run_at asc limit 1;" | tail -n +3 | head -n1`
LAST_MIN_RUN_AT=`cat $MIN_RUN_AT_FILE 2>/dev/null || echo 0`
NUM_FAILS=`cat $FAIL_COUNT_FILE 2>/dev/null || echo 0`
diff --git a/bin/check-worker-readiness b/bin/check-worker-readiness
index 1f9beb41ac30..84fbd973fe48 100755
--- a/bin/check-worker-readiness
+++ b/bin/check-worker-readiness
@@ -1,6 +1,6 @@
#!/bin/bash
-if ps aux | grep 'good_job start' | grep -v grep; then
+if ps aux | grep 'rake jobs:work' | grep -v grep; then
echo "background worker running"
exit 0
fi
diff --git a/bin/delayed_job b/bin/delayed_job
new file mode 100755
index 000000000000..edf195985f69
--- /dev/null
+++ b/bin/delayed_job
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
+require 'delayed/command'
+Delayed::Command.new(ARGV).daemonize
diff --git a/bin/setup_dev b/bin/setup_dev
index 7236581a7fc5..b69721264a9c 100755
--- a/bin/setup_dev
+++ b/bin/setup_dev
@@ -30,7 +30,7 @@ echo "---------------------------------------"
echo "Done. Now start the following services"
echo '- Rails server `RAILS_ENV=development bin/rails server`'
echo '- Angular CLI: `npm run serve`'
-echo '- Good Job worker: `RAILS_ENV=development bundle exec good_job start`'
+echo '- Delayed Job worker: `RAILS_ENV=development bin/rails jobs:work`'
echo ""
echo 'You can also run `bin/dev` to run all the above on a single terminal.'
echo ""
diff --git a/config.ru b/config.ru
index 2f1cc5f2e89b..3f4f6b1679bd 100644
--- a/config.ru
+++ b/config.ru
@@ -28,11 +28,11 @@
# This file is used by Rack-based servers to start the application.
-require File.expand_path("config/environment", __dir__)
+require File.expand_path('config/environment', __dir__)
subdir = OpenProject::Configuration.rails_relative_url_root.presence
-map (subdir || "/") do
+map (subdir || '/') do
use Rack::Protection::JsonCsrf
use Rack::Protection::FrameOptions
diff --git a/config/application.rb b/config/application.rb
index abcf69011f0b..3c92d6857a32 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -212,20 +212,7 @@ class Application < Rails::Application
# This allows for setting the root either via config file or via environment variable.
config.action_controller.relative_url_root = OpenProject::Configuration['rails_relative_url_root']
- config.active_job.queue_adapter = :good_job
-
- config.good_job.retry_on_unhandled_error = false
- # It has been commented out because AppSignal gem modifies ActiveJob::Base to report exceptions already.
- # config.good_job.on_thread_error = -> (exception) { OpenProject.logger.error(exception) }
- config.good_job.execution_mode = :external
- config.good_job.preserve_job_records = true
- config.good_job.cleanup_preserved_jobs_before_seconds_ago = OpenProject::Configuration[:good_job_cleanup_preserved_jobs_before_seconds_ago]
- config.good_job.queues = OpenProject::Configuration[:good_job_queues]
- config.good_job.max_threads = OpenProject::Configuration[:good_job_max_threads]
- config.good_job.max_cache = OpenProject::Configuration[:good_job_max_cache]
- config.good_job.enable_cron = OpenProject::Configuration[:good_job_enable_cron]
- config.good_job.shutdown_timeout = 30
- config.good_job.smaller_number_is_higher_priority = false
+ config.active_job.queue_adapter = :delayed_job
config.action_controller.asset_host = OpenProject::Configuration::AssetHost.value
diff --git a/config/boot.rb b/config/boot.rb
index 64fdb9879e5b..6067c79b2758 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -26,28 +26,28 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
# Load any local boot extras that is kept out of source control
# (e.g., silencing of deprecations)
-if File.exist?(File.join(File.dirname(__FILE__), "additional_boot.rb"))
- instance_eval File.read(File.join(File.dirname(__FILE__), "additional_boot.rb"))
+if File.exist?(File.join(File.dirname(__FILE__), 'additional_boot.rb'))
+ instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_boot.rb'))
end
-require "bundler/setup" # Set up gems listed in the Gemfile.
+require 'bundler/setup' # Set up gems listed in the Gemfile.
-env = ENV.fetch("RAILS_ENV", nil)
+env = ENV.fetch('RAILS_ENV', nil)
# Disable deprecation warnings early on (before loading gems), which behaves as RUBYOPT="-w0"
# to disable the Ruby warnings in production.
# Set OPENPROJECT_PROD_DEPRECATIONS=true if you want to see them for debugging purposes
-if env == "production" && ENV["OPENPROJECT_PROD_DEPRECATIONS"] != "true"
- require "structured_warnings"
+if env == 'production' && ENV['OPENPROJECT_PROD_DEPRECATIONS'] != 'true'
+ require 'structured_warnings'
Warning[:deprecated] = false
StructuredWarnings::BuiltInWarning.disable
StructuredWarnings::DeprecationWarning.disable
end
-if env == "development"
+if env == 'development'
warn "Starting with bootsnap."
- require "bootsnap/setup" # Speed up boot time by caching expensive operations.
+ require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
end
diff --git a/config/constants/ar_to_api_conversions.rb b/config/constants/ar_to_api_conversions.rb
index 1f87be6c494e..d7ba1b77a60b 100644
--- a/config/constants/ar_to_api_conversions.rb
+++ b/config/constants/ar_to_api_conversions.rb
@@ -32,29 +32,29 @@ class ARToAPIConversions
# * from the API to AR
# * from AR to the API
WELL_KNOWN_CONVERSIONS = {
- assigned_to: "assignee",
- version: "version",
- done_ratio: "percentageDone",
- derived_done_ratio: "derivedPercentageDone",
- estimated_hours: "estimatedTime",
- remaining_hours: "remainingTime",
- spent_hours: "spentTime",
- subproject: "subprojectId",
- relation_type: "type",
- mail: "email",
- column_names: "columns",
- sort_criteria: "sortBy",
- message: "post",
- firstname: "firstName",
- lastname: "lastName",
- member: "membership"
+ assigned_to: 'assignee',
+ version: 'version',
+ done_ratio: 'percentageDone',
+ derived_done_ratio: 'derivedPercentageDone',
+ estimated_hours: 'estimatedTime',
+ remaining_hours: 'remainingTime',
+ spent_hours: 'spentTime',
+ subproject: 'subprojectId',
+ relation_type: 'type',
+ mail: 'email',
+ column_names: 'columns',
+ sort_criteria: 'sortBy',
+ message: 'post',
+ firstname: 'firstName',
+ lastname: 'lastName',
+ member: 'membership'
}.freeze
# Conversions that are unidirectional (from the API to AR)
# This can be used to still support renamed filters/sort_by, like for created/updatedOn.
WELL_KNOWN_API_TO_AR_CONVERSIONS = {
- created_on: "created_at",
- updated_on: "updated_at"
+ created_on: 'created_at',
+ updated_on: 'updated_at'
}.freeze
class << self
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index 28df4a724e10..5fce328a34e9 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -28,7 +28,7 @@
module Settings
class Definition
- ENV_PREFIX = "OPENPROJECT_".freeze
+ ENV_PREFIX = 'OPENPROJECT_'.freeze
AR_BOOLEAN_TYPE = ActiveRecord::Type::Boolean.new
DEFINITIONS = {
activity_days_default: {
@@ -36,38 +36,34 @@ class Definition
},
after_first_login_redirect_url: {
format: :string,
- description: "URL users logging in for the first time will be redirected to (e.g., a help screen)",
+ description: 'URL users logging in for the first time will be redirected to (e.g., a help screen)',
default: nil
},
after_login_default_redirect_url: {
- description: "Override URL to which logged in users are redirected instead of the My page",
+ description: 'Override URL to which logged in users are redirected instead of the My page',
format: :string,
default: nil
},
apiv3_cors_enabled: {
- description: "Enable CORS headers for APIv3 server responses",
+ description: 'Enable CORS headers for APIv3 server responses',
default: false
},
apiv3_cors_origins: {
default: []
},
apiv3_docs_enabled: {
- description: "Enable interactive APIv3 documentation as part of the application",
+ description: 'Enable interactive APIv3 documentation as part of the application',
default: true
},
apiv3_enable_basic_auth: {
- description: "Enable API token or global basic authentication for APIv3 requests",
+ description: 'Enable API token or global basic authentication for APIv3 requests',
default: true
},
apiv3_max_page_size: {
default: 1000
},
- apiv3_write_readonly_attributes: {
- description: "Allow overriding readonly attributes (e.g. createdAt, updatedAt, author) during the creation of resources via the REST API",
- default: false
- },
app_title: {
- default: "OpenProject"
+ default: 'OpenProject'
},
attachment_max_size: {
default: 5120
@@ -80,41 +76,41 @@ class Definition
# Carrierwave storage type. Possible values are, among others, :file and :fog.
# The latter requires further configuration.
attachments_storage: {
- description: "File storage configuration",
+ description: 'File storage configuration',
default: :file,
format: :symbol,
allowed: %i[file fog],
writable: false
},
attachments_storage_path: {
- description: "File storage disk location (only applicable for local file storage)",
+ description: 'File storage disk location (only applicable for local file storage)',
format: :string,
default: nil,
writable: false
},
attachments_grace_period: {
- description: "Time in minutes to wait before uploaded files not attached to any container are removed",
+ description: 'Time in minutes to wait before uploaded files not attached to any container are removed',
default: 180
},
antivirus_scan_mode: {
- description: "Virus scanning option for files uploaded to OpenProject",
+ description: 'Virus scanning option for files uploaded to OpenProject',
format: :symbol,
default: :disabled,
allowed: %i[disabled clamav_socket clamav_host]
},
antivirus_scan_target: {
- description: "The socket or hostname to connect to ClamAV",
+ description: 'The socket or hostname to connect to ClamAV',
format: :string,
default: nil
},
antivirus_scan_action: {
- description: "Virus scanning action for found infected files",
+ description: 'Virus scanning action for found infected files',
format: :symbol,
default: :quarantine,
allowed: %i[quarantine delete]
},
auth_source_sso: {
- description: "Configuration for Header-based Single Sign-On",
+ description: 'Configuration for Header-based Single Sign-On',
format: :hash,
default: nil,
writable: false # config is cached globally so let's make it not writable
@@ -127,7 +123,7 @@ class Definition
# user: admin
# password: 123456
authentication: {
- description: "Configuration options for global basic auth",
+ description: 'Configuration options for global basic auth',
format: :hash,
default: nil
},
@@ -142,12 +138,12 @@ class Definition
allowed: [1, 7, 14, 30, 60, 90, 365]
},
autologin_cookie_name: {
- description: "Cookie name for autologin cookie",
- default: "autologin"
+ description: 'Cookie name for autologin cookie',
+ default: 'autologin'
},
autologin_cookie_path: {
- description: "Cookie path for autologin cookie",
- default: "/"
+ description: 'Cookie path for autologin cookie',
+ default: '/'
},
available_languages: {
format: :array,
@@ -157,33 +153,33 @@ class Definition
allowed: -> { Redmine::I18n.all_languages }
},
avatar_link_expiry_seconds: {
- description: "Cache duration for avatar image API responses",
+ description: 'Cache duration for avatar image API responses',
default: 24.hours.to_i
},
# Allow users with the required permissions to create backups via the web interface or API.
backup_enabled: {
- description: "Enable application backups through the UI",
+ description: 'Enable application backups through the UI',
default: true
},
backup_daily_limit: {
- description: "Maximum number of application backups allowed per day",
+ description: 'Maximum number of application backups allowed per day',
default: 3
},
backup_initial_waiting_period: {
- description: "Wait time before newly created backup tokens are usable",
+ description: 'Wait time before newly created backup tokens are usable',
default: 24.hours,
format: :integer
},
backup_include_attachments: {
- description: "Allow inclusion of attachments in application backups",
+ description: 'Allow inclusion of attachments in application backups',
default: true
},
backup_attachment_size_max_sum_mb: {
- description: "Maximum limit of attachment size to include into application backups",
+ description: 'Maximum limit of attachment size to include into application backups',
default: 1024
},
blacklisted_routes: {
- description: "Blocked routes to prevent access to certain modules or pages",
+ description: 'Blocked routes to prevent access to certain modules or pages',
default: [],
writable: false # used in initializer
},
@@ -191,19 +187,19 @@ class Definition
default: true
},
boards_demo_data_available: {
- description: "Internal setting determining availability of demo seed data",
+ description: 'Internal setting determining availability of demo seed data',
default: false
},
brute_force_block_minutes: {
- description: "Number of minutes to block users after presumed brute force attack",
+ description: 'Number of minutes to block users after presumed brute force attack',
default: 30
},
brute_force_block_after_failed_logins: {
- description: "Number of login attempts per user before assuming brute force attack",
+ description: 'Number of login attempts per user before assuming brute force attack',
default: 20
},
cache_expires_in_seconds: {
- description: "Expiration time for memcache entries, empty for no expiry be default",
+ description: 'Expiration time for memcache entries, empty for no expiry be default',
format: :integer,
default: nil,
writable: false
@@ -213,40 +209,40 @@ class Definition
},
# use dalli defaults for memcache
cache_memcache_server: {
- description: "The memcache server host and IP",
+ description: 'The memcache server host and IP',
format: :string,
default: nil,
writable: false
},
cache_redis_url: {
- description: "URL to the redis cache server",
+ description: 'URL to the redis cache server',
format: :string,
default: nil,
writable: false
},
cache_namespace: {
format: :string,
- description: "Namespace for cache keys, useful when multiple applications use a single memcache server",
+ description: 'Namespace for cache keys, useful when multiple applications use a single memcache server',
default: nil,
writable: false
},
commit_fix_done_ratio: {
- description: "Progress to apply when commit fixes work package",
+ description: 'Progress to apply when commit fixes work package',
default: 100
},
commit_fix_keywords: {
- description: "Keywords to look for in commit for fixing work packages",
- default: "fixes,closes"
+ description: 'Keywords to look for in commit for fixing work packages',
+ default: 'fixes,closes'
},
commit_fix_status_id: {
- description: "Assigned status when fixing keyword is found",
+ description: 'Assigned status when fixing keyword is found',
format: :integer,
default: nil,
allowed: -> { Status.pluck(:id) + [nil] }
},
commit_logs_encoding: {
description: "Encoding used to convert commit logs to UTF-8",
- default: "UTF-8"
+ default: 'UTF-8'
},
commit_logtime_activity_id: {
description: :setting_commit_logtime_activity_id,
@@ -260,7 +256,7 @@ class Definition
},
commit_ref_keywords: {
description: "Keywords used in commits for referencing work packages",
- default: "refs,references,IssueID"
+ default: 'refs,references,IssueID'
},
consent_decline_mail: {
format: :string,
@@ -287,7 +283,7 @@ class Definition
default: true
},
database_cipher_key: {
- description: "Encryption key for repository credentials",
+ description: 'Encryption key for repository credentials',
format: :string,
default: nil,
writable: false
@@ -296,28 +292,28 @@ class Definition
format: :string,
default: nil,
allowed: [
- "%Y-%m-%d",
- "%d/%m/%Y",
- "%d.%m.%Y",
- "%d-%m-%Y",
- "%m/%d/%Y",
- "%d %b %Y",
- "%d %B %Y",
- "%b %d, %Y",
- "%B %d, %Y"
+ '%Y-%m-%d',
+ '%d/%m/%Y',
+ '%d.%m.%Y',
+ '%d-%m-%Y',
+ '%m/%d/%Y',
+ '%d %b %Y',
+ '%d %B %Y',
+ '%b %d, %Y',
+ '%B %d, %Y'
].freeze
},
default_auto_hide_popups: {
- description: "Whether to automatically hide success notifications by default",
+ description: 'Whether to automatically hide success notifications by default',
default: true
},
# user configuration
default_comment_sort_order: {
- description: "Default sort order for activities",
- default: "asc"
+ description: 'Default sort order for activities',
+ default: 'asc'
},
default_language: {
- default: "en",
+ default: 'en',
allowed: -> { Redmine::I18n.all_languages }
},
default_projects_modules: {
@@ -337,7 +333,7 @@ class Definition
default: false
},
development_highlight_enabled: {
- description: "Enable highlighting of development environment",
+ description: 'Enable highlighting of development environment',
default: -> { Rails.env.development? },
format: :boolean
},
@@ -345,18 +341,18 @@ class Definition
default: 1500
},
direct_uploads: {
- description: "Enable direct uploads to AWS S3. Only applicable with enabled Fog / AWS S3 configuration",
+ description: 'Enable direct uploads to AWS S3. Only applicable with enabled Fog / AWS S3 configuration',
default: true,
writable: false
},
disable_browser_cache: {
- description: "Prevent browser from caching any logged-in responses for security reasons",
+ description: 'Prevent browser from caching any logged-in responses for security reasons',
default: true,
writable: false
},
# allow to disable default modules
disabled_modules: {
- description: "A list of module names to prevent access to in the application",
+ description: 'A list of module names to prevent access to in the application',
default: [],
allowed: -> { OpenProject::AccessControl.available_project_modules.map(&:to_s) },
writable: false # setting stored in global variable
@@ -366,48 +362,48 @@ class Definition
default: false
},
disable_password_login: {
- description: "Disable internal logins and instead only allow SSO through OmniAuth.",
+ description: 'Disable internal logins and instead only allow SSO through OmniAuth.',
default: false
},
display_subprojects_work_packages: {
default: true
},
drop_old_sessions_on_logout: {
- description: "Destroy all sessions for current_user on logout",
+ description: 'Destroy all sessions for current_user on logout',
default: true
},
drop_old_sessions_on_login: {
- description: "Destroy all sessions for current_user on login",
+ description: 'Destroy all sessions for current_user on login',
default: false
},
edition: {
format: :string,
- default: "standard",
- description: "OpenProject edition mode",
+ default: 'standard',
+ description: 'OpenProject edition mode',
writable: false,
allowed: %w[standard bim]
},
ee_manager_visible: {
- description: "Show or hide the Enterprise configuration page and enterprise banners",
+ description: 'Show or hide the Enterprise configuration page and enterprise banners',
default: true,
writable: false
},
enable_internal_assets_server: {
- description: "Serve assets through the Rails internal asset server",
+ description: 'Serve assets through the Rails internal asset server',
default: false,
writable: false
},
# email configuration
email_delivery_configuration: {
- default: "inapp",
+ default: 'inapp',
allowed: %w[inapp legacy],
writable: false,
- env_alias: "EMAIL_DELIVERY_CONFIGURATION"
+ env_alias: 'EMAIL_DELIVERY_CONFIGURATION'
},
email_delivery_method: {
format: :symbol,
default: nil,
- env_alias: "EMAIL_DELIVERY_METHOD"
+ env_alias: 'EMAIL_DELIVERY_METHOD'
},
emails_salutation: {
allowed: %w[firstname name],
@@ -415,12 +411,12 @@ class Definition
},
emails_footer: {
default: {
- "en" => ""
+ 'en' => ''
}
},
emails_header: {
default: {
- "en" => ""
+ 'en' => ''
}
},
# use email address as login, hide login in registration form
@@ -436,18 +432,18 @@ class Definition
},
# Allow connections for trial creation and booking
enterprise_trial_creation_host: {
- description: "Host for EE trial service",
- default: "https://start.openproject.com",
+ description: 'Host for EE trial service',
+ default: 'https://start.openproject.com',
writable: false
},
enterprise_chargebee_site: {
- description: "Site name for EE trial service",
- default: "openproject-enterprise",
+ description: 'Site name for EE trial service',
+ default: 'openproject-enterprise',
writable: false
},
enterprise_plan: {
- description: "Default EE selected plan",
- default: "enterprise-on-premises---euro---1-year",
+ description: 'Default EE selected plan',
+ default: 'enterprise-on-premises---euro---1-year',
writable: false
},
feeds_enabled: {
@@ -467,97 +463,74 @@ class Definition
allowed: [1, 4]
},
fog: {
- description: "Configure fog, e.g. when using an S3 uploader",
+ description: 'Configure fog, e.g. when using an S3 uploader',
default: {}
},
fog_download_url_expires_in: {
- description: "Expiration time in seconds of created shared presigned URLs",
+ description: 'Expiration time in seconds of created shared presigned URLs',
default: 21600 # 6h by default as 6 hours is max in S3 when using IAM roles
},
# Additional / overridden help links
force_help_link: {
- description: "You can set a custom URL for the help button in application header menu.",
+ description: 'You can set a custom URL for the help button in application header menu.',
format: :string,
default: nil
},
force_formatting_help_link: {
- description: "You can set a custom URL for the help button in the WYSIWYG editor.",
+ description: 'You can set a custom URL for the help button in the WYSIWYG editor.',
format: :string,
default: nil
},
forced_single_page_size: {
- description: "Forced page size for manually sorted work package views",
+ description: 'Forced page size for manually sorted work package views',
default: 250
},
- good_job_queues: {
- description: "",
- format: :string,
- writable: false,
- default: "*"
- },
- good_job_max_threads: {
- description: "",
- format: :integer,
- writable: false,
- default: 20
- },
- good_job_max_cache: {
- description: "",
- format: :integer,
- writable: false,
- default: 10_000
- },
- good_job_enable_cron: {
- description: "",
- format: :boolean,
- writable: false,
- default: true
- },
- good_job_cleanup_preserved_jobs_before_seconds_ago: {
- description: "",
- format: :integer,
- writable: false,
- default: 7.days
- },
host_name: {
default: "localhost:3000"
},
# Health check configuration
health_checks_authentication_password: {
- description: "Add an authentication challenge for the /health_check endpoint",
+ description: 'Add an authentication challenge for the /health_check endpoint',
format: :string,
default: nil
},
+ # Maximum number of backed up jobs (that are not yet executed)
+ # before health check fails
+ health_checks_jobs_queue_count_threshold: {
+ description: 'Set threshold of backed up background jobs to fail health check',
+ format: :integer,
+ default: 50
+ },
## Maximum number of minutes that jobs have not yet run after their designated 'run_at' time
health_checks_jobs_never_ran_minutes_ago: {
- description: "Set threshold of outstanding background jobs to fail health check",
+ description: 'Set threshold of outstanding background jobs to fail health check',
format: :integer,
default: 5
},
## Maximum number of unprocessed requests in puma's backlog.
health_checks_backlog_threshold: {
- description: "Set threshold of outstanding HTTP requests to fail health check",
+ description: 'Set threshold of outstanding HTTP requests to fail health check',
format: :integer,
default: 20
},
# Default gravatar image, set to something other than 404
# to ensure a default is returned
gravatar_fallback_image: {
- description: "Set default gravatar image fallback",
- default: "404"
+ description: 'Set default gravatar image fallback',
+ default: '404'
},
hidden_menu_items: {
- description: "Hide menu items in the menu sidebar for each main menu (such as Administration and Projects).",
+ description: 'Hide menu items in the menu sidebar for each main menu (such as Administration and Projects).',
default: {},
writable: false # cached in global variable
},
impressum_link: {
- description: "Impressum link to be set, hidden by default",
+ description: 'Impressum link to be set, hidden by default',
format: :string,
default: nil
},
installation_type: {
- default: "manual",
+ default: 'manual',
writable: false
},
installation_uuid: {
@@ -565,7 +538,7 @@ class Definition
default: nil
},
internal_password_confirmation: {
- description: "Require password confirmations for certain administrative actions",
+ description: 'Require password confirmations for certain administrative actions',
default: true
},
invitation_expiration_days: {
@@ -575,20 +548,20 @@ class Definition
default: 5
},
ldap_force_no_page: {
- description: "Force LDAP to respond as a single page, in case paged responses do not work with your server.",
+ description: 'Force LDAP to respond as a single page, in case paged responses do not work with your server.',
format: :string,
default: nil
},
ldap_groups_disable_sync_job: {
- description: "Deactivate regular synchronization job for groups in case scheduled as a separate cronjob",
+ description: 'Deactivate regular synchronization job for groups in case scheduled as a separate cronjob',
default: false
},
ldap_users_disable_sync_job: {
- description: "Deactivate user attributes synchronization from LDAP",
+ description: 'Deactivate user attributes synchronization from LDAP',
default: false
},
ldap_users_sync_status: {
- description: "Enable user status (locked/unlocked) synchronization from LDAP",
+ description: 'Enable user status (locked/unlocked) synchronization from LDAP',
format: :boolean,
default: false
},
@@ -598,8 +571,8 @@ class Definition
writable: true
},
log_level: {
- description: "Set the OpenProject logger level",
- default: Rails.env.development? ? "debug" : "info",
+ description: 'Set the OpenProject logger level',
+ default: Rails.env.development? ? 'debug' : 'info',
allowed: %w[debug info warn error fatal],
writable: false
},
@@ -607,14 +580,14 @@ class Definition
default: false
},
lograge_enabled: {
- description: "Use lograge formatter for outputting logs",
+ description: 'Use lograge formatter for outputting logs',
default: true,
format: :boolean,
writable: false
},
lograge_formatter: {
- description: "Lograge formatter to use for outputting logs",
- default: "key_value",
+ description: 'Lograge formatter to use for outputting logs',
+ default: 'key_value',
format: :string,
writable: false
},
@@ -622,42 +595,42 @@ class Definition
default: true
},
lookbook_enabled: {
- description: "Enable the Lookbook component documentation tool. Discouraged for production environments.",
+ description: 'Enable the Lookbook component documentation tool. Discouraged for production environments.',
default: -> { Rails.env.development? },
format: :boolean
},
lost_password: {
- description: "Activate or deactivate lost password form",
+ description: 'Activate or deactivate lost password form',
default: true
},
mail_from: {
- default: "openproject@example.net"
+ default: 'openproject@example.net'
},
mail_handler_api_key: {
format: :string,
default: nil
},
mail_handler_body_delimiters: {
- default: ""
+ default: ''
},
mail_handler_body_delimiter_regex: {
- default: ""
+ default: ''
},
mail_handler_ignore_filenames: {
- default: "signature.asc"
+ default: 'signature.asc'
},
mail_suffix_separators: {
- default: "+"
+ default: '+'
},
main_content_language: {
- default: "english",
- description: "Main content language for PostgreSQL full text features",
+ default: 'english',
+ description: 'Main content language for PostgreSQL full text features',
writable: false,
allowed: %w[danish dutch english finnish french german hungarian
italian norwegian portuguese romanian russian simple spanish swedish turkish]
},
migration_check_on_exceptions: {
- description: "Check for missing migrations in internal errors",
+ description: 'Check for missing migrations in internal errors',
default: true,
writable: false
},
@@ -675,12 +648,12 @@ class Definition
default: 60000
},
oauth_allow_remapping_of_existing_users: {
- description: "When set to false, prevent users from other identity providers to take over accounts connected " \
- "to another identity provider.",
+ description: 'When set to false, prevent users from other identity providers to take over accounts connected ' \
+ 'to another identity provider.',
default: true
},
omniauth_direct_login_provider: {
- description: "Clicking on login sends a login request to the specified OmniAuth provider.",
+ description: 'Clicking on login sends a login request to the specified OmniAuth provider.',
format: :string,
default: nil
},
@@ -691,11 +664,11 @@ class Definition
writable: false # this changes a global variable and must therefore not be writable at runtime
},
onboarding_video_url: {
- description: "Onboarding guide instructional video URL",
- default: "https://player.vimeo.com/video/163426858?autoplay=1"
+ description: 'Onboarding guide instructional video URL',
+ default: 'https://player.vimeo.com/video/163426858?autoplay=1'
},
onboarding_enabled: {
- description: "Enable or disable onboarding guided tour for new users",
+ description: 'Enable or disable onboarding guided tour for new users',
default: true
},
password_active_rules: {
@@ -718,7 +691,7 @@ class Definition
# Requires a migration to be written
# replace Setting#per_page_options_array
per_page_options: {
- default: "20, 100"
+ default: '20, 100'
},
plain_text_mail: {
default: false
@@ -728,63 +701,63 @@ class Definition
format: :string
},
rails_asset_host: {
- description: "Custom asset hostname for serving assets (e.g., Cloudfront)",
+ description: 'Custom asset hostname for serving assets (e.g., Cloudfront)',
format: :string,
default: nil,
writable: false
},
rails_cache_store: {
- description: "Set cache store implemenation to use with OpenProject",
+ description: 'Set cache store implemenation to use with OpenProject',
format: :symbol,
default: :file_store,
writable: false,
allowed: %i[file_store memcache redis]
},
rails_relative_url_root: {
- description: "Set a URL prefix / base path to run OpenProject under, e.g., host.tld/openproject",
- default: "",
+ description: 'Set a URL prefix / base path to run OpenProject under, e.g., host.tld/openproject',
+ default: '',
writable: false
},
https: {
- description: "Set assumed connection security for the Rails processes",
+ description: 'Set assumed connection security for the Rails processes',
format: :boolean,
default: -> { Rails.env.production? },
writable: false
},
hsts: {
- description: "Allow disabling of HSTS headers and http -> https redirects",
+ description: 'Allow disabling of HSTS headers and http -> https redirects',
format: :boolean,
default: true,
writable: false
},
home_url: {
- description: "Override default link when clicking on the top menu logo (Homescreen by default).",
+ description: 'Override default link when clicking on the top menu logo (Homescreen by default).',
format: :string,
default: nil
},
httpx_connect_timeout: {
- description: "",
+ description: '',
format: :float,
writable: false,
allowed: (0..),
default: 3
},
httpx_read_timeout: {
- description: "",
+ description: '',
format: :float,
writable: false,
allowed: (0..),
default: 3
},
httpx_write_timeout: {
- description: "",
+ description: '',
format: :float,
writable: false,
allowed: (0..),
default: 3
},
httpx_keep_alive_timeout: {
- description: "",
+ description: '',
format: :float,
writable: false,
allowed: (0..),
@@ -792,27 +765,27 @@ class Definition
},
rate_limiting: {
default: {},
- description: "Configure rate limiting for various endpoint rules. See configuration documentation for details."
+ description: 'Configure rate limiting for various endpoint rules. See configuration documentation for details.'
},
registration_footer: {
default: {
- "en" => ""
+ 'en' => ''
}
},
remote_storage_upload_host: {
format: :string,
default: nil,
writable: false,
- description: "Host the frontend uses to upload files to, which has to be added to the CSP."
+ description: 'Host the frontend uses to upload files to, which has to be added to the CSP.'
},
remote_storage_download_host: {
format: :string,
default: nil,
writable: false,
- description: "Host the frontend uses to download files, which has to be added to the CSP."
+ description: 'Host the frontend uses to download files, which has to be added to the CSP.'
},
report_incoming_email_errors: {
- description: "Respond to incoming mails with error details",
+ description: 'Respond to incoming mails with error details',
default: true
},
repositories_automatic_managed_vendor: {
@@ -858,7 +831,7 @@ class Definition
writable: false
},
scm_local_checkout_path: {
- default: "repositories", # relative to OpenProject directory
+ default: 'repositories', # relative to OpenProject directory
writable: false
},
scm_subversion_command: {
@@ -871,32 +844,32 @@ class Definition
default: true
},
security_badge_url: {
- description: "URL of the update check badge",
+ description: 'URL of the update check badge',
default: "https://releases.openproject.com/v1/check.svg",
writable: false
},
seed_admin_user_password: {
description: 'Password to set for the initially created admin user (Login remains "admin").',
- default: "admin",
+ default: 'admin',
writable: false
},
seed_admin_user_mail: {
- description: "E-mail to set for the initially created admin user.",
- default: "admin@example.net",
+ description: 'E-mail to set for the initially created admin user.',
+ default: 'admin@example.net',
writable: false
},
seed_admin_user_name: {
- description: "Name to set for the initially created admin user.",
- default: "OpenProject Admin",
+ description: 'Name to set for the initially created admin user.',
+ default: 'OpenProject Admin',
writable: false
},
seed_admin_user_password_reset: {
- description: "Whether to force a password reset for the initially created admin user.",
+ description: 'Whether to force a password reset for the initially created admin user.',
default: true,
writable: false
},
seed_ldap: {
- description: "Provide an LDAP connection and sync settings through ENV",
+ description: 'Provide an LDAP connection and sync settings through ENV',
writable: false,
default: nil,
format: :hash
@@ -905,12 +878,12 @@ class Definition
default: 2
},
sendmail_arguments: {
- description: "Arguments to call sendmail with in case it is configured as outgoing email setup",
+ description: 'Arguments to call sendmail with in case it is configured as outgoing email setup',
format: :string,
default: "-i"
},
sendmail_location: {
- description: "Location of sendmail to call if it is configured as outgoing email setup",
+ description: 'Location of sendmail to call if it is configured as outgoing email setup',
format: :string,
default: "/usr/sbin/sendmail"
},
@@ -918,11 +891,11 @@ class Definition
appsignal_frontend_key: {
format: :string,
default: nil,
- description: "Appsignal API key for JavaScript error reporting"
+ description: 'Appsignal API key for JavaScript error reporting'
},
session_cookie_name: {
- description: "Set session cookie name",
- default: "_open_project_session"
+ description: 'Set session cookie name',
+ default: '_open_project_session'
},
session_ttl_enabled: {
default: false
@@ -931,44 +904,44 @@ class Definition
default: 120
},
show_community_links: {
- description: "Enable or disable links to OpenProject community instances",
+ description: 'Enable or disable links to OpenProject community instances',
default: true
},
show_product_version: {
- description: "Show product version information in the administration section",
+ description: 'Show product version information in the administration section',
default: true
},
show_pending_migrations_warning: {
- description: "Enable or disable warning bar in case of pending migrations",
+ description: 'Enable or disable warning bar in case of pending migrations',
default: true,
writable: false
},
show_setting_mismatch_warning: {
- description: "Show mismatched protocol/hostname warning. In cases where they must differ this can be disabled",
+ description: 'Show mismatched protocol/hostname warning. In cases where they must differ this can be disabled',
default: true
},
# Render storage information
show_storage_information: {
- description: "Show available and taken storage information under administration / info",
+ description: 'Show available and taken storage information under administration / info',
default: true
},
show_warning_bars: {
- description: "Render warning bars (pending migrations, deprecation, unsupported browsers)",
+ description: 'Render warning bars (pending migrations, deprecation, unsupported browsers)',
# Hide warning bars by default in tests as they might overlay other elements
default: -> { !Rails.env.test? }
},
smtp_authentication: {
format: :string,
- default: "plain",
- env_alias: "SMTP_AUTHENTICATION"
+ default: 'plain',
+ env_alias: 'SMTP_AUTHENTICATION'
},
smtp_enable_starttls_auto: {
format: :boolean,
default: false,
- env_alias: "SMTP_ENABLE_STARTTLS_AUTO"
+ env_alias: 'SMTP_ENABLE_STARTTLS_AUTO'
},
smtp_openssl_verify_mode: {
- description: "Globally set verify mode for OpenSSL. Careful: Setting to none will disable any SSL verification!",
+ description: 'Globally set verify mode for OpenSSL. Careful: Setting to none will disable any SSL verification!',
format: :string,
default: "peer",
allowed: %w[none peer client_once fail_if_no_peer_cert],
@@ -977,43 +950,43 @@ class Definition
smtp_ssl: {
format: :boolean,
default: false,
- env_alias: "SMTP_SSL"
+ env_alias: 'SMTP_SSL'
},
smtp_address: {
format: :string,
- default: "",
- env_alias: "SMTP_ADDRESS"
+ default: '',
+ env_alias: 'SMTP_ADDRESS'
},
smtp_domain: {
format: :string,
- default: "your.domain.com",
- env_alias: "SMTP_DOMAIN"
+ default: 'your.domain.com',
+ env_alias: 'SMTP_DOMAIN'
},
smtp_user_name: {
format: :string,
- default: "",
- env_alias: "SMTP_USER_NAME"
+ default: '',
+ env_alias: 'SMTP_USER_NAME'
},
smtp_port: {
format: :integer,
default: 587,
- env_alias: "SMTP_PORT"
+ env_alias: 'SMTP_PORT'
},
smtp_password: {
format: :string,
- default: "",
- env_alias: "SMTP_PASSWORD"
+ default: '',
+ env_alias: 'SMTP_PASSWORD'
},
software_name: {
- description: "Override software application name",
- default: "OpenProject"
+ description: 'Override software application name',
+ default: 'OpenProject'
},
software_url: {
- description: "Override software application URL",
- default: "https://www.openproject.org/"
+ description: 'Override software application URL',
+ default: 'https://www.openproject.org/'
},
sql_slow_query_threshold: {
- description: "Time limit in ms after which queries will be logged as slow queries",
+ description: 'Time limit in ms after which queries will be logged as slow queries',
default: 2000,
writable: false
},
@@ -1023,19 +996,19 @@ class Definition
allowed: [1, 6, 7]
},
statsd: {
- description: "enable statsd metrics (currently puma only) by configuring host",
+ description: 'enable statsd metrics (currently puma only) by configuring host',
default: {
- "host" => nil,
- "port" => 8125
+ 'host' => nil,
+ 'port' => 8125
},
writable: false
},
sys_api_enabled: {
- description: "Enable internal system API for setting up managed repositories",
+ description: 'Enable internal system API for setting up managed repositories',
default: false
},
sys_api_key: {
- description: "Internal system API key for setting up managed repositories",
+ description: 'Internal system API key for setting up managed repositories',
default: nil,
format: :string
},
@@ -1043,8 +1016,8 @@ class Definition
format: :string,
default: nil,
allowed: [
- "%H:%M",
- "%I:%M %p"
+ '%H:%M',
+ '%I:%M %p'
].freeze
},
user_default_timezone: {
@@ -1056,10 +1029,10 @@ class Definition
default: false
},
user_default_theme: {
- default: "light",
+ default: 'light',
format: :string,
allowed: -> do
- UserPreferences::Schema.schema.dig("definitions", "UserPreferences", "properties", "theme", "enum")
+ UserPreferences::Schema.schema.dig('definitions', 'UserPreferences', 'properties', 'theme', 'enum')
end
},
users_deletable_by_self: {
@@ -1070,13 +1043,13 @@ class Definition
allowed: -> { User::USER_FORMATS_STRUCTURE.keys }
},
web: {
- description: "Web worker count and threads configuration",
+ description: 'Web worker count and threads configuration',
default: {
- "workers" => 2,
- "timeout" => 120,
- "wait_timeout" => 10,
- "min_threads" => 4,
- "max_threads" => 16
+ 'workers' => 2,
+ 'timeout' => 120,
+ 'wait_timeout' => 10,
+ 'min_threads' => 4,
+ 'max_threads' => 16
},
writable: false
},
@@ -1092,7 +1065,7 @@ class Definition
default: false
},
work_package_done_ratio: {
- default: "field",
+ default: 'field',
allowed: %w[field status disabled]
},
work_packages_projects_export_limit: {
@@ -1109,7 +1082,7 @@ class Definition
},
work_package_list_default_highlighting_mode: {
format: :string,
- default: -> { EnterpriseToken.allows_to?(:conditional_highlighting) ? "inline" : "none" },
+ default: -> { EnterpriseToken.allows_to?(:conditional_highlighting) ? 'inline' : 'none' },
allowed: -> { Query::QUERY_HIGHLIGHTING_MODES.map(&:to_s) },
writable: -> { EnterpriseToken.allows_to?(:conditional_highlighting) }
},
@@ -1121,14 +1094,14 @@ class Definition
default: false
},
working_days: {
- description: "Set working days of the week (Array of 1 to 7, where 1=Monday, 7=Sunday)",
+ description: 'Set working days of the week (Array of 1 to 7, where 1=Monday, 7=Sunday)',
format: :array,
allowed: Array(1..7),
default: Array(1..5) # Sat, Sun being non-working days,
},
youtube_channel: {
- description: "Link to YouTube channel in help menu",
- default: "https://www.youtube.com/c/OpenProjectCommunity"
+ description: 'Link to YouTube channel in help menu',
+ default: 'https://www.youtube.com/c/OpenProjectCommunity'
}
}.freeze
@@ -1293,7 +1266,7 @@ def all
def file_config
@file_config ||= begin
- filename = Rails.root.join("config/configuration.yml")
+ filename = Rails.root.join('config/configuration.yml')
file_config = {}
@@ -1318,8 +1291,8 @@ def override_value(definition)
end
def override_value_from_file(definition)
- envs = ["default", Rails.env]
- envs.delete("default") if Rails.env.test? # The test setup should govern the configuration
+ envs = ['default', Rails.env]
+ envs.delete('default') if Rails.env.test? # The test setup should govern the configuration
envs.each do |env|
next unless (env_config = file_config[env])
next unless env_config.has_key?(definition.name)
@@ -1383,7 +1356,7 @@ def path_to_hash(*path)
end
def unescape_underscores(path_segment)
- path_segment.gsub "__", "_"
+ path_segment.gsub '__', '_'
end
def find_env_var_override(definition)
@@ -1453,7 +1426,7 @@ def env_name_alias(definition)
def extract_value_from_env(env_var_name, env_var_value)
# YAML parses '' as false, but empty ENV variables will be passed as that.
# To specify specific values, one can use !!str (-> '') or !!null (-> nil)
- return env_var_value if env_var_value == ""
+ return env_var_value if env_var_value == ''
parsed = load_yaml(env_var_value)
diff --git a/config/credentials.yml b/config/credentials.yml
index 4c189e69fba1..3a96e7eedc81 100644
--- a/config/credentials.yml
+++ b/config/credentials.yml
@@ -33,7 +33,7 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-# You can use `rails credentials` to generate a secure secret key.
+# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
diff --git a/config/environment.rb b/config/environment.rb
index df243e497597..d968dea66d97 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -27,7 +27,7 @@
#++
# Load the Rails application.
-require_relative "application"
+require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 7a7ad94774d7..5c525fa135b1 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "active_support/core_ext/integer/time"
+require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -53,7 +53,7 @@
# Enable Rails's static asset server when requested
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
- config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS using a preprocessor.
config.assets.js_compressor = nil
@@ -69,7 +69,7 @@
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
- config.assets.version = "1.0"
+ config.assets.version = '1.0'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
@@ -99,7 +99,7 @@
return true unless OpenProject::Configuration.hsts_enabled?
# Respect the relative URL
- relative_url = Regexp.escape(OpenProject::Configuration["rails_relative_url_root"])
+ relative_url = Regexp.escape(OpenProject::Configuration['rails_relative_url_root'])
# When we match SYS controller API, allow non-https access
return true if /#{relative_url}\/sys\//.match?(request.path)
@@ -119,7 +119,7 @@
# config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
# Set to :debug to see everything in the log.
- config.log_level = OpenProject::Configuration["log_level"].to_sym
+ config.log_level = OpenProject::Configuration['log_level'].to_sym
config.assets.quiet = true unless config.log_level == :debug
@@ -152,8 +152,8 @@
config.i18n.fallbacks = true
# Don't log any deprecations.
- config.active_support.report_deprecations = ENV.fetch("OPENPROJECT_SHOW_DEPRECATIONS", nil)
- deprecators.silenced = !ENV.fetch("OPENPROJECT_SHOW_DEPRECATIONS", nil)
+ config.active_support.report_deprecations = ENV.fetch('OPENPROJECT_SHOW_DEPRECATIONS', nil)
+ deprecators.silenced = !ENV.fetch('OPENPROJECT_SHOW_DEPRECATIONS', nil)
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
@@ -172,10 +172,10 @@
if OpenProject::Configuration.enable_internal_assets_server?
config.public_file_server.enabled = true
config.public_file_server.headers = {
- "Access-Control-Allow-Origin" => "*",
- "Access-Control-Allow-Methods" => "GET, OPTIONS, HEAD",
- "Cache-Control" => "public, s-maxage=31536000, max-age=15552000",
- "Expires" => 1.year.from_now.to_fs(:rfc822).to_s
+ 'Access-Control-Allow-Origin' => '*',
+ 'Access-Control-Allow-Methods' => 'GET, OPTIONS, HEAD',
+ 'Cache-Control' => 'public, s-maxage=31536000, max-age=15552000',
+ 'Expires' => 1.year.from_now.to_fs(:rfc822).to_s
}
end
diff --git a/config/environments/test_pgsql.rb b/config/environments/test_pgsql.rb
index f6bdbb51b3ee..574c5da8ea46 100644
--- a/config/environments/test_pgsql.rb
+++ b/config/environments/test_pgsql.rb
@@ -26,4 +26,4 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-instance_eval File.read(File.join(File.dirname(__FILE__), "test.rb"))
+instance_eval File.read(File.join(File.dirname(__FILE__), 'test.rb'))
diff --git a/config/initializers/00-load_plugins.rb b/config/initializers/00-load_plugins.rb
index aeae3a77db65..40566b60b628 100644
--- a/config/initializers/00-load_plugins.rb
+++ b/config/initializers/00-load_plugins.rb
@@ -29,14 +29,14 @@
# TODO: check if this can be postponed and if some plugins can make use of the ActiveSupport.on_load hooks
# Loads the core plugins located in lib_static/plugins
-Dir.glob(Rails.root.join("lib_static/plugins/*")).each do |directory|
+Dir.glob(Rails.root.join('lib_static/plugins/*')).each do |directory|
if File.directory?(directory)
- lib = File.join(directory, "lib")
+ lib = File.join(directory, 'lib')
$:.unshift lib
Rails.configuration.paths.add lib, eager_load: true, glob: "**[^test]/*"
- initializer = File.join(directory, "init.rb")
+ initializer = File.join(directory, 'init.rb')
if File.file?(initializer)
eval(File.read(initializer), binding, initializer)
end
diff --git a/config/initializers/03-db_check.rb b/config/initializers/03-db_check.rb
index 5f2906272719..e026eacd7333 100644
--- a/config/initializers/03-db_check.rb
+++ b/config/initializers/03-db_check.rb
@@ -26,10 +26,10 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-env = ENV["RAILS_ENV"] || "production"
+env = ENV['RAILS_ENV'] || 'production'
if (db_config = ActiveRecord::Base.configurations.configs_for(env_name: env)[0]) &&
- db_config.configuration_hash["adapter"]&.start_with?("mysql")
+ db_config.configuration_hash['adapter']&.start_with?('mysql')
warn <<~ERROR
======= INCOMPATIBLE DATABASE DETECTED =======
Your database is set up for use with a MySQL or MySQL-compatible variant.
diff --git a/config/initializers/05-null_db_fallback.rb b/config/initializers/05-null_db_fallback.rb
index b882f1e0deae..b5fb9cd3bffd 100644
--- a/config/initializers/05-null_db_fallback.rb
+++ b/config/initializers/05-null_db_fallback.rb
@@ -30,6 +30,6 @@
# As initializers and other parts of the boot sequence rely on calls accessing
# the DB, the null db gem is used to fake the existence of a database in cases where
# the db has not been created yet.
-require Rails.root.join("config/constants/open_project/null_db_fallback")
+require Rails.root.join('config/constants/open_project/null_db_fallback')
OpenProject::NullDbFallback.fallback
diff --git a/config/initializers/06-pending_migrations_check.rb b/config/initializers/06-pending_migrations_check.rb
index f564b2e33be8..869095e63b70 100644
--- a/config/initializers/06-pending_migrations_check.rb
+++ b/config/initializers/06-pending_migrations_check.rb
@@ -28,7 +28,7 @@
is_console = Rails.const_defined? :Console
no_rake_task = !(Rake.respond_to?(:application) && Rake.application.top_level_tasks.present?)
-no_override = ENV["OPENPROJECT_DISABLE__MIGRATIONS__CHECK"] != "true"
+no_override = ENV['OPENPROJECT_DISABLE__MIGRATIONS__CHECK'] != 'true'
if Rails.env.production? && !is_console && no_rake_task && no_override
ActiveRecord::Migration.check_pending! # will raise an exception and abort boot
diff --git a/config/initializers/10-load_patches.rb b/config/initializers/10-load_patches.rb
index a066aa06d6d8..05792c1c2504 100644
--- a/config/initializers/10-load_patches.rb
+++ b/config/initializers/10-load_patches.rb
@@ -28,10 +28,10 @@
Rails.application.reloader.to_prepare do
# Do not place any patches within this file. Add a file to lib/open_project/patches
- require "open_project/patches"
+ require 'open_project/patches'
# Whatever ruby file is placed in lib/open_project/patches is required
- Dir.glob(File.expand_path("../../lib/open_project/patches/*.rb", __dir__)).each do |path|
+ Dir.glob(File.expand_path('../../lib/open_project/patches/*.rb', __dir__)).each do |path|
require path
end
end
diff --git a/config/initializers/30-open_project_loading.rb b/config/initializers/30-open_project_loading.rb
index 43fdb1d470d9..0fea8c935977 100644
--- a/config/initializers/30-open_project_loading.rb
+++ b/config/initializers/30-open_project_loading.rb
@@ -26,4 +26,4 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open_project"
+require 'open_project'
diff --git a/config/initializers/activity.rb b/config/initializers/activity.rb
index f2e51ac1c49b..3c9f322f4f7b 100644
--- a/config/initializers/activity.rb
+++ b/config/initializers/activity.rb
@@ -26,36 +26,36 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "../constants/open_project/project_latest_activity"
+require_relative '../constants/open_project/project_latest_activity'
Rails.application.reloader.to_prepare do
OpenProject::Activity.map do |activity|
- activity.register :work_packages, class_name: "::Activities::WorkPackageActivityProvider"
- activity.register :project_attributes, class_name: "Activities::ProjectActivityProvider",
+ activity.register :work_packages, class_name: '::Activities::WorkPackageActivityProvider'
+ activity.register :project_attributes, class_name: 'Activities::ProjectActivityProvider',
default: false
- activity.register :changesets, class_name: "Activities::ChangesetActivityProvider"
- activity.register :news, class_name: "Activities::NewsActivityProvider",
+ activity.register :changesets, class_name: 'Activities::ChangesetActivityProvider'
+ activity.register :news, class_name: 'Activities::NewsActivityProvider',
default: false
- activity.register :wiki_edits, class_name: "Activities::WikiPageActivityProvider",
+ activity.register :wiki_edits, class_name: 'Activities::WikiPageActivityProvider',
default: false
- activity.register :messages, class_name: "Activities::MessageActivityProvider",
+ activity.register :messages, class_name: 'Activities::MessageActivityProvider',
default: false
end
- OpenProject::ProjectLatestActivity.register on: "WorkPackage"
+ OpenProject::ProjectLatestActivity.register on: 'WorkPackage'
- OpenProject::ProjectLatestActivity.register on: "Project",
+ OpenProject::ProjectLatestActivity.register on: 'Project',
project_id_attribute: :id
- OpenProject::ProjectLatestActivity.register on: "Changeset",
- chain: "Repository",
+ OpenProject::ProjectLatestActivity.register on: 'Changeset',
+ chain: 'Repository',
attribute: :committed_on
- OpenProject::ProjectLatestActivity.register on: "News"
+ OpenProject::ProjectLatestActivity.register on: 'News'
- OpenProject::ProjectLatestActivity.register on: "WikiPage",
+ OpenProject::ProjectLatestActivity.register on: 'WikiPage',
chain: %w(Wiki)
- OpenProject::ProjectLatestActivity.register on: "Message",
- chain: "Forum"
+ OpenProject::ProjectLatestActivity.register on: 'Message',
+ chain: 'Forum'
end
diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb
index 453656c319d4..08c0268f7437 100644
--- a/config/initializers/airbrake.rb
+++ b/config/initializers/airbrake.rb
@@ -26,16 +26,16 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-airbrake = OpenProject::Configuration["airbrake"]
+airbrake = OpenProject::Configuration['airbrake']
-if airbrake && airbrake["api_key"]
+if airbrake && airbrake['api_key']
# airbrake isn't loaded by default, so let's do that now
- require "airbrake"
+ require 'airbrake'
Airbrake.configure do |config|
- config.api_key = airbrake["api_key"]
- config.host = airbrake["host"] if airbrake["host"]
- config.port = Integer(airbrake["port"] || 443)
+ config.api_key = airbrake['api_key']
+ config.host = airbrake['host'] if airbrake['host']
+ config.port = Integer(airbrake['port'] || 443)
config.secure = config.port == 443
Rails.logger.info "Successfully connected to Airbrake at #{config.host}:#{config.port}."
diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb
index fd841a338439..933b963e841f 100644
--- a/config/initializers/application_controller_renderer.rb
+++ b/config/initializers/application_controller_renderer.rb
@@ -7,8 +7,8 @@
ActiveSupport::Reloader.to_prepare do
ApplicationController.renderer.instance_variable_set(:@env,
ApplicationController.renderer.instance_variable_get(:@env).merge(
- "HTTP_HOST" => Setting.host_name,
- "HTTPS" => Setting.https?,
- "SCRIPT_NAME" => OpenProject::Configuration.rails_relative_url_root
+ 'HTTP_HOST' => Setting.host_name,
+ 'HTTPS' => Setting.https?,
+ 'SCRIPT_NAME' => OpenProject::Configuration.rails_relative_url_root
))
end
diff --git a/config/initializers/appsignal.rb b/config/initializers/appsignal.rb
index 2b55b1951f69..4447db874e40 100644
--- a/config/initializers/appsignal.rb
+++ b/config/initializers/appsignal.rb
@@ -1,32 +1,32 @@
-require "open_project/version"
-require_relative "../../lib_static/open_project/appsignal"
+require 'open_project/version'
+require_relative '../../lib_static/open_project/appsignal'
if OpenProject::Appsignal.enabled?
- require "appsignal"
+ require 'appsignal'
Rails.application.configure do |app|
config = {
active: true,
- name: ENV.fetch("APPSIGNAL_NAME"),
- push_api_key: ENV.fetch("APPSIGNAL_KEY"),
+ name: ENV.fetch('APPSIGNAL_NAME'),
+ push_api_key: ENV.fetch('APPSIGNAL_KEY'),
revision: OpenProject::VERSION.to_s,
ignore_actions: [
- "OkComputer::OkComputerController#show",
- "OkComputer::OkComputerController#index",
- "GET::API::V3::Notifications::NotificationsAPI",
- "GET::API::V3::Notifications::NotificationsAPI#/notifications/"
+ 'OkComputer::OkComputerController#show',
+ 'OkComputer::OkComputerController#index',
+ 'GET::API::V3::Notifications::NotificationsAPI',
+ 'GET::API::V3::Notifications::NotificationsAPI#/notifications/'
],
ignore_errors: [
- "Grape::Exceptions::MethodNotAllowed",
- "ActionController::UnknownFormat",
- "ActiveJob::DeserializationError",
- "Net::SMTPServerBusy"
+ 'Grape::Exceptions::MethodNotAllowed',
+ 'ActionController::UnknownFormat',
+ 'ActiveJob::DeserializationError',
+ 'Net::SMTPServerBusy'
]
}
- if ENV["APPSIGNAL_DEBUG"] == "true"
- config[:log] = "stdout"
+ if ENV['APPSIGNAL_DEBUG'] == 'true'
+ config[:log] = 'stdout'
config[:debug] = true
- config[:log_level] = "debug"
+ config[:log_level] = 'debug'
end
Appsignal.config = Appsignal::Config.new(
diff --git a/config/initializers/bullet.rb b/config/initializers/bullet.rb
index 0b83d5bf1080..ac7a612a0e33 100644
--- a/config/initializers/bullet.rb
+++ b/config/initializers/bullet.rb
@@ -31,7 +31,7 @@
config.after_initialize do
Bullet.enable = true
# Bullet.alert = true
- Bullet.bullet_logger = true if File.directory?("log") # fails if run from an engine
+ Bullet.bullet_logger = true if File.directory?('log') # fails if run from an engine
Bullet.console = true
# Bullet.growl = true
Bullet.rails_logger = true
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
index 9a7d8f909783..ebcb20e3cc4f 100644
--- a/config/initializers/carrierwave.rb
+++ b/config/initializers/carrierwave.rb
@@ -26,9 +26,9 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "fog/aws"
-require "carrierwave"
-require "carrierwave/storage/fog"
+require 'fog/aws'
+require 'carrierwave'
+require 'carrierwave/storage/fog'
module CarrierWave
module Configuration
@@ -37,13 +37,13 @@ def self.configure_fog!(credentials: OpenProject::Configuration.fog_credentials,
public: false)
# Ensure that the provider AWS is uppercased
- provider = credentials[:provider] || "AWS"
- if [:aws, "aws"].include? provider
- credentials[:provider] = "AWS"
+ provider = credentials[:provider] || 'AWS'
+ if [:aws, 'aws'].include? provider
+ credentials[:provider] = 'AWS'
end
CarrierWave.configure do |config|
- config.fog_provider = "fog/aws"
+ config.fog_provider = 'fog/aws'
config.fog_credentials = credentials
config.fog_directory = directory
config.fog_public = public
diff --git a/config/initializers/cronjobs.rb b/config/initializers/cronjobs.rb
index af7c61e8d6f7..6dda0beb89ed 100644
--- a/config/initializers/cronjobs.rb
+++ b/config/initializers/cronjobs.rb
@@ -1,71 +1,15 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2024 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
# Register "Cron-like jobs"
-Rails.application.config.after_initialize do
- Rails.application.config.good_job.cron.merge!(
- {
- "Cron::ClearOldSessionsJob": {
- cron: "15 1 * * *", # runs at 1:15 nightly
- class: Cron::ClearOldSessionsJob.name
- },
- "Cron::ClearTmpCacheJob": {
- cron: "45 2 * * 7", # runs at 02:45 sundays
- class: Cron::ClearTmpCacheJob.name
- },
- "Cron::ClearUploadedFilesJob": {
- cron: "0 23 * * 5", # runs 23:00 fridays
- class: Cron::ClearUploadedFilesJob.name
- },
- "OAuth::CleanupJob": {
- cron: "52 1 * * *",
- class: OAuth::CleanupJob.name
- },
- "PaperTrailAudits::CleanupJob": {
- cron: "3 4 * * 6",
- class: PaperTrailAudits::CleanupJob.name
- },
- "Attachments::CleanupUncontaineredJob": {
- cron: "03 22 * * *",
- class: Attachments::CleanupUncontaineredJob.name
- },
- "Notifications::ScheduleDateAlertsNotificationsJob": {
- cron: "*/15 * * * *",
- class: Notifications::ScheduleDateAlertsNotificationsJob.name
- },
- "Notifications::ScheduleReminderMailsJob": {
- cron: "*/15 * * * *",
- class: Notifications::ScheduleReminderMailsJob.name
- },
- "Ldap::SynchronizationJob": {
- cron: "30 23 * * *",
- class: Ldap::SynchronizationJob.name
- }
- }
- )
+
+Rails.application.configure do |application|
+ application.config.to_prepare do
+ Cron::CronJob.register! Cron::ClearOldSessionsJob,
+ Cron::ClearTmpCacheJob,
+ Cron::ClearUploadedFilesJob,
+ OAuth::CleanupJob,
+ PaperTrailAudits::CleanupJob,
+ Attachments::CleanupUncontaineredJob,
+ Notifications::ScheduleDateAlertsNotificationsJob,
+ Notifications::ScheduleReminderMailsJob,
+ Ldap::SynchronizationJob
+ end
end
diff --git a/config/initializers/custom_deprecators.rb b/config/initializers/custom_deprecators.rb
index a689d7784780..5a9c0d67d888 100644
--- a/config/initializers/custom_deprecators.rb
+++ b/config/initializers/custom_deprecators.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "../../lib/open_project/deprecation"
+require_relative '../../lib/open_project/deprecation'
Rails.application.configure do
# Register our custom deprecator to automatically take logging options
diff --git a/config/initializers/custom_field_format.rb b/config/initializers/custom_field_format.rb
index 7e67798075cc..00408d7e3d48 100644
--- a/config/initializers/custom_field_format.rb
+++ b/config/initializers/custom_field_format.rb
@@ -27,51 +27,51 @@
#++
OpenProject::CustomFieldFormat.map do |fields|
- fields.register OpenProject::CustomFieldFormat.new("string",
+ fields.register OpenProject::CustomFieldFormat.new('string',
label: :label_string,
order: 1)
- fields.register OpenProject::CustomFieldFormat.new("text",
+ fields.register OpenProject::CustomFieldFormat.new('text',
label: :label_text,
order: 2,
- formatter: "CustomValue::FormattableStrategy")
- fields.register OpenProject::CustomFieldFormat.new("int",
+ formatter: 'CustomValue::FormattableStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('int',
label: :label_integer,
order: 3,
- formatter: "CustomValue::IntStrategy")
- fields.register OpenProject::CustomFieldFormat.new("float",
+ formatter: 'CustomValue::IntStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('float',
label: :label_float,
order: 4,
- formatter: "CustomValue::FloatStrategy")
- fields.register OpenProject::CustomFieldFormat.new("list",
+ formatter: 'CustomValue::FloatStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('list',
label: :label_list,
order: 5,
- formatter: "CustomValue::ListStrategy")
- fields.register OpenProject::CustomFieldFormat.new("date",
+ formatter: 'CustomValue::ListStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('date',
label: :label_date,
order: 6,
- formatter: "CustomValue::DateStrategy")
- fields.register OpenProject::CustomFieldFormat.new("bool",
+ formatter: 'CustomValue::DateStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('bool',
label: :label_boolean,
order: 7,
- formatter: "CustomValue::BoolStrategy")
- fields.register OpenProject::CustomFieldFormat.new("user",
+ formatter: 'CustomValue::BoolStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('user',
label: Proc.new { User.model_name.human },
only: %w(WorkPackage TimeEntry
Version Project),
- edit_as: "list",
+ edit_as: 'list',
order: 8,
- formatter: "CustomValue::UserStrategy")
- fields.register OpenProject::CustomFieldFormat.new("version",
+ formatter: 'CustomValue::UserStrategy')
+ fields.register OpenProject::CustomFieldFormat.new('version',
label: Proc.new { Version.model_name.human },
only: %w(WorkPackage TimeEntry
Version Project),
- edit_as: "list",
+ edit_as: 'list',
order: 9,
- formatter: "CustomValue::VersionStrategy")
+ formatter: 'CustomValue::VersionStrategy')
# This is an internal formatter used as a fallback in case a value is not found.
# Setting the label to nil in order to avoid it becoming available for selection as a custom value format.
- fields.register OpenProject::CustomFieldFormat.new("empty",
+ fields.register OpenProject::CustomFieldFormat.new('empty',
label: nil,
order: 10,
- formatter: "CustomValue::EmptyStrategy")
+ formatter: 'CustomValue::EmptyStrategy')
end
diff --git a/config/initializers/database_pool_size.rb b/config/initializers/database_pool_size.rb
index f561765d1abb..8809f2439de9 100644
--- a/config/initializers/database_pool_size.rb
+++ b/config/initializers/database_pool_size.rb
@@ -1,33 +1,5 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2023 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
config = Rails.env.production? && Rails.application.config.database_configuration[Rails.env]
-pool_size = config && [OpenProject::Configuration.web_max_threads + 1, config["pool"].to_i].max
+pool_size = config && [OpenProject::Configuration.web_max_threads + 1, config['pool'].to_i].max
# make sure we have enough connections in the pool for each thread and then some
if pool_size && pool_size > ActiveRecord::Base.connection_pool.size
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_configuration.rb b/config/initializers/delayed_job_config.rb
similarity index 57%
rename from modules/storages/app/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_configuration.rb
rename to config/initializers/delayed_job_config.rb
index 263bcd29189e..89c3af7505ce 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_configuration.rb
+++ b/config/initializers/delayed_job_config.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal:true
-
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
@@ -28,28 +26,30 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-module Storages
- module Peripherals
- module StorageInteraction
- module AuthenticationStrategies
- class OAuthConfiguration
- include ActiveModel::Validations
+# Disable delayed_job's own logging as we have activejob
+Delayed::Worker.logger = nil
+
+# By default bypass worker queue and execute asynchronous tasks at once
+Delayed::Worker.delay_jobs = true
- attr_reader :scope, :issuer, :client_secret, :client_id
+# Prevent loading ApplicationJob during initialization
+Rails.application.reloader.to_prepare do
+ # Set default priority (lower = higher priority)
+ # Example ordering, see ApplicationJob.priority_number
+ Delayed::Worker.default_priority = ApplicationJob.priority_number(:default)
+end
- validates_presence_of :client_id, :client_secret, :issuer
+# Do not retry jobs from delayed_job
+# instead use 'retry_on' activejob functionality
+Delayed::Worker.max_attempts = 1
- def initialize(client_id: nil,
- client_secret: nil,
- issuer: nil,
- scope: nil)
- @client_id = client_id
- @client_secret = client_secret
- @issuer = issuer
- @scope = scope
- end
- end
- end
+# Remember DJ id in the payload object
+class Delayed::ProviderJobIdPlugin < Delayed::Plugin
+ callbacks do |lifecycle|
+ lifecycle.before(:invoke_job) do |job|
+ job.payload_object.job_data['provider_job_id'] = job.id if job.payload_object.respond_to?(:job_data)
end
end
end
+
+Delayed::Worker.plugins << Delayed::ProviderJobIdPlugin
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb
index 46080077b757..1f20f2c6fb80 100644
--- a/config/initializers/doorkeeper.rb
+++ b/config/initializers/doorkeeper.rb
@@ -48,7 +48,7 @@
# Defaults to ActionController::Base.
# See https://github.com/doorkeeper-gem/doorkeeper#custom-base-controller
#
- base_controller "::OAuth::AuthBaseController"
+ base_controller '::OAuth::AuthBaseController'
# Enable hashing and bcrypt-hashing of token secrets
# and application secrets, respectively.
@@ -197,9 +197,9 @@
application.config.to_prepare do
# Requiring some classes of Doorkeeper ourselves which for whatever reasons are
# no longer loaded for us now that we use zeitwerk
- require "doorkeeper/application_metal_controller"
- require "doorkeeper/application_controller"
- require "doorkeeper/tokens_controller"
- require "doorkeeper/authorizations_controller"
+ require 'doorkeeper/application_metal_controller'
+ require 'doorkeeper/application_controller'
+ require 'doorkeeper/tokens_controller'
+ require 'doorkeeper/authorizations_controller'
end
end
diff --git a/config/initializers/feature_decisions.rb b/config/initializers/feature_decisions.rb
index e98381d9be1e..407769fe3cd4 100644
--- a/config/initializers/feature_decisions.rb
+++ b/config/initializers/feature_decisions.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
# ++
-require_relative "../../lib_static/open_project/feature_decisions"
+require_relative '../../lib_static/open_project/feature_decisions'
# Add feature flags here via e.g.
#
diff --git a/config/initializers/grape_logging.rb b/config/initializers/grape_logging.rb
index b232a282e3ae..015303792fe7 100644
--- a/config/initializers/grape_logging.rb
+++ b/config/initializers/grape_logging.rb
@@ -1,6 +1,6 @@
Rails.application.configure do
config.after_initialize do
- ActiveSupport::Notifications.subscribe("openproject_grape_logger") do |_, _, _, _, payload|
+ ActiveSupport::Notifications.subscribe('openproject_grape_logger') do |_, _, _, _, payload|
time = payload[:time]
attributes = {
duration: time[:total],
diff --git a/config/initializers/health_checks.rb b/config/initializers/health_checks.rb
index 7f23b0f09156..8905f2d73786 100644
--- a/config/initializers/health_checks.rb
+++ b/config/initializers/health_checks.rb
@@ -1,37 +1,107 @@
-require "ok_computer/ok_computer_controller"
+require 'ok_computer/ok_computer_controller'
-Rails.application.configure do
- config.after_initialize do
- OkComputer::Registry.register "worker", OpenProject::HealthChecks::GoodJobCheck.new
- OkComputer::Registry.register "worker_backed_up", OpenProject::HealthChecks::GoodJobBackedUpCheck.new
+class DelayedJobNeverRanCheck < OkComputer::Check
+ attr_reader :threshold
- OkComputer::Registry.register "puma", OpenProject::HealthChecks::PumaCheck.new
+ def initialize(minute_threshold)
+ @threshold = minute_threshold.to_i
+ end
- # Make dj backed up optional due to bursts
- OkComputer.make_optional %w(worker_backed_up puma)
+ def check
+ never_ran = Delayed::Job.where('run_at < ?', threshold.minutes.ago).count
- # Register web worker check for web + database
- OkComputer::CheckCollection.new("web").tap do |collection|
- collection.register :default, OkComputer::Registry.fetch("default")
- collection.register :database, OkComputer::Registry.fetch("database")
- OkComputer::Registry.default_collection.register "web", collection
+ if never_ran.zero?
+ mark_message "All previous jobs have completed within the past #{threshold} minutes."
+ else
+ mark_failure
+ mark_message "#{never_ran} jobs waiting to be executed for more than #{threshold} minutes"
end
+ end
+end
+
+class PumaCheck < OkComputer::Check
+ attr_reader :threshold
+
+ def initialize(backlog_threshold)
+ @threshold = backlog_threshold.to_i
+ end
+
+ def check
+ stats = self.stats
- # Register full check for web + database + dj worker
- OkComputer::CheckCollection.new("full").tap do |collection|
- collection.register :default, OkComputer::Registry.fetch("default")
- collection.register :database, OkComputer::Registry.fetch("database")
- collection.register :mail, OpenProject::HealthChecks::SmtpCheck.new
- collection.register :worker, OkComputer::Registry.fetch("worker")
- collection.register :worker_backed_up, OkComputer::Registry.fetch("worker_backed_up")
- collection.register :puma, OkComputer::Registry.fetch("puma")
- OkComputer::Registry.default_collection.register "full", collection
+ return mark_message "N/A as Puma is not used." if stats.nil?
+
+ if stats[:running] > 0
+ mark_message "Puma is running"
+ else
+ mark_failure
+ mark_message "Puma is not running"
end
- # Check if authentication required
- authentication_password = OpenProject::Configuration.health_checks_authentication_password
- if authentication_password.present?
- OkComputer.require_authentication("health_checks", authentication_password)
+ if stats[:backlog] < threshold
+ mark_message "Backlog ok"
+ else
+ mark_failure
+ mark_message "Backlog congested"
end
end
+
+ def stats
+ return nil unless applicable?
+
+ server = Puma::Server.current
+ return nil if server.nil?
+
+ {
+ backlog: server.backlog || 0,
+ running: server.running || 0,
+ pool_capacity: server.pool_capacity || 0,
+ max_threads: server.max_threads || 0
+ }
+ end
+
+ def applicable?
+ return @applicable unless @applicable.nil?
+
+ @applicable = Object.const_defined?("Puma::Server") && !Puma::Server.current.nil?
+ end
+end
+
+# Register delayed_job backed up test
+dj_max = OpenProject::Configuration.health_checks_jobs_queue_count_threshold
+OkComputer::Registry.register "delayed_jobs_backed_up",
+ OkComputer::DelayedJobBackedUpCheck.new(0, dj_max)
+
+dj_never_ran_max = OpenProject::Configuration.health_checks_jobs_never_ran_minutes_ago
+OkComputer::Registry.register "delayed_jobs_never_ran",
+ DelayedJobNeverRanCheck.new(dj_never_ran_max)
+
+backlog_threshold = OpenProject::Configuration.health_checks_backlog_threshold
+OkComputer::Registry.register "puma", PumaCheck.new(backlog_threshold)
+
+# Make dj backed up optional due to bursts
+OkComputer.make_optional %w(delayed_jobs_backed_up puma)
+
+# Register web worker check for web + database
+OkComputer::CheckCollection.new('web').tap do |collection|
+ collection.register :default, OkComputer::Registry.fetch('default')
+ collection.register :database, OkComputer::Registry.fetch('database')
+ OkComputer::Registry.default_collection.register 'web', collection
+end
+
+# Register full check for web + database + dj worker
+OkComputer::CheckCollection.new('full').tap do |collection|
+ collection.register :default, OkComputer::Registry.fetch('default')
+ collection.register :database, OkComputer::Registry.fetch('database')
+ collection.register :mail, OkComputer::ActionMailerCheck.new
+ collection.register :delayed_jobs_backed_up, OkComputer::Registry.fetch('delayed_jobs_backed_up')
+ collection.register :delayed_jobs_never_ran, OkComputer::Registry.fetch('delayed_jobs_never_ran')
+ collection.register :puma, OkComputer::Registry.fetch('puma')
+ OkComputer::Registry.default_collection.register 'full', collection
+end
+
+# Check if authentication required
+authentication_password = OpenProject::Configuration.health_checks_authentication_password
+if authentication_password.present?
+ OkComputer.require_authentication('health_checks', authentication_password)
end
diff --git a/config/initializers/homescreen.rb b/config/initializers/homescreen.rb
index 0dff7d9d0305..5f982831c543 100644
--- a/config/initializers/homescreen.rb
+++ b/config/initializers/homescreen.rb
@@ -26,44 +26,44 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "open_project/static/homescreen"
-require "open_project/static/links"
+require 'open_project/static/homescreen'
+require 'open_project/static/links'
OpenProject::Static::Homescreen.manage :blocks do |blocks|
blocks.push(
{
- partial: "welcome",
+ partial: 'welcome',
if: Proc.new { Setting.welcome_on_homescreen? && Setting.welcome_text.present? }
},
{
- partial: "projects"
+ partial: 'projects'
},
{
- partial: "new_features",
+ partial: 'new_features',
if: Proc.new { OpenProject::Configuration.show_community_links? }
},
{
- partial: "users",
+ partial: 'users',
if: Proc.new { User.current.admin? }
},
{
- partial: "my_account",
+ partial: 'my_account',
if: Proc.new { User.current.logged? }
},
{
- partial: "news",
+ partial: 'news',
if: Proc.new { !@news.empty? }
},
{
- partial: "community",
+ partial: 'community',
if: Proc.new { EnterpriseToken.show_banners? || OpenProject::Configuration.show_community_links? }
},
{
- partial: "administration",
+ partial: 'administration',
if: Proc.new { User.current.admin? }
},
{
- partial: "upsale",
+ partial: 'upsale',
if: Proc.new { EnterpriseToken.show_banners? }
}
)
@@ -75,22 +75,22 @@
links.push(
{
label: :user_guides,
- icon: "icon-context icon-rename",
+ icon: 'icon-context icon-rename',
url: link_hash[:user_guides][:href]
},
{
label: :glossary,
- icon: "icon-context icon-glossar",
+ icon: 'icon-context icon-glossar',
url: link_hash[:glossary][:href]
},
{
label: :shortcuts,
- icon: "icon-context icon-shortcuts",
+ icon: 'icon-context icon-shortcuts',
url: link_hash[:shortcuts][:href]
},
{
label: :forums,
- icon: "icon-context icon-forums",
+ icon: 'icon-context icon-forums',
url: link_hash[:forums][:href]
}
)
@@ -99,7 +99,7 @@
links.push({
label: impressum_link[:label],
url: impressum_link[:href],
- icon: "icon-context icon-info1"
+ icon: 'icon-context icon-info1'
})
end
end
diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb
index 721dbd247f8a..03cbf2356e8b 100644
--- a/config/initializers/i18n.rb
+++ b/config/initializers/i18n.rb
@@ -1,6 +1,6 @@
# load custom translation rules, as stored in config/locales/plurals.rb
# to be aware of e.g. Japanese not having a plural from for nouns
-require "open_project/translations/pluralization_backend"
+require 'open_project/translations/pluralization_backend'
I18n::Backend::Simple.include OpenProject::Translations::PluralizationBackend
# Adds fallback to default locale for untranslated strings
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index 252893140147..70870b30fd8a 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -41,8 +41,8 @@
# These inflection rules are supported but not enabled by default:
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym "API"
- inflect.acronym "OAuth"
- inflect.acronym "OpenID"
- inflect.acronym "ICal"
- inflect.acronym "ClamAV"
+ inflect.acronym 'OAuth'
+ inflect.acronym 'OpenID'
+ inflect.acronym 'ICal'
+ inflect.acronym 'ClamAV'
end
diff --git a/config/initializers/lookbook.rb b/config/initializers/lookbook.rb
index bfd03771fe86..10f1c1874e66 100644
--- a/config/initializers/lookbook.rb
+++ b/config/initializers/lookbook.rb
@@ -1,20 +1,20 @@
Rails.application.configure do
next unless OpenProject::Configuration.lookbook_enabled?
- require "factory_bot"
- require "factory_bot_rails"
+ require 'factory_bot'
+ require 'factory_bot_rails'
# Re-define snapshot to avoid warnings
YARD::Tags::Library.define_tag("Snapshot preview (unused)", :snapshot)
config.lookbook.project_name = "OpenProject Lookbook"
- config.lookbook.project_logo = Rails.root.join("app/assets/images/icon_logo_white.svg").read
- config.lookbook.ui_favicon = Rails.root.join("app/assets/images/icon_logo.svg").read
+ config.lookbook.project_logo = Rails.root.join('app/assets/images/icon_logo_white.svg').read
+ config.lookbook.ui_favicon = Rails.root.join('app/assets/images/icon_logo.svg').read
config.lookbook.page_paths = [Rails.root.join("lookbook/docs").to_s]
- config.lookbook.component_paths << Primer::ViewComponents::Engine.root.join("app/components").to_s
+ config.lookbook.component_paths << Primer::ViewComponents::Engine.root.join('app/components').to_s
config.view_component.preview_paths += [
Rails.root.join("lookbook/previews").to_s,
- Primer::ViewComponents::Engine.root.join("previews").to_s
+ Primer::ViewComponents::Engine.root.join('previews').to_s
]
# Show pages first, then previews
diff --git a/config/initializers/mail_starttls_patch.rb b/config/initializers/mail_starttls_patch.rb
index 7c33fc0038a4..5bdf6f6b2fc4 100644
--- a/config/initializers/mail_starttls_patch.rb
+++ b/config/initializers/mail_starttls_patch.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require "mail/network/delivery_methods/smtp"
+require 'mail/network/delivery_methods/smtp'
# Monkey patch mail 2.8.1 to make it possible to disable STARTTLS.
# without having to change existing settings.
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index ec7662bd4824..a5ce41ce3da2 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -26,39 +26,39 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "redmine/menu_manager"
+require 'redmine/menu_manager'
Redmine::MenuManager.map :top_menu do |menu|
# projects menu will be added by
# Redmine::MenuManager::TopMenuHelper#render_projects_top_menu_node
menu.push :projects,
- { controller: "/projects", project_id: nil, action: "index" },
+ { controller: '/projects', project_id: nil, action: 'index' },
context: :modules,
- caption: I18n.t("label_projects_menu"),
- icon: "projects",
+ caption: I18n.t('label_projects_menu'),
+ icon: 'projects',
if: Proc.new {
User.current.logged? || !Setting.login_required?
}
menu.push :activity,
- { controller: "/activities", action: "index" },
+ { controller: '/activities', action: 'index' },
context: :modules,
- icon: "checkmark"
+ icon: 'checkmark'
menu.push :work_packages,
- { controller: "/work_packages", project_id: nil, state: nil, action: "index" },
+ { controller: '/work_packages', project_id: nil, state: nil, action: 'index' },
context: :modules,
- caption: I18n.t("label_work_package_plural"),
- icon: "work-packages",
+ caption: I18n.t('label_work_package_plural'),
+ icon: 'work-packages',
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
User.current.allowed_in_any_work_package?(:view_work_packages)
}
menu.push :news,
- { controller: "/news", project_id: nil, action: "index" },
+ { controller: '/news', project_id: nil, action: 'index' },
context: :modules,
- caption: I18n.t("label_news_plural"),
- icon: "news",
+ caption: I18n.t('label_news_plural'),
+ icon: 'news',
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
User.current.allowed_in_any_project?(:view_news)
@@ -67,17 +67,17 @@
menu.push :help,
OpenProject::Static::Links.help_link,
last: true,
- caption: "",
- icon: "help op-app-help--icon",
+ caption: '',
+ icon: 'help op-app-help--icon',
html: { accesskey: OpenProject::AccessKeys.key_for(:help),
- title: I18n.t("label_help"),
- target: "_blank" }
+ title: I18n.t('label_help'),
+ target: '_blank' }
end
Redmine::MenuManager.map :quick_add_menu do |menu|
menu.push :new_project,
Proc.new { |project|
- { controller: "/projects", action: :new, project_id: nil, parent_id: project&.id }
+ { controller: '/projects', action: :new, project_id: nil, parent_id: project&.id }
},
caption: ->(*) { Project.model_name.human },
icon: "add",
@@ -93,32 +93,32 @@
menu.push :invite_user,
nil,
caption: :label_invite_user,
- icon: "user-plus",
+ icon: 'user-plus',
html: {
- "invite-user-modal-augment": "invite-user-modal-augment"
+ 'invite-user-modal-augment': 'invite-user-modal-augment'
},
if: Proc.new { User.current.allowed_in_any_project?(:manage_members) }
end
Redmine::MenuManager.map :account_menu do |menu|
menu.push :timers,
- { controller: "/my/timer", action: "show" },
- partial: "/my/timer/menu"
+ { controller: '/my/timer', action: 'show' },
+ partial: '/my/timer/menu'
menu.push :my_page,
:my_page_path,
- caption: I18n.t("js.my_page.label"),
+ caption: I18n.t('js.my_page.label'),
if: Proc.new { User.current.logged? }
menu.push :my_profile,
- { controller: "/users", action: "show", id: "me" },
+ { controller: '/users', action: 'show', id: 'me' },
caption: :label_my_activity,
if: Proc.new { User.current.logged? }
menu.push :my_account,
- { controller: "/my", action: "account" },
+ { controller: '/my', action: 'account' },
if: Proc.new { User.current.logged? }
menu.push :administration,
- { controller: "/admin", action: "index" },
+ { controller: '/admin', action: 'index' },
if: Proc.new {
- User.current.allowed_globally?({ controller: "/admin", action: "index" })
+ User.current.allowed_globally?({ controller: '/admin', action: 'index' })
}
menu.push :logout,
:signout_path,
@@ -128,53 +128,53 @@
Redmine::MenuManager.map :global_menu do |menu|
# Homescreen
menu.push :home,
- { controller: "/homescreen", action: "index" },
- icon: "home",
+ { controller: '/homescreen', action: 'index' },
+ icon: 'home',
first: true
# Projects
menu.push :projects,
- { controller: "/projects", project_id: nil, action: "index" },
- caption: I18n.t("label_projects_menu"),
- icon: "projects",
+ { controller: '/projects', project_id: nil, action: 'index' },
+ caption: I18n.t('label_projects_menu'),
+ icon: 'projects',
after: :home,
if: Proc.new {
User.current.logged? || !Setting.login_required?
}
menu.push :projects_query_select,
- { controller: "/projects", project_id: nil, action: "index" },
+ { controller: '/projects', project_id: nil, action: 'index' },
parent: :projects,
- partial: "projects/menus/menu"
+ partial: 'projects/menus/menu'
# Activity
menu.push :activity,
- { controller: "/activities", action: "index" },
- icon: "checkmark",
+ { controller: '/activities', action: 'index' },
+ icon: 'checkmark',
after: :projects
menu.push :activity_filters,
- { controller: "/activities", action: "index" },
+ { controller: '/activities', action: 'index' },
parent: :activity,
- partial: "activities/filters_menu"
+ partial: 'activities/filters_menu'
# Work packages
menu.push :work_packages,
- { controller: "/work_packages", action: "index" },
+ { controller: '/work_packages', action: 'index' },
caption: :label_work_package_plural,
- icon: "view-list",
+ icon: 'view-list',
after: :activity
menu.push :work_packages_query_select,
- { controller: "/work_packages", action: "index" },
+ { controller: '/work_packages', action: 'index' },
parent: :work_packages,
- partial: "work_packages/menu_query_select"
+ partial: 'work_packages/menu_query_select'
# News
menu.push :news,
- { controller: "/news", project_id: nil, action: "index" },
- caption: I18n.t("label_news_plural"),
- icon: "news",
+ { controller: '/news', project_id: nil, action: 'index' },
+ caption: I18n.t('label_news_plural'),
+ icon: 'news',
after: :boards,
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
@@ -184,194 +184,194 @@
Redmine::MenuManager.map :notifications_menu do |menu|
menu.push :notification_grouping_select,
- { controller: "/my", action: "notifications" },
- partial: "notifications/menu_notification_center"
+ { controller: '/my', action: 'notifications' },
+ partial: 'notifications/menu_notification_center'
end
Redmine::MenuManager.map :my_menu do |menu|
menu.push :account,
- { controller: "/my", action: "account" },
+ { controller: '/my', action: 'account' },
caption: :label_profile,
- icon: "user"
+ icon: 'user'
menu.push :settings,
- { controller: "/my", action: "settings" },
+ { controller: '/my', action: 'settings' },
caption: :label_setting_plural,
- icon: "settings2"
+ icon: 'settings2'
menu.push :password,
- { controller: "/my", action: "password" },
+ { controller: '/my', action: 'password' },
caption: :button_change_password,
if: Proc.new { User.current.change_password_allowed? },
- icon: "locked"
+ icon: 'locked'
menu.push :access_token,
- { controller: "/my", action: "access_token" },
- caption: I18n.t("my_account.access_tokens.access_tokens"),
- icon: "key"
+ { controller: '/my', action: 'access_token' },
+ caption: I18n.t('my_account.access_tokens.access_tokens'),
+ icon: 'key'
menu.push :sessions,
- { controller: "/my/sessions", action: :index },
- caption: :"users.sessions.title",
- icon: "installation-services"
+ { controller: '/my/sessions', action: :index },
+ caption: :'users.sessions.title',
+ icon: 'installation-services'
menu.push :notifications,
- { controller: "/my", action: "notifications" },
- caption: I18n.t("js.notifications.settings.title"),
- icon: "bell"
+ { controller: '/my', action: 'notifications' },
+ caption: I18n.t('js.notifications.settings.title'),
+ icon: 'bell'
menu.push :reminders,
- { controller: "/my", action: "reminders" },
- caption: I18n.t("js.reminders.settings.title"),
- icon: "email-alert"
+ { controller: '/my', action: 'reminders' },
+ caption: I18n.t('js.reminders.settings.title'),
+ icon: 'email-alert'
menu.push :delete_account, :delete_my_account_info_path,
- caption: I18n.t("account.delete"),
+ caption: I18n.t('account.delete'),
param: :user_id,
if: Proc.new { Setting.users_deletable_by_self? },
last: :delete_account,
- icon: "delete"
+ icon: 'delete'
end
Redmine::MenuManager.map :admin_menu do |menu|
menu.push :admin_overview,
- { controller: "/admin", action: :index },
+ { controller: '/admin', action: :index },
if: Proc.new { User.current.admin? },
caption: :label_overview,
- icon: "home",
+ icon: 'home',
first: true
menu.push :users,
- { controller: "/users" },
+ { controller: '/users' },
if: Proc.new {
!User.current.admin? &&
(User.current.allowed_globally?(:manage_user) || User.current.allowed_globally?(:create_user))
},
caption: :label_user_plural,
- icon: "group"
+ icon: 'group'
menu.push :placeholder_users,
- { controller: "/placeholder_users" },
+ { controller: '/placeholder_users' },
if: Proc.new { !User.current.admin? && User.current.allowed_globally?(:manage_placeholder_user) },
caption: :label_placeholder_user_plural,
- icon: "group"
+ icon: 'group'
menu.push :users_and_permissions,
- { controller: "/users" },
+ { controller: '/users' },
if: Proc.new { User.current.admin? },
caption: :label_user_and_permission,
- icon: "group"
+ icon: 'group'
menu.push :user_settings,
- { controller: "/admin/settings/users_settings", action: :show },
+ { controller: '/admin/settings/users_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_users_settings,
parent: :users_and_permissions
menu.push :users,
- { controller: "/users" },
+ { controller: '/users' },
if: Proc.new { User.current.admin? },
caption: :label_user_plural,
parent: :users_and_permissions
menu.push :placeholder_users,
- { controller: "/placeholder_users" },
+ { controller: '/placeholder_users' },
if: Proc.new { User.current.admin? },
caption: :label_placeholder_user_plural,
parent: :users_and_permissions,
- enterprise_feature: "placeholder_users"
+ enterprise_feature: 'placeholder_users'
menu.push :groups,
- { controller: "/groups" },
+ { controller: '/groups' },
if: Proc.new { User.current.admin? },
caption: :label_group_plural,
parent: :users_and_permissions
menu.push :roles,
- { controller: "/roles" },
+ { controller: '/roles' },
if: Proc.new { User.current.admin? },
caption: :label_role_and_permissions,
parent: :users_and_permissions
menu.push :permissions_report,
- { controller: "/roles", action: "report" },
+ { controller: '/roles', action: 'report' },
if: Proc.new { User.current.admin? },
caption: :label_permissions_report,
parent: :users_and_permissions
menu.push :user_avatars,
- { controller: "/admin/settings", action: "show_plugin", id: :openproject_avatars },
+ { controller: '/admin/settings', action: 'show_plugin', id: :openproject_avatars },
if: Proc.new { User.current.admin? },
caption: :label_avatar_plural,
parent: :users_and_permissions
menu.push :admin_work_packages,
- { controller: "/admin/settings/work_packages_settings", action: :show },
+ { controller: '/admin/settings/work_packages_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_work_package_plural,
- icon: "view-list"
+ icon: 'view-list'
menu.push :work_packages_setting,
- { controller: "/admin/settings/work_packages_settings", action: :show },
+ { controller: '/admin/settings/work_packages_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_setting_plural,
parent: :admin_work_packages
menu.push :types,
- { controller: "/types" },
+ { controller: '/types' },
if: Proc.new { User.current.admin? },
caption: :label_type_plural,
parent: :admin_work_packages
menu.push :statuses,
- { controller: "/statuses" },
+ { controller: '/statuses' },
if: Proc.new { User.current.admin? },
caption: :label_status,
parent: :admin_work_packages,
- html: { class: "statuses" }
+ html: { class: 'statuses' }
menu.push :workflows,
- { controller: "/workflows", action: "edit" },
+ { controller: '/workflows', action: 'edit' },
if: Proc.new { User.current.admin? },
caption: Proc.new { Workflow.model_name.human },
parent: :admin_work_packages
menu.push :custom_fields,
- { controller: "/custom_fields" },
+ { controller: '/custom_fields' },
if: Proc.new { User.current.admin? },
caption: :label_custom_field_plural,
- icon: "custom-fields",
- html: { class: "custom_fields" }
+ icon: 'custom-fields',
+ html: { class: 'custom_fields' }
menu.push :custom_actions,
- { controller: "/custom_actions" },
+ { controller: '/custom_actions' },
if: Proc.new { User.current.admin? },
- caption: :"custom_actions.plural",
+ caption: :'custom_actions.plural',
parent: :admin_work_packages,
- enterprise_feature: "custom_actions"
+ enterprise_feature: 'custom_actions'
menu.push :attribute_help_texts,
- { controller: "/attribute_help_texts" },
- caption: :"attribute_help_texts.label_plural",
- icon: "help2",
+ { controller: '/attribute_help_texts' },
+ caption: :'attribute_help_texts.label_plural',
+ icon: 'help2',
if: Proc.new { User.current.allowed_globally?(:edit_attribute_help_texts) }
menu.push :attachments,
- { controller: "/admin/settings/attachments_settings", action: :show },
- caption: :"attributes.attachments",
- icon: "attachment",
+ { controller: '/admin/settings/attachments_settings', action: :show },
+ caption: :'attributes.attachments',
+ icon: 'attachment',
if: Proc.new { User.current.admin? }
menu.push :attachments_settings,
- { controller: "/admin/settings/attachments_settings", action: :show },
+ { controller: '/admin/settings/attachments_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_setting_plural,
parent: :attachments
menu.push :virus_scanning_settings,
- { controller: "/admin/settings/virus_scanning_settings", action: :show },
- caption: :"settings.antivirus.title",
+ { controller: '/admin/settings/virus_scanning_settings', action: :show },
+ caption: :'settings.antivirus.title',
parent: :attachments,
- enterprise_feature: "virus_scanning",
+ enterprise_feature: 'virus_scanning',
if: Proc.new { User.current.admin? }
menu.push :attachment_quarantine,
- { controller: "/admin/attachments/quarantined_attachments", action: :index },
- caption: :"antivirus_scan.quarantined_attachments.title",
+ { controller: '/admin/attachments/quarantined_attachments', action: :index },
+ caption: :'antivirus_scan.quarantined_attachments.title',
parent: :attachments,
if: Proc.new {
User.current.admin? &&
@@ -379,176 +379,176 @@
}
menu.push :enumerations,
- { controller: "/enumerations" },
+ { controller: '/enumerations' },
if: Proc.new { User.current.admin? },
- icon: "enumerations"
+ icon: 'enumerations'
menu.push :calendars_and_dates,
- { controller: "/admin/settings/working_days_settings", action: :show },
+ { controller: '/admin/settings/working_days_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_calendars_and_dates,
- icon: "calendar"
+ icon: 'calendar'
menu.push :working_days,
- { controller: "/admin/settings/working_days_settings", action: :show },
+ { controller: '/admin/settings/working_days_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_working_days,
parent: :calendars_and_dates
menu.push :date_format,
- { controller: "/admin/settings/date_format_settings", action: :show },
+ { controller: '/admin/settings/date_format_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_date_format,
parent: :calendars_and_dates
menu.push :icalendar,
- { controller: "/admin/settings/icalendar_settings", action: :show },
+ { controller: '/admin/settings/icalendar_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_calendar_subscriptions,
parent: :calendars_and_dates
menu.push :settings,
- { controller: "/admin/settings/general_settings", action: :show },
+ { controller: '/admin/settings/general_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_system_settings,
- icon: "settings2"
+ icon: 'settings2'
SettingsHelper.system_settings_tabs.each do |node|
menu.push :"settings_#{node[:name]}",
{ controller: node[:controller], action: :show },
caption: node[:label],
- if: Proc.new { User.current.admin? && node[:name] != "experimental" },
+ if: Proc.new { User.current.admin? && node[:name] != 'experimental' },
parent: :settings
end
menu.push :mail_and_notifications,
- { controller: "/admin/settings/aggregation_settings", action: :show },
+ { controller: '/admin/settings/aggregation_settings', action: :show },
if: Proc.new { User.current.admin? },
- caption: :"menus.admin.mails_and_notifications",
- icon: "mail1"
+ caption: :'menus.admin.mails_and_notifications',
+ icon: 'mail1'
menu.push :notification_settings,
- { controller: "/admin/settings/aggregation_settings", action: :show },
+ { controller: '/admin/settings/aggregation_settings', action: :show },
if: Proc.new { User.current.admin? },
- caption: :"menus.admin.aggregation",
+ caption: :'menus.admin.aggregation',
parent: :mail_and_notifications
menu.push :mail_notifications,
- { controller: "/admin/settings/mail_notifications_settings", action: :show },
+ { controller: '/admin/settings/mail_notifications_settings', action: :show },
if: Proc.new { User.current.admin? },
- caption: :"menus.admin.mail_notification",
+ caption: :'menus.admin.mail_notification',
parent: :mail_and_notifications
menu.push :incoming_mails,
- { controller: "/admin/settings/incoming_mails_settings", action: :show },
+ { controller: '/admin/settings/incoming_mails_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_incoming_emails,
parent: :mail_and_notifications
menu.push :api_and_webhooks,
- { controller: "/admin/settings/api_settings", action: :show },
+ { controller: '/admin/settings/api_settings', action: :show },
if: Proc.new { User.current.admin? },
- caption: :"menus.admin.api_and_webhooks",
- icon: "relations"
+ caption: :'menus.admin.api_and_webhooks',
+ icon: 'relations'
menu.push :api,
- { controller: "/admin/settings/api_settings", action: :show },
+ { controller: '/admin/settings/api_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_api_access_key_type,
parent: :api_and_webhooks
menu.push :authentication,
- { controller: "/admin/settings/authentication_settings", action: :show },
+ { controller: '/admin/settings/authentication_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_authentication,
- icon: "two-factor-authentication"
+ icon: 'two-factor-authentication'
menu.push :authentication_settings,
- { controller: "/admin/settings/authentication_settings", action: :show },
+ { controller: '/admin/settings/authentication_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_setting_plural,
parent: :authentication
menu.push :ldap_authentication,
- { controller: "/ldap_auth_sources", action: "index" },
+ { controller: '/ldap_auth_sources', action: 'index' },
if: Proc.new { User.current.admin? && !OpenProject::Configuration.disable_password_login? },
parent: :authentication,
caption: :label_ldap_auth_source_plural,
- html: { class: "server_authentication" },
+ html: { class: 'server_authentication' },
last: true
menu.push :oauth_applications,
- { controller: "/oauth/applications", action: "index" },
+ { controller: '/oauth/applications', action: 'index' },
if: Proc.new { User.current.admin? },
parent: :authentication,
- caption: :"oauth.application.plural",
- html: { class: "oauth_applications" }
+ caption: :'oauth.application.plural',
+ html: { class: 'oauth_applications' }
menu.push :announcements,
- { controller: "/announcements", action: "edit" },
+ { controller: '/announcements', action: 'edit' },
if: Proc.new { User.current.admin? },
caption: :label_announcement,
- icon: "news"
+ icon: 'news'
menu.push :plugins,
- { controller: "/admin", action: "plugins" },
+ { controller: '/admin', action: 'plugins' },
if: Proc.new { User.current.admin? },
last: true,
- icon: "plugins"
+ icon: 'plugins'
menu.push :backups,
- { controller: "/admin/backups", action: "show" },
+ { controller: '/admin/backups', action: 'show' },
if: Proc.new { OpenProject::Configuration.backup_enabled? && User.current.allowed_globally?(Backup.permission) },
caption: :label_backup,
last: true,
- icon: "save"
+ icon: 'save'
menu.push :info,
- { controller: "/admin", action: "info" },
+ { controller: '/admin', action: 'info' },
if: Proc.new { User.current.admin? },
caption: :label_information_plural,
last: true,
- icon: "info1"
+ icon: 'info1'
menu.push :custom_style,
- { controller: "/custom_styles", action: :show },
+ { controller: '/custom_styles', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_custom_style,
- icon: "design",
- enterprise_feature: "define_custom_style"
+ icon: 'design',
+ enterprise_feature: 'define_custom_style'
menu.push :colors,
- { controller: "/colors", action: "index" },
+ { controller: '/colors', action: 'index' },
if: Proc.new { User.current.admin? },
caption: :label_color_plural,
- icon: "status"
+ icon: 'status'
menu.push :enterprise,
- { controller: "/enterprises", action: :show },
+ { controller: '/enterprises', action: :show },
caption: :label_enterprise_edition,
- icon: "enterprise-addons",
+ icon: 'enterprise-addons',
if: proc { User.current.admin? && OpenProject::Configuration.ee_manager_visible? }
menu.push :admin_costs,
- { controller: "/admin/settings", action: "show_plugin", id: :costs },
+ { controller: '/admin/settings', action: 'show_plugin', id: :costs },
if: Proc.new { User.current.admin? },
caption: :project_module_costs,
- icon: "budget"
+ icon: 'budget'
menu.push :costs_setting,
- { controller: "/admin/settings", action: "show_plugin", id: :costs },
+ { controller: '/admin/settings', action: 'show_plugin', id: :costs },
if: Proc.new { User.current.admin? },
caption: :label_setting_plural,
parent: :admin_costs
menu.push :admin_backlogs,
- { controller: "/backlogs_settings", action: :show },
+ { controller: '/backlogs_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_backlogs,
- icon: "backlogs"
+ icon: 'backlogs'
menu.push :backlogs_settings,
- { controller: "/backlogs_settings", action: :show },
+ { controller: '/backlogs_settings', action: :show },
if: Proc.new { User.current.admin? },
caption: :label_setting_plural,
parent: :admin_backlogs
@@ -556,72 +556,72 @@
Redmine::MenuManager.map :project_menu do |menu|
menu.push :activity,
- { controller: "/activities", action: "index" },
- if: Proc.new { |p| p.module_enabled?("activity") },
- icon: "checkmark"
+ { controller: '/activities', action: 'index' },
+ if: Proc.new { |p| p.module_enabled?('activity') },
+ icon: 'checkmark'
menu.push :activity_filters,
- { controller: "/activities", action: "index" },
- if: Proc.new { |p| p.module_enabled?("activity") },
+ { controller: '/activities', action: 'index' },
+ if: Proc.new { |p| p.module_enabled?('activity') },
parent: :activity,
- partial: "activities/filters_menu"
+ partial: 'activities/filters_menu'
menu.push :roadmap,
- { controller: "/versions", action: "index" },
+ { controller: '/versions', action: 'index' },
if: Proc.new { |p| p.shared_versions.any? },
- icon: "roadmap"
+ icon: 'roadmap'
menu.push :work_packages,
- { controller: "/work_packages", action: "index" },
+ { controller: '/work_packages', action: 'index' },
caption: :label_work_package_plural,
- if: Proc.new { |p| p.module_enabled?("work_package_tracking") },
- icon: "view-list",
+ if: Proc.new { |p| p.module_enabled?('work_package_tracking') },
+ icon: 'view-list',
html: {
- id: "main-menu-work-packages",
- "wp-query-menu": "wp-query-menu"
+ id: 'main-menu-work-packages',
+ 'wp-query-menu': 'wp-query-menu'
}
menu.push :work_packages_query_select,
- { controller: "/work_packages", action: "index" },
+ { controller: '/work_packages', action: 'index' },
parent: :work_packages,
- partial: "work_packages/menu_query_select",
+ partial: 'work_packages/menu_query_select',
last: true,
caption: :label_all_open_wps
menu.push :news,
- { controller: "/news", action: "index" },
+ { controller: '/news', action: 'index' },
caption: :label_news_plural,
- icon: "news"
+ icon: 'news'
menu.push :forums,
- { controller: "/forums", action: "index", id: nil },
+ { controller: '/forums', action: 'index', id: nil },
caption: :label_forum_plural,
- icon: "ticket-note"
+ icon: 'ticket-note'
menu.push :repository,
- { controller: "/repositories", action: :show },
+ { controller: '/repositories', action: :show },
if: Proc.new { |p| p.repository && !p.repository.new_record? },
- icon: "folder-open"
+ icon: 'folder-open'
# Wiki menu items are added by WikiMenuItemHelper
menu.push :members,
- { controller: "/members", action: "index" },
+ { controller: '/members', action: 'index' },
caption: :label_member_plural,
before: :settings,
- icon: "group"
+ icon: 'group'
menu.push :members_menu,
- { controller: "/members", action: "index" },
+ { controller: '/members', action: 'index' },
parent: :members,
- partial: "members/menus/menu",
+ partial: 'members/menus/menu',
caption: :label_member_plural
menu.push :settings,
- { controller: "/projects/settings/general", action: :show },
+ { controller: '/projects/settings/general', action: :show },
caption: :label_project_settings,
last: true,
- icon: "settings2",
+ icon: 'settings2',
allow_deeplink: true
{
@@ -636,7 +636,7 @@
storage: :label_required_disk_storage
}.each do |key, caption|
menu.push :"settings_#{key}",
- { controller: "/projects/settings/#{key}", action: "show" },
+ { controller: "/projects/settings/#{key}", action: 'show' },
caption:,
parent: :settings
end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index 2fbfb6fb1c00..f058462b60eb 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -34,5 +34,5 @@
Mime::SET << Mime[:csv] unless Mime::SET.include?(Mime[:csv])
-Mime::Type.register "application/pdf", :pdf unless Mime::Type.lookup_by_extension(:pdf)
-Mime::Type.register "image/png", :png unless Mime::Type.lookup_by_extension(:png)
+Mime::Type.register 'application/pdf', :pdf unless Mime::Type.lookup_by_extension(:pdf)
+Mime::Type.register 'image/png', :png unless Mime::Type.lookup_by_extension(:png)
diff --git a/config/initializers/module_handler.rb b/config/initializers/module_handler.rb
index 486c0386398f..a1c888934aa7 100644
--- a/config/initializers/module_handler.rb
+++ b/config/initializers/module_handler.rb
@@ -31,7 +31,7 @@
to_disable = if Rails.env.test?
OpenProject::Configuration.disabled_modules
else
- ["dashboards"] + OpenProject::Configuration.disabled_modules
+ ['dashboards'] + OpenProject::Configuration.disabled_modules
end
if to_disable.any?
diff --git a/config/initializers/paper_trail.rb b/config/initializers/paper_trail.rb
index a60163d4354a..597210bcc1ad 100644
--- a/config/initializers/paper_trail.rb
+++ b/config/initializers/paper_trail.rb
@@ -1,7 +1,7 @@
PaperTrail.config.enabled = true # PT will be disabled by rspec
PaperTrail.config.has_paper_trail_defaults = {
versions: {
- class_name: "::PaperTrailAudit",
+ class_name: '::PaperTrailAudit',
name: :paper_trail_audits
},
version: :paper_trail_audit,
diff --git a/config/initializers/permissions.rb b/config/initializers/permissions.rb
index 4098e318acf5..d76e3c19f52e 100644
--- a/config/initializers/permissions.rb
+++ b/config/initializers/permissions.rb
@@ -37,7 +37,7 @@
map.permission :archive_project,
{
- "projects/archive": %i[create]
+ 'projects/archive': %i[create]
},
permissible_on: :project,
require: :member
@@ -45,7 +45,7 @@
map.permission :create_backup,
{
admin: %i[index],
- "admin/backups": %i[delete_token perform_token_reset reset_token show]
+ 'admin/backups': %i[delete_token perform_token_reset reset_token show]
},
permissible_on: :global,
require: :loggedin,
@@ -54,7 +54,7 @@
map.permission :create_user,
{
users: %i[index show new create resend_invitation],
- "users/memberships": %i[create],
+ 'users/memberships': %i[create],
admin: %i[index]
},
permissible_on: :global,
@@ -64,7 +64,7 @@
map.permission :manage_user,
{
users: %i[index show edit update change_status change_status_info],
- "users/memberships": %i[create update destroy],
+ 'users/memberships': %i[create update destroy],
admin: %i[index]
},
permissible_on: :global,
@@ -74,7 +74,7 @@
map.permission :manage_placeholder_user,
{
placeholder_users: %i[index show new create edit update deletion_info destroy],
- "placeholder_users/memberships": %i[create update destroy],
+ 'placeholder_users/memberships': %i[create update destroy],
admin: %i[index]
},
permissible_on: :global,
@@ -93,10 +93,10 @@
map.permission :edit_project,
{
- "projects/settings/general": %i[show],
- "projects/settings/storage": %i[show],
- "projects/templated": %i[create destroy],
- "projects/identifier": %i[show update]
+ 'projects/settings/general': %i[show],
+ 'projects/settings/storage': %i[show],
+ 'projects/templated': %i[create destroy],
+ 'projects/identifier': %i[show update]
},
permissible_on: :project,
require: :member,
@@ -104,7 +104,7 @@
map.permission :select_project_modules,
{
- "projects/settings/modules": %i[show update]
+ 'projects/settings/modules': %i[show update]
},
permissible_on: :project,
require: :member
@@ -112,7 +112,7 @@
map.permission :manage_members,
{
members: %i[index new create update destroy autocomplete_for_member menu],
- "members/menus": %i[show]
+ 'members/menus': %i[show]
},
permissible_on: :project,
require: :member,
@@ -122,14 +122,14 @@
map.permission :view_members,
{
members: %i[index menu],
- "members/menus": %i[show]
+ 'members/menus': %i[show]
},
permissible_on: :project,
contract_actions: { members: %i[read] }
map.permission :manage_versions,
{
- "projects/settings/versions": [:show],
+ 'projects/settings/versions': [:show],
versions: %i[new create edit update close_completed destroy]
},
permissible_on: :project,
@@ -137,14 +137,14 @@
map.permission :manage_types,
{
- "projects/settings/types": %i[show update]
+ 'projects/settings/types': %i[show update]
},
permissible_on: :project,
require: :member
map.permission :select_custom_fields,
{
- "projects/settings/custom_fields": %i[show update]
+ 'projects/settings/custom_fields': %i[show update]
},
permissible_on: :project,
require: :member
@@ -179,7 +179,7 @@
journals: %i[index],
work_packages: %i[show index],
work_packages_api: [:get],
- "work_packages/reports": %i[report report_details]
+ 'work_packages/reports': %i[report report_details]
},
permissible_on: %i[work_package project],
contract_actions: { work_packages: %i[read] }
@@ -192,7 +192,7 @@
wpt.permission :edit_work_packages,
{
- "work_packages/bulk": %i[edit update]
+ 'work_packages/bulk': %i[edit update]
},
permissible_on: %i[work_package project],
require: :member,
@@ -200,7 +200,7 @@
contract_actions: { work_packages: %i[update] }
wpt.permission :move_work_packages,
- { "work_packages/moves": %i[new create] },
+ { 'work_packages/moves': %i[new create] },
permissible_on: :project,
require: :loggedin,
dependencies: :view_work_packages,
@@ -242,7 +242,7 @@
# WorkPackage categories
wpt.permission :manage_categories,
{
- "projects/settings/categories": [:show],
+ 'projects/settings/categories': [:show],
categories: %i[new create edit update destroy]
},
permissible_on: :project,
@@ -258,7 +258,7 @@
wpt.permission :delete_work_packages,
{
work_packages: :destroy,
- "work_packages/bulk": :destroy
+ 'work_packages/bulk': :destroy
},
permissible_on: :project,
require: :member,
@@ -304,8 +304,8 @@
map.permission :share_work_packages,
{
- "work_packages/shares": %i[index create destroy update resend_invite],
- "work_packages/shares/bulk": %i[update destroy]
+ 'work_packages/shares': %i[index create destroy update resend_invite],
+ 'work_packages/shares/bulk': %i[update destroy]
},
permissible_on: :project,
dependencies: %i[edit_work_packages view_shared_work_packages],
@@ -313,7 +313,7 @@
map.permission :view_shared_work_packages,
{
- "work_packages/shares": %i[index]
+ 'work_packages/shares': %i[index]
},
permissible_on: :project,
require: :member,
@@ -350,13 +350,13 @@
news.permission :manage_news,
{
news: %i[new create edit update destroy preview],
- "news/comments": [:destroy]
+ 'news/comments': [:destroy]
},
permissible_on: :project,
require: :member
news.permission :comment_news,
- { "news/comments": :create },
+ { 'news/comments': :create },
permissible_on: :project
end
@@ -429,7 +429,7 @@
repo.permission :manage_repository,
{
repositories: %i[edit create update committers destroy_info destroy],
- "projects/settings/repository": :show
+ 'projects/settings/repository': :show
},
permissible_on: :project,
require: :member
diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb
index 11e04a3c1d32..eefcbb61230e 100644
--- a/config/initializers/rack-attack.rb
+++ b/config/initializers/rack-attack.rb
@@ -33,14 +33,14 @@
if OpenProject::Configuration.blacklisted_routes.any?
# Block logins from a bad user agent
- Rack::Attack.blocklist("block forbidden routes") do |req|
+ Rack::Attack.blocklist('block forbidden routes') do |req|
regex = OpenProject::Configuration.blacklisted_routes.map! { |str| Regexp.new(str) }
regex.any? { |i| i =~ req.path }
end
Rack::Attack.blocklisted_responder = lambda do |_env|
# All blacklisted routes would return a 404.
- [404, {}, ["Not found"]]
+ [404, {}, ['Not found']]
end
end
end
diff --git a/config/initializers/rack-cors.rb b/config/initializers/rack-cors.rb
index 500b3cd3f3da..e657fcaa5a80 100644
--- a/config/initializers/rack-cors.rb
+++ b/config/initializers/rack-cors.rb
@@ -28,13 +28,13 @@
Rails.application.config.middleware.insert_after Rails::Rack::Logger, Rack::Cors do
allow do
origins { |source, _env| API::V3::CORS.allowed?(source) }
- resource "/api/v3*",
+ resource '/api/v3*',
headers: :any,
methods: :any,
credentials: true,
if: proc { API::V3::CORS.enabled? }
- resource "/oauth/*",
+ resource '/oauth/*',
headers: :any,
methods: :any,
credentials: true,
diff --git a/config/initializers/rack_profiler.rb b/config/initializers/rack_profiler.rb
index 47c9422f0fc1..3365b4d3e168 100644
--- a/config/initializers/rack_profiler.rb
+++ b/config/initializers/rack_profiler.rb
@@ -1,12 +1,12 @@
# frozen_string_literal: true
-if Rails.env.development? && ENV["OPENPROJECT_RACK_PROFILER_ENABLED"]
+if Rails.env.development? && ENV['OPENPROJECT_RACK_PROFILER_ENABLED']
require "rack-mini-profiler"
- require "flamegraph"
- require "stackprof"
+ require 'flamegraph'
+ require 'stackprof'
# initialization is skipped so trigger it
Rack::MiniProfilerRails.initialize!(Rails.application)
- Rack::MiniProfiler.config.position = "bottom-right"
+ Rack::MiniProfiler.config.position = 'bottom-right'
end
diff --git a/config/initializers/rack_timeout.rb b/config/initializers/rack_timeout.rb
index 3e48bb80db14..b6bd86e773ae 100644
--- a/config/initializers/rack_timeout.rb
+++ b/config/initializers/rack_timeout.rb
@@ -31,7 +31,7 @@
# report the generic internal server error too as it doesn't
# add any more information. Even worse, it's not immediately
# clear that the two reports are related.
- require "rack/timeout/suppress_internal_error_report_on_timeout"
+ require 'rack/timeout/suppress_internal_error_report_on_timeout'
OpenProjectErrorHelper.prepend Rack::Timeout::SuppressInternalErrorReportOnTimeout
end
diff --git a/config/initializers/register_renderer.rb b/config/initializers/register_renderer.rb
index c954392caf39..2d8267becf3e 100644
--- a/config/initializers/register_renderer.rb
+++ b/config/initializers/register_renderer.rb
@@ -27,7 +27,7 @@
#++
ActionController::Renderers.add :csv do |obj, options|
- filename = options[:filename] || "data"
+ filename = options[:filename] || 'data'
str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s
charset = "charset=#{I18n.t(:general_csv_encoding).downcase}"
@@ -38,7 +38,7 @@
# For some reasons, the content-type header
# does only contain the charset if the response
# is manipulated like this.
- response.content_type += ""
+ response.content_type += ''
data
end
diff --git a/config/initializers/register_views.rb b/config/initializers/register_views.rb
index 9467182249d4..a01cb748eaef 100644
--- a/config/initializers/register_views.rb
+++ b/config/initializers/register_views.rb
@@ -26,6 +26,6 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require Rails.root.join("config/constants/views")
+require Rails.root.join('config/constants/views')
Constants::Views.add :WorkPackagesTable
diff --git a/config/initializers/secure_headers.rb b/config/initializers/secure_headers.rb
index 4977a527bfbc..7cf131d43eeb 100644
--- a/config/initializers/secure_headers.rb
+++ b/config/initializers/secure_headers.rb
@@ -34,13 +34,13 @@
media_src = default_src
if OpenProject::Configuration.appsignal_frontend_key
- connect_src += ["https://appsignal-endpoint.net"]
+ connect_src += ['https://appsignal-endpoint.net']
end
# Add proxy configuration for Angular CLI to csp
if FrontendAssetHelper.assets_proxied?
proxied = ["ws://#{Setting.host_name}", "http://#{Setting.host_name}",
- FrontendAssetHelper.cli_proxy.sub("http", "ws"), FrontendAssetHelper.cli_proxy]
+ FrontendAssetHelper.cli_proxy.sub('http', 'ws'), FrontendAssetHelper.cli_proxy]
connect_src += proxied
assets_src += proxied
media_src += proxied
@@ -50,15 +50,15 @@
script_src = assets_src
# Allow unsafe-eval for rack-mini-profiler
- if Rails.env.development? && ENV.fetch("OPENPROJECT_RACK_PROFILER_ENABLED", false)
+ if Rails.env.development? && ENV.fetch('OPENPROJECT_RACK_PROFILER_ENABLED', false)
script_src += %w('unsafe-eval')
end
# Allow ANDI bookmarklet to run in development mode
# https://www.ssa.gov/accessibility/andi/help/install.html
if Rails.env.development?
- script_src += ["https://www.ssa.gov"]
- assets_src += ["https://www.ssa.gov"]
+ script_src += ['https://www.ssa.gov']
+ assets_src += ['https://www.ssa.gov']
end
config.csp = {
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index e59b9eba3cfe..594349b46b9f 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -29,10 +29,10 @@
# Be sure to restart your server when you modify this file.
config = OpenProject::Configuration
-relative_url_root = config["rails_relative_url_root"].presence
+relative_url_root = config['rails_relative_url_root'].presence
session_options = {
- key: config["session_cookie_name"],
+ key: config['session_cookie_name'],
httponly: true,
secure: config.https?,
path: relative_url_root
diff --git a/db/migrate/20240229133250_rename_delayed_job_statuses.rb b/config/initializers/time_with_zone_as_json.rb
similarity index 90%
rename from db/migrate/20240229133250_rename_delayed_job_statuses.rb
rename to config/initializers/time_with_zone_as_json.rb
index 43ffd4dd4577..117f21ffaa4d 100644
--- a/db/migrate/20240229133250_rename_delayed_job_statuses.rb
+++ b/config/initializers/time_with_zone_as_json.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class RenameDelayedJobStatuses < ActiveRecord::Migration[7.1]
- def change
- rename_table :delayed_job_statuses, :job_statuses
+class ActiveSupport::TimeWithZone
+ def as_json(_options = {})
+ time.strftime('%m/%d/%Y/ %H:%M %p').to_s
end
end
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb
index c94f72f62d5c..53762fad9c26 100644
--- a/config/initializers/warden.rb
+++ b/config/initializers/warden.rb
@@ -2,12 +2,12 @@
namespace = OpenProject::Authentication::Strategies::Warden
strategies = [
- [:basic_auth_failure, namespace::BasicAuthFailure, "Basic"],
- [:global_basic_auth, namespace::GlobalBasicAuth, "Basic"],
- [:user_basic_auth, namespace::UserBasicAuth, "Basic"],
- [:oauth, namespace::DoorkeeperOAuth, "OAuth"],
- [:anonymous_fallback, namespace::AnonymousFallback, "Basic"],
- [:session, namespace::Session, "Session"]
+ [:basic_auth_failure, namespace::BasicAuthFailure, 'Basic'],
+ [:global_basic_auth, namespace::GlobalBasicAuth, 'Basic'],
+ [:user_basic_auth, namespace::UserBasicAuth, 'Basic'],
+ [:oauth, namespace::DoorkeeperOAuth, 'OAuth'],
+ [:anonymous_fallback, namespace::AnonymousFallback, 'Basic'],
+ [:session, namespace::Session, 'Session']
]
strategies.each do |name, clazz, auth_scheme|
diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb
index f346f581530a..2caf8b11a1ee 100644
--- a/config/initializers/zeitwerk.rb
+++ b/config/initializers/zeitwerk.rb
@@ -1,4 +1,4 @@
-require Rails.root.join("config/constants/open_project/inflector")
+require Rails.root.join('config/constants/open_project/inflector')
OpenProject::Inflector.rule do |_, abspath|
if abspath.match?(/open_project\/version(\.rb)?\z/) ||
@@ -18,24 +18,24 @@
"API#{default_inflect($1, abspath)}"
when /\A(.*)_api\z/
"#{default_inflect($1, abspath)}API"
- when "api"
- "API"
+ when 'api'
+ 'API'
when /(.*)_ical_(.*)/i
"#{default_inflect($1, abspath)}ICal#{default_inflect($2, abspath)}"
when /\Aical_(.*)\z/
"ICal#{default_inflect($1, abspath)}"
when /\A(.*)_ical\z/
"#{default_inflect($1, abspath)}ICal"
- when "ical"
- "ICal"
+ when 'ical'
+ 'ICal'
when /\Aar_(.*)\z/
"AR#{default_inflect($1, abspath)}"
when /\Aoauth_(.*)\z/
"OAuth#{default_inflect($1, abspath)}"
when /\A(.*)_oauth\z/
"#{default_inflect($1, abspath)}OAuth"
- when "oauth"
- "OAuth"
+ when 'oauth'
+ 'OAuth'
when /\Aclamav_(.*)\z/
"ClamAV#{default_inflect($1, abspath)}"
when /\A(.*)_sso\z/
@@ -48,32 +48,32 @@
# we simply return the general OpenProject namespace for such files.
OpenProject::Inflector.rule do |_basename, abspath|
if /\/lib\/openproject-\w+.rb\z/.match?(abspath)
- "OpenProject"
+ 'OpenProject'
end
end
OpenProject::Inflector.inflection(
- "rss" => "RSS",
- "sha1" => "SHA1",
- "sso" => "SSO",
- "csv" => "CSV",
- "pdf" => "PDF",
- "scm" => "SCM",
- "imap" => "IMAP",
- "pop3" => "POP3",
- "cors" => "CORS",
- "openid_connect" => "OpenIDConnect",
- "pdf_export" => "PDFExport",
- "ical" => "ICal",
- "clamav" => "ClamAV"
+ 'rss' => 'RSS',
+ 'sha1' => 'SHA1',
+ 'sso' => 'SSO',
+ 'csv' => 'CSV',
+ 'pdf' => 'PDF',
+ 'scm' => 'SCM',
+ 'imap' => 'IMAP',
+ 'pop3' => 'POP3',
+ 'cors' => 'CORS',
+ 'openid_connect' => 'OpenIDConnect',
+ 'pdf_export' => 'PDFExport',
+ 'ical' => 'ICal',
+ 'clamav' => 'ClamAV'
)
Rails.autoloaders.each do |autoloader|
autoloader.inflector = OpenProject::Inflector.new(__FILE__)
end
-Rails.autoloaders.main.ignore(Rails.root.join("lib/open_project/patches"))
-Rails.autoloaders.main.ignore(Rails.root.join("lib/generators"))
+Rails.autoloaders.main.ignore(Rails.root.join('lib/open_project/patches'))
+Rails.autoloaders.main.ignore(Rails.root.join('lib/generators'))
# Comment in to enable zeitwerk logging.
# Rails.autoloaders.main.log!
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 98df69b847df..eb59e3cd8644 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -35,14 +35,15 @@ en:
admin:
plugins:
- no_results_title_text: There are currently no plugins installed.
- no_results_content_text: See our integrations and plugins page for more information.
+ no_results_title_text: There are currently no plugins available.
custom_styles:
color_theme: "Color theme"
color_theme_custom: "(Custom)"
colors:
- primary-button-color: "Primary button"
- accent-color: "Accent"
+ alternative-color: "Alternative"
+ content-link-color: "Link font"
+ primary-color: "Primary"
+ primary-color-dark: "Primary (dark)"
header-bg-color: "Header background"
header-item-bg-hover-color: "Header background on hover"
header-item-font-color: "Header font"
@@ -61,8 +62,10 @@ en:
enterprise_more_info: "Note: the used logo will be publicly accessible."
manage_colors: "Edit color select options"
instructions:
- primary-button-color: "Strong accent color, used for the most important button on a screen."
- accent-color: "Color for links and other decently highlighted elements."
+ alternative-color: "Strong accent color, typically used for the most important button on a screen."
+ content-link-color: "Font color of most of the links."
+ primary-color: "Main color."
+ primary-color-dark: "Typically a darker version of the main color used for hover effects."
header-item-bg-hover-color: "Background color of clickable header items when hovered with the mouse."
header-item-font-color: "Font color of clickable header items."
header-item-font-hover-color: "Font color of clickable header items when hovered with the mouse."
@@ -1632,7 +1635,6 @@ en:
postgres_migration: "Migrating your installation to PostgreSQL"
user_guides: "User guides"
faq: "FAQ"
- impressum: "Legal notice"
glossary: "Glossary"
shortcuts: "Shortcuts"
blog: "OpenProject blog"
@@ -1646,7 +1648,6 @@ en:
changes_retracted: "The changes were retracted."
caused_changes:
- default_attribute_written: "Read-only attributes written"
dates_changed: "Dates changed"
system_update: "OpenProject system update:"
@@ -1988,6 +1989,7 @@ en:
label_subject_or_id: "Subject or ID"
label_calendar_subscriptions: "Calendar subscriptions"
label_identifier: "Identifier"
+ label_impressum: "Legal notice"
label_in: "in"
label_in_less_than: "in less than"
label_in_more_than: "in more than"
@@ -2874,16 +2876,6 @@ en:
If CORS is enabled, these are the origins that are allowed to access OpenProject API.
Please check the Documentation on the Origin header on how to specify the expected values.
- setting_apiv3_write_readonly_attributes: "Write access to read-only attributes"
- setting_apiv3_write_readonly_attributes_instructions_html: >
- If enabled, the API will allow administrators to write static read-only attributes during creation,
- such as createdAt and updatedAt timestamps.
-
- Warning: This setting has a use-case for e.g., importing data, but allows
- administrators to impersonate the creation of items as other users. All creation requests are being
- logged however with the true author.
-
- For more information on attributes and supported resources, please see the %{api_documentation_link}.
setting_apiv3_max_page_size: "Maximum API page size"
setting_apiv3_max_page_instructions_html: >
Set the maximum page size the API will respond with.
@@ -3338,7 +3330,6 @@ en:
status_user_and_brute_force: "%{user} and %{brute_force}"
status_change: "Status change"
text_change_disabled_for_provider_login: "The name is set by your login provider and can thus not be changed."
- text_change_disabled_for_ldap_login: "The name and email is set by LDAP and can thus not be changed."
unlock: "Unlock"
unlock_and_reset_failed_logins: "Unlock and reset failed logins"
diff --git a/config/puma.rb b/config/puma.rb
index 4fe6d97c7c04..d375917d8fc1 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -28,12 +28,12 @@
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
-preload_app! if ENV["RAILS_ENV"] == "production"
+preload_app! if ENV["RAILS_ENV"] == 'production'
# Allow puma to be restarted by `rails restart` command.
-plugin :tmp_restart unless ENV["RAILS_ENV"] == "production"
+plugin :tmp_restart unless ENV["RAILS_ENV"] == 'production'
-plugin :appsignal if ENV["APPSIGNAL_ENABLED"] == "true"
+plugin :appsignal if ENV['APPSIGNAL_ENABLED'] == 'true'
# activate statsd plugin only if a host is configured explicitly
if OpenProject::Configuration.statsd_host.present?
diff --git a/config/routes.rb b/config/routes.rb
index 89c4963a26d3..6e7dbf0313eb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -27,74 +27,74 @@
#++
Rails.application.routes.draw do
- root to: "homescreen#index", as: "home"
- rails_relative_url_root = OpenProject::Configuration["rails_relative_url_root"] || ""
+ root to: 'homescreen#index', as: 'home'
+ rails_relative_url_root = OpenProject::Configuration['rails_relative_url_root'] || ''
# Route for error pages
- get "/404", to: "errors#not_found"
- get "/422", to: "errors#unacceptable"
- get "/500", to: "errors#internal_error"
+ get '/404', to: "errors#not_found"
+ get '/422', to: "errors#unacceptable"
+ get '/500', to: "errors#internal_error"
# Route for health_checks
- get "/health_check" => "ok_computer/ok_computer#show", check: "web"
+ get '/health_check' => 'ok_computer/ok_computer#show', check: 'web'
# Override the default `all` checks route to return the full check
- get "/health_checks/all" => "ok_computer/ok_computer#show", check: "full"
+ get '/health_checks/all' => 'ok_computer/ok_computer#show', check: 'full'
mount OkComputer::Engine, at: "/health_checks"
- get "/api/docs" => "api_docs#index"
+ get "/api/docs" => 'api_docs#index'
# Redirect deprecated issue links to new work packages uris
- get "/issues(/)" => redirect("#{rails_relative_url_root}/work_packages")
+ get '/issues(/)' => redirect("#{rails_relative_url_root}/work_packages")
# The URI.escape doesn't escape / unless you ask it to.
# see https://github.com/rails/rails/issues/5688
- get "/issues/*rest" => redirect { |params, _req|
+ get '/issues/*rest' => redirect { |params, _req|
"#{rails_relative_url_root}/work_packages/#{URI::RFC2396_Parser.new.escape(params[:rest])}"
}
# Respond with 410 gone for APIV2 calls
- match "/api/v2(/*unmatched_route)", to: proc { [410, {}, [""]] }, via: :all
- match "/assets/compiler.js.map", to: proc { [404, {}, [""]] }, via: :all
+ match '/api/v2(/*unmatched_route)', to: proc { [410, {}, ['']] }, via: :all
+ match '/assets/compiler.js.map', to: proc { [404, {}, ['']] }, via: :all
# Redirect wp short url for work packages to full URL
- get "/wp(/)" => redirect("#{rails_relative_url_root}/work_packages")
- get "/wp/*rest" => redirect { |params, _req|
+ get '/wp(/)' => redirect("#{rails_relative_url_root}/work_packages")
+ get '/wp/*rest' => redirect { |params, _req|
"#{rails_relative_url_root}/work_packages/#{URI::RFC2396_Parser.new.escape(params[:rest])}"
}
# Add catch method for Rack OmniAuth to allow route helpers
# Note: This renders a 404 in rails but is caught by omniauth in Rack before
- get "/auth/failure", to: "account#omniauth_failure"
- get "/auth/:provider", to: proc { [404, {}, [""]] }, as: "omniauth_start"
- match "/auth/:provider/callback", to: "account#omniauth_login", as: "omniauth_login", via: %i[get post]
+ get '/auth/failure', to: 'account#omniauth_failure'
+ get '/auth/:provider', to: proc { [404, {}, ['']] }, as: 'omniauth_start'
+ match '/auth/:provider/callback', to: 'account#omniauth_login', as: 'omniauth_login', via: %i[get post]
# In case assets are actually delivered by a node server (e.g. in test env)
# forward requests to the proxy
if FrontendAssetHelper.assets_proxied?
- match "/assets/frontend/*appendix",
+ match '/assets/frontend/*appendix',
to: redirect("#{FrontendAssetHelper.cli_proxy}/assets/frontend/%{appendix}", status: 307),
format: false,
via: :all
end
- scope controller: "account" do
- get "/account/force_password_change", action: "force_password_change"
- post "/account/change_password", action: "change_password"
- match "/account/lost_password", action: "lost_password", via: %i[get post]
- match "/account/register", action: "register", via: %i[get post patch]
- get "/account/activate", action: "activate"
+ scope controller: 'account' do
+ get '/account/force_password_change', action: 'force_password_change'
+ post '/account/change_password', action: 'change_password'
+ match '/account/lost_password', action: 'lost_password', via: %i[get post]
+ match '/account/register', action: 'register', via: %i[get post patch]
+ get '/account/activate', action: 'activate'
- match "/login", action: "login", as: "signin", via: %i[get post]
- get "/login/internal", action: "internal_login", as: "internal_signin"
- get "/logout", action: "logout", as: "signout"
+ match '/login', action: 'login', as: 'signin', via: %i[get post]
+ get '/login/internal', action: 'internal_login', as: 'internal_signin'
+ get '/logout', action: 'logout', as: 'signout'
- get "/sso", action: "auth_source_sso_failed", as: "sso_failure"
+ get '/sso', action: 'auth_source_sso_failed', as: 'sso_failure'
- get "/login/:stage/failure", action: "stage_failure", as: "stage_failure"
- get "/login/:stage/:secret", action: "stage_success", as: "stage_success"
+ get '/login/:stage/failure', action: 'stage_failure', as: 'stage_failure'
+ get '/login/:stage/:secret', action: 'stage_success', as: 'stage_success'
- get "/account/consent", action: "consent", as: "account_consent"
- get "/account/decline_consent", action: "decline_consent", as: "account_decline_consent"
- post "/account/confirm_consent", action: "confirm_consent", as: "account_confirm_consent"
+ get '/account/consent', action: 'consent', as: 'account_consent'
+ get '/account/decline_consent', action: 'decline_consent', as: 'account_decline_consent'
+ post '/account/confirm_consent', action: 'confirm_consent', as: 'account_confirm_consent'
end
# Because of https://github.com/intridea/grape/pull/853/files this has to be
@@ -102,7 +102,7 @@
# returned for all routes for which the v3 has also resources. Grape does
# remove the prefix (v3) before checking whether the method is supported. I
# don't understand why that should make sense.
- mount API::Root => "/api"
+ mount API::Root => '/api'
# OAuth authorization routes
use_doorkeeper do
@@ -110,45 +110,45 @@
skip_controllers :applications, :authorized_applications
end
- get "/roles/workflow/:id/:role_id/:type_id" => "roles#workflow"
+ get '/roles/workflow/:id/:role_id/:type_id' => 'roles#workflow'
- get "/types/:id/edit/:tab" => "types#edit",
+ get '/types/:id/edit/:tab' => "types#edit",
as: "edit_type_tab"
- match "/types/:id/update/:tab" => "types#update",
+ match '/types/:id/update/:tab' => "types#update",
as: "update_type_tab",
via: %i[post patch]
resources :types do
- post "move/:id", action: "move", on: :collection
+ post 'move/:id', action: 'move', on: :collection
end
resources :statuses, except: :show do
collection do
- post "update_work_package_done_ratio"
+ post 'update_work_package_done_ratio'
end
end
- get "custom_style/:digest/logo/:filename" => "custom_styles#logo_download",
- as: "custom_style_logo",
+ get 'custom_style/:digest/logo/:filename' => 'custom_styles#logo_download',
+ as: 'custom_style_logo',
constraints: { filename: /[^\/]*/ }
- get "custom_style/:digest/export_logo/:filename" => "custom_styles#export_logo_download",
- as: "custom_style_export_logo",
+ get 'custom_style/:digest/export_logo/:filename' => 'custom_styles#export_logo_download',
+ as: 'custom_style_export_logo',
constraints: { filename: /[^\/]*/ }
- get "custom_style/:digest/export_cover/:filename" => "custom_styles#export_cover_download",
- as: "custom_style_export_cover",
+ get 'custom_style/:digest/export_cover/:filename' => 'custom_styles#export_cover_download',
+ as: 'custom_style_export_cover',
constraints: { filename: /[^\/]*/ }
- get "custom_style/:digest/favicon/:filename" => "custom_styles#favicon_download",
- as: "custom_style_favicon",
+ get 'custom_style/:digest/favicon/:filename' => 'custom_styles#favicon_download',
+ as: 'custom_style_favicon',
constraints: { filename: /[^\/]*/ }
- get "custom_style/:digest/touch-icon/:filename" => "custom_styles#touch_icon_download",
- as: "custom_style_touch_icon",
+ get 'custom_style/:digest/touch-icon/:filename' => 'custom_styles#touch_icon_download',
+ as: 'custom_style_touch_icon',
constraints: { filename: /[^\/]*/ }
- get "highlighting/styles(/:version_tag)" => "highlighting#styles",
- as: "highlighting_css_styles"
+ get 'highlighting/styles(/:version_tag)' => 'highlighting#styles',
+ as: 'highlighting_css_styles'
resources :custom_fields, except: :show do
member do
@@ -158,25 +158,25 @@
end
end
- get "(projects/:project_id)/search" => "search#index", as: "search"
+ get '(projects/:project_id)/search' => 'search#index', as: 'search'
# only providing routes for journals when there are multiple subclasses of journals
# all subclasses will look for the journals routes
resources :journals, only: :index do
- get "diff/:field", action: :diff, on: :member, as: "diff"
+ get 'diff/:field', action: :diff, on: :member, as: 'diff'
end
# REVIEW: review those wiki routes
- scope "projects/:project_id/wiki/:id" do
+ scope 'projects/:project_id/wiki/:id' do
resource :wiki_menu_item, only: %i[edit update]
end
# generic route for adding/removing watchers.
# Models declared as acts_as_watchable will be automatically added to
# OpenProject::Acts::Watchable::Routes.watched
- scope ":object_type/:object_id", constraints: OpenProject::Acts::Watchable::Routes do
- post "/watch" => "watchers#watch"
- delete "/unwatch" => "watchers#unwatch"
+ scope ':object_type/:object_id', constraints: OpenProject::Acts::Watchable::Routes do
+ post '/watch' => 'watchers#watch'
+ delete '/unwatch' => 'watchers#unwatch'
end
namespace :projects do
@@ -185,32 +185,32 @@
end
resources :projects, except: %i[show edit create update] do
- scope module: "projects" do
- namespace "settings" do
- resource :general, only: %i[show], controller: "general"
+ scope module: 'projects' do
+ namespace 'settings' do
+ resource :general, only: %i[show], controller: 'general'
resource :modules, only: %i[show update]
resource :types, only: %i[show update]
resource :custom_fields, only: %i[show update]
- resource :repository, only: %i[show], controller: "repository"
+ resource :repository, only: %i[show], controller: 'repository'
resource :versions, only: %i[show]
resource :categories, only: %i[show update]
- resource :storage, only: %i[show], controller: "storage"
+ resource :storage, only: %i[show], controller: 'storage'
end
- resource :templated, only: %i[create destroy], controller: "templated"
- resource :archive, only: %i[create destroy], controller: "archive"
- resource :identifier, only: %i[show update], controller: "identifier"
+ resource :templated, only: %i[create destroy], controller: 'templated'
+ resource :archive, only: %i[create destroy], controller: 'archive'
+ resource :identifier, only: %i[show update], controller: 'identifier'
end
member do
- get "settings", to: redirect("projects/%{id}/settings/general/")
+ get "settings", to: redirect('projects/%{id}/settings/general/')
get :copy
patch :types
# Destroy uses a get request to prompt the user before the actual DELETE request
- get :destroy_info, as: "confirm_destroy"
+ get :destroy_info, as: 'confirm_destroy'
end
resources :versions, only: %i[new create] do
@@ -222,7 +222,7 @@
# this is only another name for versions#index
# For nice "road in the url for the index action
# this could probably be rewritten with a resource as: 'roadmap'
- get "/roadmap" => "versions#index"
+ get '/roadmap' => 'versions#index'
resources :news, only: %i[index new create]
@@ -233,25 +233,25 @@
constraints: { id: /([^\/]+(?=\.markdown)|[^\/]+)/ },
except: %i[index create] do
collection do
- post "/new" => "wiki#create", as: "create"
+ post '/new' => 'wiki#create', as: 'create'
get :export
- get "/index" => "wiki#index"
+ get '/index' => 'wiki#index'
get :menu
end
member do
- get "/new" => "wiki#new_child", as: "new_child"
- get "/diff/:version/vs/:version_from" => "wiki#diff", as: "wiki_diff_compare"
- get "/diff(/:version)" => "wiki#diff", as: "wiki_diff"
- get "/annotate/:version" => "wiki#annotate", as: "wiki_annotate"
- get "/toc" => "wiki#index"
+ get '/new' => 'wiki#new_child', as: 'new_child'
+ get '/diff/:version/vs/:version_from' => 'wiki#diff', as: 'wiki_diff_compare'
+ get '/diff(/:version)' => 'wiki#diff', as: 'wiki_diff'
+ get '/annotate/:version' => 'wiki#annotate', as: 'wiki_annotate'
+ get '/toc' => 'wiki#index'
match :rename, via: %i[get patch]
- get :parent_page, action: "edit_parent_page"
- patch :parent_page, action: "update_parent_page"
+ get :parent_page, action: 'edit_parent_page'
+ patch :parent_page, action: 'update_parent_page'
get :history
post :protect
- get :select_main_menu_item, to: "wiki_menu_items#select_main_menu_item"
- post :replace_main_menu_item, to: "wiki_menu_items#replace_main_menu_item"
+ get :select_main_menu_item, to: 'wiki_menu_items#select_main_menu_item'
+ post :replace_main_menu_item, to: 'wiki_menu_items#replace_main_menu_item'
get :menu
end
end
@@ -260,24 +260,24 @@
# it is necessary to define the show action later
# than any other route as it otherwise would
# work as a catchall for everything under /wiki
- get "wiki" => "wiki#show"
+ get 'wiki' => 'wiki#show'
resources :work_packages, only: [] do
collection do
- get "/report/:detail" => "work_packages/reports#report_details"
- get "/report" => "work_packages/reports#report"
+ get '/report/:detail' => 'work_packages/reports#report_details'
+ get '/report' => 'work_packages/reports#report'
end
# states managed by client-side routing on work_package#index
- get "(/*state)" => "work_packages#index", on: :collection, as: ""
- get "/create_new" => "work_packages#index", on: :collection, as: "new_split"
- get "/new" => "work_packages#index", on: :collection, as: "new"
+ get '(/*state)' => 'work_packages#index', on: :collection, as: ''
+ get '/create_new' => 'work_packages#index', on: :collection, as: 'new_split'
+ get '/new' => 'work_packages#index', on: :collection, as: 'new'
# state for show view in project context
- get "(/*state)" => "work_packages#show", on: :member, as: ""
+ get '(/*state)' => 'work_packages#show', on: :member, as: ''
end
- resources :activity, :activities, only: :index, controller: "activities" do
+ resources :activity, :activities, only: :index, controller: 'activities' do
collection do
get :menu
end
@@ -303,7 +303,7 @@
resource :menu, only: %[show]
end
- resource :repository, controller: "repositories", except: [:new] do
+ resource :repository, controller: 'repositories', except: [:new] do
# Destroy uses a get request to prompt the user before the actual DELETE request
get :destroy_info
get :committers
@@ -311,36 +311,36 @@
get :graph
get :revisions
- get "/statistics", action: :stats, as: "stats"
+ get '/statistics', action: :stats, as: 'stats'
- get "(/revisions/:rev)/diff.:format", action: :diff
- get "(/revisions/:rev)/diff(/*repo_path)",
+ get '(/revisions/:rev)/diff.:format', action: :diff
+ get '(/revisions/:rev)/diff(/*repo_path)',
action: :diff,
- format: "html",
- constraints: { rev: /[\w.\-]+/, repo_path: /.*/ }
+ format: 'html',
+ constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ }
- get "(/revisions/:rev)/:format/*repo_path",
+ get '(/revisions/:rev)/:format/*repo_path',
action: :entry,
format: /raw/,
- rev: /[\w.\-]+/
+ rev: /[\w0-9.\-_]+/
%w{diff annotate changes entry browse}.each do |action|
get "(/revisions/:rev)/#{action}(/*repo_path)",
- format: "html",
+ format: 'html',
action:,
- constraints: { rev: /[\w.\-]+/, repo_path: /.*/ },
+ constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ },
as: "#{action}_revision"
end
- get "/revision(/:rev)", rev: /[\w.\-]+/,
+ get '/revision(/:rev)', rev: /[\w0-9.\-_]+/,
action: :revision,
- as: "show_revision"
+ as: 'show_revision'
- get "(/revisions/:rev)(/*repo_path)",
+ get '(/revisions/:rev)(/*repo_path)',
action: :show,
- format: "html",
- constraints: { rev: /[\w.\-]+/, repo_path: /.*/ },
- as: "show_revisions_path"
+ format: 'html',
+ constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ },
+ as: 'show_revisions_path'
end
end
@@ -352,52 +352,52 @@
end
end
- scope "admin" do
+ scope 'admin' do
resource :announcements, only: %i[edit update]
constraints(Constraints::Enterprise) do
resource :enterprise, only: %i[show create destroy]
- scope controller: "enterprises" do
- post "enterprise/save_trial_key" => "enterprises#save_trial_key"
- delete "enterprise/delete_trial_key" => "enterprises#delete_trial_key"
+ scope controller: 'enterprises' do
+ post 'enterprise/save_trial_key' => 'enterprises#save_trial_key'
+ delete 'enterprise/delete_trial_key' => 'enterprises#delete_trial_key'
end
end
resources :enumerations do
- post "move/:id", action: "move", on: :collection
+ post 'move/:id', action: 'move', on: :collection
end
- delete "design/logo" => "custom_styles#logo_delete", as: "custom_style_logo_delete"
- delete "design/export_logo" => "custom_styles#export_logo_delete", as: "custom_style_export_logo_delete"
- delete "design/export_cover" => "custom_styles#export_cover_delete", as: "custom_style_export_cover_delete"
- delete "design/favicon" => "custom_styles#favicon_delete", as: "custom_style_favicon_delete"
- delete "design/touch_icon" => "custom_styles#touch_icon_delete", as: "custom_style_touch_icon_delete"
- get "design/upsale" => "custom_styles#upsale", as: "custom_style_upsale"
- post "design/colors" => "custom_styles#update_colors", as: "update_design_colors"
- post "design/themes" => "custom_styles#update_themes", as: "update_design_themes"
- post "design/export_cover_text_color" => "custom_styles#update_export_cover_text_color",
- as: "update_custom_style_export_cover_text_color"
+ delete 'design/logo' => 'custom_styles#logo_delete', as: 'custom_style_logo_delete'
+ delete 'design/export_logo' => 'custom_styles#export_logo_delete', as: 'custom_style_export_logo_delete'
+ delete 'design/export_cover' => 'custom_styles#export_cover_delete', as: 'custom_style_export_cover_delete'
+ delete 'design/favicon' => 'custom_styles#favicon_delete', as: 'custom_style_favicon_delete'
+ delete 'design/touch_icon' => 'custom_styles#touch_icon_delete', as: 'custom_style_touch_icon_delete'
+ get 'design/upsale' => 'custom_styles#upsale', as: 'custom_style_upsale'
+ post 'design/colors' => 'custom_styles#update_colors', as: 'update_design_colors'
+ post 'design/themes' => 'custom_styles#update_themes', as: 'update_design_themes'
+ post 'design/export_cover_text_color' => 'custom_styles#update_export_cover_text_color',
+ as: 'update_custom_style_export_cover_text_color'
- resource :custom_style, only: %i[update show create], path: "design"
+ resource :custom_style, only: %i[update show create], path: 'design'
resources :attribute_help_texts, only: %i(index new create edit update destroy) do
- get :upsale, to: "attribute_help_texts#upsale", on: :collection, as: :upsale
+ get :upsale, to: 'attribute_help_texts#upsale', on: :collection, as: :upsale
end
resources :groups, except: %i[show] do
member do
# this should be put into it's own resource
- post "/members" => "groups#add_users", as: "members_of"
- delete "/members/:user_id" => "groups#remove_user", as: "member_of"
+ post '/members' => 'groups#add_users', as: 'members_of'
+ delete '/members/:user_id' => 'groups#remove_user', as: 'member_of'
# this should be put into it's own resource
- patch "/memberships/:membership_id" => "groups#edit_membership", as: "membership_of"
- put "/memberships/:membership_id" => "groups#edit_membership"
- delete "/memberships/:membership_id" => "groups#destroy_membership"
- post "/memberships" => "groups#create_memberships", as: "memberships_of"
+ patch '/memberships/:membership_id' => 'groups#edit_membership', as: 'membership_of'
+ put '/memberships/:membership_id' => 'groups#edit_membership'
+ delete '/memberships/:membership_id' => 'groups#destroy_membership'
+ post '/memberships' => 'groups#create_memberships', as: 'memberships_of'
end
end
resources :roles, except: %i[show] do
collection do
- put "/" => "roles#bulk_update"
+ put '/' => 'roles#bulk_update'
get :report
end
end
@@ -422,37 +422,37 @@
patch tab[:name], controller: tab[:controller], action: :update, as: "update_#{tab[:name]}"
end
- resource :authentication, controller: "/admin/settings/authentication_settings", only: %i[show update]
- resource :attachments, controller: "/admin/settings/attachments_settings", only: %i[show update]
- resource :virus_scanning, controller: "/admin/settings/virus_scanning_settings", only: %i[show update] do
+ resource :authentication, controller: '/admin/settings/authentication_settings', only: %i[show update]
+ resource :attachments, controller: '/admin/settings/attachments_settings', only: %i[show update]
+ resource :virus_scanning, controller: '/admin/settings/virus_scanning_settings', only: %i[show update] do
collection do
get :av_form
end
end
- resource :incoming_mails, controller: "/admin/settings/incoming_mails_settings", only: %i[show update]
- resource :aggregation, controller: "/admin/settings/aggregation_settings", only: %i[show update]
- resource :mail_notifications, controller: "/admin/settings/mail_notifications_settings", only: %i[show update]
- resource :api, controller: "/admin/settings/api_settings", only: %i[show update]
- resource :work_packages, controller: "/admin/settings/work_packages_settings", only: %i[show update]
- resource :working_days, controller: "/admin/settings/working_days_settings", only: %i[show update]
- resource :users, controller: "/admin/settings/users_settings", only: %i[show update]
- resource :date_format, controller: "/admin/settings/date_format_settings", only: %i[show update]
- resource :icalendar, controller: "/admin/settings/icalendar_settings", only: %i[show update]
+ resource :incoming_mails, controller: '/admin/settings/incoming_mails_settings', only: %i[show update]
+ resource :aggregation, controller: '/admin/settings/aggregation_settings', only: %i[show update]
+ resource :mail_notifications, controller: '/admin/settings/mail_notifications_settings', only: %i[show update]
+ resource :api, controller: '/admin/settings/api_settings', only: %i[show update]
+ resource :work_packages, controller: '/admin/settings/work_packages_settings', only: %i[show update]
+ resource :working_days, controller: '/admin/settings/working_days_settings', only: %i[show update]
+ resource :users, controller: '/admin/settings/users_settings', only: %i[show update]
+ resource :date_format, controller: '/admin/settings/date_format_settings', only: %i[show update]
+ resource :icalendar, controller: '/admin/settings/icalendar_settings', only: %i[show update]
# Redirect /settings to general settings
- get "/", to: redirect("/admin/settings/general")
+ get '/', to: redirect('/admin/settings/general')
# Plugin settings
- get "plugin/:id", action: :show_plugin
- post "plugin/:id", action: :update_plugin
+ get 'plugin/:id', action: :show_plugin
+ post 'plugin/:id', action: :update_plugin
end
resources :quarantined_attachments,
- controller: "/admin/attachments/quarantined_attachments",
+ controller: '/admin/attachments/quarantined_attachments',
only: %i[index destroy]
- resource :backups, controller: "/admin/backups", only: %i[show] do
+ resource :backups, controller: '/admin/backups', only: %i[show] do
collection do
get :reset_token
post :reset_token, action: :perform_token_reset
@@ -465,48 +465,48 @@
resource :workflows, only: %i[edit update show] do
member do
# We should fix this crappy routing (split up and rename controller methods)
- match "copy", action: "copy", via: %i[get post]
+ match 'copy', action: 'copy', via: %i[get post]
end
end
namespace :work_packages do
- match "auto_complete" => "auto_completes#index", via: %i[get post]
- resource :bulk, controller: "bulk", only: %i[edit update destroy]
+ match 'auto_complete' => 'auto_completes#index', via: %i[get post]
+ resource :bulk, controller: 'bulk', only: %i[edit update destroy]
# FIXME: this is kind of evil!! We need to remove this soonest and
# cover the functionality. Route is being used in work-package-service.js:331
- get "/bulk" => "bulk#destroy"
+ get '/bulk' => 'bulk#destroy'
resources :shares, only: %i[destroy update]
end
resources :work_packages, only: [:index] do
# move bulk of wps
- get "move/new" => "work_packages/moves#new", on: :collection, as: "new_move"
- post "move" => "work_packages/moves#create", on: :collection, as: "move"
+ get 'move/new' => 'work_packages/moves#new', on: :collection, as: 'new_move'
+ post 'move' => 'work_packages/moves#create', on: :collection, as: 'move'
# move individual wp
- resource :move, controller: "work_packages/moves", only: %i[new create]
+ resource :move, controller: 'work_packages/moves', only: %i[new create]
# states managed by client-side routing on work_package#index
- get "details/*state" => "work_packages#index", on: :collection, as: :details
+ get 'details/*state' => 'work_packages#index', on: :collection, as: :details
# Rails managed sharing route
- resources :shares, controller: "work_packages/shares", only: %i[index create] do
+ resources :shares, controller: 'work_packages/shares', only: %i[index create] do
member do
- post "resend_invite" => "work_packages/shares#resend_invite"
+ post 'resend_invite' => 'work_packages/shares#resend_invite'
end
collection do
- resource :bulk, controller: "work_packages/shares/bulk", only: %i[update destroy], as: :shares_bulk
+ resource :bulk, controller: 'work_packages/shares/bulk', only: %i[update destroy], as: :shares_bulk
end
end
# states managed by client-side (angular) routing on work_package#show
- get "/" => "work_packages#index", on: :collection, as: "index"
- get "/create_new" => "work_packages#index", on: :collection, as: "new_split"
- get "/new" => "work_packages#index", on: :collection, as: "new", state: "new"
+ get '/' => 'work_packages#index', on: :collection, as: 'index'
+ get '/create_new' => 'work_packages#index', on: :collection, as: 'new_split'
+ get '/new' => 'work_packages#index', on: :collection, as: 'new', state: 'new'
# We do not want to match the work package export routes
- get "(/*state)" => "work_packages#show", on: :member, as: "", constraints: { id: /\d+/ }
- get "/share_upsale" => "work_packages#index", on: :collection, as: "share_upsale"
- get "/edit" => "work_packages#show", on: :member, as: "edit"
+ get '(/*state)' => 'work_packages#show', on: :member, as: '', constraints: { id: /\d+/ }
+ get '/share_upsale' => 'work_packages#index', on: :collection, as: 'share_upsale'
+ get '/edit' => 'work_packages#show', on: :member, as: 'edit'
end
resources :versions, only: %i[show edit update destroy] do
@@ -515,18 +515,18 @@
end
end
- resources :activity, :activities, only: :index, controller: "activities" do
+ resources :activity, :activities, only: :index, controller: 'activities' do
collection do
get :menu
end
end
resources :users, constraints: { id: /(\d+|me)/ }, except: :edit do
- resources :memberships, controller: "users/memberships", only: %i[update create destroy]
+ resources :memberships, controller: 'users/memberships', only: %i[update create destroy]
member do
- get "/edit(/:tab)" => "users#edit", as: "edit"
- get "/change_status/:change_action" => "users#change_status_info", as: "change_status_info"
+ get '/edit(/:tab)' => 'users#edit', as: 'edit'
+ get '/change_status/:change_action' => 'users#change_status_info', as: 'change_status_info'
post :change_status
post :resend_invitation
get :deletion_info
@@ -534,10 +534,10 @@
end
resources :placeholder_users, except: :edit do
- resources :memberships, controller: "placeholder_users/memberships", only: %i[update create destroy]
+ resources :memberships, controller: 'placeholder_users/memberships', only: %i[update create destroy]
member do
- get "/edit(/:tab)" => "placeholder_users#edit", as: "edit"
+ get '/edit(/:tab)' => 'placeholder_users#edit', as: 'edit'
get :deletion_info
end
end
@@ -546,33 +546,33 @@
resources :groups, only: %i[show], as: :show_group
resources :forums, only: [] do
- resources :topics, controller: "messages", except: [:index], shallow: true do
+ resources :topics, controller: 'messages', except: [:index], shallow: true do
member do
get :quote
- post :reply, as: "reply_to"
+ post :reply, as: 'reply_to'
end
end
end
resources :news, only: %i[index destroy update edit show] do
- resources :comments, controller: "news/comments", only: %i[create destroy], shallow: true
+ resources :comments, controller: 'news/comments', only: %i[create destroy], shallow: true
end
# redirect for backwards compatibility
- scope "attachments",
+ scope 'attachments',
constraints: { id: /\d+/, filename: /[^\/]*/ },
format: false do
- get "/download/:id/:filename",
+ get '/download/:id/:filename',
to: redirect("#{rails_relative_url_root}/attachments/%{id}/%{filename}")
- get "/download/:id",
+ get '/download/:id',
to: redirect("#{rails_relative_url_root}/attachments/%{id}")
- scope ":id" do
- get "(/:filename)",
+ scope ':id' do
+ get '(/:filename)',
to: redirect("#{rails_relative_url_root}/api/v3/attachments/%{id}/content")
- delete "",
+ delete '',
to: redirect("#{rails_relative_url_root}/api/v3/attachments/%{id}")
end
end
@@ -584,45 +584,45 @@
end
end
- scope controller: "sys" do
- match "/sys/repo_auth", action: "repo_auth", via: %i[get post]
- get "/sys/projects", action: "projects"
- get "/sys/fetch_changesets", action: "fetch_changesets"
- get "/sys/projects/:id/repository/update_storage", action: "update_required_storage"
+ scope controller: 'sys' do
+ match '/sys/repo_auth', action: 'repo_auth', via: %i[get post]
+ get '/sys/projects', action: 'projects'
+ get '/sys/fetch_changesets', action: 'fetch_changesets'
+ get '/sys/projects/:id/repository/update_storage', action: 'update_required_storage'
end
# alternate routes for the current user
- scope "my" do
- get "/deletion_info" => "users#deletion_info", as: "delete_my_account_info"
- post "/oauth/revoke_application/:application_id" => "oauth/grants#revoke_application", as: "revoke_my_oauth_application"
- delete "/storage_token/:id" => "my#delete_storage_token", as: "storage_token_delete"
+ scope 'my' do
+ get '/deletion_info' => 'users#deletion_info', as: 'delete_my_account_info'
+ post '/oauth/revoke_application/:application_id' => 'oauth/grants#revoke_application', as: 'revoke_my_oauth_application'
+ delete '/storage_token/:id' => 'my#delete_storage_token', as: 'storage_token_delete'
- resources :sessions, controller: "my/sessions", as: "my_sessions", only: %i[index show destroy]
- resources :auto_login_tokens, controller: "my/auto_login_tokens", as: "my_auto_login_tokens", only: %i[destroy]
+ resources :sessions, controller: 'my/sessions', as: 'my_sessions', only: %i[index show destroy]
+ resources :auto_login_tokens, controller: 'my/auto_login_tokens', as: 'my_auto_login_tokens', only: %i[destroy]
end
- scope controller: "my" do
- get "/my/password", action: "password"
- post "/my/change_password", action: "change_password"
+ scope controller: 'my' do
+ get '/my/password', action: 'password'
+ post '/my/change_password', action: 'change_password'
- get "/my/account", action: "account"
- get "/my/settings", action: "settings"
- get "/my/notifications", action: "notifications"
- get "/my/reminders", action: "reminders"
+ get '/my/account', action: 'account'
+ get '/my/settings', action: 'settings'
+ get '/my/notifications', action: 'notifications'
+ get '/my/reminders', action: 'reminders'
- patch "/my/account", action: "update_account"
- patch "/my/settings", action: "update_settings"
+ patch '/my/account', action: 'update_account'
+ patch '/my/settings', action: 'update_settings'
- post "/my/generate_rss_key", action: "generate_rss_key"
- delete "/my/revoke_rss_key", action: "revoke_rss_key"
- post "/my/generate_api_key", action: "generate_api_key"
- delete "/my/revoke_api_key", action: "revoke_api_key"
- delete "/my/revoke_ical_token", action: "revoke_ical_token"
- get "/my/access_token", action: "access_token"
+ post '/my/generate_rss_key', action: 'generate_rss_key'
+ delete '/my/revoke_rss_key', action: 'revoke_rss_key'
+ post '/my/generate_api_key', action: 'generate_api_key'
+ delete '/my/revoke_api_key', action: 'revoke_api_key'
+ delete '/my/revoke_ical_token', action: 'revoke_ical_token'
+ get '/my/access_token', action: 'access_token'
end
- scope controller: "onboarding" do
- patch "user_settings", action: "user_settings"
+ scope controller: 'onboarding' do
+ patch 'user_settings', action: 'user_settings'
end
resources :colors do
@@ -633,25 +633,21 @@
end
end
- get "/robots" => "homescreen#robots", defaults: { format: :txt }
+ get '/robots' => 'homescreen#robots', defaults: { format: :txt }
- root to: "account#login"
+ root to: 'account#login'
scope :notifications do
- get "(/*state)", to: "angular#notifications_layout", as: :notifications_center
+ get '(/*state)', to: 'angular#notifications_layout', as: :notifications_center
end
# OAuthClient needs a "callback" URL that Nextcloud calls with a "code" (see OAuth2 RFC)
- scope "oauth_clients/:oauth_client_id" do
- get "callback", controller: "oauth_clients", action: :callback
- get "ensure_connection", controller: "oauth_clients", action: :ensure_connection, as: "oauth_clients_ensure_connection"
+ scope 'oauth_clients/:oauth_client_id' do
+ get 'callback', controller: 'oauth_clients', action: :callback
+ get 'ensure_connection', controller: 'oauth_clients', action: :ensure_connection, as: 'oauth_clients_ensure_connection'
end
if OpenProject::Configuration.lookbook_enabled?
mount Lookbook::Engine, at: "/lookbook"
end
-
- if Rails.env.development?
- mount GoodJob::Engine => "good_job"
- end
end
diff --git a/db/migrate/10000000000000_to_v710_aggregated_migrations.rb b/db/migrate/10000000000000_to_v710_aggregated_migrations.rb
index 028afd8fe62e..db910bc79889 100644
--- a/db/migrate/10000000000000_to_v710_aggregated_migrations.rb
+++ b/db/migrate/10000000000000_to_v710_aggregated_migrations.rb
@@ -122,7 +122,7 @@ def up
end
def down
- raise ActiveRecord::IrreversibleMigration, "Use OpenProject v7.4 for the down migrations"
+ raise ActiveRecord::IrreversibleMigration, 'Use OpenProject v7.4 for the down migrations'
end
private
@@ -137,7 +137,7 @@ def run_aggregated_migrations
# been applied. In this case, remove the information about those
# migrations from the schema_migrations table and we're done.
def remove_applied_migration_entries(intersection)
- execute <<-SQL + (intersection.map { |version| <<-CONDITIONS }).join(" OR ")
+ execute <<-SQL + (intersection.map { |version| <<-CONDITIONS }).join(' OR ')
DELETE FROM
#{quoted_schema_migrations_table_name}
WHERE
@@ -147,11 +147,11 @@ def remove_applied_migration_entries(intersection)
end
def raise_on_incomplete_3_0_migrations
- raise_on_incomplete_migrations(aggregated_versions_3_0, "v2.4.0", "ChiliProject")
+ raise_on_incomplete_migrations(aggregated_versions_3_0, 'v2.4.0', 'ChiliProject')
end
def raise_on_incomplete_7_1_migrations
- raise_on_incomplete_migrations(aggregated_versions_7_1, "v7.4.0", "OpenProject")
+ raise_on_incomplete_migrations(aggregated_versions_7_1, 'v7.4.0', 'OpenProject')
end
def raise_on_incomplete_migrations(aggregated_versions, version_number, app_name)
@@ -163,7 +163,7 @@ def raise_on_incomplete_migrations(aggregated_versions, version_number, app_name
# Only a part of the migrations that this migration aggregates
# have already been applied. In this case, fail miserably.
- raise IncompleteMigrationsError, <<-MESSAGE.split("\n").map(&:strip!).join(" ") + "\n"
+ raise IncompleteMigrationsError, <<-MESSAGE.split("\n").map(&:strip!).join(' ') + "\n"
It appears you are migrating from an incompatible version of
#{app_name}. Yourdatabase has only some migrations from #{app_name} <
#{version_number} Please update your database to the schema of #{app_name}
@@ -200,7 +200,7 @@ def quoted_schema_migrations_table_name
end
def quoted_version_column_name
- ActiveRecord::Base.connection.quote_table_name("version")
+ ActiveRecord::Base.connection.quote_table_name('version')
end
def version_column_for_comparison
diff --git a/db/migrate/20100528100562_aggregated_global_roles_migrations.rb b/db/migrate/20100528100562_aggregated_global_roles_migrations.rb
index 899eb505e311..022ab3c19993 100644
--- a/db/migrate/20100528100562_aggregated_global_roles_migrations.rb
+++ b/db/migrate/20100528100562_aggregated_global_roles_migrations.rb
@@ -27,19 +27,19 @@
#++
require Rails.root.join("db/migrate/migration_utils/migration_squasher").to_s
-require "open_project/plugins/migration_mapping"
+require 'open_project/plugins/migration_mapping'
# This migration aggregates the migrations detailed in MIGRATION_FILES
class AggregatedGlobalRolesMigrations < ActiveRecord::Migration[5.0]
MIGRATION_FILES = <<-MIGRATIONS
001_sti_for_roles.rb
MIGRATIONS
- OLD_PLUGIN_NAME = "redmine_global_roles"
+ OLD_PLUGIN_NAME = 'redmine_global_roles'
def up
migration_names = OpenProject::Plugins::MigrationMapping.migration_files_to_migration_names(MIGRATION_FILES, OLD_PLUGIN_NAME)
Migration::MigrationSquasher.squash(migration_names) do
- add_column :roles, :type, :string, limit: 30, default: "Role"
+ add_column :roles, :type, :string, limit: 30, default: 'Role'
ActiveRecord::Base.connection.execute("UPDATE roles SET type='Role';")
diff --git a/db/migrate/20170829095701_generate_wp_closure.rb b/db/migrate/20170829095701_generate_wp_closure.rb
index 60c6e4d6f07d..94eacfc0b0fe 100644
--- a/db/migrate/20170829095701_generate_wp_closure.rb
+++ b/db/migrate/20170829095701_generate_wp_closure.rb
@@ -44,7 +44,7 @@ def up
def down
recreate_nested_set_columns
- invert_from_to_on_follows("follows = 1")
+ invert_from_to_on_follows('follows = 1')
set_parent_id
@@ -94,7 +94,7 @@ def remove_hierarchy_relations
end
def invert_from_to_on_follows(condition)
- if ActiveRecord::Base.connection.adapter_name == "Mysql2"
+ if ActiveRecord::Base.connection.adapter_name == 'Mysql2'
ActiveRecord::Base.connection.execute <<-SQL
UPDATE
relations r1,
@@ -223,9 +223,9 @@ def rebuild_nested_set
end
class NestedSetWorkPackage < ActiveRecord::Base
- self.table_name = "work_packages"
+ self.table_name = 'work_packages'
- acts_as_nested_set scope: "root_id", dependent: :destroy
+ acts_as_nested_set scope: 'root_id', dependent: :destroy
include OpenProject::NestedSet::RebuildPatch
end
diff --git a/db/migrate/20171106074835_move_hashed_token_to_core.rb b/db/migrate/20171106074835_move_hashed_token_to_core.rb
index a17e0403f0f4..efa290af60d1 100644
--- a/db/migrate/20171106074835_move_hashed_token_to_core.rb
+++ b/db/migrate/20171106074835_move_hashed_token_to_core.rb
@@ -57,7 +57,7 @@ def create_tokens_table
def migrate_existing_tokens
# API tokens
::Token::API.transaction do
- OldToken.where(action: "api").find_each do |token|
+ OldToken.where(action: 'api').find_each do |token|
result = ::Token::API.create(user_id: token.user_id, value: ::Token::API.hash_function(token.value))
warn "Failed to migrate API token for ##{user.id}" unless result
end
@@ -65,7 +65,7 @@ def migrate_existing_tokens
# RSS tokens
::Token::RSS.transaction do
- OldToken.where(action: "feeds").find_each do |token|
+ OldToken.where(action: 'feeds').find_each do |token|
result = ::Token::RSS.create(user_id: token.user_id, value: token.value)
warn "Failed to migrate RSS token for ##{user.id}" unless result
end
diff --git a/db/migrate/20180105130053_rebuild_dag.rb b/db/migrate/20180105130053_rebuild_dag.rb
index 8a61cfa404a6..c171f29c468f 100644
--- a/db/migrate/20180105130053_rebuild_dag.rb
+++ b/db/migrate/20180105130053_rebuild_dag.rb
@@ -25,8 +25,8 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
-require_relative "migration_utils/typed_dag"
+require_relative 'migration_utils/utils'
+require_relative 'migration_utils/typed_dag'
class RebuildDag < ActiveRecord::Migration[5.0]
include ::Migration::Utils
@@ -47,10 +47,10 @@ def up
add_index :relations,
%i(from_id to_id hierarchy relates duplicates blocks follows includes requires),
- name: "index_relations_on_type_columns",
+ name: 'index_relations_on_type_columns',
unique: true
- say_with_time "Building the directed acyclic graph of all relations. This might take a while." do
+ say_with_time 'Building the directed acyclic graph of all relations. This might take a while.' do
Migration::MigrationUtils::TypedDag::WorkPackage.rebuild_dag! 1000
end
@@ -66,11 +66,11 @@ def down
remove_column :relations, :count
end
- remove_index_if_exists :relations, "index_relations_hierarchy_follows_scheduling"
- remove_index_if_exists :relations, "index_relations_only_hierarchy"
- remove_index_if_exists :relations, "index_relations_to_from_only_follows"
- remove_index_if_exists :relations, "index_relations_direct_non_hierarchy"
- remove_index_if_exists :relations, "index_relations_on_type_columns"
+ remove_index_if_exists :relations, 'index_relations_hierarchy_follows_scheduling'
+ remove_index_if_exists :relations, 'index_relations_only_hierarchy'
+ remove_index_if_exists :relations, 'index_relations_to_from_only_follows'
+ remove_index_if_exists :relations, 'index_relations_direct_non_hierarchy'
+ remove_index_if_exists :relations, 'index_relations_on_type_columns'
truncate_closure_entries
end
@@ -79,7 +79,7 @@ def down
def add_count_index
# supports finding relations that are to be deleted
- add_index :relations, :count, where: "count = 0"
+ add_index :relations, :count, where: 'count = 0'
end
def add_scheduling_indices
@@ -87,7 +87,7 @@ def add_scheduling_indices
# has been moved
add_index :relations,
%i(to_id hierarchy follows from_id),
- name: "index_relations_hierarchy_follows_scheduling",
+ name: 'index_relations_hierarchy_follows_scheduling',
where: <<-SQL
relations.relates = 0
AND relations.duplicates = 0
@@ -99,7 +99,7 @@ def add_scheduling_indices
add_index :relations,
%i(from_id to_id hierarchy),
- name: "index_relations_only_hierarchy",
+ name: 'index_relations_only_hierarchy',
where: <<-SQL
relations.relates = 0
AND relations.duplicates = 0
@@ -111,7 +111,7 @@ def add_scheduling_indices
add_index :relations,
%i(to_id follows from_id),
- name: "index_relations_to_from_only_follows",
+ name: 'index_relations_to_from_only_follows',
where: <<-SQL
hierarchy = 0
AND relates = 0
@@ -126,8 +126,8 @@ def add_non_hierarchy_index
# supports finding relations via the api as only non hierarchy relations are returned
add_index :relations,
:from_id,
- name: "index_relations_direct_non_hierarchy",
- where: "(hierarchy + relates + duplicates + follows + blocks + includes + requires = 1) AND relations.hierarchy = 0"
+ name: 'index_relations_direct_non_hierarchy',
+ where: '(hierarchy + relates + duplicates + follows + blocks + includes + requires = 1) AND relations.hierarchy = 0'
end
def set_count_to_1
@@ -150,7 +150,7 @@ def truncate_closure_entries
def remove_duplicate_relations
equal_conditions = relation_types.map do |type|
"r1.#{type} = r2.#{type}"
- end.join(" AND ")
+ end.join(' AND ')
ActiveRecord::Base.connection.execute <<-SQL
DELETE
diff --git a/db/migrate/20180108132929_vacuum_relations.rb b/db/migrate/20180108132929_vacuum_relations.rb
index 511ec3e4fd58..9b69feab2d1d 100644
--- a/db/migrate/20180108132929_vacuum_relations.rb
+++ b/db/migrate/20180108132929_vacuum_relations.rb
@@ -30,8 +30,8 @@ class VacuumRelations < ActiveRecord::Migration[5.0]
disable_ddl_transaction!
def up
- if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
- connection.execute "vacuum relations"
+ if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
+ connection.execute 'vacuum relations'
end
end
end
diff --git a/db/migrate/20180117065255_remove_timelines_and_reportings.rb b/db/migrate/20180117065255_remove_timelines_and_reportings.rb
index d46c111f4760..8f8eb7b5e17c 100644
--- a/db/migrate/20180117065255_remove_timelines_and_reportings.rb
+++ b/db/migrate/20180117065255_remove_timelines_and_reportings.rb
@@ -73,7 +73,7 @@ def create_timelines
def create_available_project_statuses
create_table(:available_project_statuses, id: :integer) do |t|
t.belongs_to :project_type
- t.belongs_to :reported_project_status, index: { name: "index_avail_project_statuses_on_rep_project_status_id" }
+ t.belongs_to :reported_project_status, index: { name: 'index_avail_project_statuses_on_rep_project_status_id' }
t.timestamps
end
diff --git a/db/migrate/20180305130811_remove_wiki_content_versions.rb b/db/migrate/20180305130811_remove_wiki_content_versions.rb
index 5662f355c9d2..18409d5f9d11 100644
--- a/db/migrate/20180305130811_remove_wiki_content_versions.rb
+++ b/db/migrate/20180305130811_remove_wiki_content_versions.rb
@@ -37,13 +37,13 @@ def down
t.integer :page_id, null: false
t.integer :author_id
t.binary :data, limit: 16.megabytes
- t.string :compression, limit: 6, default: ""
- t.string :comments, default: ""
+ t.string :compression, limit: 6, default: ''
+ t.string :comments, default: ''
t.datetime :updated_on, null: false
t.integer :version, null: false
end
- add_index :wiki_content_versions, [:updated_on], name: "index_wiki_content_versions_on_updated_on"
- add_index :wiki_content_versions, [:wiki_content_id], name: "wiki_content_versions_wcid"
+ add_index :wiki_content_versions, [:updated_on], name: 'index_wiki_content_versions_on_updated_on'
+ add_index :wiki_content_versions, [:wiki_content_id], name: 'wiki_content_versions_wcid'
end
end
diff --git a/db/migrate/20180419061910_timestamp_for_caching.rb b/db/migrate/20180419061910_timestamp_for_caching.rb
index 19f13c1596ba..49e7ab6ee421 100644
--- a/db/migrate/20180419061910_timestamp_for_caching.rb
+++ b/db/migrate/20180419061910_timestamp_for_caching.rb
@@ -28,7 +28,7 @@
class TimestampForCaching < ActiveRecord::Migration[5.1]
class MigratingAuthSource < ApplicationRecord
- self.table_name = "auth_sources"
+ self.table_name = 'auth_sources'
end
def change
diff --git a/db/migrate/20180524084654_remove_non_null_container_on_attachments.rb b/db/migrate/20180524084654_remove_non_null_container_on_attachments.rb
index 0c8339d6211a..63e4498e355b 100644
--- a/db/migrate/20180524084654_remove_non_null_container_on_attachments.rb
+++ b/db/migrate/20180524084654_remove_non_null_container_on_attachments.rb
@@ -32,13 +32,13 @@ def change
change_column_null :attachments, :container_type, true
change_column_default :attachments, :container_id, from: 0, to: nil
- change_column_default :attachments, :container_type, from: "", to: nil
+ change_column_default :attachments, :container_type, from: '', to: nil
change_column_null :attachment_journals, :container_id, true
change_column_null :attachment_journals, :container_type, true
change_column_default :attachment_journals, :container_id, from: 0, to: nil
- change_column_default :attachment_journals, :container_type, from: "", to: nil
+ change_column_default :attachment_journals, :container_type, from: '', to: nil
add_column :attachments, :updated_at, :datetime
rename_column :attachments, :created_on, :created_at
diff --git a/db/migrate/20180706150714_convert_to_markdown.rb b/db/migrate/20180706150714_convert_to_markdown.rb
index 1da5c0af589b..0b2123ad43b7 100644
--- a/db/migrate/20180706150714_convert_to_markdown.rb
+++ b/db/migrate/20180706150714_convert_to_markdown.rb
@@ -28,10 +28,10 @@
class ConvertToMarkdown < ActiveRecord::Migration[5.1]
def up
- setting = Setting.where(name: "text_formatting").pluck(:value)
- return unless setting && setting[0] == "textile"
+ setting = Setting.where(name: 'text_formatting').pluck(:value)
+ return unless setting && setting[0] == 'textile'
- if ENV["OPENPROJECT_SKIP_TEXTILE_MIGRATION"].present?
+ if ENV['OPENPROJECT_SKIP_TEXTILE_MIGRATION'].present?
warn <<~WARNING
Your instance is configured with Textile text formatting, this means you have likely been running OpenProject before 8.0.0
@@ -49,7 +49,7 @@ def up
return
end
- if setting && setting[0] == "textile"
+ if setting && setting[0] == 'textile'
raise <<~ERROR
You appear to be upgrading from an old version of OpenProject using textile text formatters.
diff --git a/db/migrate/20180830120550_migrate_light_background_themes.rb b/db/migrate/20180830120550_migrate_light_background_themes.rb
index 0a8140fd583e..0653b2a3baab 100644
--- a/db/migrate/20180830120550_migrate_light_background_themes.rb
+++ b/db/migrate/20180830120550_migrate_light_background_themes.rb
@@ -42,29 +42,29 @@ def up
return unless apply?
# Main menu was set to white
- if DesignColor.find_by(variable: "main-menu-bg-color")&.hexcode == "#FFFFFF"
+ if DesignColor.find_by(variable: 'main-menu-bg-color')&.hexcode == '#FFFFFF'
set_old_default_menu_colors
end
# Header is white and main menu was default light grey
- if DesignColor.find_by(variable: "header-bg-color")&.hexcode == "#FFFFFF" &&
- DesignColor.find_by(variable: "main-menu-bg-color").nil?
- set_variable("main-menu-bg-color", "#F8F8F8")
+ if DesignColor.find_by(variable: 'header-bg-color')&.hexcode == '#FFFFFF' &&
+ DesignColor.find_by(variable: 'main-menu-bg-color').nil?
+ set_variable('main-menu-bg-color', '#F8F8F8')
set_old_default_menu_colors
end
end
def set_old_default_menu_colors
- content_link_color = DesignColor.find_by(variable: "content-link-color")&.hexcode ||
- DesignColor.find_by(variable: "primary-color-dark")&.hexcode ||
+ content_link_color = DesignColor.find_by(variable: 'content-link-color')&.hexcode ||
+ DesignColor.find_by(variable: 'primary-color-dark')&.hexcode ||
"#175A8E"
- set_variable("main-menu-font-color", "#333333")
- set_variable("main-menu-bg-selected-background", "#E9E9E9")
- set_variable("main-menu-selected-font-color", content_link_color)
- set_variable("main-menu-bg-hover-background", "#F0F0F0")
- set_variable("main-menu-hover-font-color", "#333333")
- set_variable("main-menu-border-color", "#E7E7E7")
+ set_variable('main-menu-font-color', '#333333')
+ set_variable('main-menu-bg-selected-background', '#E9E9E9')
+ set_variable('main-menu-selected-font-color', content_link_color)
+ set_variable('main-menu-bg-hover-background', '#F0F0F0')
+ set_variable('main-menu-hover-font-color', '#333333')
+ set_variable('main-menu-border-color', '#E7E7E7')
end
def set_variable(variable_name, hexcode)
diff --git a/db/migrate/20181112125034_create_doorkeeper_tables.rb b/db/migrate/20181112125034_create_doorkeeper_tables.rb
index 4313df4ff752..77f5b2ace9df 100644
--- a/db/migrate/20181112125034_create_doorkeeper_tables.rb
+++ b/db/migrate/20181112125034_create_doorkeeper_tables.rb
@@ -36,7 +36,7 @@ def change
t.integer :owner_id
t.integer :client_credentials_user_id
t.text :redirect_uri, null: false
- t.string :scopes, null: false, default: ""
+ t.string :scopes, null: false, default: ''
t.boolean :confidential, null: false, default: true
t.timestamps null: false
end
diff --git a/db/migrate/20190220080647_migrate_my_page_layout.rb b/db/migrate/20190220080647_migrate_my_page_layout.rb
index 53869baa4998..d72bfca54885 100644
--- a/db/migrate/20190220080647_migrate_my_page_layout.rb
+++ b/db/migrate/20190220080647_migrate_my_page_layout.rb
@@ -61,7 +61,7 @@ def migrate_my_page(user_id, old_layout)
start_row = 1
# Give every widget a fixed height of 4 rows
widget_height = 4
- (old_layout["top"] || []).each do |block|
+ (old_layout['top'] || []).each do |block|
map_widget my_page,
old_name: block,
start_row:,
@@ -74,7 +74,7 @@ def migrate_my_page(user_id, old_layout)
# Migrate left
left_row = start_row
- (old_layout["left"] || []).each do |block|
+ (old_layout['left'] || []).each do |block|
map_widget my_page,
old_name: block,
start_row: left_row,
@@ -87,7 +87,7 @@ def migrate_my_page(user_id, old_layout)
# Migrate right
right_row = start_row
- (old_layout["right"] || []).each do |block|
+ (old_layout['right'] || []).each do |block|
map_widget my_page,
old_name: block,
start_row: right_row,
@@ -107,7 +107,7 @@ def migrate_my_page(user_id, old_layout)
def remove_old_my_page(pref)
# There are some cases where keys where not symbolized
pref.others.delete(:my_page_layout)
- pref.others.delete("my_page_layout")
+ pref.others.delete('my_page_layout')
pref.save
end
diff --git a/db/migrate/20190227163226_add_tls_mode_to_auth_sources.rb b/db/migrate/20190227163226_add_tls_mode_to_auth_sources.rb
index 52360fa37907..0da94f8cbfd0 100644
--- a/db/migrate/20190227163226_add_tls_mode_to_auth_sources.rb
+++ b/db/migrate/20190227163226_add_tls_mode_to_auth_sources.rb
@@ -28,7 +28,7 @@
class AddTlsModeToAuthSources < ActiveRecord::Migration[5.2]
class MigratingAuthSource < ApplicationRecord
- self.table_name = "auth_sources"
+ self.table_name = 'auth_sources'
end
def change
diff --git a/db/migrate/20190301122554_remove_hierarchy_paths.rb b/db/migrate/20190301122554_remove_hierarchy_paths.rb
index 473c3864a33f..58a852737842 100644
--- a/db/migrate/20190301122554_remove_hierarchy_paths.rb
+++ b/db/migrate/20190301122554_remove_hierarchy_paths.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "20180116065518_add_hierarchy_paths"
+require_relative '20180116065518_add_hierarchy_paths'
class RemoveHierarchyPaths < ActiveRecord::Migration[5.2]
def up
@@ -60,7 +60,7 @@ def down
##
# Map parent sort_criteria to id asc.
def map_parent_to_id(criteria)
- if criteria.first.to_s == "parent"
+ if criteria.first.to_s == 'parent'
%w[id asc]
else
criteria
diff --git a/db/migrate/20190312083304_rename_boards_to_forums.rb b/db/migrate/20190312083304_rename_boards_to_forums.rb
index 0b4b2c6b1b3c..046fc6252afa 100644
--- a/db/migrate/20190312083304_rename_boards_to_forums.rb
+++ b/db/migrate/20190312083304_rename_boards_to_forums.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "tables/forums"
+require_relative 'tables/forums'
class RenameBoardsToForums < ActiveRecord::Migration[5.2]
def up
@@ -39,9 +39,9 @@ def up
rename_column :message_journals, :board_id, :forum_id
# Rename string references in DB to forums
- EnabledModule.where(name: "boards").update_all(name: "forums")
- RolePermission.where(permission: "manage_boards").update_all(permission: "manage_forums")
- Watcher.where(watchable_type: "Board").update_all(watchable_type: "Forum")
+ EnabledModule.where(name: 'boards').update_all(name: 'forums')
+ RolePermission.where(permission: 'manage_boards').update_all(permission: 'manage_forums')
+ Watcher.where(watchable_type: 'Board').update_all(watchable_type: 'Forum')
# Finally, drop the old table
drop_table :boards
@@ -54,8 +54,8 @@ def down
rename_column :message_journals, :forum_id, :board_id
# Rename back items
- EnabledModule.where(name: "forums").update_all(name: "boards")
- RolePermission.where(permission: "manage_forums").update_all(permission: "manage_boards")
- Watcher.where(watchable_type: "Forum").update_all(watchable_type: "Board")
+ EnabledModule.where(name: 'forums').update_all(name: 'boards')
+ RolePermission.where(permission: 'manage_forums').update_all(permission: 'manage_boards')
+ Watcher.where(watchable_type: 'Forum').update_all(watchable_type: 'Board')
end
end
diff --git a/db/migrate/20190502102512_ensure_postgres_index_names.rb b/db/migrate/20190502102512_ensure_postgres_index_names.rb
index 1d3a19ea8261..901f3fd8e639 100644
--- a/db/migrate/20190502102512_ensure_postgres_index_names.rb
+++ b/db/migrate/20190502102512_ensure_postgres_index_names.rb
@@ -42,8 +42,8 @@ def up
SQL
ActiveRecord::Base.connection.execute(sql).each do |entry|
- old_name = entry["old_name"]
- new_name = entry["new_name"]
+ old_name = entry['old_name']
+ new_name = entry['new_name']
ActiveRecord::Base.transaction do
execute %(ALTER INDEX "#{old_name}" RENAME TO #{new_name};)
diff --git a/db/migrate/20190507132517_add_board_view_to_roles.rb b/db/migrate/20190507132517_add_board_view_to_roles.rb
index e407292e2ada..3f7fb964788d 100644
--- a/db/migrate/20190507132517_add_board_view_to_roles.rb
+++ b/db/migrate/20190507132517_add_board_view_to_roles.rb
@@ -34,8 +34,8 @@ def up
.add(:view_work_packages,
:show_board_views)
- unless Setting.default_projects_modules.include?("board_view")
- Setting.default_projects_modules = Setting.default_projects_modules + ["board_view"]
+ unless Setting.default_projects_modules.include?('board_view')
+ Setting.default_projects_modules = Setting.default_projects_modules + ['board_view']
end
end
diff --git a/db/migrate/20190618115620_fix_available_languages.rb b/db/migrate/20190618115620_fix_available_languages.rb
index 42f3cf8e1e12..9b6835ec2034 100644
--- a/db/migrate/20190618115620_fix_available_languages.rb
+++ b/db/migrate/20190618115620_fix_available_languages.rb
@@ -28,34 +28,34 @@
class FixAvailableLanguages < ActiveRecord::Migration[5.2]
def up
- if Setting.where(name: "available_languages").exists? # rubocop:disable Rails/WhereExists
+ if Setting.where(name: 'available_languages').exists? # rubocop:disable Rails/WhereExists
Setting.reset_column_information
Setting.available_languages = Setting.available_languages.map do |lang|
- if lang == "zh"
- "zh-CN"
+ if lang == 'zh'
+ 'zh-CN'
else
lang
end
end
end
- User.where(language: "zh").update_all(language: "zh-CN")
+ User.where(language: 'zh').update_all(language: 'zh-CN')
end
def down
- if Setting.where(name: "available_languages").exists? # rubocop:disable Rails/WhereExists
+ if Setting.where(name: 'available_languages').exists? # rubocop:disable Rails/WhereExists
Setting.reset_column_information
Setting.available_languages = Setting.available_languages.map do |lang|
- if lang == "zh-CN"
- "zh"
+ if lang == 'zh-CN'
+ 'zh'
else
lang
end
end
end
- User.where(language: "zh-CN").update_all(language: "zh")
+ User.where(language: 'zh-CN').update_all(language: 'zh')
end
end
diff --git a/db/migrate/20190710132957_rename_my_page_widgets.rb b/db/migrate/20190710132957_rename_my_page_widgets.rb
index fa991d11817a..a15f85f9fc55 100644
--- a/db/migrate/20190710132957_rename_my_page_widgets.rb
+++ b/db/migrate/20190710132957_rename_my_page_widgets.rb
@@ -31,13 +31,13 @@ def up
reset_column_information
Grids::MyPage.eager_load(:widgets, user: :preference).each do |page|
- I18n.with_locale(page.user&.language.presence || "en") do
+ I18n.with_locale(page.user&.language.presence || 'en') do
page.widgets.each(&method(:update_widget))
end
rescue I18n::InvalidLocale => e
Rails.logger.warn "Failed to use user locale from #{page.user.inspect}: #{e} #{e.message}. Correcting"
page.widgets.each(&method(:update_widget))
- page.user&.update_column(:language, "en")
+ page.user&.update_column(:language, 'en')
end
end
@@ -45,17 +45,17 @@ def up
def update_widget(widget)
case widget.identifier
- when "work_packages_assigned"
- update_table_widget(widget, "assignee")
- when "work_packages_accountable"
- update_table_widget(widget, "responsible")
- when "work_packages_created"
- update_table_widget(widget, "author")
- when "work_packages_watched"
- update_table_widget(widget, "watcher")
- when "work_packages_calendar", "news", "documents", "time_entries_current_user"
+ when 'work_packages_assigned'
+ update_table_widget(widget, 'assignee')
+ when 'work_packages_accountable'
+ update_table_widget(widget, 'responsible')
+ when 'work_packages_created'
+ update_table_widget(widget, 'author')
+ when 'work_packages_watched'
+ update_table_widget(widget, 'watcher')
+ when 'work_packages_calendar', 'news', 'documents', 'time_entries_current_user'
update_widget_name(widget)
- when "work_packages_table"
+ when 'work_packages_table'
update_query_widget(widget)
end
end
@@ -64,12 +64,12 @@ def update_table_widget(widget, filter_name)
widget.options = {
name: I18n.t("js.grid.widgets.#{widget.identifier}.title"),
queryProps: {
- "columns[]": %w(id project type subject),
+ 'columns[]': %w(id project type subject),
filters: JSON.dump([{ status: { operator: "o", values: [] } },
{ filter_name => { operator: "=", values: ["me"] } }])
}
}
- widget.identifier = "work_packages_table"
+ widget.identifier = 'work_packages_table'
widget.save(validate: false)
end
@@ -83,9 +83,9 @@ def update_widget_name(widget)
end
def update_query_widget(widget)
- query_id = widget.options["queryId"]
+ query_id = widget.options['queryId']
- name = Query.where(id: query_id).limit(1).pick(:name) || I18n.t("js.grid.widgets.work_packages_table.title")
+ name = Query.where(id: query_id).limit(1).pick(:name) || I18n.t('js.grid.widgets.work_packages_table.title')
widget.options = {
name:,
diff --git a/db/migrate/20190724093332_add_journal_versions_table.rb b/db/migrate/20190724093332_add_journal_versions_table.rb
index cdfaf1a128bf..f9dd416c5c91 100644
--- a/db/migrate/20190724093332_add_journal_versions_table.rb
+++ b/db/migrate/20190724093332_add_journal_versions_table.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class AddJournalVersionsTable < ActiveRecord::Migration[5.2]
include ::Migration::Utils
@@ -37,7 +37,7 @@ def up
t.integer :journable_id
t.integer :version, default: 0
t.index %i[journable_type journable_id version],
- name: "unique_journal_version",
+ name: 'unique_journal_version',
unique: true
end
diff --git a/db/migrate/20190920102446_clean_custom_values.rb b/db/migrate/20190920102446_clean_custom_values.rb
index d5207a17831f..13ca1ea4f248 100644
--- a/db/migrate/20190920102446_clean_custom_values.rb
+++ b/db/migrate/20190920102446_clean_custom_values.rb
@@ -31,7 +31,7 @@ def up
invalid_cv = CustomValue
.joins(:custom_field)
.where("#{CustomField.table_name}.field_format = 'list'")
- .where.not(value: "")
+ .where.not(value: '')
.where("value !~ '^[0-9]+$'")
if invalid_cv.count > 0
@@ -41,7 +41,7 @@ def up
end
warn warn_string
- invalid_cv.update_all(value: "")
+ invalid_cv.update_all(value: '')
end
end
diff --git a/db/migrate/20191216135213_join_table_for_active_activities.rb b/db/migrate/20191216135213_join_table_for_active_activities.rb
index e0b491e0fc51..965c2504a240 100644
--- a/db/migrate/20191216135213_join_table_for_active_activities.rb
+++ b/db/migrate/20191216135213_join_table_for_active_activities.rb
@@ -59,7 +59,7 @@ def create_join_table
add_index :time_entry_activities_projects,
%i[project_id activity_id],
unique: true,
- name: "index_teap_on_project_id_and_activity_id"
+ name: 'index_teap_on_project_id_and_activity_id'
end
# Delete all references from enumerations to projects which point to no longer
diff --git a/db/migrate/20200217155632_rename_tokens.rb b/db/migrate/20200217155632_rename_tokens.rb
index 2446e06f9e80..a11699b77dd1 100644
--- a/db/migrate/20200217155632_rename_tokens.rb
+++ b/db/migrate/20200217155632_rename_tokens.rb
@@ -31,12 +31,12 @@ class Token < ApplicationRecord
end
def up
- Token.where(type: "Token::Rss").update_all(type: "Token::RSS")
- Token.where(type: "Token::Api").update_all(type: "Token::API")
+ Token.where(type: 'Token::Rss').update_all(type: 'Token::RSS')
+ Token.where(type: 'Token::Api').update_all(type: 'Token::API')
end
def down
- Token.where(type: "Token::RSS").update_all(type: "Token::Rss")
- Token.where(type: "Token::API").update_all(type: "Token::Api")
+ Token.where(type: 'Token::RSS').update_all(type: 'Token::Rss')
+ Token.where(type: 'Token::API').update_all(type: 'Token::Api')
end
end
diff --git a/db/migrate/20200220171133_rename_bim_module.rb b/db/migrate/20200220171133_rename_bim_module.rb
index de32c897def0..1536d7a1b53d 100644
--- a/db/migrate/20200220171133_rename_bim_module.rb
+++ b/db/migrate/20200220171133_rename_bim_module.rb
@@ -33,14 +33,14 @@ class RenameBimModule < ActiveRecord::Migration[6.0]
class Project < ApplicationRecord; end
def up
- projects_with_bcf = EnabledModule.where(name: "bcf").pluck(:project_id)
+ projects_with_bcf = EnabledModule.where(name: 'bcf').pluck(:project_id)
# Delete all bcf to avoid duplicates
- EnabledModule.where(name: "bcf").delete_all
- EnabledModule.where(name: "ifc_models").update_all(name: "bim")
+ EnabledModule.where(name: 'bcf').delete_all
+ EnabledModule.where(name: 'ifc_models').update_all(name: 'bim')
# Re-enable bim if ifc_models was not active but bcf was
Project.where(id: projects_with_bcf).includes(:enabled_modules).each do |project|
- project.enabled_modules.create(name: "bim") unless project.enabled_module_names.include?("bim")
+ project.enabled_modules.create(name: 'bim') unless project.enabled_module_names.include?('bim')
end
# Rename attachments container
@@ -50,7 +50,7 @@ def up
def down
# We cannot now which module was active, so enable BCF
- EnabledModule.where(name: "bim").update_all(name: "bcf")
+ EnabledModule.where(name: 'bim').update_all(name: 'bcf')
# Rename attachments container
execute "UPDATE attachments SET container_type = 'Bcf::Viewpoint' WHERE container_type = 'Bim::Bcf::Viewpoint'"
diff --git a/db/migrate/20200325101528_strip_whitespace_from_user_attributes.rb b/db/migrate/20200325101528_strip_whitespace_from_user_attributes.rb
index d8538cbc6848..ca7302c16e30 100644
--- a/db/migrate/20200325101528_strip_whitespace_from_user_attributes.rb
+++ b/db/migrate/20200325101528_strip_whitespace_from_user_attributes.rb
@@ -28,7 +28,7 @@
class StripWhitespaceFromUserAttributes < ActiveRecord::Migration[6.0]
def up
- User.update_all("login = TRIM(login), mail = TRIM(mail)")
+ User.update_all('login = TRIM(login), mail = TRIM(mail)')
end
def down
diff --git a/db/migrate/20200326102408_rename_fixed_version.rb b/db/migrate/20200326102408_rename_fixed_version.rb
index e940c5277004..8e0cfde92442 100644
--- a/db/migrate/20200326102408_rename_fixed_version.rb
+++ b/db/migrate/20200326102408_rename_fixed_version.rb
@@ -31,14 +31,14 @@ def up
rename_column :work_packages, :fixed_version_id, :version_id
rename_column :work_package_journals, :fixed_version_id, :version_id
- rename_query_attributes("fixed_version", "version")
+ rename_query_attributes('fixed_version', 'version')
end
def down
rename_column :work_packages, :version_id, :fixed_version_id
rename_column :work_package_journals, :version_id, :fixed_version_id
- rename_query_attributes("version", "fixed_version")
+ rename_query_attributes('version', 'fixed_version')
end
def rename_query_attributes(from, to)
diff --git a/db/migrate/20200428105404_unique_member_role.rb b/db/migrate/20200428105404_unique_member_role.rb
index 900a24442f7a..07058d0ed72f 100644
--- a/db/migrate/20200428105404_unique_member_role.rb
+++ b/db/migrate/20200428105404_unique_member_role.rb
@@ -30,7 +30,7 @@ class UniqueMemberRole < ActiveRecord::Migration[6.0]
def change
change_table :member_roles do |t|
t.index %i[member_id role_id inherited_from],
- name: "unique_inherited_role",
+ name: 'unique_inherited_role',
unique: true
end
end
diff --git a/db/migrate/20200522140244_remove_journal_versions_table.rb b/db/migrate/20200522140244_remove_journal_versions_table.rb
index aea50b7974b6..88e5b5f1cc8f 100644
--- a/db/migrate/20200522140244_remove_journal_versions_table.rb
+++ b/db/migrate/20200522140244_remove_journal_versions_table.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "20190724093332_add_journal_versions_table"
+require_relative '20190724093332_add_journal_versions_table'
class RemoveJournalVersionsTable < ActiveRecord::Migration[6.0]
def up
diff --git a/db/migrate/20200625133727_fix_inherited_group_member_roles.rb b/db/migrate/20200625133727_fix_inherited_group_member_roles.rb
index f3602c463f39..b171fd239e6c 100644
--- a/db/migrate/20200625133727_fix_inherited_group_member_roles.rb
+++ b/db/migrate/20200625133727_fix_inherited_group_member_roles.rb
@@ -35,7 +35,7 @@ def up
# which will auto-create members for the users if necessary
Member
.includes(%i[principal])
- .where(users: { type: "Group" })
+ .where(users: { type: 'Group' })
.find_each do |member|
# Recreate member_roles for all group members
Groups::UpdateRolesService
diff --git a/db/migrate/20200708065116_fix_members_inconsistencies.rb b/db/migrate/20200708065116_fix_members_inconsistencies.rb
index f8435abcdb09..daf1212e968c 100644
--- a/db/migrate/20200708065116_fix_members_inconsistencies.rb
+++ b/db/migrate/20200708065116_fix_members_inconsistencies.rb
@@ -28,7 +28,7 @@
class FixMembersInconsistencies < ActiveRecord::Migration[6.0]
def change
- change_column_default :members, :created_on, -> { "CURRENT_TIMESTAMP" }
+ change_column_default :members, :created_on, -> { 'CURRENT_TIMESTAMP' }
# Update all members without created_on which got created by CTE
Member.where(created_on: nil).update_all(created_on: Time.zone.now)
diff --git a/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb b/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb
index b568154c5d7c..f650a3870481 100644
--- a/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb
+++ b/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb
@@ -28,7 +28,7 @@
class EnableCurrentProjectCustomFieldsColumns < ActiveRecord::Migration[6.0]
def up
- return unless Setting.where(name: "enabled_projects_column").exists? # rubocop:disable Rails/WhereExists
+ return unless Setting.where(name: 'enabled_projects_column').exists? # rubocop:disable Rails/WhereExists
columns = Setting.enabled_projects_columns
cf_columns = ProjectCustomField.pluck(:id).map { |id| "cf_#{id}" }
diff --git a/db/migrate/20200914092212_set_current_timestamp_defaults_for_bcf_viewpoints_and_issues.rb b/db/migrate/20200914092212_set_current_timestamp_defaults_for_bcf_viewpoints_and_issues.rb
index 768ba09c6cff..18588a3c2927 100644
--- a/db/migrate/20200914092212_set_current_timestamp_defaults_for_bcf_viewpoints_and_issues.rb
+++ b/db/migrate/20200914092212_set_current_timestamp_defaults_for_bcf_viewpoints_and_issues.rb
@@ -28,10 +28,10 @@
class SetCurrentTimestampDefaultsForBcfViewpointsAndIssues < ActiveRecord::Migration[6.0]
def up
- change_column_default(:bcf_issues, :created_at, -> { "CURRENT_TIMESTAMP" })
- change_column_default(:bcf_issues, :updated_at, -> { "CURRENT_TIMESTAMP" })
- change_column_default(:bcf_viewpoints, :created_at, -> { "CURRENT_TIMESTAMP" })
- change_column_default(:bcf_viewpoints, :updated_at, -> { "CURRENT_TIMESTAMP" })
+ change_column_default(:bcf_issues, :created_at, -> { 'CURRENT_TIMESTAMP' })
+ change_column_default(:bcf_issues, :updated_at, -> { 'CURRENT_TIMESTAMP' })
+ change_column_default(:bcf_viewpoints, :created_at, -> { 'CURRENT_TIMESTAMP' })
+ change_column_default(:bcf_viewpoints, :updated_at, -> { 'CURRENT_TIMESTAMP' })
end
def down
diff --git a/db/migrate/20200924085508_cleanup_orphaned_journal_data.rb b/db/migrate/20200924085508_cleanup_orphaned_journal_data.rb
index b0786030e775..0ccfdbd0ce5b 100644
--- a/db/migrate/20200924085508_cleanup_orphaned_journal_data.rb
+++ b/db/migrate/20200924085508_cleanup_orphaned_journal_data.rb
@@ -28,14 +28,14 @@
class CleanupOrphanedJournalData < ActiveRecord::Migration[6.0]
def up
- cleanup_orphaned_journals("attachable_journals")
- cleanup_orphaned_journals("customizable_journals")
- cleanup_orphaned_journals("attachment_journals")
- cleanup_orphaned_journals("changeset_journals")
- cleanup_orphaned_journals("message_journals")
- cleanup_orphaned_journals("news_journals")
- cleanup_orphaned_journals("wiki_content_journals")
- cleanup_orphaned_journals("work_package_journals")
+ cleanup_orphaned_journals('attachable_journals')
+ cleanup_orphaned_journals('customizable_journals')
+ cleanup_orphaned_journals('attachment_journals')
+ cleanup_orphaned_journals('changeset_journals')
+ cleanup_orphaned_journals('message_journals')
+ cleanup_orphaned_journals('news_journals')
+ cleanup_orphaned_journals('wiki_content_journals')
+ cleanup_orphaned_journals('work_package_journals')
end
# No down needed as this only cleans up data that should have been deleted anyway.
diff --git a/db/migrate/20200925084550_members_allow_null_on_project.rb b/db/migrate/20200925084550_members_allow_null_on_project.rb
index 1cb890e030cf..47bf49e8c05c 100644
--- a/db/migrate/20200925084550_members_allow_null_on_project.rb
+++ b/db/migrate/20200925084550_members_allow_null_on_project.rb
@@ -30,7 +30,7 @@ class MembersAllowNullOnProject < ActiveRecord::Migration[6.0]
def change
change_column_null :members, :project_id, true
change_column_default :members, :project_id, from: 0, to: nil
- add_column :members, :updated_at, :timestamp, default: -> { "CURRENT_TIMESTAMP" }
+ add_column :members, :updated_at, :timestamp, default: -> { 'CURRENT_TIMESTAMP' }
reversible do |rev|
rev.up do
@@ -66,8 +66,8 @@ def add_updated_at_values
def migrate_principal_roles_data
fetch_principal_roles.each do |principal_id, records|
- member_id = insert_into_members(principal_id, records.first["created_at"], records.first["updated_at"])
- insert_into_member_roles(member_id, records.pluck("role_id"))
+ member_id = insert_into_members(principal_id, records.first['created_at'], records.first['updated_at'])
+ insert_into_member_roles(member_id, records.pluck('role_id'))
end
end
@@ -85,7 +85,7 @@ def insert_into_members(principal_id, created_at, updated_at)
RETURNING id
SQL
- member_id.to_a.first["id"]
+ member_id.to_a.first['id']
end
def insert_into_member_roles(member_id, role_ids)
diff --git a/db/migrate/20201001184404_rename_timestamp_on_time_and_cost_entry.rb b/db/migrate/20201001184404_rename_timestamp_on_time_and_cost_entry.rb
index f19ec790ee0e..d771b159ac04 100644
--- a/db/migrate/20201001184404_rename_timestamp_on_time_and_cost_entry.rb
+++ b/db/migrate/20201001184404_rename_timestamp_on_time_and_cost_entry.rb
@@ -38,7 +38,7 @@ def alter_name_and_defaults(table)
rename_column table, :created_on, :created_at
rename_column table, :updated_on, :updated_at
- change_column_default table, :created_at, from: nil, to: -> { "CURRENT_TIMESTAMP" }
- change_column_default table, :updated_at, from: nil, to: -> { "CURRENT_TIMESTAMP" }
+ change_column_default table, :created_at, from: nil, to: -> { 'CURRENT_TIMESTAMP' }
+ change_column_default table, :updated_at, from: nil, to: -> { 'CURRENT_TIMESTAMP' }
end
end
diff --git a/db/migrate/20201005120137_ensure_integer_for_relations_foreign_keys.rb b/db/migrate/20201005120137_ensure_integer_for_relations_foreign_keys.rb
index e291582dd851..11025bb671c6 100644
--- a/db/migrate/20201005120137_ensure_integer_for_relations_foreign_keys.rb
+++ b/db/migrate/20201005120137_ensure_integer_for_relations_foreign_keys.rb
@@ -37,7 +37,7 @@ def up
Relation.reset_column_information
# Nothing to do for us if the column already has the expected type
- return if Relation.column_for_attribute("from_id").sql_type == "integer"
+ return if Relation.column_for_attribute('from_id').sql_type == 'integer'
change_table :relations do |t|
t.change :from_id, :integer, null: false
diff --git a/db/migrate/20201005184411_rename_timestamps.rb b/db/migrate/20201005184411_rename_timestamps.rb
index b0ba86cbe6b5..2dda2f451760 100644
--- a/db/migrate/20201005184411_rename_timestamps.rb
+++ b/db/migrate/20201005184411_rename_timestamps.rb
@@ -54,8 +54,8 @@ def change
add_timestamp_column(:journals, :updated_at, :created_at)
- add_timestamp_column(:roles, :created_at, "CURRENT_TIMESTAMP")
- add_timestamp_column(:roles, :updated_at, "CURRENT_TIMESTAMP")
+ add_timestamp_column(:roles, :created_at, 'CURRENT_TIMESTAMP')
+ add_timestamp_column(:roles, :updated_at, 'CURRENT_TIMESTAMP')
end
private
@@ -63,7 +63,7 @@ def change
def alter_name_and_defaults(table, old_column_name, new_column_name)
rename_column table, old_column_name, new_column_name
- change_column_default table, new_column_name, from: nil, to: -> { "CURRENT_TIMESTAMP" }
+ change_column_default table, new_column_name, from: nil, to: -> { 'CURRENT_TIMESTAMP' }
# Ensure we reset column information because otherwise,
# +updated_on+ will still be used.
@@ -76,7 +76,7 @@ def alter_name_and_defaults(table, old_column_name, new_column_name)
end
def add_timestamp_column(table, column_name, from_column = nil)
- add_column table, column_name, :timestamp, default: -> { "CURRENT_TIMESTAMP" }
+ add_column table, column_name, :timestamp, default: -> { 'CURRENT_TIMESTAMP' }
reversible do |dir|
dir.up do
diff --git a/db/migrate/20201125121949_remove_renamed_cron_job.rb b/db/migrate/20201125121949_remove_renamed_cron_job.rb
index be642846ee2a..c9d08ea8a7ed 100644
--- a/db/migrate/20201125121949_remove_renamed_cron_job.rb
+++ b/db/migrate/20201125121949_remove_renamed_cron_job.rb
@@ -31,6 +31,8 @@ def up
# The job has been renamed to JobStatus::Cron::ClearOldJobStatusJob
# the new job will be added on restarting the application but the old will still be in the database
# and will cause 'uninitialized constant' errors.
- execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Cron::ClearOldJobStatusJob%'")
+ Delayed::Job
+ .where('handler LIKE ?', "%job_class: Cron::ClearOldJobStatusJob%")
+ .delete_all
end
end
diff --git a/db/migrate/20210214205545_replace_invalid_principal_references.rb b/db/migrate/20210214205545_replace_invalid_principal_references.rb
index 912b9b3f6e52..2d9fd7de7cb4 100644
--- a/db/migrate/20210214205545_replace_invalid_principal_references.rb
+++ b/db/migrate/20210214205545_replace_invalid_principal_references.rb
@@ -34,7 +34,7 @@ def up
say "Replacing invalid custom value user references"
CustomValue
.joins(:custom_field)
- .where("#{CustomField.table_name}.field_format" => "user")
+ .where("#{CustomField.table_name}.field_format" => 'user')
.where("value NOT IN (SELECT id::text FROM users)")
.update_all(value: deleted_user_id)
diff --git a/db/migrate/20210510193438_remove_project_setting.rb b/db/migrate/20210510193438_remove_project_setting.rb
index c6c25faa1232..99c4bb7c2d79 100644
--- a/db/migrate/20210510193438_remove_project_setting.rb
+++ b/db/migrate/20210510193438_remove_project_setting.rb
@@ -33,7 +33,7 @@ class RemoveProjectSetting < ActiveRecord::Migration[6.1]
class Project < ApplicationRecord; end
def up
- Project.where(name: "sequential_project_identifiers").delete_all
+ Project.where(name: 'sequential_project_identifiers').delete_all
end
def down
diff --git a/db/migrate/20210615150558_aggregate_journals.rb b/db/migrate/20210615150558_aggregate_journals.rb
index 6b6cd3a851cb..7f164a718393 100644
--- a/db/migrate/20210615150558_aggregate_journals.rb
+++ b/db/migrate/20210615150558_aggregate_journals.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "20200924085508_cleanup_orphaned_journal_data"
-require_relative "migration_utils/utils"
+require_relative '20200924085508_cleanup_orphaned_journal_data'
+require_relative 'migration_utils/utils'
class AggregateJournals < ActiveRecord::Migration[6.1]
include ::Migration::Utils
@@ -368,11 +368,11 @@ def notes_projection
def raw_journals_subselect(journable, sql, until_version)
if sql
- raise "until_version used together with sql" if until_version
+ raise 'until_version used together with sql' if until_version
"(#{sql})"
elsif journable
- limit = until_version ? "AND journals.version <= #{until_version}" : ""
+ limit = until_version ? "AND journals.version <= #{until_version}" : ''
<<~SQL.squish
(
@@ -383,7 +383,7 @@ def raw_journals_subselect(journable, sql, until_version)
)
SQL
else
- where = until_version ? "WHERE journals.version <= #{until_version}" : ""
+ where = until_version ? "WHERE journals.version <= #{until_version}" : ''
<<~SQL.squish
(SELECT * from journals #{where})
@@ -399,7 +399,7 @@ def beyond_aggregation_time_condition
if aggregation_time_seconds == 0
# if aggregation is disabled, we consider everything to be beyond aggregation time
# even if creation dates are exactly equal
- return "(true = true)"
+ return '(true = true)'
end
difference = "(successor.created_at - predecessor.created_at)"
diff --git a/db/migrate/20210616145324_polymorphic_journal_data.rb b/db/migrate/20210616145324_polymorphic_journal_data.rb
index 45169574f3a1..4bfb8b05bd0e 100644
--- a/db/migrate/20210616145324_polymorphic_journal_data.rb
+++ b/db/migrate/20210616145324_polymorphic_journal_data.rb
@@ -29,7 +29,7 @@
class PolymorphicJournalData < ActiveRecord::Migration[6.1]
# The wiki content table got renamed after writing the migration initially.
class WikiContentJournal < ApplicationRecord
- self.table_name = "wiki_content_journals"
+ self.table_name = 'wiki_content_journals'
end
def up
diff --git a/db/migrate/20210618132206_add_notification_settings.rb b/db/migrate/20210618132206_add_notification_settings.rb
index d91a287018d4..3275f6f02c84 100644
--- a/db/migrate/20210618132206_add_notification_settings.rb
+++ b/db/migrate/20210618132206_add_notification_settings.rb
@@ -37,17 +37,17 @@ def up
t.boolean :mentioned, default: false
t.boolean :all, default: false
- t.timestamps default: -> { "CURRENT_TIMESTAMP" }
+ t.timestamps default: -> { 'CURRENT_TIMESTAMP' }
t.index %i[user_id channel],
unique: true,
where: "project_id IS NULL",
- name: "index_notification_settings_unique_project_null"
+ name: 'index_notification_settings_unique_project_null'
t.index %i[user_id project_id channel],
unique: true,
where: "project_id IS NOT NULL",
- name: "index_notification_settings_unique_project"
+ name: 'index_notification_settings_unique_project'
end
remove_column :members, :mail_notification
@@ -56,11 +56,11 @@ def up
def down
add_column :members, :mail_notification, :boolean, default: false, null: false
- add_column :users, :mail_notification, :string, default: "", null: false
+ add_column :users, :mail_notification, :string, default: '', null: false
drop_table :notification_settings
User.reset_column_information
- User.update_all(mail_notification: "only_assigned")
+ User.update_all(mail_notification: 'only_assigned')
end
end
diff --git a/db/migrate/20210726070813_remove_journal_versions.rb b/db/migrate/20210726070813_remove_journal_versions.rb
index b7a10ea60603..96d7a52d2d94 100644
--- a/db/migrate/20210726070813_remove_journal_versions.rb
+++ b/db/migrate/20210726070813_remove_journal_versions.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "20190724093332_add_journal_versions_table"
+require_relative '20190724093332_add_journal_versions_table'
# db/migrate/20200522140244_remove_journal_versions_table.rb
# incorrectly removes journal_versions
diff --git a/db/migrate/20210825183540_make_user_preferences_json.rb b/db/migrate/20210825183540_make_user_preferences_json.rb
index 38a9b40029ce..b03141633ed9 100644
--- a/db/migrate/20210825183540_make_user_preferences_json.rb
+++ b/db/migrate/20210825183540_make_user_preferences_json.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class MakeUserPreferencesJson < ActiveRecord::Migration[6.1]
include ::Migration::Utils
class UserPreferenceWithOthers < ::UserPreference
- self.table_name = "user_preferences"
+ self.table_name = 'user_preferences'
serialize :others, type: Hash
serialize :settings, coder: ::Serializers::IndifferentHashSerializer
end
diff --git a/db/migrate/20210914065555_cleanup_notifications.rb b/db/migrate/20210914065555_cleanup_notifications.rb
index 9941e8f2925f..b0a74aa61860 100644
--- a/db/migrate/20210914065555_cleanup_notifications.rb
+++ b/db/migrate/20210914065555_cleanup_notifications.rb
@@ -36,23 +36,23 @@ def up
end
change_table :notification_settings, bulk: true do |t|
- t.remove_index name: "index_notification_settings_unique_project_null"
- t.remove_index name: "index_notification_settings_unique_project"
+ t.remove_index name: 'index_notification_settings_unique_project_null'
+ t.remove_index name: 'index_notification_settings_unique_project'
# Delete all non in-app
- NotificationSetting.where("channel > 0").delete_all
+ NotificationSetting.where('channel > 0').delete_all
t.remove :channel, :all
t.index %i[user_id],
unique: true,
where: "project_id IS NULL",
- name: "index_notification_settings_unique_project_null"
+ name: 'index_notification_settings_unique_project_null'
t.index %i[user_id project_id],
unique: true,
where: "project_id IS NOT NULL",
- name: "index_notification_settings_unique_project"
+ name: 'index_notification_settings_unique_project'
end
end
@@ -69,18 +69,18 @@ def down
t.integer :channel, limit: 1
t.boolean :all, default: false
- t.remove_index name: "index_notification_settings_unique_project_null"
- t.remove_index name: "index_notification_settings_unique_project"
+ t.remove_index name: 'index_notification_settings_unique_project_null'
+ t.remove_index name: 'index_notification_settings_unique_project'
t.index %i[user_id channel],
unique: true,
where: "project_id IS NULL",
- name: "index_notification_settings_unique_project_null"
+ name: 'index_notification_settings_unique_project_null'
t.index %i[user_id project_id channel],
unique: true,
where: "project_id IS NOT NULL",
- name: "index_notification_settings_unique_project"
+ name: 'index_notification_settings_unique_project'
end
end
end
diff --git a/db/migrate/20210915154656_add_user_preference_settings_indices.rb b/db/migrate/20210915154656_add_user_preference_settings_indices.rb
index f83d8d50995b..e688edef5e19 100644
--- a/db/migrate/20210915154656_add_user_preference_settings_indices.rb
+++ b/db/migrate/20210915154656_add_user_preference_settings_indices.rb
@@ -31,16 +31,16 @@ def change
add_index :user_preferences,
"(settings->'daily_reminders'->'enabled')",
using: :gin,
- name: "index_user_prefs_settings_daily_reminders_enabled"
+ name: 'index_user_prefs_settings_daily_reminders_enabled'
add_index :user_preferences,
"(settings->'daily_reminders'->'times')",
using: :gin,
- name: "index_user_prefs_settings_daily_reminders_times"
+ name: 'index_user_prefs_settings_daily_reminders_times'
add_index :user_preferences,
"(settings->'time_zone')",
using: :gin,
- name: "index_user_prefs_settings_time_zone"
+ name: 'index_user_prefs_settings_time_zone'
end
end
diff --git a/db/migrate/20210928133538_add_reminder_workdays.rb b/db/migrate/20210928133538_add_reminder_workdays.rb
index da4feef12fbd..2372fce4de02 100644
--- a/db/migrate/20210928133538_add_reminder_workdays.rb
+++ b/db/migrate/20210928133538_add_reminder_workdays.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class AddReminderWorkdays < ActiveRecord::Migration[6.1]
include ::Migration::Utils
diff --git a/db/migrate/20211026061420_add_indexes_for_email_reminder_pause.rb b/db/migrate/20211026061420_add_indexes_for_email_reminder_pause.rb
index 60620b7719a0..b4116f669fa4 100644
--- a/db/migrate/20211026061420_add_indexes_for_email_reminder_pause.rb
+++ b/db/migrate/20211026061420_add_indexes_for_email_reminder_pause.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class AddIndexesForEmailReminderPause < ActiveRecord::Migration[6.1]
include ::Migration::Utils
diff --git a/db/migrate/20211101152840_redistribute_edit_project_permission.rb b/db/migrate/20211101152840_redistribute_edit_project_permission.rb
index 630584eca4fb..73c52dc9a644 100644
--- a/db/migrate/20211101152840_redistribute_edit_project_permission.rb
+++ b/db/migrate/20211101152840_redistribute_edit_project_permission.rb
@@ -28,13 +28,13 @@
class RedistributeEditProjectPermission < ActiveRecord::Migration[6.1]
def up
- add_permission("select_custom_fields")
- add_permission("select_done_status")
+ add_permission('select_custom_fields')
+ add_permission('select_done_status')
end
def down
- remove_permission("select_custom_fields")
- remove_permission("select_done_status")
+ remove_permission('select_custom_fields')
+ remove_permission('select_done_status')
end
private
diff --git a/db/migrate/20211102161932_remove_custom_field_types.rb b/db/migrate/20211102161932_remove_custom_field_types.rb
index f1b6389a86b3..2da68f215401 100644
--- a/db/migrate/20211102161932_remove_custom_field_types.rb
+++ b/db/migrate/20211102161932_remove_custom_field_types.rb
@@ -28,9 +28,9 @@
class RemoveCustomFieldTypes < ActiveRecord::Migration[6.1]
def up
- delete_custom_field("TimeEntryActivityCustomField")
- delete_custom_field("DocumentCategoryCustomField")
- delete_custom_field("IssuePriorityCustomField")
+ delete_custom_field('TimeEntryActivityCustomField')
+ delete_custom_field('DocumentCategoryCustomField')
+ delete_custom_field('IssuePriorityCustomField')
delete_custom_values
end
diff --git a/db/migrate/20211103120946_clean_emails_footer.rb b/db/migrate/20211103120946_clean_emails_footer.rb
index abad1e984e7d..89e2a0519e35 100644
--- a/db/migrate/20211103120946_clean_emails_footer.rb
+++ b/db/migrate/20211103120946_clean_emails_footer.rb
@@ -28,7 +28,7 @@
class CleanEmailsFooter < ActiveRecord::Migration[6.1]
def up
- return unless Setting.where(name: "emails_footer").exists? # rubocop:disable Rails/WhereExists
+ return unless Setting.where(name: 'emails_footer').exists? # rubocop:disable Rails/WhereExists
Setting.reset_column_information
filtered_footer = Setting
@@ -53,11 +53,11 @@ def down
def assumed_notification_text?(text)
[
- "You have received this notification because of your notification settings",
- "You have received this notification because you have either subscribed to it, or are involved in it.",
- "Sie erhalten diese E-Mail aufgrund Ihrer Benachrichtungseinstellungen",
- "/my/account",
- "/my/notifications",
+ 'You have received this notification because of your notification settings',
+ 'You have received this notification because you have either subscribed to it, or are involved in it.',
+ 'Sie erhalten diese E-Mail aufgrund Ihrer Benachrichtungseinstellungen',
+ '/my/account',
+ '/my/notifications',
'/my/mail\_notifications'
].any? { |val| text.include?(val) }
end
diff --git a/db/migrate/20211105142202_queue_notification_update_mail.rb b/db/migrate/20211105142202_queue_notification_update_mail.rb
index 8ab5d59d742e..945b15e64744 100644
--- a/db/migrate/20211105142202_queue_notification_update_mail.rb
+++ b/db/migrate/20211105142202_queue_notification_update_mail.rb
@@ -33,9 +33,9 @@ def up
return unless User.not_builtin.exists?
::Announcements::SchedulerJob
- .perform_later subject: :"notifications.update_info_mail.subject",
- body: :"notifications.update_info_mail.body",
- body_header: :"notifications.update_info_mail.body_header",
- body_subheader: :"notifications.update_info_mail.body_subheader"
+ .perform_later subject: :'notifications.update_info_mail.subject',
+ body: :'notifications.update_info_mail.body',
+ body_header: :'notifications.update_info_mail.body_header',
+ body_subheader: :'notifications.update_info_mail.body_subheader'
end
end
diff --git a/db/migrate/20220202140507_reorder_project_children.rb b/db/migrate/20220202140507_reorder_project_children.rb
index 760467ec60f9..d964d0d077e8 100644
--- a/db/migrate/20220202140507_reorder_project_children.rb
+++ b/db/migrate/20220202140507_reorder_project_children.rb
@@ -27,54 +27,7 @@
#++
class ReorderProjectChildren < ActiveRecord::Migration[6.1]
- class ProjectMigration < ApplicationRecord
- include ::Projects::Hierarchy
- self.table_name = "projects"
- end
-
def up
- Rails.logger.info { "Resorting siblings by name in the project's nested set." }
- ProjectMigration.transaction { reorder! }
- end
-
- def down
- # Nothing to do
- end
-
- private
-
- def reorder!
- # Reorder the project roots
- reorder_siblings ProjectMigration.roots
-
- # Reorder every project hierarchy
- ProjectMigration
- .where(id: unique_parent_ids)
- .find_each { |project| reorder_siblings(project.children) }
- end
-
- def unique_parent_ids
- ProjectMigration
- .where.not(parent_id: nil)
- .select(:parent_id)
- .distinct
- end
-
- def reorder_siblings(siblings)
- return unless siblings.many?
-
- # Resort children manually
- sorted = siblings.sort_by { |project| project.name.downcase }
-
- # Get the current first child
- first = siblings.first
-
- sorted.each_with_index do |child, i|
- if i == 0
- child.move_to_left_of(first) unless child == first
- else
- child.move_to_right_of(sorted[i - 1])
- end
- end
+ ::Projects::ReorderHierarchyJob.perform_later
end
end
diff --git a/db/migrate/20220319211253_add_parent_id_to_wp.rb b/db/migrate/20220319211253_add_parent_id_to_wp.rb
index be79605ab36c..cc235f6d5884 100644
--- a/db/migrate/20220319211253_add_parent_id_to_wp.rb
+++ b/db/migrate/20220319211253_add_parent_id_to_wp.rb
@@ -247,7 +247,7 @@ def remove_closure_tree_columns_on_foreign_tables
end
def build_typed_dag
- require_relative "20180105130053_rebuild_dag"
+ require_relative '20180105130053_rebuild_dag'
::RebuildDag.new.up
end
@@ -265,7 +265,7 @@ def insert_hierarchy_relation_for_parent
# rubocop:disable Rails/ApplicationRecord
class ClosureTreeWorkPackage < ActiveRecord::Base
- self.table_name = "work_packages"
+ self.table_name = 'work_packages'
has_closure_tree
end
diff --git a/db/migrate/20220426132637_refix_inherited_group_member_roles.rb b/db/migrate/20220426132637_refix_inherited_group_member_roles.rb
index 25ba7173120a..b60b03f51d52 100644
--- a/db/migrate/20220426132637_refix_inherited_group_member_roles.rb
+++ b/db/migrate/20220426132637_refix_inherited_group_member_roles.rb
@@ -31,7 +31,7 @@ def up
# When the FixInheritedGroupMemberRoles ran initially, Members
# where the MemberRoles were inherited from more than one Group where
# applied incorrectly. Only the MemberRoles of the last Group where kept.
- require Rails.root.join("db/migrate/20200625133727_fix_inherited_group_member_roles.rb")
+ require Rails.root.join('db/migrate/20200625133727_fix_inherited_group_member_roles.rb')
# created_on has been renamed to created_at
Member.reset_column_information
diff --git a/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb b/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb
index ba31fe2fe3be..34643140a82f 100644
--- a/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb
+++ b/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb
@@ -28,7 +28,7 @@
class RestoreDefaultsOnEmptySettings < ActiveRecord::Migration[6.1]
def up
- settings = Setting.where(value: "")
+ settings = Setting.where(value: '')
settings.find_each do |setting|
definition = Settings::Definition[setting.name]
@@ -38,7 +38,7 @@ def up
next
end
- next if definition.value == ""
+ next if definition.value == ''
if definition.writable?
setting.update_attribute(:value, definition.value)
diff --git a/db/migrate/20220615213015_migrate_log_time_to_log_own_time_in_role_permissions.rb b/db/migrate/20220615213015_migrate_log_time_to_log_own_time_in_role_permissions.rb
index 590ea5780fe5..29fe69536032 100644
--- a/db/migrate/20220615213015_migrate_log_time_to_log_own_time_in_role_permissions.rb
+++ b/db/migrate/20220615213015_migrate_log_time_to_log_own_time_in_role_permissions.rb
@@ -28,6 +28,6 @@
class MigrateLogTimeToLogOwnTimeInRolePermissions < ActiveRecord::Migration[7.0]
def change
- RolePermission.where(permission: "log_time").update_all(permission: "log_own_time")
+ RolePermission.where(permission: 'log_time').update_all(permission: 'log_own_time')
end
end
diff --git a/db/migrate/20220707192304_backfill_time_entries_with_logged_by_id.rb b/db/migrate/20220707192304_backfill_time_entries_with_logged_by_id.rb
index a6dc47b3bffe..f667737f5cd1 100644
--- a/db/migrate/20220707192304_backfill_time_entries_with_logged_by_id.rb
+++ b/db/migrate/20220707192304_backfill_time_entries_with_logged_by_id.rb
@@ -32,7 +32,7 @@ def up
.where.not(user_id: User.select(:id))
.update_all(user_id: DeletedUser.first.id)
- TimeEntry.all.update_all("logged_by_id = user_id")
+ TimeEntry.all.update_all('logged_by_id = user_id')
end
def down
diff --git a/db/migrate/20220804112533_remove_notification_cleanup_job.rb b/db/migrate/20220804112533_remove_notification_cleanup_job.rb
index a041d7bdd07a..956032ddad79 100644
--- a/db/migrate/20220804112533_remove_notification_cleanup_job.rb
+++ b/db/migrate/20220804112533_remove_notification_cleanup_job.rb
@@ -28,9 +28,14 @@
class RemoveNotificationCleanupJob < ActiveRecord::Migration[7.0]
def up
- execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CleanupJob%'")
+ # Remove the cron job no longer desired.
+ # The code itself is removed but keeping it in the database would lead to UninitializedConstant errors.
+ Delayed::Job
+ .where('handler LIKE ?', "%job_class: Notifications::CleanupJob%")
+ .delete_all
+
Setting
- .where(name: "notification_retention_period_days")
+ .where(name: 'notification_retention_period_days')
.delete_all
end
end
diff --git a/db/migrate/20220811061024_rename_work_package_export_limit.rb b/db/migrate/20220811061024_rename_work_package_export_limit.rb
index 685c45d9c908..277529873560 100644
--- a/db/migrate/20220811061024_rename_work_package_export_limit.rb
+++ b/db/migrate/20220811061024_rename_work_package_export_limit.rb
@@ -28,20 +28,20 @@
class RenameWorkPackageExportLimit < ActiveRecord::Migration[7.0]
def up
- if Setting.where(name: "work_packages_projects_export_limit").exists? # rubocop:disable Rails/WhereExists
+ if Setting.where(name: 'work_packages_projects_export_limit').exists? # rubocop:disable Rails/WhereExists
Setting
- .where(name: "work_packages_export_limit")
+ .where(name: 'work_packages_export_limit')
.delete_all
else
Setting
- .where(name: "work_packages_export_limit")
- .update_all(name: "work_packages_projects_export_limit")
+ .where(name: 'work_packages_export_limit')
+ .update_all(name: 'work_packages_projects_export_limit')
end
end
def down
Setting
- .where(name: "work_packages_projects_export_limit")
- .update_all(name: "work_packages_export_limit")
+ .where(name: 'work_packages_projects_export_limit')
+ .update_all(name: 'work_packages_export_limit')
end
end
diff --git a/db/migrate/20220817154403_remove_work_packages_duration_field_active_setting.rb b/db/migrate/20220817154403_remove_work_packages_duration_field_active_setting.rb
index 62a1c931100a..5667e3581346 100644
--- a/db/migrate/20220817154403_remove_work_packages_duration_field_active_setting.rb
+++ b/db/migrate/20220817154403_remove_work_packages_duration_field_active_setting.rb
@@ -28,6 +28,6 @@
class RemoveWorkPackagesDurationFieldActiveSetting < ActiveRecord::Migration[7.0]
def change
- Setting.where(name: "work_packages_duration_field_active").destroy_all
+ Setting.where(name: 'work_packages_duration_field_active').destroy_all
end
end
diff --git a/db/migrate/20220818074150_fix_invalid_journals.rb b/db/migrate/20220818074150_fix_invalid_journals.rb
index 28fb789f9545..9ddb18688331 100644
--- a/db/migrate/20220818074150_fix_invalid_journals.rb
+++ b/db/migrate/20220818074150_fix_invalid_journals.rb
@@ -62,7 +62,7 @@ def destroy_journals(journals)
def get_broken_journals
Journal
- .pluck("DISTINCT(journable_type)")
+ .pluck('DISTINCT(journable_type)')
.compact
.to_h do |journable_type|
relation = Journal
diff --git a/db/migrate/20220818074159_fix_deleted_data_journals.rb b/db/migrate/20220818074159_fix_deleted_data_journals.rb
index 68bc67073849..e639e302ee2e 100644
--- a/db/migrate/20220818074159_fix_deleted_data_journals.rb
+++ b/db/migrate/20220818074159_fix_deleted_data_journals.rb
@@ -43,7 +43,7 @@ def down
end
def unfixed_journals_found(journable_type, relation, count)
- unless ENV["SKIP_MISSING_JOURNALS"] == "true"
+ unless ENV['SKIP_MISSING_JOURNALS'] == 'true'
warning = <<~WARNING
There shouldn't be any missing data left for #{journable_type}, but found #{count}.
@@ -95,7 +95,7 @@ def fix_journal_data(journal)
def insert_journal_data(journal, write_message: false)
service = Journals::CreateService.new(journal.journable, User.system)
- insert_sql = service.instance_eval { insert_data_sql("placeholder", nil) }
+ insert_sql = service.instance_eval { insert_data_sql('placeholder', nil) }
result = Journal.connection.uncached do
::Journal
@@ -103,18 +103,18 @@ def insert_journal_data(journal, write_message: false)
.select_one(insert_sql)
end
- raise "ID is missing #{result.inspect}" unless result["id"]
+ raise "ID is missing #{result.inspect}" unless result['id']
if write_message
- update_with_new_data!(journal, result["id"])
+ update_with_new_data!(journal, result['id'])
else
- journal.update_column(:data_id, result["id"])
+ journal.update_column(:data_id, result['id'])
end
end
def get_missing_journals
Journal
- .pluck("DISTINCT(journable_type)")
+ .pluck('DISTINCT(journable_type)')
.to_h do |journable_type|
journal_class = journable_type.constantize.journal_class
table_name = journal_class.table_name
@@ -124,7 +124,7 @@ def get_missing_journals
.where("#{table_name}.id IS NULL")
.where(journable_type:)
.where.not(data_type: nil) # Ignore special tenants with data_type nil errors
- .order("journals.version ASC")
+ .order('journals.version ASC')
.includes(:journable)
[journable_type, relation]
@@ -153,7 +153,7 @@ def take_over_from_source(journal, source)
end
def update_with_new_data!(journal, data_id)
- notes = journal.notes || ""
+ notes = journal.notes || ''
notes << "\n" unless notes.empty?
notes << "_(This activity had to be modified by the system and may be missing some changes or contain changes from previous or following activities.)_"
diff --git a/db/migrate/20220926124435_constrain_work_package_dates.rb b/db/migrate/20220926124435_constrain_work_package_dates.rb
index cf7b3af7f5bf..81688e3d71fb 100644
--- a/db/migrate/20220926124435_constrain_work_package_dates.rb
+++ b/db/migrate/20220926124435_constrain_work_package_dates.rb
@@ -34,13 +34,13 @@ def change
User.execute_as(User.system) do
work_package.start_date = work_package.due_date
work_package.duration = 1
- work_package.journal_notes = "_Resetting the start date automatically to fix inconsistent dates._"
+ work_package.journal_notes = '_Resetting the start date automatically to fix inconsistent dates._'
work_package.save!(validate: false)
end
end
end
end
- add_check_constraint :work_packages, "due_date >= start_date", name: "work_packages_due_larger_start_date"
+ add_check_constraint :work_packages, 'due_date >= start_date', name: 'work_packages_due_larger_start_date'
end
end
diff --git a/db/migrate/20221018160449_add_logged_by_to_cost_entries.rb b/db/migrate/20221018160449_add_logged_by_to_cost_entries.rb
index 346e3b3be546..78ed9b8a1b16 100644
--- a/db/migrate/20221018160449_add_logged_by_to_cost_entries.rb
+++ b/db/migrate/20221018160449_add_logged_by_to_cost_entries.rb
@@ -36,7 +36,7 @@ def change
.where.not(user_id: User.select(:id))
.update_all(user_id: DeletedUser.first.id)
- CostEntry.update_all("logged_by_id = user_id")
+ CostEntry.update_all('logged_by_id = user_id')
end
end
end
diff --git a/db/migrate/20221026132134_bigint_primary_and_foreign_keys.rb b/db/migrate/20221026132134_bigint_primary_and_foreign_keys.rb
index 795c3473c559..c641d892044f 100644
--- a/db/migrate/20221026132134_bigint_primary_and_foreign_keys.rb
+++ b/db/migrate/20221026132134_bigint_primary_and_foreign_keys.rb
@@ -60,8 +60,8 @@ class BigintPrimaryAndForeignKeys < ActiveRecord::Migration[7.0]
CustomStyle => [:id],
CustomValue => %i[id customized_id custom_field_id],
Journal::CustomizableJournal => %i[id journal_id custom_field_id],
+ Delayed::Job => [:id],
DesignColor => [:id],
- :delayed_jobs => [:id], # delayed job removed in favour of good_job see WP #42 or PR #42
Journal::DocumentJournal => %i[id project_id category_id],
Document => %i[id project_id category_id],
:done_statuses_for_project => %i[project_id status_id],
diff --git a/db/migrate/20221027151959_remove_plaintext_tokens.rb b/db/migrate/20221027151959_remove_plaintext_tokens.rb
index 8b85eb09e1b2..2d678071dd7b 100644
--- a/db/migrate/20221027151959_remove_plaintext_tokens.rb
+++ b/db/migrate/20221027151959_remove_plaintext_tokens.rb
@@ -30,11 +30,11 @@ class RemovePlaintextTokens < ActiveRecord::Migration[7.0]
def change
drop_table :plaintext_tokens do |t|
t.integer :user_id, default: 0, null: false
- t.string :action, limit: 30, default: "", null: false
- t.string :value, limit: 40, default: "", null: false
+ t.string :action, limit: 30, default: '', null: false
+ t.string :value, limit: 40, default: '', null: false
t.datetime :created_on, null: false
- t.index :user_id, name: "index_plaintext_tokens_on_user_id"
+ t.index :user_id, name: 'index_plaintext_tokens_on_user_id'
end
end
end
diff --git a/db/migrate/20221115082403_add_ldap_tls_options.rb b/db/migrate/20221115082403_add_ldap_tls_options.rb
index eda3d679f5e3..03850cfdaa19 100644
--- a/db/migrate/20221115082403_add_ldap_tls_options.rb
+++ b/db/migrate/20221115082403_add_ldap_tls_options.rb
@@ -28,7 +28,7 @@
class AddLdapTlsOptions < ActiveRecord::Migration[7.0]
class MigratingAuthSource < ApplicationRecord
- self.table_name = "auth_sources"
+ self.table_name = 'auth_sources'
end
def change
diff --git a/db/migrate/20221213092910_remove_default_values_from_journal_tables_definition.rb b/db/migrate/20221213092910_remove_default_values_from_journal_tables_definition.rb
index 5a49bfc8e656..8e0db8218529 100644
--- a/db/migrate/20221213092910_remove_default_values_from_journal_tables_definition.rb
+++ b/db/migrate/20221213092910_remove_default_values_from_journal_tables_definition.rb
@@ -30,36 +30,36 @@ class RemoveDefaultValuesFromJournalTablesDefinition < ActiveRecord::Migration[7
# rubocop:disable Metrics/AbcSize
def change
change_table :attachable_journals, bulk: true do |t|
- t.change_default :filename, from: "", to: nil
+ t.change_default :filename, from: '', to: nil
end
change_table :attachment_journals, bulk: true do |t|
- t.change_default :filename, from: "", to: nil
- t.change_default :disk_filename, from: "", to: nil
+ t.change_default :filename, from: '', to: nil
+ t.change_default :disk_filename, from: '', to: nil
t.change_default :filesize, from: 0, to: nil
- t.change_default :content_type, from: "", to: nil
- t.change_default :digest, from: "", to: nil
+ t.change_default :content_type, from: '', to: nil
+ t.change_default :digest, from: '', to: nil
t.change_default :downloads, from: 0, to: nil
end
change_table :document_journals, bulk: true do |t|
- t.change_default :title, from: "", to: nil
+ t.change_default :title, from: '', to: nil
end
change_table :message_journals, bulk: true do |t|
- t.change_default :subject, from: "", to: nil
+ t.change_default :subject, from: '', to: nil
t.change_default :locked, from: false, to: nil
t.change_default :sticky, from: 0, to: nil
end
change_table :news_journals, bulk: true do |t|
- t.change_default :title, from: "", to: nil
- t.change_default :summary, from: "", to: nil
+ t.change_default :title, from: '', to: nil
+ t.change_default :summary, from: '', to: nil
t.change_default :comments_count, from: 0, to: nil
end
change_table :work_package_journals, bulk: true do |t|
- t.change_default :subject, from: "", to: nil
+ t.change_default :subject, from: '', to: nil
t.change_default :done_ratio, from: 0, to: nil
t.change_default :schedule_manually, from: false, to: nil
end
diff --git a/db/migrate/20230105073117_remove_renamed_date_alert_job.rb b/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
index e59bc347aa68..9ae61bc1923b 100644
--- a/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
+++ b/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
@@ -30,6 +30,8 @@ class RemoveRenamedDateAlertJob < ActiveRecord::Migration[6.0]
def up
# The job has been renamed to Notifications::ScheduleDateAlertsNotificationsJob.
# The new job will be added on restarting the application.
- execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CreateDateAlertsNotificationsJob%'")
+ Delayed::Job
+ .where('handler LIKE ?', "%job_class: Notifications::CreateDateAlertsNotificationsJob%")
+ .delete_all
end
end
diff --git a/db/migrate/20230315103437_add_foreign_keys_to_workflows.rb b/db/migrate/20230315103437_add_foreign_keys_to_workflows.rb
index 51b58599edd6..e0674071b4e2 100644
--- a/db/migrate/20230315103437_add_foreign_keys_to_workflows.rb
+++ b/db/migrate/20230315103437_add_foreign_keys_to_workflows.rb
@@ -30,8 +30,8 @@ def up
Workflow.where.not(type: Type.all).destroy_all
add_foreign_key :workflows, :types, on_delete: :cascade, on_update: :cascade
Workflow.where.not(old_status_id: Status.all).or(Workflow.where.not(new_status_id: Status.all)).destroy_all
- add_foreign_key :workflows, :statuses, column: "old_status_id", on_delete: :cascade, on_update: :cascade
- add_foreign_key :workflows, :statuses, column: "new_status_id", on_delete: :cascade, on_update: :cascade
+ add_foreign_key :workflows, :statuses, column: 'old_status_id', on_delete: :cascade, on_update: :cascade
+ add_foreign_key :workflows, :statuses, column: 'new_status_id', on_delete: :cascade, on_update: :cascade
Workflow.where.not(role: Role.all).destroy_all
add_foreign_key :workflows, :roles, on_delete: :cascade, on_update: :cascade
end
diff --git a/db/migrate/20230322135932_merge_wiki_content_into_page.rb b/db/migrate/20230322135932_merge_wiki_content_into_page.rb
index a1fd45aacfe5..d97b2536fabf 100644
--- a/db/migrate/20230322135932_merge_wiki_content_into_page.rb
+++ b/db/migrate/20230322135932_merge_wiki_content_into_page.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class MergeWikiContentIntoPage < ActiveRecord::Migration[7.0]
include ::Migration::Utils
@@ -75,8 +75,8 @@ def drop_wiki_contents
t.datetime :updated_at, null: false
t.integer :lock_version, null: false
- t.index :author_id, name: "index_wiki_contents_on_author_id"
- t.index :page_id, name: "wiki_contents_page_id"
+ t.index :author_id, name: 'index_wiki_contents_on_author_id'
+ t.index :page_id, name: 'wiki_contents_page_id'
t.index %i[page_id updated_at]
end
end
diff --git a/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb b/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb
index 22c1d74a3ec7..ba11f3233880 100644
--- a/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb
+++ b/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb
@@ -30,9 +30,9 @@ class AddGinTrgmIndexOnJournalsAndCustomValues < ActiveRecord::Migration[7.0]
def up
safe_enable_pg_trgm_extension
- if extensions.include?("pg_trgm")
- add_index(:journals, :notes, using: "gin", opclass: :gin_trgm_ops)
- add_index(:custom_values, :value, using: "gin", opclass: :gin_trgm_ops)
+ if extensions.include?('pg_trgm')
+ add_index(:journals, :notes, using: 'gin', opclass: :gin_trgm_ops)
+ add_index(:custom_values, :value, using: 'gin', opclass: :gin_trgm_ops)
end
end
@@ -47,10 +47,10 @@ def down
def safe_enable_pg_trgm_extension
ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA pg_catalog;")
rescue StandardError => e
- raise unless e.message.include?("pg_trgm")
+ raise unless e.message.include?('pg_trgm')
# Rollback the transaction in order to recover from the error.
- ActiveRecord::Base.connection.execute "ROLLBACK"
+ ActiveRecord::Base.connection.execute 'ROLLBACK'
warn <<~MESSAGE
diff --git a/db/migrate/20230531093004_remove_default_from_query_name.rb b/db/migrate/20230531093004_remove_default_from_query_name.rb
index f974e9ec9ff7..8f7f0c634665 100644
--- a/db/migrate/20230531093004_remove_default_from_query_name.rb
+++ b/db/migrate/20230531093004_remove_default_from_query_name.rb
@@ -1,5 +1,5 @@
class RemoveDefaultFromQueryName < ActiveRecord::Migration[7.0]
def change
- change_column_default :queries, :name, to: nil, from: ""
+ change_column_default :queries, :name, to: nil, from: ''
end
end
diff --git a/db/migrate/20230608151123_add_validity_period_to_journals.rb b/db/migrate/20230608151123_add_validity_period_to_journals.rb
index 40c97406f6c3..6a65e62ab879 100644
--- a/db/migrate/20230608151123_add_validity_period_to_journals.rb
+++ b/db/migrate/20230608151123_add_validity_period_to_journals.rb
@@ -12,12 +12,12 @@ def change
end
add_check_constraint :journals,
- "NOT isempty(validity_period) AND validity_period IS NOT NULL",
+ 'NOT isempty(validity_period) AND validity_period IS NOT NULL',
name: "journals_validity_period_not_empty"
end
def fix_all_journal_timestamps
- max_attempts = attempts = (ENV["MAX_JOURNAL_TIMESTAMPS_ATTEMPTS"].presence && ENV["MAX_JOURNAL_TIMESTAMPS_ATTEMPTS"].to_i) ||
+ max_attempts = attempts = (ENV['MAX_JOURNAL_TIMESTAMPS_ATTEMPTS'].presence && ENV['MAX_JOURNAL_TIMESTAMPS_ATTEMPTS'].to_i) ||
Journal.all.maximum(:version)
invalid_journables = nil
diff --git a/db/migrate/20230718084649_add_create_user_permission_to_roles.rb b/db/migrate/20230718084649_add_create_user_permission_to_roles.rb
index b91e0ceb4bd1..0819c3d03b32 100644
--- a/db/migrate/20230718084649_add_create_user_permission_to_roles.rb
+++ b/db/migrate/20230718084649_add_create_user_permission_to_roles.rb
@@ -1,17 +1,17 @@
class AddCreateUserPermissionToRoles < ActiveRecord::Migration[7.0]
class MigrationRolePermission < ApplicationRecord
- self.table_name = "role_permissions"
+ self.table_name = 'role_permissions'
end
def up
- role_ids = MigrationRolePermission.where(permission: "manage_user").pluck(:role_id)
+ role_ids = MigrationRolePermission.where(permission: 'manage_user').pluck(:role_id)
role_ids.each do |role_id|
- MigrationRolePermission.create(permission: "create_user", role_id:)
+ MigrationRolePermission.create(permission: 'create_user', role_id:)
end
end
def down
- MigrationRolePermission.where(permission: "create_user").delete_all
+ MigrationRolePermission.where(permission: 'create_user').delete_all
end
end
diff --git a/db/migrate/20230810074642_add_optional_entity_to_members.rb b/db/migrate/20230810074642_add_optional_entity_to_members.rb
index 95fa693d3d5a..1ba9a51a8ae0 100644
--- a/db/migrate/20230810074642_add_optional_entity_to_members.rb
+++ b/db/migrate/20230810074642_add_optional_entity_to_members.rb
@@ -6,11 +6,11 @@ def change
add_index :members, %i[user_id project_id],
unique: true,
where: "entity_type IS NULL AND entity_id IS NULL",
- name: "index_members_on_user_id_and_project_without_entity"
+ name: 'index_members_on_user_id_and_project_without_entity'
add_index :members, %i[user_id project_id entity_type entity_id],
unique: true,
where: "entity_type IS NOT NULL AND entity_id IS NOT NULL",
- name: "index_members_on_user_id_and_project_with_entity"
+ name: 'index_members_on_user_id_and_project_with_entity'
end
end
diff --git a/db/migrate/20230829151629_add_copy_work_packages_permission_to_roles.rb b/db/migrate/20230829151629_add_copy_work_packages_permission_to_roles.rb
index 2b214a967034..2ef9ba3c1898 100644
--- a/db/migrate/20230829151629_add_copy_work_packages_permission_to_roles.rb
+++ b/db/migrate/20230829151629_add_copy_work_packages_permission_to_roles.rb
@@ -28,12 +28,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/permission_adder"
+require_relative 'migration_utils/permission_adder'
class AddCopyWorkPackagesPermissionToRoles < ActiveRecord::Migration[7.0]
# Decouple ActiveRecord model from Migration
class MigrationRolePermission < ApplicationRecord
- self.table_name = "role_permissions"
+ self.table_name = 'role_permissions'
end
def up
@@ -43,6 +43,6 @@ def up
end
def down
- MigrationRolePermission.where(permission: "copy_work_packages").delete_all
+ MigrationRolePermission.where(permission: 'copy_work_packages').delete_all
end
end
diff --git a/db/migrate/20230905090205_add_share_workpackages_permission.rb b/db/migrate/20230905090205_add_share_workpackages_permission.rb
index 84b28bb9d439..2e7ee6bd5237 100644
--- a/db/migrate/20230905090205_add_share_workpackages_permission.rb
+++ b/db/migrate/20230905090205_add_share_workpackages_permission.rb
@@ -28,12 +28,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "migration_utils/permission_adder"
+require_relative 'migration_utils/permission_adder'
class AddShareWorkpackagesPermission < ActiveRecord::Migration[7.0]
# Decouple ActiveRecord model from Migration
class MigrationRolePermission < ApplicationRecord
- self.table_name = "role_permissions"
+ self.table_name = 'role_permissions'
end
def up
@@ -42,6 +42,6 @@ def up
end
def down
- MigrationRolePermission.where(permission: "share_work_packages").delete_all
+ MigrationRolePermission.where(permission: 'share_work_packages').delete_all
end
end
diff --git a/db/migrate/20230912185647_add_view_shared_work_packages_permission.rb b/db/migrate/20230912185647_add_view_shared_work_packages_permission.rb
index 1e55b42832aa..cfcaede77826 100644
--- a/db/migrate/20230912185647_add_view_shared_work_packages_permission.rb
+++ b/db/migrate/20230912185647_add_view_shared_work_packages_permission.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
# ++
-require_relative "migration_utils/permission_adder"
+require_relative 'migration_utils/permission_adder'
class AddViewSharedWorkPackagesPermission < ActiveRecord::Migration[7.0]
# Decouple ActiveRecord model from Migration
class MigrationRolePermission < ApplicationRecord
- self.table_name = "role_permissions"
+ self.table_name = 'role_permissions'
end
def up
@@ -39,6 +39,6 @@ def up
end
def down
- MigrationRolePermission.where(permission: "share_work_packages").delete_all
+ MigrationRolePermission.where(permission: 'share_work_packages').delete_all
end
end
diff --git a/db/migrate/20231002141527_fix_default_language_value_for_chinese_simplified.rb b/db/migrate/20231002141527_fix_default_language_value_for_chinese_simplified.rb
index 384677737c93..72d40d8cb900 100644
--- a/db/migrate/20231002141527_fix_default_language_value_for_chinese_simplified.rb
+++ b/db/migrate/20231002141527_fix_default_language_value_for_chinese_simplified.rb
@@ -1,5 +1,5 @@
class FixDefaultLanguageValueForChineseSimplified < ActiveRecord::Migration[7.0]
def up
- Setting.where(name: "default_language", value: "zh").update_all(value: "zh-CN")
+ Setting.where(name: 'default_language', value: 'zh').update_all(value: 'zh-CN')
end
end
diff --git a/db/migrate/20231005113307_role_to_project_role.rb b/db/migrate/20231005113307_role_to_project_role.rb
index 0b1e101c34d9..64b86d53ccd2 100644
--- a/db/migrate/20231005113307_role_to_project_role.rb
+++ b/db/migrate/20231005113307_role_to_project_role.rb
@@ -1,10 +1,10 @@
class RoleToProjectRole < ActiveRecord::Migration[7.0]
def up
- rename_role("Role", "ProjectRole")
+ rename_role('Role', 'ProjectRole')
end
def down
- rename_role("ProjectRole", "Role")
+ rename_role('ProjectRole', 'Role')
end
private
diff --git a/db/migrate/20231020154219_add_trgm_index_to_meeting_agenda_item_notes.rb b/db/migrate/20231020154219_add_trgm_index_to_meeting_agenda_item_notes.rb
index f5e2630b8b5d..3bd4837286de 100644
--- a/db/migrate/20231020154219_add_trgm_index_to_meeting_agenda_item_notes.rb
+++ b/db/migrate/20231020154219_add_trgm_index_to_meeting_agenda_item_notes.rb
@@ -4,8 +4,8 @@ def change
# already enabled on the extension. Hence we do not attempt to enable it here, just
# to use it if it's available.
- if extensions.include?("pg_trgm")
- add_index(:meeting_agenda_items, :notes, using: "gin", opclass: :gin_trgm_ops)
+ if extensions.include?('pg_trgm')
+ add_index(:meeting_agenda_items, :notes, using: 'gin', opclass: :gin_trgm_ops)
end
end
end
diff --git a/db/migrate/20231025144701_migrate_agenda_item_permissions.rb b/db/migrate/20231025144701_migrate_agenda_item_permissions.rb
index 78265bc7ee7b..4b7bddb9b5d6 100644
--- a/db/migrate/20231025144701_migrate_agenda_item_permissions.rb
+++ b/db/migrate/20231025144701_migrate_agenda_item_permissions.rb
@@ -28,10 +28,10 @@
class MigrateAgendaItemPermissions < ActiveRecord::Migration[7.0]
def up
- RolePermission.where(permission: "create_meeting_agendas").update_all(permission: "manage_agendas")
+ RolePermission.where(permission: 'create_meeting_agendas').update_all(permission: 'manage_agendas')
end
def down
- RolePermission.where(permission: "manage_agendas").update_all(permission: "create_meeting_agendas")
+ RolePermission.where(permission: 'manage_agendas').update_all(permission: 'create_meeting_agendas')
end
end
diff --git a/db/migrate/20231027102747_rollback_create_meeting_agendas_and_split_edit_meeting_role.rb b/db/migrate/20231027102747_rollback_create_meeting_agendas_and_split_edit_meeting_role.rb
index 4d52c0e2ffd5..3310d0e675a9 100644
--- a/db/migrate/20231027102747_rollback_create_meeting_agendas_and_split_edit_meeting_role.rb
+++ b/db/migrate/20231027102747_rollback_create_meeting_agendas_and_split_edit_meeting_role.rb
@@ -31,7 +31,7 @@
class RollbackCreateMeetingAgendasAndSplitEditMeetingRole < ActiveRecord::Migration[7.0]
def up
# Rollback the create_meeting_agendas permission
- RolePermission.where(permission: "manage_agendas").update_all(permission: "create_meeting_agendas")
+ RolePermission.where(permission: 'manage_agendas').update_all(permission: 'create_meeting_agendas')
# Introduce manage_agendas permission, that is being split from the edit_meeting permission
::Migration::MigrationUtils::PermissionAdder
@@ -40,7 +40,7 @@ def up
end
def down
- RolePermission.where(permission: "manage_agendas").destroy_all
- RolePermission.where(permission: "create_meeting_agendas").update_all(permission: "manage_agendas")
+ RolePermission.where(permission: 'manage_agendas').destroy_all
+ RolePermission.where(permission: 'create_meeting_agendas').update_all(permission: 'manage_agendas')
end
end
diff --git a/db/migrate/20231128080650_add_work_package_roles.rb b/db/migrate/20231128080650_add_work_package_roles.rb
index 4143842141ac..859a3c488d34 100644
--- a/db/migrate/20231128080650_add_work_package_roles.rb
+++ b/db/migrate/20231128080650_add_work_package_roles.rb
@@ -1,13 +1,13 @@
class AddWorkPackageRoles < ActiveRecord::Migration[7.0]
def up
# This is how the role was seeded in the first iteration of seeds
- editor_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: "Work Package Editor")
+ editor_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: 'Work Package Editor')
# If we couldn't find a WP from the first iteration of the seeds, find it by the builtin
editor_role ||= WorkPackageRole.find_or_initialize_by(builtin: Role::BUILTIN_WORK_PACKAGE_EDITOR)
editor_role.update!(
builtin: Role::BUILTIN_WORK_PACKAGE_EDITOR,
- name: I18n.t("seeds.common.work_package_roles.item_0.name", default: "Work package editor"),
+ name: I18n.t('seeds.common.work_package_roles.item_0.name', default: 'Work package editor'),
permissions: %i[
view_work_packages
edit_work_packages
@@ -26,12 +26,12 @@ def up
)
# This is how the role was seeded in the first iteration of seeds
- commenter_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: "Work Package Commenter")
+ commenter_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: 'Work Package Commenter')
# If we couldn't find a WP from the first iteration of the seeds, find it by the builtin
commenter_role ||= WorkPackageRole.find_or_initialize_by(builtin: Role::BUILTIN_WORK_PACKAGE_COMMENTER)
commenter_role.update!(
builtin: Role::BUILTIN_WORK_PACKAGE_COMMENTER,
- name: I18n.t("seeds.common.work_package_roles.item_1.name", default: "Work package commenter"),
+ name: I18n.t('seeds.common.work_package_roles.item_1.name', default: 'Work package commenter'),
permissions: %i[
view_work_packages
work_package_assigned
@@ -48,13 +48,13 @@ def up
)
# This is how the role was seeded in the first iteration of seeds
- viewer_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: "Work Package Viewer")
+ viewer_role = WorkPackageRole.find_by(builtin: Role::NON_BUILTIN, name: 'Work Package Viewer')
# If we couldn't find a WP from the first iteration of the seeds, find it by the builtin
viewer_role ||= WorkPackageRole.find_or_initialize_by(builtin: Role::BUILTIN_WORK_PACKAGE_VIEWER)
# Set up attributes
viewer_role.update!(
builtin: Role::BUILTIN_WORK_PACKAGE_VIEWER,
- name: I18n.t("seeds.common.work_package_roles.item_2.name", default: "Work package viewer"),
+ name: I18n.t('seeds.common.work_package_roles.item_2.name', default: 'Work package viewer'),
permissions: %i[
view_work_packages
export_work_packages
diff --git a/db/migrate/20231201085450_change_view_of_queries_with_timeline_to_gantt.rb b/db/migrate/20231201085450_change_view_of_queries_with_timeline_to_gantt.rb
index d8d220a7a589..0cf2b11907b8 100644
--- a/db/migrate/20231201085450_change_view_of_queries_with_timeline_to_gantt.rb
+++ b/db/migrate/20231201085450_change_view_of_queries_with_timeline_to_gantt.rb
@@ -1,23 +1,23 @@
class ChangeViewOfQueriesWithTimelineToGantt < ActiveRecord::Migration[7.0]
class MigrationQuery < ApplicationRecord
- self.table_name = "queries"
+ self.table_name = 'queries'
end
class MigrationView < ApplicationRecord
- self.table_name = "views"
+ self.table_name = 'views'
# disable STI
self.inheritance_column = :_type_disabled
- belongs_to :query, class_name: "MigrationQuery"
+ belongs_to :query, class_name: 'MigrationQuery'
end
def up
- update_view_type_for_timeline_queries(from_view_type: "work_packages_table", to_view_type: "gantt")
+ update_view_type_for_timeline_queries(from_view_type: 'work_packages_table', to_view_type: 'gantt')
end
def down
- update_view_type_for_timeline_queries(from_view_type: "gantt", to_view_type: "work_packages_table")
+ update_view_type_for_timeline_queries(from_view_type: 'gantt', to_view_type: 'work_packages_table')
end
private
@@ -25,7 +25,7 @@ def down
def update_view_type_for_timeline_queries(from_view_type:, to_view_type:)
MigrationView
.joins(:query)
- .where("queries.timeline_visible": true)
+ .where('queries.timeline_visible': true)
.where(type: from_view_type)
.update_all(type: to_view_type)
end
diff --git a/db/migrate/20240123151246_create_good_jobs.rb b/db/migrate/20240123151246_create_good_jobs.rb
deleted file mode 100644
index 83cb7893fae8..000000000000
--- a/db/migrate/20240123151246_create_good_jobs.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGoodJobs < ActiveRecord::Migration[7.0]
- def change
- # Uncomment for Postgres v12 or earlier to enable gen_random_uuid() support
- # enable_extension 'pgcrypto'
-
- create_table :good_jobs, id: :uuid do |t|
- t.text :queue_name
- t.integer :priority
- t.jsonb :serialized_params
- t.datetime :scheduled_at
- t.datetime :performed_at
- t.datetime :finished_at
- t.text :error
-
- t.timestamps
-
- t.uuid :active_job_id
- t.text :concurrency_key
- t.text :cron_key
- t.uuid :retried_good_job_id
- t.datetime :cron_at
- end
-
- create_table :good_job_processes, id: :uuid do |t|
- t.timestamps
- t.jsonb :state
- end
-
- add_index :good_jobs, :scheduled_at, where: "(finished_at IS NULL)", name: :index_good_jobs_on_scheduled_at
- add_index :good_jobs, [:queue_name, :scheduled_at], where: "(finished_at IS NULL)", name: :index_good_jobs_on_queue_name_and_scheduled_at
- add_index :good_jobs, [:active_job_id, :created_at], name: :index_good_jobs_on_active_job_id_and_created_at
- add_index :good_jobs, :concurrency_key, where: "(finished_at IS NULL)", name: :index_good_jobs_on_concurrency_key_when_unfinished
- add_index :good_jobs, [:cron_key, :created_at], name: :index_good_jobs_on_cron_key_and_created_at
- add_index :good_jobs, [:cron_key, :cron_at], name: :index_good_jobs_on_cron_key_and_cron_at, unique: true
- add_index :good_jobs, [:active_job_id], name: :index_good_jobs_on_active_job_id
- add_index :good_jobs, [:finished_at], where: "retried_good_job_id IS NULL AND finished_at IS NOT NULL", name: :index_good_jobs_jobs_on_finished_at
- end
-end
diff --git a/db/migrate/20240123151247_create_good_job_settings.rb b/db/migrate/20240123151247_create_good_job_settings.rb
deleted file mode 100644
index fa3540174a62..000000000000
--- a/db/migrate/20240123151247_create_good_job_settings.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGoodJobSettings < ActiveRecord::Migration[7.0]
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.table_exists?(:good_job_settings)
- end
- end
-
- create_table :good_job_settings, id: :uuid do |t|
- t.timestamps
- t.text :key
- t.jsonb :value
- t.index :key, unique: true
- end
- end
-end
diff --git a/db/migrate/20240123151248_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb b/db/migrate/20240123151248_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb
deleted file mode 100644
index 7b9dbab3816f..000000000000
--- a/db/migrate/20240123151248_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexGoodJobsJobsOnPriorityCreatedAtWhenUnfinished < ActiveRecord::Migration[7.0]
- disable_ddl_transaction!
-
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.index_name_exists?(:good_jobs, :index_good_jobs_jobs_on_priority_created_at_when_unfinished)
- end
- end
-
- add_index :good_jobs, [:priority, :created_at], order: { priority: "DESC NULLS LAST", created_at: :asc },
- where: "finished_at IS NULL", name: :index_good_jobs_jobs_on_priority_created_at_when_unfinished,
- algorithm: :concurrently
- end
-end
diff --git a/db/migrate/20240123151249_create_good_job_batches.rb b/db/migrate/20240123151249_create_good_job_batches.rb
deleted file mode 100644
index ac6c5b37e982..000000000000
--- a/db/migrate/20240123151249_create_good_job_batches.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGoodJobBatches < ActiveRecord::Migration[7.0]
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.table_exists?(:good_job_batches)
- end
- end
-
- create_table :good_job_batches, id: :uuid do |t|
- t.timestamps
- t.text :description
- t.jsonb :serialized_properties
- t.text :on_finish
- t.text :on_success
- t.text :on_discard
- t.text :callback_queue_name
- t.integer :callback_priority
- t.datetime :enqueued_at
- t.datetime :discarded_at
- t.datetime :finished_at
- end
-
- change_table :good_jobs do |t|
- t.uuid :batch_id
- t.uuid :batch_callback_id
-
- t.index :batch_id, where: "batch_id IS NOT NULL"
- t.index :batch_callback_id, where: "batch_callback_id IS NOT NULL"
- end
- end
-end
diff --git a/db/migrate/20240123151250_create_good_job_executions.rb b/db/migrate/20240123151250_create_good_job_executions.rb
deleted file mode 100644
index 32723220ccec..000000000000
--- a/db/migrate/20240123151250_create_good_job_executions.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGoodJobExecutions < ActiveRecord::Migration[7.0]
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.table_exists?(:good_job_executions)
- end
- end
-
- create_table :good_job_executions, id: :uuid do |t|
- t.timestamps
-
- t.uuid :active_job_id, null: false
- t.text :job_class
- t.text :queue_name
- t.jsonb :serialized_params
- t.datetime :scheduled_at
- t.datetime :finished_at
- t.text :error
-
- t.index [:active_job_id, :created_at], name: :index_good_job_executions_on_active_job_id_and_created_at
- end
-
- change_table :good_jobs do |t|
- t.boolean :is_discrete
- t.integer :executions_count
- t.text :job_class
- end
- end
-end
diff --git a/db/migrate/20240123151251_create_good_jobs_error_event.rb b/db/migrate/20240123151251_create_good_jobs_error_event.rb
deleted file mode 100644
index b07e0f14e7f1..000000000000
--- a/db/migrate/20240123151251_create_good_jobs_error_event.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGoodJobsErrorEvent < ActiveRecord::Migration[7.0]
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.column_exists?(:good_jobs, :error_event)
- end
- end
-
- add_column :good_jobs, :error_event, :integer, limit: 2
- add_column :good_job_executions, :error_event, :integer, limit: 2
- end
-end
diff --git a/db/migrate/20240123151252_recreate_good_job_cron_indexes_with_conditional.rb b/db/migrate/20240123151252_recreate_good_job_cron_indexes_with_conditional.rb
deleted file mode 100644
index aff2d4eae9a8..000000000000
--- a/db/migrate/20240123151252_recreate_good_job_cron_indexes_with_conditional.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-class RecreateGoodJobCronIndexesWithConditional < ActiveRecord::Migration[7.0]
- disable_ddl_transaction!
-
- def change
- reversible do |dir|
- dir.up do
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_created_at_cond)
- add_index :good_jobs, [:cron_key, :created_at], where: "(cron_key IS NOT NULL)",
- name: :index_good_jobs_on_cron_key_and_created_at_cond, algorithm: :concurrently
- end
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_cron_at_cond)
- add_index :good_jobs, [:cron_key, :cron_at], where: "(cron_key IS NOT NULL)", unique: true,
- name: :index_good_jobs_on_cron_key_and_cron_at_cond, algorithm: :concurrently
- end
-
- if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_created_at)
- remove_index :good_jobs, name: :index_good_jobs_on_cron_key_and_created_at
- end
- if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_cron_at)
- remove_index :good_jobs, name: :index_good_jobs_on_cron_key_and_cron_at
- end
- end
-
- dir.down do
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_created_at)
- add_index :good_jobs, [:cron_key, :created_at],
- name: :index_good_jobs_on_cron_key_and_created_at, algorithm: :concurrently
- end
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_cron_at)
- add_index :good_jobs, [:cron_key, :cron_at], unique: true,
- name: :index_good_jobs_on_cron_key_and_cron_at, algorithm: :concurrently
- end
-
- if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_created_at_cond)
- remove_index :good_jobs, name: :index_good_jobs_on_cron_key_and_created_at_cond
- end
- if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_cron_at_cond)
- remove_index :good_jobs, name: :index_good_jobs_on_cron_key_and_cron_at_cond
- end
- end
- end
- end
-end
diff --git a/db/migrate/20240131130149_enable_gantt_module_for_all_projects.rb b/db/migrate/20240131130149_enable_gantt_module_for_all_projects.rb
index ef7c1484219d..ef5951220d64 100644
--- a/db/migrate/20240131130149_enable_gantt_module_for_all_projects.rb
+++ b/db/migrate/20240131130149_enable_gantt_module_for_all_projects.rb
@@ -1,4 +1,4 @@
-require_relative "migration_utils/utils"
+require_relative 'migration_utils/utils'
class EnableGanttModuleForAllProjects < ActiveRecord::Migration[7.0]
include ::Migration::Utils
diff --git a/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
index 80ce0a01129c..53dc268ee379 100644
--- a/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
+++ b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
@@ -1,7 +1,7 @@
class AddGanttModuleToDefaultModules < ActiveRecord::Migration[7.0]
def up
- unless Setting.default_projects_modules.include?("gantt")
- Setting.default_projects_modules = Setting.default_projects_modules + ["gantt"]
+ unless Setting.default_projects_modules.include?('gantt')
+ Setting.default_projects_modules = Setting.default_projects_modules + ['gantt']
end
end
diff --git a/db/migrate/20240206085104_remove_enums.rb b/db/migrate/20240206085104_remove_enums.rb
index c89706010449..a991f7b1c522 100644
--- a/db/migrate/20240206085104_remove_enums.rb
+++ b/db/migrate/20240206085104_remove_enums.rb
@@ -1,24 +1,24 @@
class RemoveEnums < ActiveRecord::Migration[7.1]
def up
- change_column(:storages, :health_status, :string, default: "pending")
+ change_column(:storages, :health_status, :string, default: 'pending')
add_check_constraint(:storages,
- "health_status IN ('pending', 'healthy', 'unhealthy')",
- name: "storages_health_status_check")
+ 'health_status IN (\'pending\', \'healthy\', \'unhealthy\')',
+ name: 'storages_health_status_check')
- change_column(:last_project_folders, :mode, :string, default: "inactive")
+ change_column(:last_project_folders, :mode, :string, default: 'inactive')
add_check_constraint(:last_project_folders,
- "mode IN ('inactive', 'manual', 'automatic')",
- name: "last_project_folders_mode_check")
+ 'mode IN (\'inactive\', \'manual\', \'automatic\')',
+ name: 'last_project_folders_mode_check')
change_column(:project_storages, :project_folder_mode, :string)
add_check_constraint(:project_storages,
- "project_folder_mode IN ('inactive', 'manual', 'automatic')",
- name: "project_storages_project_folder_mode_check")
+ 'project_folder_mode IN (\'inactive\', \'manual\', \'automatic\')',
+ name: 'project_storages_project_folder_mode_check')
- change_column(:delayed_job_statuses, :status, :string, default: "in_queue")
+ change_column(:delayed_job_statuses, :status, :string, default: 'in_queue')
add_check_constraint(:delayed_job_statuses,
- "status IS NULL OR status IN ('in_queue', 'error', 'in_process', 'success', 'failure', 'cancelled')",
- name: "delayed_job_statuses_status_check")
+ 'status IS NULL OR status IN (\'in_queue\', \'error\', \'in_process\', \'success\', \'failure\', \'cancelled\')',
+ name: 'delayed_job_statuses_status_check')
execute <<~SQL.squish
DROP TYPE delayed_job_status RESTRICT;
@@ -51,23 +51,23 @@ def down
);
SQL
- remove_check_constraint(:storages, name: "storages_health_status_check")
+ remove_check_constraint(:storages, name: 'storages_health_status_check')
change_column(:storages, :health_status, :storage_health_statuses, default: nil,
- using: "health_status::storage_health_statuses")
+ using: 'health_status::storage_health_statuses')
- remove_check_constraint(:last_project_folders, name: "last_project_folders_mode_check")
+ remove_check_constraint(:last_project_folders, name: 'last_project_folders_mode_check')
- change_column_default(:storages, :health_status, "pending")
+ change_column_default(:storages, :health_status, 'pending')
- change_column(:last_project_folders, :mode, :project_folder_modes, default: nil, using: "mode::project_folder_modes")
- change_column_default(:last_project_folders, :mode, "inactive")
+ change_column(:last_project_folders, :mode, :project_folder_modes, default: nil, using: 'mode::project_folder_modes')
+ change_column_default(:last_project_folders, :mode, 'inactive')
- remove_check_constraint(:project_storages, name: "project_storages_project_folder_mode_check")
+ remove_check_constraint(:project_storages, name: 'project_storages_project_folder_mode_check')
change_column(:project_storages, :project_folder_mode, :project_folder_modes, default: nil,
- using: "project_folder_mode::project_folder_modes")
+ using: 'project_folder_mode::project_folder_modes')
- remove_check_constraint(:delayed_job_statuses, name: "delayed_job_statuses_status_check")
- change_column(:delayed_job_statuses, :status, :delayed_job_status, default: nil, using: "status::delayed_job_status")
- change_column_default(:delayed_job_statuses, :status, "in_queue")
+ remove_check_constraint(:delayed_job_statuses, name: 'delayed_job_statuses_status_check')
+ change_column(:delayed_job_statuses, :status, :delayed_job_status, default: nil, using: 'status::delayed_job_status')
+ change_column_default(:delayed_job_statuses, :status, 'in_queue')
end
end
diff --git a/db/migrate/20240206173841_fix_untranslated_work_package_roles.rb b/db/migrate/20240206173841_fix_untranslated_work_package_roles.rb
index 5e4856811558..b6d119b1c1d7 100644
--- a/db/migrate/20240206173841_fix_untranslated_work_package_roles.rb
+++ b/db/migrate/20240206173841_fix_untranslated_work_package_roles.rb
@@ -7,7 +7,7 @@ def up
end
def seed_work_package_roles_data
- seed_data = RootSeeder.new.translated_seed_data_for("work_package_roles", "modules_permissions")
+ seed_data = RootSeeder.new.translated_seed_data_for('work_package_roles', 'modules_permissions')
seeder = BasicData::WorkPackageRoleSeeder.new(seed_data)
seeder.mapped_models_data
end
diff --git a/db/migrate/20240227154544_remove_delayed_jobs.rb b/db/migrate/20240227154544_remove_delayed_jobs.rb
deleted file mode 100644
index cc47c1c9d066..000000000000
--- a/db/migrate/20240227154544_remove_delayed_jobs.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2024 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
-class RemoveDelayedJobs < ActiveRecord::Migration[7.1]
- # it is needed, because ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper
- # can not be used without required delayed_job
- # See https://github.com/rails/rails/blob/6f0d1ad14b92b9f5906e44740fce8b4f1c7075dc/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb
- class JobWrapperDeserializationMock
- attr_accessor :job_data
-
- def initialize(job_data)
- @job_data = job_data
- end
- end
-
- def change
- reversible do |direction|
- direction.up do
- tuples = execute <<~SQL
- select * from delayed_jobs
- where locked_by is null -- not in progress
- and handler NOT LIKE '%job_class: Storages::ManageNextcloudIntegrationEventsJob%' -- no need to migrate. It will be run later with cron.
- and cron is null -- not cron schedule
- FOR UPDATE; -- to prevent potentialy running delayed_job process working on these jobs(delayed_job uses SELECT FOR UPDATE to get workable jobs)
- SQL
- tuples.each do |tuple|
- handler = tuple["handler"].gsub("ruby/object:ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper",
- "ruby/object:#{RemoveDelayedJobs::JobWrapperDeserializationMock.name}")
- job_data = YAML.load(handler, permitted_classes: [RemoveDelayedJobs::JobWrapperDeserializationMock])
- .job_data
- new_uuid = SecureRandom.uuid
- good_job_record = GoodJob::BaseExecution.new
- good_job_record.id = new_uuid
- good_job_record.serialized_params = job_data
- good_job_record.serialized_params["job_id"] = new_uuid
- good_job_record.queue_name = job_data["queue_name"]
- good_job_record.priority = job_data["priority"]
- good_job_record.scheduled_at = job_data["scheduled_at"]
- good_job_record.active_job_id = new_uuid
- good_job_record.concurrency_key = nil
- good_job_record.job_class = job_data["job_class"]
- good_job_record.save!
- end
- end
- direction.down {}
- end
-
- drop_table :delayed_jobs do |t|
- t.integer :priority, default: 0
- t.integer :attempts, default: 0
- t.text :handler
- t.text :last_error
- t.datetime :run_at
- t.datetime :locked_at
- t.datetime :failed_at
- t.string :locked_by
- t.timestamps null: true
- t.string :queue
- t.string :cron
-
- t.index %i[priority run_at], name: "delayed_jobs_priority"
- end
- end
-end
diff --git a/db/migrate/20240306083241_change_default_value_of_alternative_color.rb b/db/migrate/20240306083241_change_default_value_of_alternative_color.rb
index 5b6c6a90bcec..118de5da5488 100644
--- a/db/migrate/20240306083241_change_default_value_of_alternative_color.rb
+++ b/db/migrate/20240306083241_change_default_value_of_alternative_color.rb
@@ -1,17 +1,17 @@
class ChangeDefaultValueOfAlternativeColor < ActiveRecord::Migration[7.1]
class MigrationDesignColor < ApplicationRecord
- self.table_name = "design_colors"
+ self.table_name = 'design_colors'
end
def up
- alternative_color = MigrationDesignColor.find_by(variable: "alternative-color")
+ alternative_color = MigrationDesignColor.find_by(variable: 'alternative-color')
if alternative_color&.hexcode == OpenProject::CustomStyles::ColorThemes::DEPRECATED_ALTERNATIVE_COLOR
alternative_color.update(hexcode: OpenProject::CustomStyles::ColorThemes::PRIMER_PRIMARY_BUTTON_COLOR)
end
end
def down
- alternative_color = MigrationDesignColor.find_by(variable: "alternative-color")
+ alternative_color = MigrationDesignColor.find_by(variable: 'alternative-color')
if alternative_color&.hexcode == OpenProject::CustomStyles::ColorThemes::PRIMER_PRIMARY_BUTTON_COLOR
alternative_color.update(hexcode: OpenProject::CustomStyles::ColorThemes::DEPRECATED_ALTERNATIVE_COLOR)
end
diff --git a/db/migrate/20240306154734_create_good_job_labels.rb b/db/migrate/20240306154734_create_good_job_labels.rb
deleted file mode 100644
index 48e9770eedb4..000000000000
--- a/db/migrate/20240306154734_create_good_job_labels.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2024 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
-class CreateGoodJobLabels < ActiveRecord::Migration[7.1]
- def change
- reversible do |dir|
- dir.up do
- # Ensure this incremental update migration is idempotent
- # with monolithic install migration.
- return if connection.column_exists?(:good_jobs, :labels)
- end
- end
-
- add_column :good_jobs, :labels, :text, array: true
- end
-end
diff --git a/db/migrate/20240307102541_reduce_configurable_design_variables.rb b/db/migrate/20240307102541_reduce_configurable_design_variables.rb
deleted file mode 100644
index bf0ac9a36aed..000000000000
--- a/db/migrate/20240307102541_reduce_configurable_design_variables.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class ReduceConfigurableDesignVariables < ActiveRecord::Migration[7.1]
- class MigrationDesignColor < ApplicationRecord
- self.table_name = "design_colors"
- end
-
- def up
- # Delete "primary-color" and "primary-color-dark"
- MigrationDesignColor
- .where(variable: %w(primary-color primary-color-dark))
- .delete_all
-
- # Rename "alternative-color" to "primary-button-color"
- MigrationDesignColor
- .where(variable: "alternative-color")
- .update(variable: "primary-button-color")
-
- # Rename "content-link-color" to "accent-color"
- MigrationDesignColor
- .where(variable: "content-link-color")
- .update(variable: "accent-color")
- end
-
- def down
- MigrationDesignColor
- .create(variable: "primary-color", hexcode: OpenProject::CustomStyles::ColorThemes::DEPRECATED_PRIMARY_COLOR)
- MigrationDesignColor
- .create(variable: "primary-color-dark", hexcode: OpenProject::CustomStyles::ColorThemes::DEPRECATED_PRIMARY_DARK_COLOR)
-
- MigrationDesignColor
- .where(variable: "primary-button-color")
- .update(variable: "alternative-color")
-
- MigrationDesignColor
- .where(variable: "accent-color")
- .update(variable: "content-link-color")
- end
-end
diff --git a/db/migrate/20240307190126_rename_portuguese_locale.rb b/db/migrate/20240307190126_rename_portuguese_locale.rb
index 32fed764f80b..4dd89c474ec4 100644
--- a/db/migrate/20240307190126_rename_portuguese_locale.rb
+++ b/db/migrate/20240307190126_rename_portuguese_locale.rb
@@ -2,13 +2,13 @@ class RenamePortugueseLocale < ActiveRecord::Migration[7.1]
def up
execute "UPDATE users SET language = 'pt-BR' WHERE language = 'pt'"
execute "UPDATE settings SET value = 'pt-BR' WHERE name = 'default_language' AND value = 'pt'"
- modify_available_languages!("pt", "pt-BR")
+ modify_available_languages!('pt', 'pt-BR')
end
def down
execute "UPDATE users SET language = 'pt' WHERE language = 'pt-BR'"
execute "UPDATE settings SET value = 'pt' WHERE name = 'default_language' AND value = 'pt-BR'"
- modify_available_languages!("pt-BR", "pt")
+ modify_available_languages!('pt-BR', 'pt')
end
private
diff --git a/db/migrate/20240311111957_enable_unaccent_extension.rb b/db/migrate/20240311111957_enable_unaccent_extension.rb
deleted file mode 100644
index cec572b5918b..000000000000
--- a/db/migrate/20240311111957_enable_unaccent_extension.rb
+++ /dev/null
@@ -1,47 +0,0 @@
- #-- copyright
- # OpenProject is an open source project management software.
- # Copyright (C) 2012-2024 the OpenProject GmbH
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License version 3.
- #
- # OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
- # Copyright (C) 2006-2013 Jean-Philippe Lang
- # Copyright (C) 2010-2013 the ChiliProject Team
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- # See COPYRIGHT and LICENSE files for more details.
- #++
-
- class EnableUnaccentExtension < ActiveRecord::Migration[7.1]
- def up
- ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA pg_catalog;")
- rescue StandardError => e
- raise unless e.message.include?("unaccent")
-
- raise <<~MESSAGE
- \e[33mWARNING:\e[0m Could not find or enable the `unaccent` extension for PostgreSQL.
- This is needed for filtering users with accents, please install the postgresql-contrib module
- for your PostgreSQL installation and re-run this migration.
-
- Read more about the contrib module at `https://www.postgresql.org/docs/current/contrib.html`.
- MESSAGE
- end
-
- def down
- ActiveRecord::Base.connection.execute("DROP EXTENSION IF EXISTS unaccent CASCADE;")
- end
- end
diff --git a/db/migrate/aggregated/base.rb b/db/migrate/aggregated/base.rb
index 372f3f333da6..aad20d12c193 100644
--- a/db/migrate/aggregated/base.rb
+++ b/db/migrate/aggregated/base.rb
@@ -35,7 +35,7 @@ def self.migrations
def self.normalized_migrations
migrations.split.map do |m|
- m.gsub(/_.*\z/, "").to_i
+ m.gsub(/_.*\z/, '').to_i
end
end
end
diff --git a/db/migrate/aggregated/to_3_0.rb b/db/migrate/aggregated/to_3_0.rb
index 860a5b544682..efbb459c3ced 100644
--- a/db/migrate/aggregated/to_3_0.rb
+++ b/db/migrate/aggregated/to_3_0.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
# rubocop:disable Naming/ClassAndModuleCamelCase
class Aggregated::To_3_0 < Aggregated::Base
diff --git a/db/migrate/aggregated/to_7_1.rb b/db/migrate/aggregated/to_7_1.rb
index 9af58c14063a..fc0607a9a8f1 100644
--- a/db/migrate/aggregated/to_7_1.rb
+++ b/db/migrate/aggregated/to_7_1.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
# rubocop:disable Naming/ClassAndModuleCamelCase
class Aggregated::To_7_1 < Aggregated::Base
diff --git a/db/migrate/migration_utils/migration_squasher.rb b/db/migrate/migration_utils/migration_squasher.rb
index 23d0dd5eae83..29e9d7751ccb 100644
--- a/db/migrate/migration_utils/migration_squasher.rb
+++ b/db/migrate/migration_utils/migration_squasher.rb
@@ -49,7 +49,7 @@ def squash(aggregated_versions)
# All migrations that this migration aggregates have already
# been applied. In this case, remove the information about those
# migrations from the schema_migrations table and we're done.
- ActiveRecord::Base.connection.execute <<-SQL + (intersection.map { |version| <<-CONDITIONS }).join(" OR ")
+ ActiveRecord::Base.connection.execute <<-SQL + (intersection.map { |version| <<-CONDITIONS }).join(' OR ')
DELETE FROM
#{quoted_schema_migrations_table_name}
WHERE
@@ -63,7 +63,7 @@ def squash(aggregated_versions)
# Only a part of the migrations that this migration aggregates
# have already been applied. In this case, fail miserably.
- raise IncompleteMigrationsError, <<-MESSAGE.split("\n").map(&:strip!).join(" ") + "\n"
+ raise IncompleteMigrationsError, <<-MESSAGE.split("\n").map(&:strip!).join(' ') + "\n"
It appears you are migrating from an incompatible version.
Your database has only some migrations to be squashed.
Please update your installation to a version including all the
@@ -78,7 +78,7 @@ def squash(aggregated_versions)
def all_versions
table = Arel::Table.new(schema_migrations_table_name)
- ActiveRecord::Base.connection.select_values(table.project(table["version"]))
+ ActiveRecord::Base.connection.select_values(table.project(table['version']))
end
def schema_migrations_table_name
@@ -90,7 +90,7 @@ def quoted_schema_migrations_table_name
end
def quoted_version_column_name
- ActiveRecord::Base.connection.quote_table_name("version")
+ ActiveRecord::Base.connection.quote_table_name('version')
end
def version_column_for_comparison
diff --git a/db/migrate/migration_utils/module_renamer.rb b/db/migrate/migration_utils/module_renamer.rb
index 81ce589fbb4f..1fa3874579cf 100644
--- a/db/migrate/migration_utils/module_renamer.rb
+++ b/db/migrate/migration_utils/module_renamer.rb
@@ -58,7 +58,7 @@ def remove_from_enabled(modules)
def add_to_default(new_modules, old_modules)
# avoid creating the settings implicitly on new installations
- setting = Setting.find_by(name: "default_projects_modules")
+ setting = Setting.find_by(name: 'default_projects_modules')
return unless setting
@@ -80,7 +80,7 @@ def execute(string)
end
def comma_separated_strings(array)
- Array(array).map { |i| "'#{i}'" }.join(", ")
+ Array(array).map { |i| "'#{i}'" }.join(', ')
end
end
end
diff --git a/db/migrate/migration_utils/setting_renamer.rb b/db/migrate/migration_utils/setting_renamer.rb
index 0b34f82a2c89..88c93f6af2ab 100644
--- a/db/migrate/migration_utils/setting_renamer.rb
+++ b/db/migrate/migration_utils/setting_renamer.rb
@@ -41,7 +41,7 @@ def rename(source_name, target_name)
private
def settings_table
- @settings_table ||= ActiveRecord::Base.connection.quote_table_name("settings")
+ @settings_table ||= ActiveRecord::Base.connection.quote_table_name('settings')
end
def quote_value(s)
diff --git a/db/migrate/migration_utils/typed_dag.rb b/db/migrate/migration_utils/typed_dag.rb
index df06bfbeb3ff..74b5b4ae89a0 100644
--- a/db/migrate/migration_utils/typed_dag.rb
+++ b/db/migrate/migration_utils/typed_dag.rb
@@ -26,26 +26,26 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require "typed_dag"
+require 'typed_dag'
module Migration
module MigrationUtils
module TypedDag
# rubocop:disable Rails/ApplicationRecord
class WorkPackage < ActiveRecord::Base
- self.table_name = "work_packages"
+ self.table_name = 'work_packages'
end
class Relation < ActiveRecord::Base
- self.table_name = "relations"
+ self.table_name = 'relations'
end
# rubocop:enable Rails/ApplicationRecord
def self.configure
- ::TypedDag::Configuration.set node_class_name: "Migration::MigrationUtils::TypedDag::WorkPackage",
- edge_class_name: "Migration::MigrationUtils::TypedDag::Relation",
- ancestor_column: "from_id",
- descendant_column: "to_id",
+ ::TypedDag::Configuration.set node_class_name: 'Migration::MigrationUtils::TypedDag::WorkPackage',
+ edge_class_name: 'Migration::MigrationUtils::TypedDag::Relation',
+ ancestor_column: 'from_id',
+ descendant_column: 'to_id',
types: {
hierarchy: { from: { name: :parent, limit: 1 },
to: :children,
diff --git a/db/migrate/tables/announcements.rb b/db/migrate/tables/announcements.rb
index 9fbd0c0d4a16..600f277e2b02 100644
--- a/db/migrate/tables/announcements.rb
+++ b/db/migrate/tables/announcements.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Announcements < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/attachable_journals.rb b/db/migrate/tables/attachable_journals.rb
index 149e82549391..b74fbdbdc6ef 100644
--- a/db/migrate/tables/attachable_journals.rb
+++ b/db/migrate/tables/attachable_journals.rb
@@ -26,14 +26,14 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::AttachableJournals < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :journal_id, null: false
t.integer :attachment_id, null: false
- t.string :filename, default: "", null: false
+ t.string :filename, default: '', null: false
t.index :journal_id
t.index :attachment_id
diff --git a/db/migrate/tables/attachment_journals.rb b/db/migrate/tables/attachment_journals.rb
index cabc163bcd32..cd8fd11b0470 100644
--- a/db/migrate/tables/attachment_journals.rb
+++ b/db/migrate/tables/attachment_journals.rb
@@ -26,19 +26,19 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::AttachmentJournals < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :journal_id, null: false
t.integer :container_id, default: 0, null: false
- t.string :container_type, limit: 30, default: "", null: false
- t.string :filename, default: "", null: false
- t.string :disk_filename, default: "", null: false
+ t.string :container_type, limit: 30, default: '', null: false
+ t.string :filename, default: '', null: false
+ t.string :disk_filename, default: '', null: false
t.integer :filesize, default: 0, null: false
- t.string :content_type, default: ""
- t.string :digest, limit: 40, default: "", null: false
+ t.string :content_type, default: ''
+ t.string :digest, limit: 40, default: '', null: false
t.integer :downloads, default: 0, null: false
t.integer :author_id, default: 0, null: false
t.text :description
diff --git a/db/migrate/tables/attachments.rb b/db/migrate/tables/attachments.rb
index e15e068de949..db06f34153b1 100644
--- a/db/migrate/tables/attachments.rb
+++ b/db/migrate/tables/attachments.rb
@@ -26,27 +26,27 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Attachments < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :container_id, default: 0, null: false
- t.string :container_type, limit: 30, default: "", null: false
- t.string :filename, default: "", null: false
- t.string :disk_filename, default: "", null: false
+ t.string :container_type, limit: 30, default: '', null: false
+ t.string :filename, default: '', null: false
+ t.string :disk_filename, default: '', null: false
t.integer :filesize, default: 0, null: false
- t.string :content_type, default: ""
- t.string :digest, limit: 40, default: "", null: false
+ t.string :content_type, default: ''
+ t.string :digest, limit: 40, default: '', null: false
t.integer :downloads, default: 0, null: false
t.integer :author_id, default: 0, null: false
t.datetime :created_on
t.string :description
t.string :file
- t.index :author_id, name: "index_attachments_on_author_id"
- t.index %i[container_id container_type], name: "index_attachments_on_container_id_and_container_type"
- t.index :created_on, name: "index_attachments_on_created_on"
+ t.index :author_id, name: 'index_attachments_on_author_id'
+ t.index %i[container_id container_type], name: 'index_attachments_on_container_id_and_container_type'
+ t.index :created_on, name: 'index_attachments_on_created_on'
end
end
end
diff --git a/db/migrate/tables/auth_sources.rb b/db/migrate/tables/auth_sources.rb
index bc7bbc6b5251..a5e572e4b7d5 100644
--- a/db/migrate/tables/auth_sources.rb
+++ b/db/migrate/tables/auth_sources.rb
@@ -26,17 +26,17 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::AuthSources < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :type, limit: 30, default: "", null: false
- t.string :name, limit: 60, default: "", null: false
+ t.string :type, limit: 30, default: '', null: false
+ t.string :name, limit: 60, default: '', null: false
t.string :host, limit: 60
t.integer :port
t.string :account
- t.string :account_password, default: ""
+ t.string :account_password, default: ''
t.string :base_dn
t.string :attr_login, limit: 30
t.string :attr_firstname, limit: 30
@@ -46,7 +46,7 @@ def self.table(migration)
t.boolean :tls, default: false, null: false
t.string :attr_admin
- t.index %i[id type], name: "index_auth_sources_on_id_and_type"
+ t.index %i[id type], name: 'index_auth_sources_on_id_and_type'
end
end
end
diff --git a/db/migrate/tables/available_project_statuses.rb b/db/migrate/tables/available_project_statuses.rb
index 1852fc4558a8..250f6a2c07bc 100644
--- a/db/migrate/tables/available_project_statuses.rb
+++ b/db/migrate/tables/available_project_statuses.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::AvailableProjectStatuses < Tables::Base
def self.table(migration)
create_table migration do |t|
t.belongs_to :project_type, type: :int
- t.belongs_to :reported_project_status, type: :int, index: { name: "index_avail_project_statuses_on_rep_project_status_id" }
+ t.belongs_to :reported_project_status, type: :int, index: { name: 'index_avail_project_statuses_on_rep_project_status_id' }
t.timestamps null: true # compatibility to pre 5.1 migrations
end
diff --git a/db/migrate/tables/boards.rb b/db/migrate/tables/boards.rb
index 489bd29365b2..70a3e51dadb9 100644
--- a/db/migrate/tables/boards.rb
+++ b/db/migrate/tables/boards.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Boards < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id, null: false
- t.string :name, default: "", null: false
+ t.string :name, default: '', null: false
t.string :description
t.integer :position, default: 1
t.integer :topics_count, default: 0, null: false
diff --git a/db/migrate/tables/categories.rb b/db/migrate/tables/categories.rb
index e45d4801cb63..b941b68f4d35 100644
--- a/db/migrate/tables/categories.rb
+++ b/db/migrate/tables/categories.rb
@@ -26,17 +26,17 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Categories < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id, default: 0, null: false
- t.string :name, limit: 256, null: false, default: ""
+ t.string :name, limit: 256, null: false, default: ''
t.integer :assigned_to_id
- t.index :assigned_to_id, name: "index_categories_on_assigned_to_id"
- t.index :project_id, name: "issue_categories_project_id"
+ t.index :assigned_to_id, name: 'index_categories_on_assigned_to_id'
+ t.index :project_id, name: 'issue_categories_project_id'
end
end
end
diff --git a/db/migrate/tables/changes.rb b/db/migrate/tables/changes.rb
index eb643c6a6392..ff2ad8103017 100644
--- a/db/migrate/tables/changes.rb
+++ b/db/migrate/tables/changes.rb
@@ -26,20 +26,20 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Changes < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :changeset_id, null: false
- t.string :action, limit: 1, default: "", null: false
+ t.string :action, limit: 1, default: '', null: false
t.text :path, null: false
t.text :from_path
t.string :from_revision
t.string :revision
t.string :branch
- t.index :changeset_id, name: "changesets_changeset_id"
+ t.index :changeset_id, name: 'changesets_changeset_id'
end
end
end
diff --git a/db/migrate/tables/changeset_journals.rb b/db/migrate/tables/changeset_journals.rb
index a9aa43acb0d1..92f17eb5654b 100644
--- a/db/migrate/tables/changeset_journals.rb
+++ b/db/migrate/tables/changeset_journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::ChangesetJournals < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/changesets.rb b/db/migrate/tables/changesets.rb
index 2d77b7dd0d37..105182316541 100644
--- a/db/migrate/tables/changesets.rb
+++ b/db/migrate/tables/changesets.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Changesets < Tables::Base
def self.table(migration)
@@ -40,11 +40,11 @@ def self.table(migration)
t.string :scmid
t.integer :user_id
- t.index :committed_on, name: "index_changesets_on_committed_on"
- t.index %i[repository_id revision], name: "changesets_repos_rev", unique: true
- t.index %i[repository_id scmid], name: "changesets_repos_scmid"
- t.index :repository_id, name: "index_changesets_on_repository_id"
- t.index :user_id, name: "index_changesets_on_user_id"
+ t.index :committed_on, name: 'index_changesets_on_committed_on'
+ t.index %i[repository_id revision], name: 'changesets_repos_rev', unique: true
+ t.index %i[repository_id scmid], name: 'changesets_repos_scmid'
+ t.index :repository_id, name: 'index_changesets_on_repository_id'
+ t.index :user_id, name: 'index_changesets_on_user_id'
t.index %i[repository_id committed_on]
end
end
diff --git a/db/migrate/tables/changesets_work_packages.rb b/db/migrate/tables/changesets_work_packages.rb
index 17e348272194..eddc9c10865a 100644
--- a/db/migrate/tables/changesets_work_packages.rb
+++ b/db/migrate/tables/changesets_work_packages.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::ChangesetsWorkPackages < Tables::Base
def self.id_options
diff --git a/db/migrate/tables/comments.rb b/db/migrate/tables/comments.rb
index 59c19f4c5638..2af97f861f88 100644
--- a/db/migrate/tables/comments.rb
+++ b/db/migrate/tables/comments.rb
@@ -26,20 +26,20 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Comments < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :commented_type, limit: 30, default: "", null: false
+ t.string :commented_type, limit: 30, default: '', null: false
t.integer :commented_id, default: 0, null: false
t.integer :author_id, default: 0, null: false
t.text :comments
t.datetime :created_on, null: false
t.datetime :updated_on, null: false
- t.index :author_id, name: "index_comments_on_author_id"
- t.index %i[commented_id commented_type], name: "index_comments_on_commented_id_and_commented_type"
+ t.index :author_id, name: 'index_comments_on_author_id'
+ t.index %i[commented_id commented_type], name: 'index_comments_on_commented_id_and_commented_type'
end
end
end
diff --git a/db/migrate/tables/custom_fields.rb b/db/migrate/tables/custom_fields.rb
index 89181272876c..152acee355bd 100644
--- a/db/migrate/tables/custom_fields.rb
+++ b/db/migrate/tables/custom_fields.rb
@@ -26,15 +26,15 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomFields < Tables::Base
# rubocop:disable Metrics/AbcSize
def self.table(migration)
create_table migration do |t|
- t.string :type, limit: 30, default: "", null: false
- t.string :field_format, limit: 30, default: "", null: false
- t.string :regexp, default: ""
+ t.string :type, limit: 30, default: '', null: false
+ t.string :field_format, limit: 30, default: '', null: false
+ t.string :regexp, default: ''
t.integer :min_length, default: 0, null: false
t.integer :max_length, default: 0, null: false
t.boolean :is_required, default: false, null: false
@@ -50,7 +50,7 @@ def self.table(migration)
t.datetime :created_at
t.datetime :updated_at
- t.index %i[id type], name: "index_custom_fields_on_id_and_type"
+ t.index %i[id type], name: 'index_custom_fields_on_id_and_type'
end
end
# rubocop:enable Metrics/AbcSize
diff --git a/db/migrate/tables/custom_fields_projects.rb b/db/migrate/tables/custom_fields_projects.rb
index 6272c782db30..6259d895b5b4 100644
--- a/db/migrate/tables/custom_fields_projects.rb
+++ b/db/migrate/tables/custom_fields_projects.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomFieldsProjects < Tables::Base
def self.id_options
@@ -39,7 +39,7 @@ def self.table(migration)
t.integer :project_id, default: 0, null: false
t.index %i[custom_field_id project_id],
- name: "index_custom_fields_projects_on_custom_field_id_and_project_id"
+ name: 'index_custom_fields_projects_on_custom_field_id_and_project_id'
end
end
end
diff --git a/db/migrate/tables/custom_fields_types.rb b/db/migrate/tables/custom_fields_types.rb
index 76ac44f248c5..ccc225ec44fd 100644
--- a/db/migrate/tables/custom_fields_types.rb
+++ b/db/migrate/tables/custom_fields_types.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomFieldsTypes < Tables::Base
def self.id_options
diff --git a/db/migrate/tables/custom_options.rb b/db/migrate/tables/custom_options.rb
index 50f3be270f56..502b05c6d700 100644
--- a/db/migrate/tables/custom_options.rb
+++ b/db/migrate/tables/custom_options.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomOptions < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/custom_styles.rb b/db/migrate/tables/custom_styles.rb
index c0991d813f21..a6e176a8a0d6 100644
--- a/db/migrate/tables/custom_styles.rb
+++ b/db/migrate/tables/custom_styles.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomStyles < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/custom_values.rb b/db/migrate/tables/custom_values.rb
index 5aceedc1ffe7..e9c08d0311d0 100644
--- a/db/migrate/tables/custom_values.rb
+++ b/db/migrate/tables/custom_values.rb
@@ -26,18 +26,18 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomValues < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :customized_type, limit: 30, default: "", null: false
+ t.string :customized_type, limit: 30, default: '', null: false
t.integer :customized_id, default: 0, null: false
t.integer :custom_field_id, default: 0, null: false
t.text :value
- t.index :custom_field_id, name: "index_custom_values_on_custom_field_id"
- t.index %i[customized_type customized_id], name: "custom_values_customized"
+ t.index :custom_field_id, name: 'index_custom_values_on_custom_field_id'
+ t.index %i[customized_type customized_id], name: 'custom_values_customized'
end
end
end
diff --git a/db/migrate/tables/customizable_journals_table.rb b/db/migrate/tables/customizable_journals_table.rb
index ad58c5531d17..4d9cee2d72aa 100644
--- a/db/migrate/tables/customizable_journals_table.rb
+++ b/db/migrate/tables/customizable_journals_table.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::CustomizableJournals < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/delayed_jobs.rb b/db/migrate/tables/delayed_jobs.rb
index 9448acf567f9..08520082054f 100644
--- a/db/migrate/tables/delayed_jobs.rb
+++ b/db/migrate/tables/delayed_jobs.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::DelayedJobs < Tables::Base
def self.table(migration)
@@ -42,7 +42,7 @@ def self.table(migration)
t.timestamps null: true
t.string :queue
- t.index %i[priority run_at], name: "delayed_jobs_priority"
+ t.index %i[priority run_at], name: 'delayed_jobs_priority'
end
end
end
diff --git a/db/migrate/tables/design_colors.rb b/db/migrate/tables/design_colors.rb
index ac0a1384d6d0..8e0f747c4832 100644
--- a/db/migrate/tables/design_colors.rb
+++ b/db/migrate/tables/design_colors.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::DesignColors < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/enabled_modules.rb b/db/migrate/tables/enabled_modules.rb
index 45e73111375f..e6b2585dc4f0 100644
--- a/db/migrate/tables/enabled_modules.rb
+++ b/db/migrate/tables/enabled_modules.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::EnabledModules < Tables::Base
def self.table(migration)
@@ -34,7 +34,7 @@ def self.table(migration)
t.integer :project_id
t.string :name, null: false
- t.index :project_id, name: "enabled_modules_project_id"
+ t.index :project_id, name: 'enabled_modules_project_id'
t.index :name, length: 8
end
end
diff --git a/db/migrate/tables/enterprise_tokens.rb b/db/migrate/tables/enterprise_tokens.rb
index 5302a47b679e..e7dc71db2384 100644
--- a/db/migrate/tables/enterprise_tokens.rb
+++ b/db/migrate/tables/enterprise_tokens.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::EnterpriseTokens < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/enumerations.rb b/db/migrate/tables/enumerations.rb
index 99cf7bc02ed9..7f03c65358b9 100644
--- a/db/migrate/tables/enumerations.rb
+++ b/db/migrate/tables/enumerations.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Enumerations < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :name, limit: 30, default: "", null: false
+ t.string :name, limit: 30, default: '', null: false
t.integer :position, default: 1
t.boolean :is_default, default: false, null: false
t.string :type
@@ -39,8 +39,8 @@ def self.table(migration)
t.integer :project_id
t.integer :parent_id
- t.index %i[id type], name: "index_enumerations_on_id_and_type"
- t.index :project_id, name: "index_enumerations_on_project_id"
+ t.index %i[id type], name: 'index_enumerations_on_id_and_type'
+ t.index :project_id, name: 'index_enumerations_on_project_id'
end
end
end
diff --git a/db/migrate/tables/forums.rb b/db/migrate/tables/forums.rb
index 18260a7002f6..8b1da2a8d7ce 100644
--- a/db/migrate/tables/forums.rb
+++ b/db/migrate/tables/forums.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
-require_relative "boards"
+require_relative 'base'
+require_relative 'boards'
class Tables::Forums < Tables::Boards
end
diff --git a/db/migrate/tables/group_users.rb b/db/migrate/tables/group_users.rb
index f0339ab48ed5..12b8d56ca203 100644
--- a/db/migrate/tables/group_users.rb
+++ b/db/migrate/tables/group_users.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::GroupUsers < Tables::Base
def self.id_options
diff --git a/db/migrate/tables/journals.rb b/db/migrate/tables/journals.rb
index c189d64e3139..0cdfefb7107e 100644
--- a/db/migrate/tables/journals.rb
+++ b/db/migrate/tables/journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Journals < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/member_roles.rb b/db/migrate/tables/member_roles.rb
index 69bb318b6512..1242f3e3a5c9 100644
--- a/db/migrate/tables/member_roles.rb
+++ b/db/migrate/tables/member_roles.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::MemberRoles < Tables::Base
def self.table(migration)
@@ -35,8 +35,8 @@ def self.table(migration)
t.integer :role_id, null: false
t.integer :inherited_from
- t.index :member_id, name: "index_member_roles_on_member_id"
- t.index :role_id, name: "index_member_roles_on_role_id"
+ t.index :member_id, name: 'index_member_roles_on_member_id'
+ t.index :role_id, name: 'index_member_roles_on_role_id'
t.index :inherited_from
end
end
diff --git a/db/migrate/tables/members.rb b/db/migrate/tables/members.rb
index a265ff15bc35..e8e41b8e1084 100644
--- a/db/migrate/tables/members.rb
+++ b/db/migrate/tables/members.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Members < Tables::Base
def self.table(migration)
@@ -36,9 +36,9 @@ def self.table(migration)
t.datetime :created_on
t.boolean :mail_notification, default: false, null: false
- t.index :project_id, name: "index_members_on_project_id"
- t.index %i[user_id project_id], name: "index_members_on_user_id_and_project_id", unique: true
- t.index :user_id, name: "index_members_on_user_id"
+ t.index :project_id, name: 'index_members_on_project_id'
+ t.index %i[user_id project_id], name: 'index_members_on_user_id_and_project_id', unique: true
+ t.index :user_id, name: 'index_members_on_user_id'
end
end
end
diff --git a/db/migrate/tables/menu_items.rb b/db/migrate/tables/menu_items.rb
index 565756559471..65b385749504 100644
--- a/db/migrate/tables/menu_items.rb
+++ b/db/migrate/tables/menu_items.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::MenuItems < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/message_journals.rb b/db/migrate/tables/message_journals.rb
index 3359b4e3250d..7f5aaffaa522 100644
--- a/db/migrate/tables/message_journals.rb
+++ b/db/migrate/tables/message_journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::MessageJournals < Tables::Base
def self.table(migration)
@@ -34,7 +34,7 @@ def self.table(migration)
t.integer :journal_id, null: false
t.integer :board_id, null: false
t.integer :parent_id
- t.string :subject, default: "", null: false
+ t.string :subject, default: '', null: false
t.text :content
t.integer :author_id
t.integer :replies_count, default: 0, null: false
diff --git a/db/migrate/tables/messages.rb b/db/migrate/tables/messages.rb
index 8bccf557a09a..1ccd345af5d4 100644
--- a/db/migrate/tables/messages.rb
+++ b/db/migrate/tables/messages.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Messages < Tables::Base
# rubocop:disable Metrics/AbcSize
@@ -34,7 +34,7 @@ def self.table(migration)
create_table migration do |t|
t.integer :board_id, null: false
t.integer :parent_id
- t.string :subject, default: "", null: false
+ t.string :subject, default: '', null: false
t.text :content
t.integer :author_id
t.integer :replies_count, default: 0, null: false
@@ -45,11 +45,11 @@ def self.table(migration)
t.integer :sticky, default: 0
t.datetime :sticked_on, default: nil, null: true
- t.index :author_id, name: "index_messages_on_author_id"
- t.index :board_id, name: "messages_board_id"
- t.index :created_on, name: "index_messages_on_created_on"
- t.index :last_reply_id, name: "index_messages_on_last_reply_id"
- t.index :parent_id, name: "messages_parent_id"
+ t.index :author_id, name: 'index_messages_on_author_id'
+ t.index :board_id, name: 'messages_board_id'
+ t.index :created_on, name: 'index_messages_on_created_on'
+ t.index :last_reply_id, name: 'index_messages_on_last_reply_id'
+ t.index :parent_id, name: 'messages_parent_id'
t.index %i[board_id updated_on]
end
end
diff --git a/db/migrate/tables/news.rb b/db/migrate/tables/news.rb
index e68cfb880a80..f37d95cd05fa 100644
--- a/db/migrate/tables/news.rb
+++ b/db/migrate/tables/news.rb
@@ -26,22 +26,22 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::News < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id
- t.string :title, limit: 60, default: "", null: false
- t.string :summary, default: ""
+ t.string :title, limit: 60, default: '', null: false
+ t.string :summary, default: ''
t.text :description
t.integer :author_id, default: 0, null: false
t.datetime :created_on
t.integer :comments_count, default: 0, null: false
- t.index :author_id, name: "index_news_on_author_id"
- t.index :created_on, name: "index_news_on_created_on"
- t.index :project_id, name: "news_project_id"
+ t.index :author_id, name: 'index_news_on_author_id'
+ t.index :created_on, name: 'index_news_on_created_on'
+ t.index :project_id, name: 'news_project_id'
t.index %i[project_id created_on]
end
end
diff --git a/db/migrate/tables/news_journals.rb b/db/migrate/tables/news_journals.rb
index 3be5d12b28c3..c9c04326ff0e 100644
--- a/db/migrate/tables/news_journals.rb
+++ b/db/migrate/tables/news_journals.rb
@@ -26,15 +26,15 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::NewsJournals < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :journal_id, null: false
t.integer :project_id
- t.string :title, limit: 60, default: "", null: false
- t.string :summary, default: ""
+ t.string :title, limit: 60, default: '', null: false
+ t.string :summary, default: ''
t.text :description
t.integer :author_id, default: 0, null: false
t.integer :comments_count, default: 0, null: false
diff --git a/db/migrate/tables/planning_element_type_colors.rb b/db/migrate/tables/planning_element_type_colors.rb
index 306c487ceba7..4fa4e6aedd48 100644
--- a/db/migrate/tables/planning_element_type_colors.rb
+++ b/db/migrate/tables/planning_element_type_colors.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::PlanningElementTypeColors < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/project_associations.rb b/db/migrate/tables/project_associations.rb
index 6f14db81a91d..b619e97b7bcc 100644
--- a/db/migrate/tables/project_associations.rb
+++ b/db/migrate/tables/project_associations.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::ProjectAssociations < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/project_types.rb b/db/migrate/tables/project_types.rb
index 19748a6ef8c8..433b6ca182cc 100644
--- a/db/migrate/tables/project_types.rb
+++ b/db/migrate/tables/project_types.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::ProjectTypes < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.column :name, :string, default: "", null: false
+ t.column :name, :string, default: '', null: false
t.column :allows_association, :boolean, default: true, null: false
t.column :position, :integer, default: 1, null: true
diff --git a/db/migrate/tables/projects.rb b/db/migrate/tables/projects.rb
index f224d2415180..c7e3806aabca 100644
--- a/db/migrate/tables/projects.rb
+++ b/db/migrate/tables/projects.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Projects < Tables::Base
# rubocop:disable Metrics/AbcSize
def self.table(migration)
create_table migration do |t|
- t.string :name, default: "", null: false
+ t.string :name, default: '', null: false
t.text :description
t.boolean :is_public, default: true, null: false
t.integer :parent_id
@@ -46,8 +46,8 @@ def self.table(migration)
t.belongs_to :responsible, type: :int
t.belongs_to :work_packages_responsible, type: :int
- t.index :lft, name: "index_projects_on_lft"
- t.index :rgt, name: "index_projects_on_rgt"
+ t.index :lft, name: 'index_projects_on_lft'
+ t.index :rgt, name: 'index_projects_on_rgt'
t.index :identifier
end
end
diff --git a/db/migrate/tables/projects_types.rb b/db/migrate/tables/projects_types.rb
index fbd42ecfed43..6b4e72f80c15 100644
--- a/db/migrate/tables/projects_types.rb
+++ b/db/migrate/tables/projects_types.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::ProjectsTypes < Tables::Base
def self.id_options
diff --git a/db/migrate/tables/queries.rb b/db/migrate/tables/queries.rb
index a9859081d05d..e58079d27692 100644
--- a/db/migrate/tables/queries.rb
+++ b/db/migrate/tables/queries.rb
@@ -26,13 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Queries < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id
- t.string :name, default: "", null: false
+ t.string :name, default: '', null: false
t.text :filters
t.integer :user_id, default: 0, null: false
t.boolean :is_public, default: false, null: false
@@ -44,8 +44,8 @@ def self.table(migration)
t.boolean :show_hierarchies, default: false
t.integer :timeline_zoom_level, default: 0
- t.index :project_id, name: "index_queries_on_project_id"
- t.index :user_id, name: "index_queries_on_user_id"
+ t.index :project_id, name: 'index_queries_on_project_id'
+ t.index :user_id, name: 'index_queries_on_user_id'
end
end
end
diff --git a/db/migrate/tables/relations.rb b/db/migrate/tables/relations.rb
index 8d5dfe56a3cb..042d2f848a34 100644
--- a/db/migrate/tables/relations.rb
+++ b/db/migrate/tables/relations.rb
@@ -26,19 +26,19 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Relations < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :from_id, null: false
t.integer :to_id, null: false
- t.string :relation_type, default: "", null: false
+ t.string :relation_type, default: '', null: false
t.integer :delay
t.text :description
- t.index :from_id, name: "index_relations_on_from_id"
- t.index :to_id, name: "index_relations_on_to_id"
+ t.index :from_id, name: 'index_relations_on_from_id'
+ t.index :to_id, name: 'index_relations_on_to_id'
end
end
end
diff --git a/db/migrate/tables/reportings.rb b/db/migrate/tables/reportings.rb
index 3edbe20a5d99..7545654bd7a9 100644
--- a/db/migrate/tables/reportings.rb
+++ b/db/migrate/tables/reportings.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Reportings < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/repositories.rb b/db/migrate/tables/repositories.rb
index da1be57acd04..d9751892d198 100644
--- a/db/migrate/tables/repositories.rb
+++ b/db/migrate/tables/repositories.rb
@@ -26,16 +26,16 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Repositories < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id, default: 0, null: false
- t.string :url, default: "", null: false
- t.string :login, limit: 60, default: ""
- t.string :password, default: ""
- t.string :root_url, default: ""
+ t.string :url, default: '', null: false
+ t.string :login, limit: 60, default: ''
+ t.string :password, default: ''
+ t.string :root_url, default: ''
t.string :type
t.string :path_encoding, limit: 64
t.string :log_encoding, limit: 64
@@ -43,7 +43,7 @@ def self.table(migration)
t.integer :required_storage_bytes, limit: 8, null: false, default: 0
t.datetime :storage_updated_at
- t.index :project_id, name: "index_repositories_on_project_id"
+ t.index :project_id, name: 'index_repositories_on_project_id'
end
end
end
diff --git a/db/migrate/tables/role_permissions.rb b/db/migrate/tables/role_permissions.rb
index 25b3bcce0da7..d8315ec7a0b7 100644
--- a/db/migrate/tables/role_permissions.rb
+++ b/db/migrate/tables/role_permissions.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::RolePermissions < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/roles.rb b/db/migrate/tables/roles.rb
index 2f5129c99f56..598103a6104f 100644
--- a/db/migrate/tables/roles.rb
+++ b/db/migrate/tables/roles.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Roles < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :name, limit: 30, default: "", null: false
+ t.string :name, limit: 30, default: '', null: false
t.integer :position, default: 1
t.boolean :assignable, default: true
t.integer :builtin, default: 0, null: false
diff --git a/db/migrate/tables/sessions.rb b/db/migrate/tables/sessions.rb
index 410f1c7314bc..28f3a309ad73 100644
--- a/db/migrate/tables/sessions.rb
+++ b/db/migrate/tables/sessions.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Sessions < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/settings.rb b/db/migrate/tables/settings.rb
index 47f7e176f1a8..bc73881c242e 100644
--- a/db/migrate/tables/settings.rb
+++ b/db/migrate/tables/settings.rb
@@ -26,16 +26,16 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Settings < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :name, default: "", null: false
+ t.string :name, default: '', null: false
t.text :value
t.datetime :updated_on
- t.index :name, name: "index_settings_on_name"
+ t.index :name, name: 'index_settings_on_name'
end
end
end
diff --git a/db/migrate/tables/statuses.rb b/db/migrate/tables/statuses.rb
index 53a0e2b7d3bc..082ee00f4b19 100644
--- a/db/migrate/tables/statuses.rb
+++ b/db/migrate/tables/statuses.rb
@@ -26,20 +26,20 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Statuses < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :name, limit: 30, default: "", null: false
+ t.string :name, limit: 30, default: '', null: false
t.boolean :is_closed, default: false, null: false
t.boolean :is_default, default: false, null: false
t.integer :position, default: 1
t.integer :default_done_ratio
- t.index :is_closed, name: "index_statuses_on_is_closed"
- t.index :is_default, name: "index_statuses_on_is_default"
- t.index :position, name: "index_statuses_on_position"
+ t.index :is_closed, name: 'index_statuses_on_is_closed'
+ t.index :is_default, name: 'index_statuses_on_is_default'
+ t.index :position, name: 'index_statuses_on_position'
end
end
end
diff --git a/db/migrate/tables/time_entries.rb b/db/migrate/tables/time_entries.rb
index deb1b44f222b..9902438c6d3b 100644
--- a/db/migrate/tables/time_entries.rb
+++ b/db/migrate/tables/time_entries.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::TimeEntries < Tables::Base
# rubocop:disable Metrics/AbcSize
@@ -45,11 +45,11 @@ def self.table(migration)
t.datetime :created_on, null: false
t.datetime :updated_on, null: false
- t.index :activity_id, name: "index_time_entries_on_activity_id"
- t.index :created_on, name: "index_time_entries_on_created_on"
- t.index :work_package_id, name: "time_entries_issue_id" # issue_id for backwards compatibility
- t.index :project_id, name: "time_entries_project_id"
- t.index :user_id, name: "index_time_entries_on_user_id"
+ t.index :activity_id, name: 'index_time_entries_on_activity_id'
+ t.index :created_on, name: 'index_time_entries_on_created_on'
+ t.index :work_package_id, name: 'time_entries_issue_id' # issue_id for backwards compatibility
+ t.index :project_id, name: 'time_entries_project_id'
+ t.index :user_id, name: 'index_time_entries_on_user_id'
t.index %i[project_id updated_on]
end
end
diff --git a/db/migrate/tables/time_entry_journals.rb b/db/migrate/tables/time_entry_journals.rb
index 2364896ef7fb..f7df9bc28faa 100644
--- a/db/migrate/tables/time_entry_journals.rb
+++ b/db/migrate/tables/time_entry_journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::TimeEntryJournals < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/timelines.rb b/db/migrate/tables/timelines.rb
index 5551092c2a75..ba75fa069231 100644
--- a/db/migrate/tables/timelines.rb
+++ b/db/migrate/tables/timelines.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Timelines < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/tokens.rb b/db/migrate/tables/tokens.rb
index 3d1cb9c49820..f814f8de75c6 100644
--- a/db/migrate/tables/tokens.rb
+++ b/db/migrate/tables/tokens.rb
@@ -26,17 +26,17 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Tokens < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :user_id, default: 0, null: false
- t.string :action, limit: 30, default: "", null: false
- t.string :value, limit: 40, default: "", null: false
+ t.string :action, limit: 30, default: '', null: false
+ t.string :value, limit: 40, default: '', null: false
t.datetime :created_on, null: false
- t.index :user_id, name: "index_tokens_on_user_id"
+ t.index :user_id, name: 'index_tokens_on_user_id'
end
end
end
diff --git a/db/migrate/tables/types.rb b/db/migrate/tables/types.rb
index 08717ff6fd76..23ef705b0d29 100644
--- a/db/migrate/tables/types.rb
+++ b/db/migrate/tables/types.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Types < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :name, default: "", null: false
+ t.string :name, default: '', null: false
t.integer :position, default: 1
t.boolean :is_in_roadmap, default: true, null: false
t.boolean :in_aggregation, default: true, null: false
diff --git a/db/migrate/tables/user_passwords.rb b/db/migrate/tables/user_passwords.rb
index 427f4d56e3ee..e773ab782cc4 100644
--- a/db/migrate/tables/user_passwords.rb
+++ b/db/migrate/tables/user_passwords.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::UserPasswords < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/user_preferences.rb b/db/migrate/tables/user_preferences.rb
index bb3a098de45f..8265e5b6a013 100644
--- a/db/migrate/tables/user_preferences.rb
+++ b/db/migrate/tables/user_preferences.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::UserPreferences < Tables::Base
def self.table(migration)
@@ -37,7 +37,7 @@ def self.table(migration)
t.string :time_zone
t.boolean :impaired, default: false
- t.index :user_id, name: "index_user_preferences_on_user_id"
+ t.index :user_id, name: 'index_user_preferences_on_user_id'
end
end
end
diff --git a/db/migrate/tables/users.rb b/db/migrate/tables/users.rb
index b6151ed8c9d7..8cbb6e745b23 100644
--- a/db/migrate/tables/users.rb
+++ b/db/migrate/tables/users.rb
@@ -26,34 +26,34 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Users < Tables::Base
# rubocop:disable Metrics/AbcSize
def self.table(migration)
create_table migration do |t|
- t.string :login, limit: 256, default: "", null: false
- t.string :firstname, limit: 30, default: "", null: false
- t.string :lastname, limit: 30, default: "", null: false
- t.string :mail, limit: 60, default: "", null: false
+ t.string :login, limit: 256, default: '', null: false
+ t.string :firstname, limit: 30, default: '', null: false
+ t.string :lastname, limit: 30, default: '', null: false
+ t.string :mail, limit: 60, default: '', null: false
t.boolean :admin, default: false, null: false
t.integer :status, default: 1, null: false
t.datetime :last_login_on
- t.string :language, limit: 5, default: ""
+ t.string :language, limit: 5, default: ''
t.integer :auth_source_id
t.datetime :created_on
t.datetime :updated_on
t.string :type
t.string :identity_url
- t.string :mail_notification, default: "", null: false
+ t.string :mail_notification, default: '', null: false
t.boolean :first_login, null: false, default: true
t.boolean :force_password_change, default: false
t.integer :failed_login_count, default: 0
t.datetime :last_failed_login_on, null: true
- t.index %i[auth_source_id], name: "index_users_on_auth_source_id"
- t.index %i[id type], name: "index_users_on_id_and_type"
- t.index %i[type], name: "index_users_on_type"
+ t.index %i[auth_source_id], name: 'index_users_on_auth_source_id'
+ t.index %i[id type], name: 'index_users_on_id_and_type'
+ t.index %i[type], name: 'index_users_on_type'
t.index %i[type login], length: { type: 255, login: 255 }
t.index %i[type status]
end
diff --git a/db/migrate/tables/versions.rb b/db/migrate/tables/versions.rb
index 27651683e3d7..30e6f77a4bf5 100644
--- a/db/migrate/tables/versions.rb
+++ b/db/migrate/tables/versions.rb
@@ -26,14 +26,14 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Versions < Tables::Base
def self.table(migration)
create_table migration do |t|
t.integer :project_id, default: 0, null: false
- t.string :name, default: "", null: false
- t.string :description, default: ""
+ t.string :name, default: '', null: false
+ t.string :description, default: ''
t.date :effective_date
t.datetime :created_on
t.datetime :updated_on
@@ -42,8 +42,8 @@ def self.table(migration)
t.string :sharing, default: :none, null: false
t.date :start_date
- t.index :project_id, name: "versions_project_id"
- t.index :sharing, name: "index_versions_on_sharing"
+ t.index :project_id, name: 'versions_project_id'
+ t.index :sharing, name: 'index_versions_on_sharing'
end
end
end
diff --git a/db/migrate/tables/watchers.rb b/db/migrate/tables/watchers.rb
index 0b61a2f546e3..1999a8c800f9 100644
--- a/db/migrate/tables/watchers.rb
+++ b/db/migrate/tables/watchers.rb
@@ -26,18 +26,18 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Watchers < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.string :watchable_type, default: "", null: false
+ t.string :watchable_type, default: '', null: false
t.integer :watchable_id, default: 0, null: false
t.integer :user_id
- t.index %i(user_id watchable_type), name: "watchers_user_id_type"
- t.index :user_id, name: "index_watchers_on_user_id"
- t.index %i(watchable_id watchable_type), name: "index_watchers_on_watchable_id_and_watchable_type"
+ t.index %i(user_id watchable_type), name: 'watchers_user_id_type'
+ t.index :user_id, name: 'index_watchers_on_user_id'
+ t.index %i(watchable_id watchable_type), name: 'index_watchers_on_watchable_id_and_watchable_type'
end
end
end
diff --git a/db/migrate/tables/wiki_content_journals.rb b/db/migrate/tables/wiki_content_journals.rb
index 566b08cb0b7a..a1b62394c517 100644
--- a/db/migrate/tables/wiki_content_journals.rb
+++ b/db/migrate/tables/wiki_content_journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WikiContentJournals < Tables::Base
def self.table(migration)
diff --git a/db/migrate/tables/wiki_content_versions.rb b/db/migrate/tables/wiki_content_versions.rb
index 3e6fa66b488e..3b9ac4561880 100644
--- a/db/migrate/tables/wiki_content_versions.rb
+++ b/db/migrate/tables/wiki_content_versions.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WikiContentVersions < Tables::Base
def self.table(migration)
@@ -35,13 +35,13 @@ def self.table(migration)
t.integer :page_id, null: false
t.integer :author_id
t.binary :data, limit: 16.megabytes
- t.string :compression, limit: 6, default: ""
- t.string :comments, default: ""
+ t.string :compression, limit: 6, default: ''
+ t.string :comments, default: ''
t.datetime :updated_on, null: false
t.integer :version, null: false
- t.index :updated_on, name: "index_wiki_content_versions_on_updated_on"
- t.index :wiki_content_id, name: "wiki_content_versions_wcid"
+ t.index :updated_on, name: 'index_wiki_content_versions_on_updated_on'
+ t.index :wiki_content_id, name: 'wiki_content_versions_wcid'
end
end
end
diff --git a/db/migrate/tables/wiki_contents.rb b/db/migrate/tables/wiki_contents.rb
index 79766d3e4624..02f835c60c8a 100644
--- a/db/migrate/tables/wiki_contents.rb
+++ b/db/migrate/tables/wiki_contents.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WikiContents < Tables::Base
def self.table(migration)
@@ -37,8 +37,8 @@ def self.table(migration)
t.datetime :updated_on, null: false
t.integer :lock_version, null: false
- t.index :author_id, name: "index_wiki_contents_on_author_id"
- t.index :page_id, name: "wiki_contents_page_id"
+ t.index :author_id, name: 'index_wiki_contents_on_author_id'
+ t.index :page_id, name: 'wiki_contents_page_id'
t.index %i[page_id updated_on]
end
end
diff --git a/db/migrate/tables/wiki_pages.rb b/db/migrate/tables/wiki_pages.rb
index d017e6a47fd0..52c9e332bedb 100644
--- a/db/migrate/tables/wiki_pages.rb
+++ b/db/migrate/tables/wiki_pages.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WikiPages < Tables::Base
def self.table(migration)
@@ -38,10 +38,10 @@ def self.table(migration)
t.integer :parent_id
t.string :slug, null: false
- t.index %i[wiki_id slug], name: "wiki_pages_wiki_id_slug", unique: true
- t.index :parent_id, name: "index_wiki_pages_on_parent_id"
- t.index %i[wiki_id title], name: "wiki_pages_wiki_id_title"
- t.index :wiki_id, name: "index_wiki_pages_on_wiki_id"
+ t.index %i[wiki_id slug], name: 'wiki_pages_wiki_id_slug', unique: true
+ t.index :parent_id, name: 'index_wiki_pages_on_parent_id'
+ t.index %i[wiki_id title], name: 'wiki_pages_wiki_id_title'
+ t.index :wiki_id, name: 'index_wiki_pages_on_wiki_id'
end
end
end
diff --git a/db/migrate/tables/wiki_redirects.rb b/db/migrate/tables/wiki_redirects.rb
index 3b8a2decede4..bd90fca19c40 100644
--- a/db/migrate/tables/wiki_redirects.rb
+++ b/db/migrate/tables/wiki_redirects.rb
@@ -26,18 +26,18 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WikiRedirects < Tables::Base
def self.table(migration)
create_table migration do |t|
- t.integer "wiki_id", null: false
- t.string "title"
- t.string "redirects_to"
- t.datetime "created_on", null: false
+ t.integer 'wiki_id', null: false
+ t.string 'title'
+ t.string 'redirects_to'
+ t.datetime 'created_on', null: false
- t.index %i[wiki_id title], name: "wiki_redirects_wiki_id_title"
- t.index :wiki_id, name: "index_wiki_redirects_on_wiki_id"
+ t.index %i[wiki_id title], name: 'wiki_redirects_wiki_id_title'
+ t.index :wiki_id, name: 'index_wiki_redirects_on_wiki_id'
end
end
end
diff --git a/db/migrate/tables/wikis.rb b/db/migrate/tables/wikis.rb
index 9f219b55e355..a6e737ac665b 100644
--- a/db/migrate/tables/wikis.rb
+++ b/db/migrate/tables/wikis.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Wikis < Tables::Base
def self.table(migration)
@@ -35,7 +35,7 @@ def self.table(migration)
t.string :start_page, null: false
t.integer :status, default: 1, null: false
- t.index :project_id, name: "wikis_project_id"
+ t.index :project_id, name: 'wikis_project_id'
end
end
end
diff --git a/db/migrate/tables/work_package_journals.rb b/db/migrate/tables/work_package_journals.rb
index 51333e4b0bb9..d8095fb3f700 100644
--- a/db/migrate/tables/work_package_journals.rb
+++ b/db/migrate/tables/work_package_journals.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WorkPackageJournals < Tables::Base
# rubocop:disable Metrics/AbcSize
@@ -35,7 +35,7 @@ def self.table(migration)
t.integer :journal_id, null: false
t.integer :type_id, default: 0, null: false
t.integer :project_id, default: 0, null: false
- t.string :subject, default: "", null: false
+ t.string :subject, default: '', null: false
t.text :description
t.date :due_date
t.integer :category_id
diff --git a/db/migrate/tables/work_packages.rb b/db/migrate/tables/work_packages.rb
index 47e0a9d50f2a..67e0a7e97b4e 100644
--- a/db/migrate/tables/work_packages.rb
+++ b/db/migrate/tables/work_packages.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::WorkPackages < Tables::Base
# rubocop:disable Metrics/AbcSize
@@ -34,7 +34,7 @@ def self.table(migration)
create_table migration do |t|
t.integer :type_id, default: 0, null: false
t.belongs_to :project, default: 0, null: false, type: :int
- t.string :subject, default: "", null: false
+ t.string :subject, default: '', null: false
t.text :description
t.date :due_date
t.integer :category_id
diff --git a/db/migrate/tables/workflows.rb b/db/migrate/tables/workflows.rb
index fc103ecc8ea6..236c80a5da58 100644
--- a/db/migrate/tables/workflows.rb
+++ b/db/migrate/tables/workflows.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require_relative "base"
+require_relative 'base'
class Tables::Workflows < Tables::Base
def self.table(migration)
@@ -38,10 +38,10 @@ def self.table(migration)
t.boolean :assignee, default: false, null: false
t.boolean :author, default: false, null: false
- t.index :new_status_id, name: "index_workflows_on_new_status_id"
- t.index :old_status_id, name: "index_workflows_on_old_status_id"
- t.index :role_id, name: "index_workflows_on_role_id"
- t.index %i[role_id type_id old_status_id], name: "wkfs_role_type_old_status"
+ t.index :new_status_id, name: 'index_workflows_on_new_status_id'
+ t.index :old_status_id, name: 'index_workflows_on_old_status_id'
+ t.index :role_id, name: 'index_workflows_on_role_id'
+ t.index %i[role_id type_id old_status_id], name: 'wkfs_role_type_old_status'
end
end
end
diff --git a/docker-compose.yml b/docker-compose.yml
index 6ee045bc57e2..5c77c0aa4a30 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,3 +1,5 @@
+version: '3.8'
+
networks:
network:
testing:
@@ -66,7 +68,7 @@ services:
worker:
<<: *backend
- command: bundle exec good_job start
+ command: bundle exec rake jobs:work
depends_on:
- db
- cache
diff --git a/docker/prod/bimworker b/docker/prod/bimworker
index 01b7766a1b57..a63e2777dbc1 100755
--- a/docker/prod/bimworker
+++ b/docker/prod/bimworker
@@ -1,3 +1,3 @@
#!/bin/bash -e
export QUEUE=bim,ifc_conversion
-exec bundle exec good_job start
+exec bundle exec rake jobs:work
diff --git a/docker/prod/seeder b/docker/prod/seeder
index 751ba6dec915..f8e78f91fb0f 100755
--- a/docker/prod/seeder
+++ b/docker/prod/seeder
@@ -7,8 +7,7 @@ if [[ "$OUTPUT" = "No relations found." ]]; then
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:structure:load db:seed
else
echo "Executing database migration and database seed..."
- bundle exec rake db:migrate
- bundle exec rake db:seed
+ bundle exec rake db:migrate db:seed
fi
if [ "$1" = "--set" ]; then
diff --git a/docker/prod/wait_for_db.rb b/docker/prod/wait_for_db.rb
index 4fc18e2afc13..971e7fafea33 100644
--- a/docker/prod/wait_for_db.rb
+++ b/docker/prod/wait_for_db.rb
@@ -1,6 +1,6 @@
-require "timeout"
+require 'timeout'
-timeout = (ENV["WAIT_FOR_DB_TIMEOUT_SECONDS"] || 120).to_i
+timeout = (ENV['WAIT_FOR_DB_TIMEOUT_SECONDS'] || 120).to_i
Timeout::timeout(timeout) do
loop do
diff --git a/docker/prod/worker b/docker/prod/worker
index 87130302b193..bc4d194cbaaf 100755
--- a/docker/prod/worker
+++ b/docker/prod/worker
@@ -5,4 +5,4 @@ if [ "$1" = "--seed" ]; then
$APP_PATH/docker/prod/seeder "$@"
fi
-QUIET=true bundle exec good_job start
+QUIET=true bundle exec rake jobs:work
diff --git a/docs/api/apiv3/components/schemas/project_model.yml b/docs/api/apiv3/components/schemas/project_model.yml
index 2e766c0c62f2..166a14575c47 100644
--- a/docs/api/apiv3/components/schemas/project_model.yml
+++ b/docs/api/apiv3/components/schemas/project_model.yml
@@ -29,7 +29,7 @@ properties:
createdAt:
type: string
format: date-time
- description: Time of creation. Can be writable by admins with the `apiv3_write_readonly_attributes` setting enabled.
+ description: Time of creation
updatedAt:
type: string
format: date-time
diff --git a/docs/api/apiv3/components/schemas/work_package_model.yml b/docs/api/apiv3/components/schemas/work_package_model.yml
index 0f364c55fb45..2e8e48a36c4b 100644
--- a/docs/api/apiv3/components/schemas/work_package_model.yml
+++ b/docs/api/apiv3/components/schemas/work_package_model.yml
@@ -104,12 +104,12 @@ properties:
createdAt:
type: string
format: date-time
- description: Time of creation. Can be writable by admins with the `apiv3_write_readonly_attributes` setting enabled.
+ description: Time of creation
readOnly: true
updatedAt:
type: string
format: date-time
- description: Time of the most recent change to the work package. Can be writable by admins with the `apiv3_write_readonly_attributes` setting enabled.
+ description: Time of the most recent change to the work package
readOnly: true
_links:
type: object
diff --git a/docs/bim-guide/revit-add-in/README.md b/docs/bim-guide/revit-add-in/README.md
index 435b81ebd668..94dada52c25d 100644
--- a/docs/bim-guide/revit-add-in/README.md
+++ b/docs/bim-guide/revit-add-in/README.md
@@ -48,7 +48,7 @@ The **OpenProject Revit AddIn** does not have any special system requirements. A
To download the setup application for the **OpenProject Revit AddIn**, click here: [DOWNLOAD](https://github.com/opf/openproject-revit-add-in/releases/download/v2.3.3/OpenProject.Revit.exe)
-You can find the latest version of our AddIn on [Github](https://github.com/opf/openproject-revit-add-in/releases/latest) as well.
+You can find the latest version of our AddIn on [GitHub](https://github.com/opf/openproject-revit-add-in/releases/latest) as well.
diff --git a/docs/development/concepts/translations/README.md b/docs/development/concepts/translations/README.md
index d4237061e9b9..f32ca3e7a1ce 100644
--- a/docs/development/concepts/translations/README.md
+++ b/docs/development/concepts/translations/README.md
@@ -115,7 +115,7 @@ public text = {
Then you can use them as below in your template:
```html
-
+
diff --git a/docs/development/contribution-documentation/documentation-process/README.md b/docs/development/contribution-documentation/documentation-process/README.md
index 1962c6a0c252..fb9b76e126af 100644
--- a/docs/development/contribution-documentation/documentation-process/README.md
+++ b/docs/development/contribution-documentation/documentation-process/README.md
@@ -32,7 +32,7 @@ You can download the installer from the [Typora website](https://typora.io). Fol
You can install the software GitHub Desktop on any [supported operating systems](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/overview/supported-operating-systems). To install GitHub Desktop navigate to [https://desktop.github.com](https://desktop.github.com) and download the appropriate version for your operating system. Follow the prompts to complete the installation.
-## Step 4: Sign in into Github.com in GitHub Desktop
+## Step 4: Sign in into GitHub.com in GitHub Desktop
To exchange data between your local repository and remote repositories you need to first sign (File -> Options -> Sign in).
@@ -196,7 +196,7 @@ In GitHub Desktop **at Current branch the old branch is visible [1]** . After yo
#### C) Change remote repository back to the forked repository (ORIGIN)
-In Github Desktop choose menu "Repository -> Repository settings". This will open a new window (screenshot below). Enter the URL of your forked OpenProject repository (e.g. https://github.com/adam-op/openproject.git). Confirm with **Save**
+In GitHub Desktop choose menu "Repository -> Repository settings". This will open a new window (screenshot below). Enter the URL of your forked OpenProject repository (e.g. https://github.com/adam-op/openproject.git). Confirm with **Save**
![rebase-your-fork-step-3](rebase-your-fork-step-3.png)
diff --git a/docs/development/development-environment-docker/README.md b/docs/development/development-environment-docker/README.md
index dbfe1b08f6cb..191755e3dcf2 100644
--- a/docs/development/development-environment-docker/README.md
+++ b/docs/development/development-environment-docker/README.md
@@ -141,8 +141,15 @@ system's resources.
```shell
# Start the worker service and let it run continuously
docker compose up -d worker
+
+# Start the worker service to work off all delayed jobs and shut it down afterwards
+docker compose run --rm worker rake jobs:workoff
```
+The testing containers are excluded as well, while they are harmless to start, but take up system resources again and
+clog your logs while running. The delayed_job background worker reloads the application for every job in development
+mode. This is a know issue and documented here: https://github.com/collectiveidea/delayed_job/issues/823
+
This process can take quite a long time on the first run where all gems are installed for the first time. However, these
are cached in a docker volume. Meaning that from the 2nd run onwards it will start a lot quicker.
@@ -389,7 +396,7 @@ docker compose --project-directory docker/dev/tls up -d
## GitLab CE Service
-Within `docker/dev/gitlab` a compose file is provided for running local Gitlab instance with TLS support. This provides
+Within `docker/dev/gitlab` a compose file is provided for running local GitLab instance with TLS support. This provides
a production like environment for testing the OpenProject GitLab integration against a community edition GitLab instance
accessible on `https://gitlab.local`.
diff --git a/docs/development/development-environment-osx/README.md b/docs/development/development-environment-osx/README.md
index 8a6e2a77c9bd..c484e6ea84f3 100644
--- a/docs/development/development-environment-osx/README.md
+++ b/docs/development/development-environment-osx/README.md
@@ -250,7 +250,7 @@ You can then access the application either through `localhost:3000` (Rails serve
### Delayed Job background worker
```shell
-RAILS_ENV=development bundle exec good_job start
+RAILS_ENV=development bin/rails jobs:work
```
This will start a Delayed::Job worker to perform asynchronous jobs like sending emails.
@@ -298,6 +298,12 @@ brew install git
## Known issues
+### Memory management
+
+The delayed_job background worker reloads the application for every job in development mode. This is a know issue and documented here: https://github.com/collectiveidea/delayed_job/issues/823
+
+
+
### Spawning a lot of browser tabs
If you haven't run this command for a while, chances are that a lot of background jobs have queued up and might cause a significant amount of open tabs (due to the way we deliver mails with the letter_opener gem). To get rid of the jobs before starting the worker, use the following command. **This will remove all currently scheduled jobs, never use this in a production setting.**
diff --git a/docs/development/development-environment-ubuntu/README.md b/docs/development/development-environment-ubuntu/README.md
index 52ed199ef6e6..25c551a6adb1 100644
--- a/docs/development/development-environment-ubuntu/README.md
+++ b/docs/development/development-environment-ubuntu/README.md
@@ -301,7 +301,7 @@ You can then access the application either through `localhost:3000` (Rails serve
### Background job worker
```shell
-RAILS_ENV=development bundle exec good_job start
+RAILS_ENV=development bin/rails jobs:work
```
This will start a Delayed::Job worker to perform asynchronous jobs like sending emails.
@@ -310,6 +310,12 @@ This will start a Delayed::Job worker to perform asynchronous jobs like sending
## Known issues
+### Memory management
+
+The delayed_job background worker reloads the application for every job in development mode. This is a know issue and documented here: https://github.com/collectiveidea/delayed_job/issues/823
+
+
+
### Spawning a lot of browser tabs
If you haven't run this command for a while, chances are that a lot of background jobs have queued up and might cause a significant amount of open tabs (due to the way we deliver mails with the letter_opener gem). To get rid of the jobs before starting the worker, use the following command. **This will remove all currently scheduled jobs, never use this in a production setting.**
diff --git a/docs/development/running-tests/README.md b/docs/development/running-tests/README.md
index 0eebfa67defc..79e39b8fc71a 100644
--- a/docs/development/running-tests/README.md
+++ b/docs/development/running-tests/README.md
@@ -837,7 +837,7 @@ OPENPROJECT_CLI_PROXY='http://:4200' ./bin/rails s -b 0.0.0.0 -p
# Now access your server from http://:3000 with code reloading
```
-You might have to also update your host name setting `bundle exec rake setting:set[host_name=yourip]`.
+You might have to also update your host name setting `bundle exec rake setting:set[host_name=your-ip]`.
## Legacy LDAP tests
diff --git a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-create-project-plan.gif b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-create-project-plan.gif
index 86bdb3c00e5b..5a57e841797d 100644
Binary files a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-create-project-plan.gif and b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-create-project-plan.gif differ
diff --git a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-edit-project-plan.gif b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-edit-project-plan.gif
index 1e3e21b26a77..b95c45a764f0 100644
Binary files a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-edit-project-plan.gif and b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-edit-project-plan.gif differ
diff --git a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-select-gantt-charts-module.png b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-select-gantt-charts-module.png
index 138e078a430b..466e10d66b95 100644
Binary files a/docs/getting-started/gantt-chart-introduction/openproject-user-guide-select-gantt-charts-module.png and b/docs/getting-started/gantt-chart-introduction/openproject-user-guide-select-gantt-charts-module.png differ
diff --git a/docs/getting-started/invite-members/create-project-button.png b/docs/getting-started/invite-members/create-project-button.png
index 1e7579161468..be98dc258f64 100644
Binary files a/docs/getting-started/invite-members/create-project-button.png and b/docs/getting-started/invite-members/create-project-button.png differ
diff --git a/docs/getting-started/invite-members/invite-new-member-email.png b/docs/getting-started/invite-members/invite-new-member-email.png
index 9244cac0fd30..7e2611ffb631 100644
Binary files a/docs/getting-started/invite-members/invite-new-member-email.png and b/docs/getting-started/invite-members/invite-new-member-email.png differ
diff --git a/docs/getting-started/invite-members/invite-new-member.png b/docs/getting-started/invite-members/invite-new-member.png
index ca3187700312..7598a2717d33 100644
Binary files a/docs/getting-started/invite-members/invite-new-member.png and b/docs/getting-started/invite-members/invite-new-member.png differ
diff --git a/docs/getting-started/invite-members/invite-user-over-assignment.png b/docs/getting-started/invite-members/invite-user-over-assignment.png
index 2766aab005cf..ebb918fc7f8a 100644
Binary files a/docs/getting-started/invite-members/invite-user-over-assignment.png and b/docs/getting-started/invite-members/invite-user-over-assignment.png differ
diff --git a/docs/getting-started/invite-members/invite-user-pop-up.png b/docs/getting-started/invite-members/invite-user-pop-up.png
index b2c4bb75556c..5afcb4198ff5 100644
Binary files a/docs/getting-started/invite-members/invite-user-pop-up.png and b/docs/getting-started/invite-members/invite-user-pop-up.png differ
diff --git a/docs/getting-started/invite-members/project-members-module.png b/docs/getting-started/invite-members/project-members-module.png
index 2cd07dbbad43..ee6e5c648b73 100644
Binary files a/docs/getting-started/invite-members/project-members-module.png and b/docs/getting-started/invite-members/project-members-module.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_2fa_overview.png b/docs/getting-started/my-account/openproject_my_account_2fa_overview.png
index 161ca2b95701..89bd0c38fb53 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_2fa_overview.png and b/docs/getting-started/my-account/openproject_my_account_2fa_overview.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_authentication_options.png b/docs/getting-started/my-account/openproject_my_account_authentication_options.png
index 465a6eaf7303..f0c5f0370da9 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_authentication_options.png and b/docs/getting-started/my-account/openproject_my_account_authentication_options.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_authenticator_app.png b/docs/getting-started/my-account/openproject_my_account_authenticator_app.png
index f3cf1a9474d2..20bdf66034d5 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_authenticator_app.png and b/docs/getting-started/my-account/openproject_my_account_authenticator_app.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_authenticator_webauth.png b/docs/getting-started/my-account/openproject_my_account_authenticator_webauth.png
index e02686fb1c9c..81e36f862af9 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_authenticator_webauth.png and b/docs/getting-started/my-account/openproject_my_account_authenticator_webauth.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_two_factor_authentication.png b/docs/getting-started/my-account/openproject_my_account_two_factor_authentication.png
index 5a3c82644068..380de66d21b8 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_two_factor_authentication.png and b/docs/getting-started/my-account/openproject_my_account_two_factor_authentication.png differ
diff --git a/docs/getting-started/my-account/openproject_my_account_two_factor_authentication_mobile.png b/docs/getting-started/my-account/openproject_my_account_two_factor_authentication_mobile.png
index 2ccc05254f5c..b38891250493 100644
Binary files a/docs/getting-started/my-account/openproject_my_account_two_factor_authentication_mobile.png and b/docs/getting-started/my-account/openproject_my_account_two_factor_authentication_mobile.png differ
diff --git a/docs/getting-started/projects/create-a-new-project-landing-page.png b/docs/getting-started/projects/create-a-new-project-landing-page.png
index d0fb8becb201..43859edcba1c 100644
Binary files a/docs/getting-started/projects/create-a-new-project-landing-page.png and b/docs/getting-started/projects/create-a-new-project-landing-page.png differ
diff --git a/docs/getting-started/projects/create-project-header.png b/docs/getting-started/projects/create-project-header.png
index 9ec6f351932e..ed89c62571f9 100644
Binary files a/docs/getting-started/projects/create-project-header.png and b/docs/getting-started/projects/create-project-header.png differ
diff --git a/docs/getting-started/projects/openproject-landing-page.png b/docs/getting-started/projects/openproject-landing-page.png
index 4392998684b5..d3d2736bf578 100644
Binary files a/docs/getting-started/projects/openproject-landing-page.png and b/docs/getting-started/projects/openproject-landing-page.png differ
diff --git a/docs/getting-started/projects/project-overview-list.png b/docs/getting-started/projects/project-overview-list.png
index e87b19b3dd2d..9a31c0706155 100644
Binary files a/docs/getting-started/projects/project-overview-list.png and b/docs/getting-started/projects/project-overview-list.png differ
diff --git a/docs/getting-started/projects/view_all_projects.png b/docs/getting-started/projects/view_all_projects.png
index 62a5f4f1be14..8240d050cfe3 100644
Binary files a/docs/getting-started/projects/view_all_projects.png and b/docs/getting-started/projects/view_all_projects.png differ
diff --git a/docs/getting-started/projects/view_all_projects_options.png b/docs/getting-started/projects/view_all_projects_options.png
index ad8cf874ccc7..5fa959b7f4b2 100644
Binary files a/docs/getting-started/projects/view_all_projects_options.png and b/docs/getting-started/projects/view_all_projects_options.png differ
diff --git a/docs/glossary/README.md b/docs/glossary/README.md
index bd18d288858d..3c3bd4d27dbf 100644
--- a/docs/glossary/README.md
+++ b/docs/glossary/README.md
@@ -274,7 +274,7 @@ Your activated plugins are listed together with your [modules](#module) in your
### Primer design system
-OpenProject started adopting [Github's Primer Design System](https://primer.style/) in 2023. New features will be developed using Primer and existing features will will be gradually revised. Relevant reusable components from Primer as well as common patterns and compositions of these components will be documented in our [Lookbook](https://qa.openproject-edge.com/lookbook/pages/how_to_use). [Read more about OpenProject's decision to use Primer](https://www.openproject.org/blog/primer-design-system/).
+OpenProject started adopting [GitHub's Primer Design System](https://primer.style/) in 2023. New features will be developed using Primer and existing features will will be gradually revised. Relevant reusable components from Primer as well as common patterns and compositions of these components will be documented in our [Lookbook](https://qa.openproject-edge.com/lookbook/pages/how_to_use). [Read more about OpenProject's decision to use Primer](https://www.openproject.org/blog/primer-design-system/).
### Project
diff --git a/docs/installation-and-operations/configuration/README.md b/docs/installation-and-operations/configuration/README.md
index 92e9234ecf47..3571d5935f80 100644
--- a/docs/installation-and-operations/configuration/README.md
+++ b/docs/installation-and-operations/configuration/README.md
@@ -758,7 +758,7 @@ OPENPROJECT_2FA_ENFORCED="true"
**Setting available strategies**
-By default, the TOTP and WebAuthn strategie are active.
+By default, the TOTP and WebAuthn strategies are active.
If you have a [MessageBird account](https://www.messagebird.com/), you can setup a SMS 2FA by activating that strategy like so:
diff --git a/docs/installation-and-operations/configuration/plugins/README.md b/docs/installation-and-operations/configuration/plugins/README.md
index 99faac1d6a5d..7282137ec9f7 100644
--- a/docs/installation-and-operations/configuration/plugins/README.md
+++ b/docs/installation-and-operations/configuration/plugins/README.md
@@ -24,7 +24,7 @@ group :opf_plugins do
end
```
-**Note:** The Gitlab plugin is usually only compatible with the latest versions. For more information, please see the respective repository: https://github.com/btey/openproject-gitlab-integration/
+**Note:** The GitLab plugin is usually only compatible with the latest versions. For more information, please see the respective repository: https://github.com/btey/openproject-gitlab-integration/
The group `:opf_plugins` is generally recommended, but only required for plugins with custom frontend code that is picked up by webpack and output into their respective bundles.
diff --git a/docs/installation-and-operations/installation-faq/README.md b/docs/installation-and-operations/installation-faq/README.md
index a086e93eec30..802e11c602c6 100644
--- a/docs/installation-and-operations/installation-faq/README.md
+++ b/docs/installation-and-operations/installation-faq/README.md
@@ -124,7 +124,7 @@ Set a higher number of web workers to allow more processes to be handled at the
There are two different types of emails in OpenProject: One sent directly within the request to the server (this includes the test mail) and one sent asynchronously, via a background job from the backend. The majority of mail sending jobs is run asynchronously to facilitate a faster response time for server request.
-Use a browser to call your domain name followed by "health_checks/all" (e.g. `https://myopenproject.com/health_checks/all`). There should be entries about "worker" and "worker_backed_up". If PASSED is written behind it, everything is good.
+Use a browser to call your domain name followed by "health_checks/all" (e.g. `https://myopenproject.com/health_checks/all`). There should be entries about "delayed_jobs_backed_up" and "delayed_jobs_never_ran". If PASSED is written behind it, everything is good.
If the health check does not return satisfying results, have a look if the background worker is running by entering `ps aux | grep jobs` on the server. If it is not running, no entry is returned. If it is running an entry with "jobs:work" at the end is displayed.
diff --git a/docs/installation-and-operations/operation/monitoring/README.md b/docs/installation-and-operations/operation/monitoring/README.md
index 145dba04978c..40d740b33464 100644
--- a/docs/installation-and-operations/operation/monitoring/README.md
+++ b/docs/installation-and-operations/operation/monitoring/README.md
@@ -124,10 +124,8 @@ We provide the following health checks:
- `https://your-hostname.example.tld/health_checks/default` - An application level check to ensure the web workers are running.
- `https://your-hostname.example.tld/health_checks/database` - A database liveliness check.
-- `https://your-hostname.example.tld/health_checks/mail` - SMTP configuration check.
-- `https://your-hostname.example.tld/health_checks/puma` - A check on Puma web server.
-- `https://your-hostname.example.tld/health_checks/worker` - A check to ensure background jobs are being processed.
-- `https://your-hostname.example.tld/health_checks/worker_backed_up` - A check to determine whether background workers are at capacity and might need to be scaled up to provide timely processing of mails and other background work.
+- `https://your-hostname.example.tld/health_checks/delayed_jobs_never_ran` - A check to ensure background jobs are being processed.
+- `https://your-hostname.example.tld/health_checks/delayed_jobs_backed_up` - A check to determine whether background workers are at capacity and might need to be scaled up to provide timely processing of mails and other background work.
- `https://your-hostname.example.tld/health_checks/all` - All of the above checks and additional checks combined as one. Not recommended as the liveliness check of a pod/container.
### Optional authentication
diff --git a/docs/release-notes/11/11-0-0/README.md b/docs/release-notes/11/11-0-0/README.md
index e3f569d5990b..1bfaa6c36e6c 100644
--- a/docs/release-notes/11/11-0-0/README.md
+++ b/docs/release-notes/11/11-0-0/README.md
@@ -229,7 +229,7 @@ There are lots and lots of new things we packed into 11.0 to tell you about.
- Fixed: Error 500 when bulk-editing work packages \[[#34588](https://community.openproject.org/wp/34588)\]
- Fixed: Year almost hidden in date picker for version \[[#34590](https://community.openproject.org/wp/34590)\]
- Fixed: Onboarding tour broken in multiple places \[[#34597](https://community.openproject.org/wp/34597)\]
-- Fixed: Github Integration \[[#34598](https://community.openproject.org/wp/34598)\]
+- Fixed: GitHub Integration \[[#34598](https://community.openproject.org/wp/34598)\]
- Fixed: Google OpenID provider image not shown in login form \[[#34601](https://community.openproject.org/wp/34601)\]
- Fixed: Parent work package in manual scheduling mode without date cannot be scheduled from Gantt chart \[[#34710](https://community.openproject.org/wp/34710)\]
- Fixed: Menu too small/completely hidden on Roadmap \[[#34712](https://community.openproject.org/wp/34712)\]
@@ -291,7 +291,7 @@ There are lots and lots of new things we packed into 11.0 to tell you about.
- Changed: Improve board creation modal \[[#34070](https://community.openproject.org/wp/34070)\]
- Changed: Hide derived (Start/Finish) Date from work package forms \[[#34122](https://community.openproject.org/wp/34122)\]
- Changed: Extend search autocompleter with useful information \[[#34132](https://community.openproject.org/wp/34132)\]
-- Changed: [all projects overview] (Add option to) show status-text in expanded view. \[[#34191](https://community.openproject.org/wp/34191)\]
+- Changed: \[all projects overview\] (Add option to) show status-text in expanded view. \[[#34191](https://community.openproject.org/wp/34191)\]
- Changed: Map board subtasks columns when copying projects \[[#34238](https://community.openproject.org/wp/34238)\]
- Changed: Having meetings as a linkable resource \[[#34256](https://community.openproject.org/wp/34256)\]
- Changed: What's new teaser OpenProject BIM 11.0 \[[#34514](https://community.openproject.org/wp/34514)\]
diff --git a/docs/release-notes/11/11-3-0/README.md b/docs/release-notes/11/11-3-0/README.md
index 3bbf6d9b53a6..bac6cff9810b 100644
--- a/docs/release-notes/11/11-3-0/README.md
+++ b/docs/release-notes/11/11-3-0/README.md
@@ -124,7 +124,7 @@ Users now have the option to **create backups of their OpenProject installation*
- Changed: Add copy project form to APIv3 \[[#37091](https://community.openproject.org/wp/37091)\]
- Changed: Attribute help text on dynamic form \[[#37092](https://community.openproject.org/wp/37092)\]
- Changed: Improve design of checkboxes in formly forms \[[#37105](https://community.openproject.org/wp/37105)\]
-- Changed: Improve design of Github tab \[[#37108](https://community.openproject.org/wp/37108)\]
+- Changed: Improve design of GitHub tab \[[#37108](https://community.openproject.org/wp/37108)\]
- Changed: Allow inviting users from project member administration for non admins \[[#37126](https://community.openproject.org/wp/37126)\]
- Changed: Handle duplicate project identifiers in the backend \[[#37140](https://community.openproject.org/wp/37140)\]
- Fixed: Unable to enter Boards module when work package module is disabled \[[#34794](https://community.openproject.org/wp/34794)\]
@@ -183,7 +183,7 @@ Users now have the option to **create backups of their OpenProject installation*
- Fixed: "(None)" option missing for parent project drop down select \[[#37398](https://community.openproject.org/wp/37398)\]
- Fixed: Multi-select fields do not adjust height (cannot see values) \[[#37404](https://community.openproject.org/wp/37404)\]
- Fixed: OpenProject backup completes partially with file permission errors \[[#37440](https://community.openproject.org/wp/37440)\]
-- Fixed: Github user avatar not rendered correctly \[[#37444](https://community.openproject.org/wp/37444)\]
+- Fixed: GitHub user avatar not rendered correctly \[[#37444](https://community.openproject.org/wp/37444)\]
- Fixed: Password confirmation during backup token reset not working \[[#37445](https://community.openproject.org/wp/37445)\]
- Fixed: Several problem with the header in mobile view \[[#37452](https://community.openproject.org/wp/37452)\]
- Fixed: allowedValues for project user custom fields result in 400 bad request \[[#37453](https://community.openproject.org/wp/37453)\]
diff --git a/docs/release-notes/11/11-4-0/README.md b/docs/release-notes/11/11-4-0/README.md
index d2690f702a75..5ba523517c25 100644
--- a/docs/release-notes/11/11-4-0/README.md
+++ b/docs/release-notes/11/11-4-0/README.md
@@ -28,7 +28,7 @@ OpenProject 11.4.0 adds packaged installation support for Debian 11 "Bullseye".
- Fixed: Wiki menu item scrolling does not work with two main wiki items \[[#38878](https://community.openproject.org/wp/38878)\]
- Fixed: Imminent user limit warning shown prematurely \[[#38893](https://community.openproject.org/wp/38893)\]
- Fixed: Custom S3 compatible upload providers blocked by CSP \[[#38900](https://community.openproject.org/wp/38900)\]
-- Fixed: [Github Integration] Webhook fails for pull_request event without body \[[#38919](https://community.openproject.org/wp/38919)\]
+- Fixed: [GitHub Integration] Webhook fails for pull_request event without body \[[#38919](https://community.openproject.org/wp/38919)\]
- Fixed: IFC upload not working since attachment whitelisting \[[#38954](https://community.openproject.org/wp/38954)\]
- Fixed: BIM seed are missing snapshots \[[#39009](https://community.openproject.org/wp/39009)\]
- Fixed: Regression: Typing S while focus in viewer opens the OP global search \[[#39029](https://community.openproject.org/wp/39029)\]
diff --git a/docs/release-notes/12/12-1-0/README.md b/docs/release-notes/12/12-1-0/README.md
index 8c457b75608c..90ce53533abb 100644
--- a/docs/release-notes/12/12-1-0/README.md
+++ b/docs/release-notes/12/12-1-0/README.md
@@ -150,7 +150,7 @@ We added a new “Files” tab in the work package details. This way, you will h
- Fixed: Users can't select public template projects in new project dialog \[[#40918](https://community.openproject.org/wp/40918)\]
- Fixed: Meeting Time in iCalendar is wrong \[[#40941](https://community.openproject.org/wp/40941)\]
- Fixed: Toolbar icons should be rendered in the "old" style and not the new rounded style (which is a work in progress) \[[#40957](https://community.openproject.org/wp/40957)\]
-- Fixed: [Docker] - Gitlab integration plugin \[[#40959](https://community.openproject.org/wp/40959)\]
+- Fixed: [Docker] - GitLab integration plugin \[[#40959](https://community.openproject.org/wp/40959)\]
- Fixed: Project dropdown no longer autofocused \[[#40978](https://community.openproject.org/wp/40978)\]
- Fixed: Not possible to copy work package to another project \[[#41005](https://community.openproject.org/wp/41005)\]
- Fixed: Changed calendar styles applied to time entries component \[[#41013](https://community.openproject.org/wp/41013)\]
diff --git a/docs/release-notes/13-3-0/README.md b/docs/release-notes/13-3-0/README.md
index c501e37adc3f..dcfbdb794101 100644
--- a/docs/release-notes/13-3-0/README.md
+++ b/docs/release-notes/13-3-0/README.md
@@ -56,7 +56,7 @@ With this release, admins of an Enterprise edition can choose between manually o
- Bugfix: Lookbook is broken \[[#51787](https://community.openproject.org/wp/51787)\]
- Bugfix: Anonymous Users (without signing in) cannot load board content \[[#51850](https://community.openproject.org/wp/51850)\]
- Bugfix: Misalignment in the dropdown on searching work packages \[[#51948](https://community.openproject.org/wp/51948)\]
-- Bugfix: Remove colour in share modal is not correct \[[#52012](https://community.openproject.org/wp/52012)\]
+- Bugfix: Remove color in share modal is not correct \[[#52012](https://community.openproject.org/wp/52012)\]
- Bugfix: Timeouts as non privileged users \[[#52022](https://community.openproject.org/wp/52022)\]
- Bugfix: WorkPackage query with baseline filter takes too much time for non-admins \[[#52156](https://community.openproject.org/wp/52156)\]
- Bugfix: Multi-select user custom field broken in table \[[#52289](https://community.openproject.org/wp/52289)\]
diff --git a/docs/release-notes/13-3-0/openproject-13-3-sharepoint-onedrive-automatically-managed-project-folders-highlighted.png b/docs/release-notes/13-3-0/openproject-13-3-sharepoint-onedrive-automatically-managed-project-folders-highlighted.png
index d2a002099aa0..c983ff779c48 100644
Binary files a/docs/release-notes/13-3-0/openproject-13-3-sharepoint-onedrive-automatically-managed-project-folders-highlighted.png and b/docs/release-notes/13-3-0/openproject-13-3-sharepoint-onedrive-automatically-managed-project-folders-highlighted.png differ
diff --git a/docs/release-notes/13-3-0/openproject-filter-project-lists.png b/docs/release-notes/13-3-0/openproject-filter-project-lists.png
index 0391b318eefc..b94140e02a09 100644
Binary files a/docs/release-notes/13-3-0/openproject-filter-project-lists.png and b/docs/release-notes/13-3-0/openproject-filter-project-lists.png differ
diff --git a/docs/release-notes/13-3-0/openproject-user-guide-select-gantt-charts-global.png b/docs/release-notes/13-3-0/openproject-user-guide-select-gantt-charts-global.png
index 3800c47c724a..d24e3625f174 100644
Binary files a/docs/release-notes/13-3-0/openproject-user-guide-select-gantt-charts-global.png and b/docs/release-notes/13-3-0/openproject-user-guide-select-gantt-charts-global.png differ
diff --git a/docs/release-notes/13-4-0/GitLab_integration.png b/docs/release-notes/13-4-0/GitLab_integration.png
index c140eaa0e9ee..a83ef84cfed7 100644
Binary files a/docs/release-notes/13-4-0/GitLab_integration.png and b/docs/release-notes/13-4-0/GitLab_integration.png differ
diff --git a/docs/release-notes/13-4-0/README.md b/docs/release-notes/13-4-0/README.md
index 813bc959c79c..ce75e15c7e43 100644
--- a/docs/release-notes/13-4-0/README.md
+++ b/docs/release-notes/13-4-0/README.md
@@ -88,7 +88,7 @@ Accessibility functionality: Convey to screenreaders when OAuth login has starte
OpenProject version 13.4 now supports PDF exports with lists in table cells that are displayed correctly. Export a work package that contains a table with lists in it into a PDF. Here is an example of how this looks from now on:
-![Work package with a table in the description field and how it looks when exportet as PDF](openproject-13-4-pdf-export-table-lists.png)
+![Work package with a table in the description field and how it looks when exported as PDF](openproject-13-4-pdf-export-table-lists.png)
### WebAuthn/FIDO/U2F is added as a second factor
@@ -139,13 +139,13 @@ Thanks to our great Community we can continuously offer more languages for OpenP
- Bugfix: LDAP user can't be created if optional attributes are not mapped \[[#53327](https://community.openproject.org/wp/53327)\]
- Bugfix: Page editor menu moves under the header \[[#53365](https://community.openproject.org/wp/53365)\]
- Bugfix: Project folder is shown in the main menu based on the wrong permission for automatically managed project folders \[[#53367](https://community.openproject.org/wp/53367)\]
-- Bugfix: Portuguese and Portuguese Brezilian should be distinct from each other \[[#53374](https://community.openproject.org/wp/53374)\]
+- Bugfix: Portuguese and Portuguese Brazilian should be distinct from each other \[[#53374](https://community.openproject.org/wp/53374)\]
- Bugfix: Blacklisted routes not working \[[#53399](https://community.openproject.org/wp/53399)\]
- Bugfix: Incorrect spelling of GitLab module under project settings \[[#53434](https://community.openproject.org/wp/53434)\]
- Bugfix: Webauthn fails on mobile Safari \[[#53442](https://community.openproject.org/wp/53442)\]
- Bugfix: Rake secret task gone in 13.3.1 (breaking scripts & diverging from docs) \[[#53447](https://community.openproject.org/wp/53447)\]
- Bugfix: WebAuth fails on iOS \[[#53494](https://community.openproject.org/wp/53494)\]
-- Bugfix: WebAuthen not selectable on mobile \[[#53495](https://community.openproject.org/wp/53495)\]
+- Bugfix: WebAuthn not selectable on mobile \[[#53495](https://community.openproject.org/wp/53495)\]
- Bugfix: Cannot delete reports in time and costs \[[#52284](https://community.openproject.org/projects/openproject/work_packages/52284/activity)\]
diff --git a/docs/release-notes/13-4-0/meetings-openproject-13-4-files.png b/docs/release-notes/13-4-0/meetings-openproject-13-4-files.png
index e5cad2c41941..ea441c0d869f 100644
Binary files a/docs/release-notes/13-4-0/meetings-openproject-13-4-files.png and b/docs/release-notes/13-4-0/meetings-openproject-13-4-files.png differ
diff --git a/docs/release-notes/13-4-0/openproject-13-4-intermediate-modal-nudging.jpg b/docs/release-notes/13-4-0/openproject-13-4-intermediate-modal-nudging.jpg
index 8af812a1a3d4..fef763895545 100644
Binary files a/docs/release-notes/13-4-0/openproject-13-4-intermediate-modal-nudging.jpg and b/docs/release-notes/13-4-0/openproject-13-4-intermediate-modal-nudging.jpg differ
diff --git a/docs/release-notes/13-4-0/openproject-13-4-meetings-copy-agenda-highlighted.png b/docs/release-notes/13-4-0/openproject-13-4-meetings-copy-agenda-highlighted.png
index 45585cd7fd61..5ac4c67b1fa6 100644
Binary files a/docs/release-notes/13-4-0/openproject-13-4-meetings-copy-agenda-highlighted.png and b/docs/release-notes/13-4-0/openproject-13-4-meetings-copy-agenda-highlighted.png differ
diff --git a/docs/release-notes/13-4-0/openproject-13-4-nudge-oauth.jpg b/docs/release-notes/13-4-0/openproject-13-4-nudge-oauth.jpg
deleted file mode 100644
index 8c2d677f8f57..000000000000
Binary files a/docs/release-notes/13-4-0/openproject-13-4-nudge-oauth.jpg and /dev/null differ
diff --git a/docs/release-notes/13-4-0/openproject-13-4-pdf-export-table-lists.png b/docs/release-notes/13-4-0/openproject-13-4-pdf-export-table-lists.png
index 8e67103b32ec..0864c8a0fca7 100644
Binary files a/docs/release-notes/13-4-0/openproject-13-4-pdf-export-table-lists.png and b/docs/release-notes/13-4-0/openproject-13-4-pdf-export-table-lists.png differ
diff --git a/docs/release-notes/13-4-0/openproject_system_settings_virus_scanning.png b/docs/release-notes/13-4-0/openproject_system_settings_virus_scanning.png
deleted file mode 100644
index cee2c77825c2..000000000000
Binary files a/docs/release-notes/13-4-0/openproject_system_settings_virus_scanning.png and /dev/null differ
diff --git a/docs/release-notes/13-4-0/openproject_virus_scanning.png b/docs/release-notes/13-4-0/openproject_virus_scanning.png
index 52bebc987c66..9cae7c1d47f9 100644
Binary files a/docs/release-notes/13-4-0/openproject_virus_scanning.png and b/docs/release-notes/13-4-0/openproject_virus_scanning.png differ
diff --git a/docs/release-notes/3/3-0-16/README.md b/docs/release-notes/3/3-0-16/README.md
index ac8cd5306918..c5ab39238e14 100644
--- a/docs/release-notes/3/3-0-16/README.md
+++ b/docs/release-notes/3/3-0-16/README.md
@@ -28,6 +28,6 @@ bugs!
For a complete list of changes, please refer to the
[Changelog v3.0.16](https://community.openproject.org/versions/544)
or have a look at
-[Github](https://github.com/opf/openproject/tree/v3.0.16).
+[GitHub](https://github.com/opf/openproject/tree/v3.0.16).
diff --git a/docs/release-notes/4/4-0-2/README.md b/docs/release-notes/4/4-0-2/README.md
index dc4c12179dca..b517b918ff79 100644
--- a/docs/release-notes/4/4-0-2/README.md
+++ b/docs/release-notes/4/4-0-2/README.md
@@ -36,4 +36,4 @@ A big thanks to everyone involved in fixing and reporting those bugs!
For a complete list of changes, please refer to the
[Changelog v4.0.2](https://community.openproject.org/versions/532)
or to
-[Github](https://github.com/opf/openproject/tree/v4.0.2).
+[GitHub](https://github.com/opf/openproject/tree/v4.0.2).
diff --git a/docs/release-notes/8/8-0-2/README.md b/docs/release-notes/8/8-0-2/README.md
index ee9d09ba74b6..bb055bfa229c 100644
--- a/docs/release-notes/8/8-0-2/README.md
+++ b/docs/release-notes/8/8-0-2/README.md
@@ -45,7 +45,7 @@ newest version.
#### Contributions
-Thanks to Github users @storm2513 and @akasparas for providing bugfixes
+Thanks to GitHub users @storm2513 and @akasparas for providing bugfixes
as pull requests [on our GitHub
project](https://github.com/opf/openproject). A big thanks to community
members for reporting bugs and helping us identifying and providing
diff --git a/docs/security-and-privacy/processing-of-personal-data/README.md b/docs/security-and-privacy/processing-of-personal-data/README.md
index e56cc6be77b9..b361b802270e 100644
--- a/docs/security-and-privacy/processing-of-personal-data/README.md
+++ b/docs/security-and-privacy/processing-of-personal-data/README.md
@@ -580,7 +580,7 @@ flowchart LR
subgraph openproject[OpenProject]
direction TB
- opgithubintegration[Github integration] --- workpackagesmodule[Work packages module]
+ opgithubintegration[GitHub integration] --- workpackagesmodule[Work packages module]
end
@@ -635,7 +635,7 @@ flowchart LR
#### Purpose
- Connect merge requests in GitLab with work packages in OpenProject.
-- Connect issues in GitLab with work packages in OpenPrject.
+- Connect issues in GitLab with work packages in OpenProject.
- Show the status of merge requests in related work packages.
#### Processed data
diff --git a/docs/system-admin-guide/attachments/openproject_system_adminstration_attachment_settings.png b/docs/system-admin-guide/attachments/openproject_system_adminstration_attachment_settings.png
index 9700924b171e..b59d032de6fe 100644
Binary files a/docs/system-admin-guide/attachments/openproject_system_adminstration_attachment_settings.png and b/docs/system-admin-guide/attachments/openproject_system_adminstration_attachment_settings.png differ
diff --git a/docs/system-admin-guide/attachments/openproject_system_adminstration_attachments.png b/docs/system-admin-guide/attachments/openproject_system_adminstration_attachments.png
index b976b79b392d..87eb08724f38 100644
Binary files a/docs/system-admin-guide/attachments/openproject_system_adminstration_attachments.png and b/docs/system-admin-guide/attachments/openproject_system_adminstration_attachments.png differ
diff --git a/docs/system-admin-guide/attachments/virus-scanning/image-20240220-iedi.png b/docs/system-admin-guide/attachments/virus-scanning/image-20240220-iedi.png
deleted file mode 100644
index 42f26c07fecc..000000000000
Binary files a/docs/system-admin-guide/attachments/virus-scanning/image-20240220-iedi.png and /dev/null differ
diff --git a/docs/system-admin-guide/attachments/virus-scanning/openproject_system_settings_virus_scanning.png b/docs/system-admin-guide/attachments/virus-scanning/openproject_system_settings_virus_scanning.png
index cee2c77825c2..ea4b533ad8bb 100644
Binary files a/docs/system-admin-guide/attachments/virus-scanning/openproject_system_settings_virus_scanning.png and b/docs/system-admin-guide/attachments/virus-scanning/openproject_system_settings_virus_scanning.png differ
diff --git a/docs/system-admin-guide/design/Sys-admin-design-favicon-1579613889024.png b/docs/system-admin-guide/design/Sys-admin-design-favicon-1579613889024.png
deleted file mode 100644
index 43972eabc841..000000000000
Binary files a/docs/system-admin-guide/design/Sys-admin-design-favicon-1579613889024.png and /dev/null differ
diff --git a/docs/system-admin-guide/design/Sys-admin-design-favicon.png b/docs/system-admin-guide/design/Sys-admin-design-favicon.png
index 25d42aa599a9..e0c4d6516e8a 100644
Binary files a/docs/system-admin-guide/design/Sys-admin-design-favicon.png and b/docs/system-admin-guide/design/Sys-admin-design-favicon.png differ
diff --git a/docs/system-admin-guide/design/Sys-admin-design-upload-logo.png b/docs/system-admin-guide/design/Sys-admin-design-upload-logo.png
index b577b6716eea..deee0aefa7ea 100644
Binary files a/docs/system-admin-guide/design/Sys-admin-design-upload-logo.png and b/docs/system-admin-guide/design/Sys-admin-design-upload-logo.png differ
diff --git a/docs/system-admin-guide/design/System-admin-guide_color-theme.png b/docs/system-admin-guide/design/System-admin-guide_color-theme.png
index ebe6e007c68e..6e0befe01cda 100644
Binary files a/docs/system-admin-guide/design/System-admin-guide_color-theme.png and b/docs/system-admin-guide/design/System-admin-guide_color-theme.png differ
diff --git a/docs/system-admin-guide/design/System-admin-guide_design.png b/docs/system-admin-guide/design/System-admin-guide_design.png
deleted file mode 100644
index 9557c4712363..000000000000
Binary files a/docs/system-admin-guide/design/System-admin-guide_design.png and /dev/null differ
diff --git a/docs/system-admin-guide/design/image-20200121143402479.png b/docs/system-admin-guide/design/image-20200121143402479.png
deleted file mode 100644
index 06225d6018fc..000000000000
Binary files a/docs/system-admin-guide/design/image-20200121143402479.png and /dev/null differ
diff --git a/docs/system-admin-guide/design/image-20200211140615090.png b/docs/system-admin-guide/design/image-20200211140615090.png
deleted file mode 100644
index f80c7c93cdc9..000000000000
Binary files a/docs/system-admin-guide/design/image-20200211140615090.png and /dev/null differ
diff --git a/docs/system-admin-guide/design/openproject_system_guide_design.png b/docs/system-admin-guide/design/openproject_system_guide_design.png
index 1fa57a9a2b7d..d5a8fc355f66 100644
Binary files a/docs/system-admin-guide/design/openproject_system_guide_design.png and b/docs/system-admin-guide/design/openproject_system_guide_design.png differ
diff --git a/docs/system-admin-guide/design/openproject_system_guide_design_advanced_settings.png b/docs/system-admin-guide/design/openproject_system_guide_design_advanced_settings.png
index 0e661eb519a2..ba6efe9d90d8 100644
Binary files a/docs/system-admin-guide/design/openproject_system_guide_design_advanced_settings.png and b/docs/system-admin-guide/design/openproject_system_guide_design_advanced_settings.png differ
diff --git a/docs/system-admin-guide/design/system_admin_logo_updated.png b/docs/system-admin-guide/design/system_admin_logo_updated.png
index b0d1f1468357..cb4768e1067a 100644
Binary files a/docs/system-admin-guide/design/system_admin_logo_updated.png and b/docs/system-admin-guide/design/system_admin_logo_updated.png differ
diff --git a/docs/system-admin-guide/file-storages/README.md b/docs/system-admin-guide/file-storages/README.md
index 5c36009d83d9..da8a50c8a7d6 100644
--- a/docs/system-admin-guide/file-storages/README.md
+++ b/docs/system-admin-guide/file-storages/README.md
@@ -3,7 +3,7 @@ sidebar_navigation:
title: File storages
priority: 830
description: File storages in OpenProject.
-keywords: file storages, Nextcloud setup, Nextcloud integration, OneDrive setup, Sharepoint setup, OneDrive, Sharepoint
+keywords: file storages, Nextcloud setup, Nextcloud integration, OneDrive setup, SharePoint setup, OneDrive, SharePoint
---
# File storages
diff --git a/docs/system-admin-guide/integrations/README.md b/docs/system-admin-guide/integrations/README.md
index d4b645ad04b4..1285fe09def6 100644
--- a/docs/system-admin-guide/integrations/README.md
+++ b/docs/system-admin-guide/integrations/README.md
@@ -46,7 +46,7 @@ OpenProject offers integration with Nextcloud for file storage and collaboration
## OneDrive/SharePoint (Enterprise add-on)
-OpenProject offers an integration with OneDrive/Sharepoint for file storage and collaboration. You can find more information about [setting up the integration with OneDrive/SharePoint](./one-drive) and [using the integration](../../user-guide/file-management/one-drive-integration/).
+OpenProject offers an integration with OneDrive/SharePoint for file storage and collaboration. You can find more information about [setting up the integration with OneDrive/SharePoint](./one-drive) and [using the integration](../../user-guide/file-management/one-drive-integration/).
> **Note**: OneDrive/SharePoint integration is an Enterprise add-on and can only be used with [Enterprise cloud](../../enterprise-guide/enterprise-cloud-guide/) or [Enterprise on-premises](../../enterprise-guide/enterprise-on-premises-guide/). An upgrade from the free Community edition is easy and helps support OpenProject.
diff --git a/docs/system-admin-guide/integrations/github-integration/README.md b/docs/system-admin-guide/integrations/github-integration/README.md
index fff564826bc6..8db04cc83cb0 100644
--- a/docs/system-admin-guide/integrations/github-integration/README.md
+++ b/docs/system-admin-guide/integrations/github-integration/README.md
@@ -28,7 +28,7 @@ Pull request activities will also show up in the Activity tab when the pull requ
* merged
* closed
-![Github comments on work package](workpackage-github-comments.png)
+![GitHub comments on work package](workpackage-github-comments.png)
## Create a pull request
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/README.md b/docs/system-admin-guide/integrations/gitlab-integration/README.md
index de18ed91a139..d4a8e2d7ffc2 100644
--- a/docs/system-admin-guide/integrations/gitlab-integration/README.md
+++ b/docs/system-admin-guide/integrations/gitlab-integration/README.md
@@ -13,7 +13,7 @@ OpenProject offers an integration with GitLab merge requests to link software de
OpenProject work packages will directly display information from GitLab in a separate tab.
-![Gitlab tab in an OpenProject work package](gitlab-tab.png)
+![GitLab tab in an OpenProject work package](gitlab-tab.png)
The tab shows all merge requests (MR) linked to a work package with the corresponding status (e.g. 'Ready' or 'Merged') as well as the state (e.g. 'success' or 'queued') of the GitLab actions configured to run for a MR. MRs and work packages are in an n:m relationship, so a work package can be linked to multiple merge requests and a merge request can be linked to multiple work packages.
@@ -100,7 +100,7 @@ You can now publish your branch (you can also do this later, after making the ch
With the branch opened, you can start the actual development work using your preferred tool to alter your codebase.
-![Gitlab changes in a merge request changes](gitlab-changes.png)
+![GitLab changes in a merge request changes](gitlab-changes.png)
Once you are satisfied with the changes you can create a commit. Within the 'Git snippets' menu, OpenProject suggests a commit message for you based on the title and the URL of the work package.
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/gitlab-changes.png b/docs/system-admin-guide/integrations/gitlab-integration/gitlab-changes.png
index 8864c8dba762..efdd00b8cb1e 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/gitlab-changes.png and b/docs/system-admin-guide/integrations/gitlab-integration/gitlab-changes.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/gitlab-tab.png b/docs/system-admin-guide/integrations/gitlab-integration/gitlab-tab.png
index b811186ef0a0..46f459406766 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/gitlab-tab.png and b/docs/system-admin-guide/integrations/gitlab-integration/gitlab-tab.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-activity-tab.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-activity-tab.png
index 1681730da097..529031251afe 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-activity-tab.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-activity-tab.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-branch-name.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-branch-name.png
index c65d82f32f31..681373ce2d9c 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-branch-name.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-branch-name.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-commit-message-in-client.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-commit-message-in-client.png
index 9bac3fa1390a..f52498d3d488 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-commit-message-in-client.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-commit-message-in-client.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-branch.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-branch.png
index 462dc662780e..f43910d175f7 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-branch.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-branch.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr-detail.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr-detail.png
index 5d3f49e00246..afb68a3d78cd 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr-detail.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr-detail.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr.png
index f04bf02f8423..4191b8d03c77 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-create-mr.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets-commit-message.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets-commit-message.png
index 45eb212ce119..ffd2762e3842 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets-commit-message.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets-commit-message.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets.png
index d78823fb8f9d..2337bf9395fa 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-git-snippets.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-actions.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-actions.png
index e4e51696156b..300a3b5b4b39 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-actions.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-actions.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-issue.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-issue.png
index 6ddd7402d8ad..b1dfdeba59ed 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-issue.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-issue.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-webhook.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-webhook.png
index a4f751e00a68..df924dc1b4b1 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-webhook.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-gitlab-webhook.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-opened.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-opened.png
index 166cc2070e4c..0e12505ea012 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-opened.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-opened.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-status.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-status.png
index c5d95b69a498..f3b2f47d80c1 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-status.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-mr-status.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-new-issues.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-new-issues.png
index b8377598f355..738f4be2aedf 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-new-issues.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-new-issues.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-no-issues.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-no-issues.png
index b822b09415b0..fdb5b565babc 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-no-issues.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-no-issues.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-member.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-member.png
index 4314b43eec37..3fac0b7a57e7 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-member.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-member.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-modules.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-modules.png
index ed4b6aed38ad..f3934ff1cd09 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-modules.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-project-modules.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-publish-branch.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-publish-branch.png
index 36326daaa118..d345eed58812 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-publish-branch.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-publish-branch.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-push-activity.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-push-activity.png
index b7cb87b01cdb..662893a605d6 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-push-activity.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-push-activity.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-role.png b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-role.png
index 5228926ea92e..3f2035d8279c 100644
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-role.png and b/docs/system-admin-guide/integrations/gitlab-integration/openproject-system-guide-gitlab-integration-role.png differ
diff --git a/docs/system-admin-guide/integrations/gitlab-integration/workpackage-github-comments.png b/docs/system-admin-guide/integrations/gitlab-integration/workpackage-github-comments.png
deleted file mode 100644
index 833b52931ae6..000000000000
Binary files a/docs/system-admin-guide/integrations/gitlab-integration/workpackage-github-comments.png and /dev/null differ
diff --git a/docs/system-admin-guide/integrations/nextcloud/README.md b/docs/system-admin-guide/integrations/nextcloud/README.md
index aa4ea7617d89..1fc9d5a245a0 100644
--- a/docs/system-admin-guide/integrations/nextcloud/README.md
+++ b/docs/system-admin-guide/integrations/nextcloud/README.md
@@ -348,9 +348,9 @@ You have setup the *Project folder* in both environments (Nextcloud and OpenProj
a. If you have root access to the OpenProject server where your worker should be running, check if the worker processes are in fact present:
`ps aux | grep job`
- The result should show lines containing `bundle exec bundle exec good_job start`
+ The result should show lines containing `bundle exec rake jobs:work`
- b. If you don't have root access to the OpenProject server then you can check the following URL in your browser: `https:///health_checks/all` (please insert the domain name of your OpenProject server). If your background workers are running, you should see a line like that `worker_backed_up: PASSED No jobs are waiting to be picked up.`
+ b. If you don't have root access to the OpenProject server then you can check the following URL in your browser: `https:///health_checks/all` (please insert the domain name of your OpenProject server). If your background workers are running, you should see a line like that `delayed_jobs_never_ran: PASSED All previous jobs have completed within the past 5 minutes`
2. Ensure that your project is setup correctly:
1. In your browser navigate to the project for which you want the **Project folders** feature to be working.
diff --git a/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details.png b/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details.png
deleted file mode 100644
index e7406bf8eb79..000000000000
Binary files a/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details.png and /dev/null differ
diff --git a/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details_new.png b/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details_new.png
index 9bcd1e54830f..638e0d98fcf9 100644
Binary files a/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details_new.png and b/docs/system-admin-guide/integrations/one-drive/openproject_system_guide_new_onedrive_storage_details_new.png differ
diff --git a/docs/user-guide/file-management/README.md b/docs/user-guide/file-management/README.md
index 9283527bd02c..e881b5bce977 100644
--- a/docs/user-guide/file-management/README.md
+++ b/docs/user-guide/file-management/README.md
@@ -12,7 +12,7 @@ keywords: files, attachment, Nextcloud, OneDrive, SharePoint
|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [Manual upload](#manual-upload) | How to manually upload files to work packages in OpenProject. |
| [Nextcloud integration](#nextcloud-integration) | How to manage files using Nextcloud integration in OpenProject. |
-| [OneDrive/SharePoint integration](#onedrivesharepoint-integration-enterprise-add-on) | How to manage files using OneDrive/Sharepoint integration in OpenProject. |
+| [OneDrive/SharePoint integration](#onedrivesharepoint-integration-enterprise-add-on) | How to manage files using OneDrive/SharePoint integration in OpenProject. |
| [File management FAQs](./file-management-faq) | Frequently asked questions on file management in OpenProject. |
There are several ways of adding or linking files to work packages in OpenProject. You can manually attach files directly to work packages or use one of the integrations with file management systems.
diff --git a/docs/user-guide/file-management/nextcloud-integration/nc-new-work-package-created.png b/docs/user-guide/file-management/nextcloud-integration/nc-new-work-package-created.png
index 062391e426ef..fd34461acbe0 100644
Binary files a/docs/user-guide/file-management/nextcloud-integration/nc-new-work-package-created.png and b/docs/user-guide/file-management/nextcloud-integration/nc-new-work-package-created.png differ
diff --git a/docs/user-guide/file-management/nextcloud-integration/nc_create_new_wp.png b/docs/user-guide/file-management/nextcloud-integration/nc_create_new_wp.png
index a189c134f9a2..d6488081dc00 100644
Binary files a/docs/user-guide/file-management/nextcloud-integration/nc_create_new_wp.png and b/docs/user-guide/file-management/nextcloud-integration/nc_create_new_wp.png differ
diff --git a/docs/user-guide/file-management/nextcloud-integration/nc_select_multiple_files.png b/docs/user-guide/file-management/nextcloud-integration/nc_select_multiple_files.png
index f17bedc2f6d2..c48dce2e9953 100644
Binary files a/docs/user-guide/file-management/nextcloud-integration/nc_select_multiple_files.png and b/docs/user-guide/file-management/nextcloud-integration/nc_select_multiple_files.png differ
diff --git a/docs/user-guide/file-management/nextcloud-integration/nc_select_wp_to_link.png b/docs/user-guide/file-management/nextcloud-integration/nc_select_wp_to_link.png
index d388e701ee9c..9201ad47bb23 100644
Binary files a/docs/user-guide/file-management/nextcloud-integration/nc_select_wp_to_link.png and b/docs/user-guide/file-management/nextcloud-integration/nc_select_wp_to_link.png differ
diff --git a/docs/user-guide/file-management/one-drive-integration/README.md b/docs/user-guide/file-management/one-drive-integration/README.md
index 9b29dce4242e..8344e260a66b 100644
--- a/docs/user-guide/file-management/one-drive-integration/README.md
+++ b/docs/user-guide/file-management/one-drive-integration/README.md
@@ -33,7 +33,7 @@ To begin using this integration, you will need to first connect your OpenProject
1. Select any work package. Go to the **Files tab** and, within the correct file storage section, click on **Storage login** button.
- ![Login to Sharepoint storage from an OpenProject work package](openproject_onedrive_login_to_storage.png)
+ ![Login to SharePoint storage from an OpenProject work package](openproject_onedrive_login_to_storage.png)
2. You will see a Microsoft login prompt asking you to log in. Enter your credentials and log in.
3. Once you have logged in, you will automatically return to the work package in OpenProject and see that you can now start uploading and linking files.
@@ -71,7 +71,7 @@ Once you have selected or dropped the files you would like to upload, you will n
> **Info**: The default location that opens in the file picker is the file root of the configured OneDrive/SharePoint drive.
-![Selection a Sharepoint location to upload a file from OpenProject](openproject_onedrive_select_location.png)
+![Selection a SharePoint location to upload a file from OpenProject](openproject_onedrive_select_location.png)
You can click on folders you see to navigate to them. Helpful breadcrumbs show you where you are in the folder hierarchy.
@@ -83,7 +83,7 @@ To save the files you uploaded to the currently open folder, click on the **Choo
The selected file is uploaded to your OneDrive/SharePoint instance and linked to the current work package. It appears under the name of the file storage.
-![File successfully uploaded to Sharepoint storage](openproject_onedrive_file_uploaded.png)
+![File successfully uploaded to SharePoint storage](openproject_onedrive_file_uploaded.png)
If a file has been deleted on the OneDrive/SharePoint file storage it will still be displayed under the **Files** tab. However it will not be selectable. If you hover over a deleted file you will see the message indicating that the file could not be found.
@@ -95,7 +95,7 @@ If a file has been deleted on the OneDrive/SharePoint file storage it will still
If you wish to unlink any linked file or folder, hover it in the list of linked files and click on the **Unlink** icon.
-![Unlink a linked Sharepoint file from an OpenProject work package](openproject_onedrive_download_file.png)
+![Unlink a linked SharePoint file from an OpenProject work package](openproject_onedrive_download_file.png)
Respectively in order to download a file, click on the **Download icon** in the context menu of the file link in the list of the linked files.
diff --git a/docs/user-guide/gantt-chart/activate-gantt.gif b/docs/user-guide/gantt-chart/activate-gantt.gif
deleted file mode 100644
index f7fb2ff6de7d..000000000000
Binary files a/docs/user-guide/gantt-chart/activate-gantt.gif and /dev/null differ
diff --git a/docs/user-guide/gantt-chart/collapse-all-expand-all.png b/docs/user-guide/gantt-chart/collapse-all-expand-all.png
deleted file mode 100644
index 1503ea060e78..000000000000
Binary files a/docs/user-guide/gantt-chart/collapse-all-expand-all.png and /dev/null differ
diff --git a/docs/user-guide/gantt-chart/dependencies-gantt-chart-1566556144225.gif b/docs/user-guide/gantt-chart/dependencies-gantt-chart-1566556144225.gif
deleted file mode 100644
index 4cfedbe4a203..000000000000
Binary files a/docs/user-guide/gantt-chart/dependencies-gantt-chart-1566556144225.gif and /dev/null differ
diff --git a/docs/user-guide/gantt-chart/image-20201211020748715.png b/docs/user-guide/gantt-chart/image-20201211020748715.png
deleted file mode 100644
index 1df2323bbb2d..000000000000
Binary files a/docs/user-guide/gantt-chart/image-20201211020748715.png and /dev/null differ
diff --git a/docs/user-guide/gantt-chart/image-20201211131511543.png b/docs/user-guide/gantt-chart/image-20201211131511543.png
deleted file mode 100644
index cf520a70c35b..000000000000
Binary files a/docs/user-guide/gantt-chart/image-20201211131511543.png and /dev/null differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-configure-gantt-chart.gif b/docs/user-guide/gantt-chart/openproject-user-guide-configure-gantt-chart.gif
index db5c44f302fd..52e101ff55a6 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-configure-gantt-chart.gif and b/docs/user-guide/gantt-chart/openproject-user-guide-configure-gantt-chart.gif differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-auto-zoom.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-auto-zoom.png
index ee499cca076d..9da602392d06 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-auto-zoom.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-auto-zoom.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-collapse-all.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-collapse-all.png
index 4b623faf9385..a218c8a38254 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-collapse-all.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-collapse-all.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-filters.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-filters.png
index f9ecfeb53596..14df5d466014 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-filters.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-filters.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-views.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-views.png
index d9de4df0a85f..e6617ee79d79 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-views.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-views.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zen-mode.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zen-mode.png
index 50ac0cbdf8d2..d4f2209c0735 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zen-mode.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zen-mode.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zoom.png b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zoom.png
index 8419fbf6fd25..b6e2991edbc1 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zoom.png and b/docs/user-guide/gantt-chart/openproject-user-guide-gantt-charts-zoom.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts-global.png b/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts-global.png
index 3800c47c724a..d24e3625f174 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts-global.png and b/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts-global.png differ
diff --git a/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts.png b/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts.png
index f8706ea066eb..0d13b508bbeb 100644
Binary files a/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts.png and b/docs/user-guide/gantt-chart/openproject-user-guide-select-gantt-charts.png differ
diff --git a/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu.png b/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu.png
index 67359ff634b1..acdf764350e2 100644
Binary files a/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu.png and b/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu.png differ
diff --git a/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu_grid_icon.png b/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu_grid_icon.png
index 6b84f69164dc..917c54463bd4 100644
Binary files a/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu_grid_icon.png and b/docs/user-guide/home/global-modules/open_project_user_guide_global_modules_menu_grid_icon.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_boards.png b/docs/user-guide/home/global-modules/openproject_global_modules_boards.png
index 224ef34f1153..9aa013f6258c 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_boards.png and b/docs/user-guide/home/global-modules/openproject_global_modules_boards.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_calendars.png b/docs/user-guide/home/global-modules/openproject_global_modules_calendars.png
index 413c8b7c868f..f2241a4086db 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_calendars.png and b/docs/user-guide/home/global-modules/openproject_global_modules_calendars.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_gantt_charts.png b/docs/user-guide/home/global-modules/openproject_global_modules_gantt_charts.png
index 310caf1e652a..2f8ea9291e52 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_gantt_charts.png and b/docs/user-guide/home/global-modules/openproject_global_modules_gantt_charts.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_myprojects_filter.png b/docs/user-guide/home/global-modules/openproject_global_modules_myprojects_filter.png
deleted file mode 100644
index 5314ccf0b749..000000000000
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_myprojects_filter.png and /dev/null differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_news.png b/docs/user-guide/home/global-modules/openproject_global_modules_news.png
index c94eecab8fbc..11a381d68e0f 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_news.png and b/docs/user-guide/home/global-modules/openproject_global_modules_news.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_projects.png b/docs/user-guide/home/global-modules/openproject_global_modules_projects.png
index 453183be86f5..4e395fb51f78 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_projects.png and b/docs/user-guide/home/global-modules/openproject_global_modules_projects.png differ
diff --git a/docs/user-guide/home/global-modules/openproject_global_modules_team_planner.png b/docs/user-guide/home/global-modules/openproject_global_modules_team_planner.png
index 7874b02d1b33..325b08e038b1 100644
Binary files a/docs/user-guide/home/global-modules/openproject_global_modules_team_planner.png and b/docs/user-guide/home/global-modules/openproject_global_modules_team_planner.png differ
diff --git a/docs/user-guide/home/openproject_user_guide_home_page.png b/docs/user-guide/home/openproject_user_guide_home_page.png
index 000650c687da..a8da1232609e 100644
Binary files a/docs/user-guide/home/openproject_user_guide_home_page.png and b/docs/user-guide/home/openproject_user_guide_home_page.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/copy-meeting.png b/docs/user-guide/meetings/classic-meetings/copy-meeting.png
index 210c72a613d0..4c0c2432faa4 100644
Binary files a/docs/user-guide/meetings/classic-meetings/copy-meeting.png and b/docs/user-guide/meetings/classic-meetings/copy-meeting.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/create-new-classic-meeting.png b/docs/user-guide/meetings/classic-meetings/create-new-classic-meeting.png
index afc12ea56009..60f43708da40 100644
Binary files a/docs/user-guide/meetings/classic-meetings/create-new-classic-meeting.png and b/docs/user-guide/meetings/classic-meetings/create-new-classic-meeting.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/delete-meeting.png b/docs/user-guide/meetings/classic-meetings/delete-meeting.png
index 28875a5a8334..d4806a22dead 100644
Binary files a/docs/user-guide/meetings/classic-meetings/delete-meeting.png and b/docs/user-guide/meetings/classic-meetings/delete-meeting.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/download-a-meeting.png b/docs/user-guide/meetings/classic-meetings/download-a-meeting.png
index 585a7417d634..a35f86043491 100644
Binary files a/docs/user-guide/meetings/classic-meetings/download-a-meeting.png and b/docs/user-guide/meetings/classic-meetings/download-a-meeting.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/edit-meeting-agenda.png b/docs/user-guide/meetings/classic-meetings/edit-meeting-agenda.png
index 8985994db0a8..b16c132d2f07 100644
Binary files a/docs/user-guide/meetings/classic-meetings/edit-meeting-agenda.png and b/docs/user-guide/meetings/classic-meetings/edit-meeting-agenda.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/edit-meeting.png b/docs/user-guide/meetings/classic-meetings/edit-meeting.png
index a337bbe740f6..94b50695f163 100644
Binary files a/docs/user-guide/meetings/classic-meetings/edit-meeting.png and b/docs/user-guide/meetings/classic-meetings/edit-meeting.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/edit-minutes.png b/docs/user-guide/meetings/classic-meetings/edit-minutes.png
index 34cfc122a7fa..dafb27a6b89c 100644
Binary files a/docs/user-guide/meetings/classic-meetings/edit-minutes.png and b/docs/user-guide/meetings/classic-meetings/edit-minutes.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/meeting-participants.png b/docs/user-guide/meetings/classic-meetings/meeting-participants.png
index 24832bd7a1d1..59eaaf0f77c4 100644
Binary files a/docs/user-guide/meetings/classic-meetings/meeting-participants.png and b/docs/user-guide/meetings/classic-meetings/meeting-participants.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/meetings.png b/docs/user-guide/meetings/classic-meetings/meetings.png
index eae8071876cc..797bef102d9d 100644
Binary files a/docs/user-guide/meetings/classic-meetings/meetings.png and b/docs/user-guide/meetings/classic-meetings/meetings.png differ
diff --git a/docs/user-guide/meetings/classic-meetings/send-email-to-participants.png b/docs/user-guide/meetings/classic-meetings/send-email-to-participants.png
index 1ee9736e329d..c853a095234b 100644
Binary files a/docs/user-guide/meetings/classic-meetings/send-email-to-participants.png and b/docs/user-guide/meetings/classic-meetings/send-email-to-participants.png differ
diff --git a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting.png b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting.png
index 5caa45d31422..20287abc5bce 100644
Binary files a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting.png and b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting.png differ
diff --git a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting_details.png b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting_details.png
index a7c2620e650f..48991f2d121b 100644
Binary files a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting_details.png and b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_copy_meeting_details.png differ
diff --git a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_delete_meeting.png b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_delete_meeting.png
index 4d8b64a91135..e9ee987262d3 100644
Binary files a/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_delete_meeting.png and b/docs/user-guide/meetings/dynamic-meetings/openproject_dynamic_meetings_delete_meeting.png differ
diff --git a/docs/user-guide/meetings/dynamic-meetings/openproject_userguid_dynamic_meeting_edit_title.png b/docs/user-guide/meetings/dynamic-meetings/openproject_userguid_dynamic_meeting_edit_title.png
index ad9ad398bf2c..469cd761baa6 100644
Binary files a/docs/user-guide/meetings/dynamic-meetings/openproject_userguid_dynamic_meeting_edit_title.png and b/docs/user-guide/meetings/dynamic-meetings/openproject_userguid_dynamic_meeting_edit_title.png differ
diff --git a/docs/user-guide/projects/delete-a-project.png b/docs/user-guide/projects/delete-a-project.png
index ba6a37d14f34..0f93a047fb5c 100644
Binary files a/docs/user-guide/projects/delete-a-project.png and b/docs/user-guide/projects/delete-a-project.png differ
diff --git a/docs/user-guide/projects/new-subproject-project-list.png b/docs/user-guide/projects/new-subproject-project-list.png
deleted file mode 100644
index aa02969491a0..000000000000
Binary files a/docs/user-guide/projects/new-subproject-project-list.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-information-copy-project.png b/docs/user-guide/projects/project-information-copy-project.png
index f7e0b1b60bd1..8e0854525fa2 100644
Binary files a/docs/user-guide/projects/project-information-copy-project.png and b/docs/user-guide/projects/project-information-copy-project.png differ
diff --git a/docs/user-guide/projects/project-list-filter.png b/docs/user-guide/projects/project-list-filter.png
index 816ec641625b..3f782e95d2c5 100644
Binary files a/docs/user-guide/projects/project-list-filter.png and b/docs/user-guide/projects/project-list-filter.png differ
diff --git a/docs/user-guide/projects/project-lists/Filter-projects-list.png b/docs/user-guide/projects/project-lists/Filter-projects-list.png
deleted file mode 100644
index 10151c4d2ed3..000000000000
Binary files a/docs/user-guide/projects/project-lists/Filter-projects-list.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/Name-private-projects-filter.png b/docs/user-guide/projects/project-lists/Name-private-projects-filter.png
index 6e3e89e4479c..0b228bf09c86 100644
Binary files a/docs/user-guide/projects/project-lists/Name-private-projects-filter.png and b/docs/user-guide/projects/project-lists/Name-private-projects-filter.png differ
diff --git a/docs/user-guide/projects/project-lists/Project-list-button.png b/docs/user-guide/projects/project-lists/Project-list-button.png
index 120e2c05128b..0c285f387e0c 100644
Binary files a/docs/user-guide/projects/project-lists/Project-list-button.png and b/docs/user-guide/projects/project-lists/Project-list-button.png differ
diff --git a/docs/user-guide/projects/project-lists/activity-global-menu.png b/docs/user-guide/projects/project-lists/activity-global-menu.png
index 8bbec85ab6a0..cb5e36fae9ee 100644
Binary files a/docs/user-guide/projects/project-lists/activity-global-menu.png and b/docs/user-guide/projects/project-lists/activity-global-menu.png differ
diff --git a/docs/user-guide/projects/project-lists/actvity-global-filter.png b/docs/user-guide/projects/project-lists/actvity-global-filter.png
index acec7c885314..78fa94d6291e 100644
Binary files a/docs/user-guide/projects/project-lists/actvity-global-filter.png and b/docs/user-guide/projects/project-lists/actvity-global-filter.png differ
diff --git a/docs/user-guide/projects/project-lists/arrow-project-description.png b/docs/user-guide/projects/project-lists/arrow-project-description.png
deleted file mode 100644
index 8ab28ed52d19..000000000000
Binary files a/docs/user-guide/projects/project-lists/arrow-project-description.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/configure-project-list.png b/docs/user-guide/projects/project-lists/configure-project-list.png
deleted file mode 100644
index 4f4a6f2d41e5..000000000000
Binary files a/docs/user-guide/projects/project-lists/configure-project-list.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/configure-view-form-project-list.png b/docs/user-guide/projects/project-lists/configure-view-form-project-list.png
index 3240d3b13de2..4ecd9566bca4 100644
Binary files a/docs/user-guide/projects/project-lists/configure-view-form-project-list.png and b/docs/user-guide/projects/project-lists/configure-view-form-project-list.png differ
diff --git a/docs/user-guide/projects/project-lists/configure-view-project-list.png b/docs/user-guide/projects/project-lists/configure-view-project-list.png
index 8ffa1b67f883..5ae98e35a78e 100644
Binary files a/docs/user-guide/projects/project-lists/configure-view-project-list.png and b/docs/user-guide/projects/project-lists/configure-view-project-list.png differ
diff --git a/docs/user-guide/projects/project-lists/display-all-workpackages.png b/docs/user-guide/projects/project-lists/display-all-workpackages.png
index b7beb129d259..8c42a507e028 100644
Binary files a/docs/user-guide/projects/project-lists/display-all-workpackages.png and b/docs/user-guide/projects/project-lists/display-all-workpackages.png differ
diff --git a/docs/user-guide/projects/project-lists/expand-link-project-description.png b/docs/user-guide/projects/project-lists/expand-link-project-description.png
index e59f128607bd..f27246010edb 100644
Binary files a/docs/user-guide/projects/project-lists/expand-link-project-description.png and b/docs/user-guide/projects/project-lists/expand-link-project-description.png differ
diff --git a/docs/user-guide/projects/project-lists/export-project-list-formats.png b/docs/user-guide/projects/project-lists/export-project-list-formats.png
index 3163ac310963..4f244ce916a3 100644
Binary files a/docs/user-guide/projects/project-lists/export-project-list-formats.png and b/docs/user-guide/projects/project-lists/export-project-list-formats.png differ
diff --git a/docs/user-guide/projects/project-lists/export-projects.png b/docs/user-guide/projects/project-lists/export-projects.png
index 16349d1031c3..c0c677e9d448 100644
Binary files a/docs/user-guide/projects/project-lists/export-projects.png and b/docs/user-guide/projects/project-lists/export-projects.png differ
diff --git a/docs/user-guide/projects/project-lists/navigation-bar-modules-3923134.png b/docs/user-guide/projects/project-lists/navigation-bar-modules-3923134.png
deleted file mode 100644
index 2ff03580934e..000000000000
Binary files a/docs/user-guide/projects/project-lists/navigation-bar-modules-3923134.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/navigation-bar-modules.png b/docs/user-guide/projects/project-lists/navigation-bar-modules.png
index 57fd78f478a5..f9b5ee2803da 100644
Binary files a/docs/user-guide/projects/project-lists/navigation-bar-modules.png and b/docs/user-guide/projects/project-lists/navigation-bar-modules.png differ
diff --git a/docs/user-guide/projects/project-lists/new-subproject-project-list.png b/docs/user-guide/projects/project-lists/new-subproject-project-list.png
index b0c06a445ed9..c1073b77af99 100644
Binary files a/docs/user-guide/projects/project-lists/new-subproject-project-list.png and b/docs/user-guide/projects/project-lists/new-subproject-project-list.png differ
diff --git a/docs/user-guide/projects/project-lists/overall-activity-button-3922893.png b/docs/user-guide/projects/project-lists/overall-activity-button-3922893.png
deleted file mode 100644
index cb059ccf32f5..000000000000
Binary files a/docs/user-guide/projects/project-lists/overall-activity-button-3922893.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/overall-activity-link.png b/docs/user-guide/projects/project-lists/overall-activity-link.png
index e4c8660ac84b..68103544d329 100644
Binary files a/docs/user-guide/projects/project-lists/overall-activity-link.png and b/docs/user-guide/projects/project-lists/overall-activity-link.png differ
diff --git a/docs/user-guide/projects/project-lists/overall-activity-meeting-filter.png b/docs/user-guide/projects/project-lists/overall-activity-meeting-filter.png
deleted file mode 100644
index d18c70cd455f..000000000000
Binary files a/docs/user-guide/projects/project-lists/overall-activity-meeting-filter.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-lists/private-project-filter-delete.png b/docs/user-guide/projects/project-lists/private-project-filter-delete.png
index 8763b6a4c66c..5b1cefbd20fd 100644
Binary files a/docs/user-guide/projects/project-lists/private-project-filter-delete.png and b/docs/user-guide/projects/project-lists/private-project-filter-delete.png differ
diff --git a/docs/user-guide/projects/project-lists/private-project-filter-saved.png b/docs/user-guide/projects/project-lists/private-project-filter-saved.png
index b4f949284f5e..15e319e7e77e 100644
Binary files a/docs/user-guide/projects/project-lists/private-project-filter-saved.png and b/docs/user-guide/projects/project-lists/private-project-filter-saved.png differ
diff --git a/docs/user-guide/projects/project-lists/projects-list.png b/docs/user-guide/projects/project-lists/projects-list.png
index b1d14b79350e..7cdbfc27e201 100644
Binary files a/docs/user-guide/projects/project-lists/projects-list.png and b/docs/user-guide/projects/project-lists/projects-list.png differ
diff --git a/docs/user-guide/projects/project-lists/projects-lists-default-filters.png b/docs/user-guide/projects/project-lists/projects-lists-default-filters.png
index 2410bc230453..cba9c9942f6e 100644
Binary files a/docs/user-guide/projects/project-lists/projects-lists-default-filters.png and b/docs/user-guide/projects/project-lists/projects-lists-default-filters.png differ
diff --git a/docs/user-guide/projects/project-lists/save-button-filtered-view.png b/docs/user-guide/projects/project-lists/save-button-filtered-view.png
index d796ab07e08d..40811989537c 100644
Binary files a/docs/user-guide/projects/project-lists/save-button-filtered-view.png and b/docs/user-guide/projects/project-lists/save-button-filtered-view.png differ
diff --git a/docs/user-guide/projects/project-lists/view_all_projects_options.png b/docs/user-guide/projects/project-lists/view_all_projects_options.png
index 5ed573792fa8..42982648ded4 100644
Binary files a/docs/user-guide/projects/project-lists/view_all_projects_options.png and b/docs/user-guide/projects/project-lists/view_all_projects_options.png differ
diff --git a/docs/user-guide/projects/project-settigns-copy-project.png b/docs/user-guide/projects/project-settigns-copy-project.png
index 5aebfc01053f..2f8d85fe6ca2 100644
Binary files a/docs/user-guide/projects/project-settigns-copy-project.png and b/docs/user-guide/projects/project-settigns-copy-project.png differ
diff --git a/docs/user-guide/projects/project-settings-archive-project.png b/docs/user-guide/projects/project-settings-archive-project.png
index f7322de982de..4a6037380830 100644
Binary files a/docs/user-guide/projects/project-settings-archive-project.png and b/docs/user-guide/projects/project-settings-archive-project.png differ
diff --git a/docs/user-guide/projects/project-settings-copy-project-advanced-settings.png b/docs/user-guide/projects/project-settings-copy-project-advanced-settings.png
index 08d631c46d0a..1b73a9f43e00 100644
Binary files a/docs/user-guide/projects/project-settings-copy-project-advanced-settings.png and b/docs/user-guide/projects/project-settings-copy-project-advanced-settings.png differ
diff --git a/docs/user-guide/projects/project-settings-information-change-hierarchy.png b/docs/user-guide/projects/project-settings-information-change-hierarchy.png
index 589d9765b4f1..99c411f6261d 100644
Binary files a/docs/user-guide/projects/project-settings-information-change-hierarchy.png and b/docs/user-guide/projects/project-settings-information-change-hierarchy.png differ
diff --git a/docs/user-guide/projects/project-settings-information-copy-project-copy-options.png b/docs/user-guide/projects/project-settings-information-copy-project-copy-options.png
deleted file mode 100644
index 8a58e027a654..000000000000
Binary files a/docs/user-guide/projects/project-settings-information-copy-project-copy-options.png and /dev/null differ
diff --git a/docs/user-guide/projects/project-settings-subproject.png b/docs/user-guide/projects/project-settings-subproject.png
index 99853c293f10..26a4b244ae85 100644
Binary files a/docs/user-guide/projects/project-settings-subproject.png and b/docs/user-guide/projects/project-settings-subproject.png differ
diff --git a/docs/user-guide/projects/project-settings/file-storages/file-storages-oauth-nudge-nextcloud.png b/docs/user-guide/projects/project-settings/file-storages/file-storages-oauth-nudge-nextcloud.png
index 80a6224cb596..f46a9aaaa19e 100644
Binary files a/docs/user-guide/projects/project-settings/file-storages/file-storages-oauth-nudge-nextcloud.png and b/docs/user-guide/projects/project-settings/file-storages/file-storages-oauth-nudge-nextcloud.png differ
diff --git a/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders-new.png b/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders-new.png
index b6389a000168..30af3f740147 100644
Binary files a/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders-new.png and b/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders-new.png differ
diff --git a/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders.png b/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders.png
deleted file mode 100644
index 8baecfbfda15..000000000000
Binary files a/docs/user-guide/projects/project-settings/file-storages/onedrive-storage-add-folders.png and /dev/null differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-bulk-editing.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-bulk-editing.png
index 9c777429b619..31d1699c57f7 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-bulk-editing.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-bulk-editing.png differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-hierarchy-progress.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-hierarchy-progress.png
index 86d768e55971..af129927740b 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-hierarchy-progress.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-hierarchy-progress.png differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-two-progress-values.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-two-progress-values.png
index 8f706abb987c..70b91d6a87b0 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-two-progress-values.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-two-progress-values.png differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-50perc.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-50perc.png
index e541f1f9bc74..f20245a3d7a7 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-50perc.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-50perc.png differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-editor.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-editor.png
index a8fdcb8cfb3d..25c68ac05f42 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-editor.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field-editor.png differ
diff --git a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field.png b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field.png
index b084d798c6a0..2d302453d004 100644
Binary files a/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field.png and b/docs/user-guide/time-and-costs/progress-tracking/progress-tracking-wp-field.png differ
diff --git a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_share_button_wp_numbers.png b/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_share_button_wp_numbers.png
index 237585a45f33..b20a3afb5125 100644
Binary files a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_share_button_wp_numbers.png and b/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_share_button_wp_numbers.png differ
diff --git a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter.png b/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter.png
deleted file mode 100644
index 603efe926a53..000000000000
Binary files a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter.png and /dev/null differ
diff --git a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter_new.png b/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter_new.png
index cd0c5dd20edd..88430a51ccf0 100644
Binary files a/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter_new.png and b/docs/user-guide/work-packages/share-work-packages/openproject_user_guide_shared_with_users_filter_new.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-full-screen-back-arrow.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-full-screen-back-arrow.png
index 6e5f10d92d75..ec30bd878af2 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-full-screen-back-arrow.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-full-screen-back-arrow.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-table-view.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-table-view.png
index 9d15625eeab7..e3fdef54b432 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-table-view.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-table-view.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-views.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-views.png
index a281987eff86..a8ad0b3db68e 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-views.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-package-views.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-full-screen-icon.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-full-screen-icon.png
index ae1163344ca4..8681448b84bc 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-full-screen-icon.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-full-screen-icon.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-icon.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-icon.png
index df001234c60f..c8df03be200d 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-icon.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-icon.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-view.png b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-view.png
index 1e9412ca951f..17c1577f79f1 100644
Binary files a/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-view.png and b/docs/user-guide/work-packages/work-package-views/openproject-user-guide-work-packages-split-screen-view.png differ
diff --git a/docs/user-guide/work-packages/work-package-views/work-package-views-default.png b/docs/user-guide/work-packages/work-package-views/work-package-views-default.png
deleted file mode 100644
index 6886b97771a9..000000000000
Binary files a/docs/user-guide/work-packages/work-package-views/work-package-views-default.png and /dev/null differ
diff --git a/docs/user-guide/work-packages/work-packages-faq/README.md b/docs/user-guide/work-packages/work-packages-faq/README.md
index fa3a7715a8db..5ad656c8c6d3 100644
--- a/docs/user-guide/work-packages/work-packages-faq/README.md
+++ b/docs/user-guide/work-packages/work-packages-faq/README.md
@@ -236,7 +236,7 @@ The following factors can have an impact on the duration of the export:
- Number of columns in the export (less of an impact)
To identify how many background jobs have run or are delayed, enter "/health_checks/full" after the URL (e.g. myopenprojectinstance.com/health_checks/full).
-This provides an overview of "worker_backed_up" which shows the number of background jobs that could not get ran within the last 5 minutes. If there are multiple entries, this can indicate that the number of web workers should be increased.
+This provides an overview of "delayed_jobs_never_ran" which shows the number of background jobs that could not get ran within the last 10 minutes. If there are multiple entries, this can indicate that the number of web workers should be increased.
For a documentation of how to do this, please refer to [these instructions](../../../installation-and-operations/operation/control) (see section "Scaling the number of web workers").
diff --git a/extra/mail_handler/rdm-mailhandler.rb b/extra/mail_handler/rdm-mailhandler.rb
index a40d446ce0e7..80e2cf8ff7d0 100644
--- a/extra/mail_handler/rdm-mailhandler.rb
+++ b/extra/mail_handler/rdm-mailhandler.rb
@@ -77,11 +77,11 @@
# --type bug \\
# --allow-override type,priority
-require "net/http"
-require "net/https"
-require "uri"
-require "getoptlong"
-require "rdoc/usage"
+require 'net/http'
+require 'net/https'
+require 'uri'
+require 'getoptlong'
+require 'rdoc/usage'
module Net
class HTTPS < HTTP
@@ -91,14 +91,14 @@ def self.post_form(url, params, headers)
request.basic_auth url.user, url.password if url.user
request.initialize_http_header(headers)
http = new(url.host, url.port)
- http.use_ssl = (url.scheme == "https")
+ http.use_ssl = (url.scheme == 'https')
http.start { |h| h.request(request) }
end
end
end
class RedmineMailHandler
- VERSION = "0.1"
+ VERSION = '0.1'
attr_accessor :verbose, :issue_attributes, :allow_override, :unknown_user, :no_permission_check, :url, :key
@@ -106,42 +106,42 @@ def initialize
self.issue_attributes = {}
opts = GetoptLong.new(
- ["--help", "-h", GetoptLong::NO_ARGUMENT],
- ["--version", "-V", GetoptLong::NO_ARGUMENT],
- ["--verbose", "-v", GetoptLong::NO_ARGUMENT],
- ["--url", "-u", GetoptLong::REQUIRED_ARGUMENT],
- ["--key", "-k", GetoptLong::REQUIRED_ARGUMENT],
- ["--project", "-p", GetoptLong::REQUIRED_ARGUMENT],
- ["--status", "-s", GetoptLong::REQUIRED_ARGUMENT],
- ["--type", "-t", GetoptLong::REQUIRED_ARGUMENT],
- ["--category", GetoptLong::REQUIRED_ARGUMENT],
- ["--priority", GetoptLong::REQUIRED_ARGUMENT],
- ["--allow-override", "-o", GetoptLong::REQUIRED_ARGUMENT],
- ["--unknown-user", GetoptLong::REQUIRED_ARGUMENT],
- ["--no-permission-check", GetoptLong::NO_ARGUMENT]
+ ['--help', '-h', GetoptLong::NO_ARGUMENT],
+ ['--version', '-V', GetoptLong::NO_ARGUMENT],
+ ['--verbose', '-v', GetoptLong::NO_ARGUMENT],
+ ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
+ ['--key', '-k', GetoptLong::REQUIRED_ARGUMENT],
+ ['--project', '-p', GetoptLong::REQUIRED_ARGUMENT],
+ ['--status', '-s', GetoptLong::REQUIRED_ARGUMENT],
+ ['--type', '-t', GetoptLong::REQUIRED_ARGUMENT],
+ ['--category', GetoptLong::REQUIRED_ARGUMENT],
+ ['--priority', GetoptLong::REQUIRED_ARGUMENT],
+ ['--allow-override', '-o', GetoptLong::REQUIRED_ARGUMENT],
+ ['--unknown-user', GetoptLong::REQUIRED_ARGUMENT],
+ ['--no-permission-check', GetoptLong::NO_ARGUMENT]
)
opts.each do |opt, arg|
case opt
- when "--url"
+ when '--url'
self.url = arg.dup
- when "--key"
+ when '--key'
self.key = arg.dup
- when "--help"
+ when '--help'
usage
- when "--verbose"
+ when '--verbose'
self.verbose = true
- when "--version"
+ when '--version'
puts VERSION
exit
- when "--project", "--status", "--type", "--category", "--priority"
- issue_attributes[opt.gsub(%r{^--}, "")] = arg.dup
- when "--allow-override"
+ when '--project', '--status', '--type', '--category', '--priority'
+ issue_attributes[opt.gsub(%r{^--}, '')] = arg.dup
+ when '--allow-override'
self.allow_override = arg.dup
- when "--unknown-user"
+ when '--unknown-user'
self.unknown_user = arg.dup
- when "--no-permission-check"
- self.no_permission_check = "1"
+ when '--no-permission-check'
+ self.no_permission_check = '1'
end
end
@@ -149,14 +149,14 @@ def initialize
end
def submit(email)
- uri = url.gsub(%r{/*\z}, "") + "/mail_handler"
+ uri = url.gsub(%r{/*\z}, '') + '/mail_handler'
- headers = { "User-Agent" => "Redmine mail handler/#{VERSION}" }
+ headers = { 'User-Agent' => "Redmine mail handler/#{VERSION}" }
- data = { "key" => key, "email" => email,
- "allow_override" => allow_override,
- "unknown_user" => unknown_user,
- "no_permission_check" => no_permission_check }
+ data = { 'key' => key, 'email' => email,
+ 'allow_override' => allow_override,
+ 'unknown_user' => unknown_user,
+ 'no_permission_check' => no_permission_check }
issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
debug "Posting to #{uri}..."
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 916c75b717ae..ef6d447f6e4b 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -4586,21 +4586,21 @@
"integrity": "sha512-HWwz+6MrfK5NTWcg9GdKFpMBW/yrAV937oXiw2eDtsd88P3SRwoCt6ZO6QmKp9RP3nDU9cbqmuGZ0xBh0eIFeg=="
},
"node_modules/@primer/css": {
- "version": "21.2.2",
- "resolved": "https://registry.npmjs.org/@primer/css/-/css-21.2.2.tgz",
- "integrity": "sha512-Mcpt9CyajnPW8TJmZYIUhnctdLk7rfsoyvh8w4qDydu2C7HHOHa0wKQjf0zofQ+AyJOIW1Gfa9xvBfwAeNkgoQ==",
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/@primer/css/-/css-21.1.1.tgz",
+ "integrity": "sha512-1XRx8FwWxrr8SSZit2C9KxaofTi0CELKbGmHGpmYQmRIAECIa912Emp4BlAC7iQmf3Tb5oZOkke5zuAt+seDxg==",
"dependencies": {
- "@primer/primitives": "^7.15.12",
- "@primer/view-components": "^0.19.0"
+ "@primer/primitives": "^7.12.0",
+ "@primer/view-components": "^0.14.0"
},
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/@primer/primitives": {
- "version": "7.15.12",
- "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.12.tgz",
- "integrity": "sha512-ujAsbRB5Xw6rrxizbTgv1bxpraZ091stPMsO6pqGxzc+zIyhrojpGVBuCKJ+RYkpbKK7T4bZzgOT/KyWBAFwwg=="
+ "version": "7.15.5",
+ "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.5.tgz",
+ "integrity": "sha512-tiJEMxy5hDi9a3YxgrBeJScLPUQSLuWsKDNuoXXiX7zLzejnYdxXXG3qOaNHzNyyn8TkSQkzmKx0ioaSLR2zNw=="
},
"node_modules/@primer/view-components": {
"name": "@openproject/primer-view-components",
@@ -4912,9 +4912,9 @@
"dev": true
},
"node_modules/@types/lodash": {
- "version": "4.17.0",
- "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz",
- "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==",
+ "version": "4.14.202",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz",
+ "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==",
"dev": true
},
"node_modules/@types/mime": {
@@ -8080,9 +8080,9 @@
}
},
"node_modules/core-js": {
- "version": "3.36.1",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.1.tgz",
- "integrity": "sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==",
+ "version": "3.36.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.0.tgz",
+ "integrity": "sha512-mt7+TUBbTFg5+GngsAxeKBTl5/VS0guFeJacYge9OmHb+m058UwwIm41SE9T4Den7ClatV57B6TYTuJ0CX1MAw==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
@@ -9801,9 +9801,9 @@
"dev": true
},
"node_modules/eslint-plugin-react": {
- "version": "7.34.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz",
- "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==",
+ "version": "7.34.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.0.tgz",
+ "integrity": "sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==",
"dev": true,
"dependencies": {
"array-includes": "^3.1.7",
@@ -10776,9 +10776,9 @@
"dev": true
},
"node_modules/follow-redirects": {
- "version": "1.15.6",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
- "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
+ "version": "1.15.4",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
+ "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
"funding": [
{
"type": "individual",
@@ -23899,18 +23899,18 @@
"integrity": "sha512-HWwz+6MrfK5NTWcg9GdKFpMBW/yrAV937oXiw2eDtsd88P3SRwoCt6ZO6QmKp9RP3nDU9cbqmuGZ0xBh0eIFeg=="
},
"@primer/css": {
- "version": "21.2.2",
- "resolved": "https://registry.npmjs.org/@primer/css/-/css-21.2.2.tgz",
- "integrity": "sha512-Mcpt9CyajnPW8TJmZYIUhnctdLk7rfsoyvh8w4qDydu2C7HHOHa0wKQjf0zofQ+AyJOIW1Gfa9xvBfwAeNkgoQ==",
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/@primer/css/-/css-21.1.1.tgz",
+ "integrity": "sha512-1XRx8FwWxrr8SSZit2C9KxaofTi0CELKbGmHGpmYQmRIAECIa912Emp4BlAC7iQmf3Tb5oZOkke5zuAt+seDxg==",
"requires": {
- "@primer/primitives": "^7.15.12",
+ "@primer/primitives": "^7.12.0",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.23.0"
}
},
"@primer/primitives": {
- "version": "7.15.12",
- "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.12.tgz",
- "integrity": "sha512-ujAsbRB5Xw6rrxizbTgv1bxpraZ091stPMsO6pqGxzc+zIyhrojpGVBuCKJ+RYkpbKK7T4bZzgOT/KyWBAFwwg=="
+ "version": "7.15.5",
+ "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.5.tgz",
+ "integrity": "sha512-tiJEMxy5hDi9a3YxgrBeJScLPUQSLuWsKDNuoXXiX7zLzejnYdxXXG3qOaNHzNyyn8TkSQkzmKx0ioaSLR2zNw=="
},
"@primer/view-components": {
"version": "npm:@openproject/primer-view-components@0.23.0",
@@ -24194,9 +24194,9 @@
"dev": true
},
"@types/lodash": {
- "version": "4.17.0",
- "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz",
- "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==",
+ "version": "4.14.202",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz",
+ "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==",
"dev": true
},
"@types/mime": {
@@ -26528,9 +26528,9 @@
}
},
"core-js": {
- "version": "3.36.1",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.1.tgz",
- "integrity": "sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA=="
+ "version": "3.36.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.0.tgz",
+ "integrity": "sha512-mt7+TUBbTFg5+GngsAxeKBTl5/VS0guFeJacYge9OmHb+m058UwwIm41SE9T4Den7ClatV57B6TYTuJ0CX1MAw=="
},
"core-js-compat": {
"version": "3.33.1",
@@ -27996,9 +27996,9 @@
}
},
"eslint-plugin-react": {
- "version": "7.34.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz",
- "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==",
+ "version": "7.34.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.0.tgz",
+ "integrity": "sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==",
"dev": true,
"requires": {
"array-includes": "^3.1.7",
@@ -28661,9 +28661,9 @@
"dev": true
},
"follow-redirects": {
- "version": "1.15.6",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
- "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
+ "version": "1.15.4",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
+ "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw=="
},
"for-each": {
"version": "0.3.3",
diff --git a/frontend/src/app/core/global_search/input/global-search-input.component.sass b/frontend/src/app/core/global_search/input/global-search-input.component.sass
index 85c46526661e..8a9c67005320 100644
--- a/frontend/src/app/core/global_search/input/global-search-input.component.sass
+++ b/frontend/src/app/core/global_search/input/global-search-input.component.sass
@@ -59,9 +59,6 @@ $search-input-height: 30px
background: transparent
border-color: var(--header-item-font-color) !important
- &:focus-within
- @include spot-focus
-
.ng-arrow-wrapper
display: none
@@ -129,15 +126,19 @@ $search-input-height: 30px
background-color: unset
&:last-child
border-bottom: none
+ &.ng-option-marked
+ color: var(--header-drop-down-item-font-hover-color)
&.ng-option-disabled
display: none
+ &.ng-option-selected
+ color: var(--header-drop-down-item-font-hover-color)
&.-markable
.ng-option
&.ng-option-marked
background-color: var(--drop-down-hover-bg-color)
&.ng-option-selected
- background-color: unset
+ background-color: var(--drop-down-selected-bg-color)
&--input
// Fix position of the spinner
diff --git a/frontend/src/app/core/setup/globals/components/admin/backup.component.html b/frontend/src/app/core/setup/globals/components/admin/backup.component.html
index 669d35fa1816..e5e8a99e8c92 100644
--- a/frontend/src/app/core/setup/globals/components/admin/backup.component.html
+++ b/frontend/src/app/core/setup/globals/components/admin/backup.component.html
@@ -66,7 +66,7 @@