Skip to content

Commit

Permalink
Merge pull request #15154 from opf/correcting-single-quotes
Browse files Browse the repository at this point in the history
Switch to double quotes all files not changed by current PRs
  • Loading branch information
cbliard authored Mar 29, 2024
2 parents 6c359a5 + bc883f5 commit 64623e7
Show file tree
Hide file tree
Showing 68 changed files with 1,458 additions and 1,457 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ c795874f7f281297bbd3bad2fdb58b24cb4ce624
# switch to double quotes
5c72ea0046a6b5230bf456f55a296ed6fd579535
9e4934cd0a468f46d8f0fc0f11ebc2d4216f789c
6678cab48d443b5782fa93b171d62093819ee4fc
20 changes: 10 additions & 10 deletions app/components/mailer/label_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@

module Mailer
LABEL_SCHEME_COLORS = {
default: 'rgb(208, 215, 222)',
primary: 'rgb(110, 119, 129)',
secondary: 'rgb(208, 215, 222)',
accent: 'rgb(9, 105, 218)',
success: 'rgb(31, 136, 61)',
attention: 'rgb(154, 103, 0)',
danger: 'rgb(207, 34, 46)',
severe: 'rgb(188, 76, 0)',
done: 'rgb(130, 80, 223)',
sponsor: 'rgb(191, 57, 137)'
default: "rgb(208, 215, 222)",
primary: "rgb(110, 119, 129)",
secondary: "rgb(208, 215, 222)",
accent: "rgb(9, 105, 218)",
success: "rgb(31, 136, 61)",
attention: "rgb(154, 103, 0)",
danger: "rgb(207, 34, 46)",
severe: "rgb(188, 76, 0)",
done: "rgb(130, 80, 223)",
sponsor: "rgb(191, 57, 137)"
}.freeze

class LabelComponent < ViewComponent::Base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def initialize(project:, project_custom_field_sections:)

def wrapper_data_attributes
{
controller: 'projects--settings--project-custom-fields-mapping-filter',
'application-target': 'dynamic'
controller: "projects--settings--project-custom-fields-mapping-filter",
"application-target": "dynamic"
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ def first_and_last

def wrapper_data_attributes
{
controller: 'generic-drag-and-drop',
'application-target': 'dynamic'
controller: "generic-drag-and-drop",
"application-target": "dynamic"
}
end

def drop_target_config
{
'is-drag-and-drop-target': true,
'target-allowed-drag-type': 'section' # the type of dragged items which are allowed to be dropped in this target
"is-drag-and-drop-target": true,
"target-allowed-drag-type": "section" # the type of dragged items which are allowed to be dropped in this target
}
end

def draggable_item_config(section)
{
'draggable-id': section.id,
'draggable-type': 'section',
'drop-url': drop_admin_settings_project_custom_field_section_path(section)
"draggable-id": section.id,
"draggable-type": "section",
"drop-url": drop_admin_settings_project_custom_field_section_path(section)
}
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/contracts/base_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def attribute_permission(attribute, permission)
private

def add_writable(attribute, writable)
attribute_name = attribute.to_s.delete_suffix('_id')
attribute_name = attribute.to_s.delete_suffix("_id")

unless writable == false
writable_attributes << attribute_name
Expand Down Expand Up @@ -260,7 +260,7 @@ def reduce_by_writable_permissions(attributes)
attribute_permissions = collect_ancestor_attributes(:attribute_permissions)

attributes.reject do |attribute|
canonical_attribute = attribute.delete_suffix('_id')
canonical_attribute = attribute.delete_suffix("_id")

permissions = attribute_permissions[canonical_attribute] ||
attribute_permissions["#{canonical_attribute}_id"] ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def validate_enabled_modules
.select { |m| m[:dependencies] && enabled_modules.include?(m[:name]) && (m[:dependencies] & enabled_modules) != m[:dependencies] }
.map do |m|
I18n.t(
'settings.projects.missing_dependencies',
"settings.projects.missing_dependencies",
module: I18n.t("project_module_#{m[:name]}"),
dependencies: m[:dependencies].map { |dep| I18n.t("project_module_#{dep}") }.join(', ')
dependencies: m[:dependencies].map { |dep| I18n.t("project_module_#{dep}") }.join(", ")
)
end

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/concerns/custom_fields/shared_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ module SharedActions

included do
def index_path(custom_field, params = {})
if custom_field.type == 'ProjectCustomField'
if custom_field.type == "ProjectCustomField"
admin_settings_project_custom_fields_path(**params)
else
custom_fields_path(**params)
end
end

def edit_path(custom_field, params = {})
if custom_field.type == 'ProjectCustomField'
if custom_field.type == "ProjectCustomField"
admin_settings_project_custom_field_path(**params)
else
edit_custom_field_path(**params)
Expand All @@ -58,7 +58,7 @@ def create
redirect_to index_path(call.result, tab: call.result.class.name)
else
@custom_field = call.result || new_custom_field
render action: 'new'
render action: "new"
end
end

Expand All @@ -76,7 +76,7 @@ def perform_update(custom_field_params)
call_hook(:controller_custom_fields_edit_after_save, custom_field: @custom_field)
redirect_back_or_default(edit_path(@custom_field, id: @custom_field.id))
else
render action: 'edit'
render action: "edit"
end
end

Expand Down
18 changes: 9 additions & 9 deletions app/controllers/custom_fields_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class CustomFieldsController < ApplicationController
include CustomFields::SharedActions # share logic with ProjectCustomFieldsControlller
layout 'admin'
layout "admin"

before_action :require_admin
before_action :find_custom_field, only: %i(edit update destroy delete_option reorder_alphabetical)
Expand All @@ -38,12 +38,12 @@ class CustomFieldsController < ApplicationController
def index
# loading wp cfs exclicity to allow for eager loading
@custom_fields_by_type = CustomField.all
.where.not(type: ['WorkPackageCustomField', 'ProjectCustomField'])
.where.not(type: ["WorkPackageCustomField", "ProjectCustomField"])
.group_by { |f| f.class.name }

@custom_fields_by_type['WorkPackageCustomField'] = WorkPackageCustomField.includes(:types).all
@custom_fields_by_type["WorkPackageCustomField"] = WorkPackageCustomField.includes(:types).all

@tab = params[:tab] || 'WorkPackageCustomField'
@tab = params[:tab] || "WorkPackageCustomField"
end

def new
Expand All @@ -59,10 +59,10 @@ def edit
protected

def default_breadcrumb
if action_name == 'index'
t('label_custom_field_plural')
if action_name == "index"
t("label_custom_field_plural")
else
ActionController::Base.helpers.link_to(t('label_custom_field_plural'), custom_fields_path)
ActionController::Base.helpers.link_to(t("label_custom_field_plural"), custom_fields_path)
end
end

Expand All @@ -78,8 +78,8 @@ def find_custom_field

def check_custom_field
# ProjecCustomFields now managed in a different UI
if @custom_field.nil? || @custom_field.type == 'ProjectCustomField'
flash[:error] = 'Invalid CF type'
if @custom_field.nil? || @custom_field.type == "ProjectCustomField"
flash[:error] = "Invalid CF type"
redirect_to action: :index
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def input_attributes
base_input_attributes.merge(
autocomplete_options:,
wrapper_data_attributes: {
'qa-field-name': qa_field_name
"qa-field-name": qa_field_name
}
)
end
Expand All @@ -57,6 +57,6 @@ def invalid?
end

def validation_message
custom_values.map { |custom_value| custom_value.errors.full_messages }.join(', ') if invalid?
custom_values.map { |custom_value| custom_value.errors.full_messages }.join(", ") if invalid?
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def input_attributes
base_input_attributes.merge(
autocomplete_options:,
wrapper_data_attributes: {
'qa-field-name': qa_field_name
"qa-field-name": qa_field_name
}
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
module CustomFields::Inputs::Base::Autocomplete::UserQueryUtils
def user_autocomplete_options
{
component: 'opce-user-autocompleter',
component: "opce-user-autocompleter",
defaultData: false,
placeholder: I18n.t(:label_user_search),
resource:,
Expand All @@ -43,18 +43,18 @@ def user_autocomplete_options
end

def resource
'principals'
"principals"
end

def search_key
'any_name_attribute'
"any_name_attribute"
end

def filters
[
{ name: 'type', operator: '=', values: ['User', 'Group', 'PlaceholderUser'] },
{ name: 'member', operator: '=', values: [@object.id.to_s] },
{ name: 'status', operator: '!', values: [Principal.statuses["locked"].to_s] }
{ name: "type", operator: "=", values: ["User", "Group", "PlaceholderUser"] },
{ name: "member", operator: "=", values: [@object.id.to_s] },
{ name: "status", operator: "!", values: [Principal.statuses["locked"].to_s] }
]
end
end
4 changes: 2 additions & 2 deletions app/forms/custom_fields/inputs/base/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(custom_field:, object:, **options)
def input_attributes
base_input_attributes.merge(
{
data: { 'qa-field-name': qa_field_name },
data: { "qa-field-name": qa_field_name },
value:
}
)
Expand All @@ -55,6 +55,6 @@ def invalid?
end

def validation_message
custom_value.errors.full_messages.join(', ') if invalid?
custom_value.errors.full_messages.join(", ") if invalid?
end
end
2 changes: 1 addition & 1 deletion app/forms/custom_fields/inputs/base/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ def qa_field_name

# used within autocompleter inputs
def append_to
options.fetch(:wrapper_id, 'body')
options.fetch(:wrapper_id, "body")
end
end
22 changes: 11 additions & 11 deletions app/forms/work_packages/share/invitee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ class Invitee < ApplicationForm
form do |user_invite_form|
user_invite_form.autocompleter(
name: :user_id,
label: I18n.t('work_package.sharing.label_search'),
label: I18n.t("work_package.sharing.label_search"),
visually_hide_label: true,
data: { 'work-packages--share--user-limit-target': 'autocompleter' },
data: { "work-packages--share--user-limit-target": "autocompleter" },
autocomplete_options: {
component: 'opce-user-autocompleter',
component: "opce-user-autocompleter",
defaultData: false,
id: "op-share-wp-invite-autocomplete",
placeholder: I18n.t('work_package.sharing.label_search_placeholder'),
placeholder: I18n.t("work_package.sharing.label_search_placeholder"),
data: {
'test-selector': 'op-share-wp-invite-autocomplete'
"test-selector": "op-share-wp-invite-autocomplete"
},
url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals,
filters: [{ name: 'type', operator: '=', values: %w[User Group] },
{ name: 'id', operator: '!', values: [::Queries::Filters::MeValue::KEY] },
{ name: 'status', operator: '=', values: [Principal.statuses[:active], Principal.statuses[:invited]] }],
searchKey: 'any_name_attribute',
filters: [{ name: "type", operator: "=", values: %w[User Group] },
{ name: "id", operator: "!", values: [::Queries::Filters::MeValue::KEY] },
{ name: "status", operator: "=", values: [Principal.statuses[:active], Principal.statuses[:invited]] }],
searchKey: "any_name_attribute",
addTag: User.current.allowed_globally?(:create_user),
addTagText: I18n.t('members.send_invite_to'),
addTagText: I18n.t("members.send_invite_to"),
multiple: true,
focusDirectly: true,
appendTo: 'body',
appendTo: "body",
disabled: @disabled
}
)
Expand Down
Loading

0 comments on commit 64623e7

Please sign in to comment.