Skip to content

Commit 8c65bb3

Browse files
authored
Merge pull request #21599 from opf/maintenance-extracted-from-64264
Maintenance extracted from 64264
2 parents 8fbeaf3 + 3473972 commit 8c65bb3

File tree

26 files changed

+41
-50
lines changed

26 files changed

+41
-50
lines changed

app/contracts/custom_fields/base_contract.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ module CustomFields
3232
class BaseContract < ::ModelContract
3333
include RequiresAdminGuard
3434

35+
attribute :admin_only
36+
attribute :allow_non_open_versions
37+
attribute :content_right_to_left
38+
attribute :custom_field_section_id
39+
attribute :default_value
3540
attribute :editable
36-
attribute :type
3741
attribute :field_format
42+
attribute :formula
3843
attribute :is_filter
3944
attribute :is_for_all
4045
attribute :is_required do
4146
validate_non_true_for_some_formats
4247
end
4348
attribute :max_length
4449
attribute :min_length
50+
attribute :multi_value
4551
attribute :name
4652
attribute :possible_values
4753
attribute :regexp
48-
attribute :formula
4954
attribute :searchable
50-
attribute :admin_only
51-
attribute :default_value
52-
attribute :multi_value
53-
attribute :content_right_to_left
54-
attribute :custom_field_section_id
55-
attribute :allow_non_open_versions
55+
attribute :type
5656

5757
def validate_non_true_for_some_formats
5858
return unless %w[bool calculated_value].include?(field_format)

app/models/calculated_value_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CalculatedValueError < ApplicationRecord
3838
ERROR_DISABLED_VALUE].freeze
3939

4040
validates :customized, presence: true
41-
validates :custom_field_id, presence: true
41+
validates :custom_field, presence: true
4242

4343
validates :error_code, inclusion: { in: VALID_ERROR_CODES }
4444

lib/open_project/custom_field_format_dependent.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class CustomFieldFormatDependent
3333
defaultBool: [:only, %w[bool]],
3434
defaultLongText: [:only, %w[text]],
3535
defaultText: [:except, %w[list bool date text user version hierarchy calculated_value]],
36+
enterpriseBanner: [:only, %w[hierarchy]],
37+
formula: [:only, %w[calculated_value]],
3638
length: [:except, %w[list bool date user version link hierarchy calculated_value]],
3739
multiSelect: [:only, %w[list user version hierarchy]],
3840
possibleValues: [:only, %w[list]],
3941
regexp: [:except, %w[list bool date user version hierarchy calculated_value]],
40-
formula: [:only, %w[calculated_value]],
4142
searchable: [:except, %w[bool date float int user version hierarchy calculated_value]],
42-
textOrientation: [:only, %w[text]],
43-
enterpriseBanner: [:only, %w[hierarchy]]
43+
textOrientation: [:only, %w[text]]
4444
}.freeze
4545

4646
def self.stimulus_config

lib/open_project/mutex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def with_advisory_lock_transaction(entry, suffix = nil, options = {}, &)
6565
end
6666

6767
def with_advisory_lock(resource_class, lock_name, options = {})
68-
debug_log("Attempting to fetched advisory lock", lock_name)
68+
debug_log("Attempting to fetch advisory lock", lock_name)
6969
result = resource_class.with_advisory_lock(lock_name, options) do
7070
debug_log("Fetched advisory lock", lock_name)
7171
yield

spec/features/admin/custom_fields/shared_custom_field_expectations.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# ++
3030

3131
RSpec.shared_examples_for "list custom fields" do |type|
32-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
32+
let(:cf_page) { Pages::CustomFields::Index.new }
3333
let(:user) { create(:admin) }
3434

3535
current_user { user }
@@ -94,7 +94,7 @@
9494
end
9595

9696
RSpec.shared_examples_for "hierarchy custom fields on index page" do |type|
97-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
97+
let(:cf_page) { Pages::CustomFields::Index.new }
9898
let(:user) { create(:admin) }
9999

100100
current_user { user }
@@ -126,7 +126,7 @@
126126
end
127127

128128
RSpec.shared_examples_for "expected fields for the custom field's format" do |type, format|
129-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
129+
let(:cf_page) { Pages::CustomFields::Index.new }
130130
let(:user) { create(:admin) }
131131

132132
current_user { user }

spec/features/admin/custom_fields/time_entries/list_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
RSpec.describe "List custom fields edit", :js do
3535
shared_let(:admin) { create(:admin) }
3636

37-
let(:index_cf_page) { Pages::CustomFields::IndexPage.new }
38-
let(:new_cf_page) { Pages::CustomFields::NewPage.new }
37+
let(:index_cf_page) { Pages::CustomFields::Index.new }
38+
let(:new_cf_page) { Pages::CustomFields::New.new }
3939

4040
current_user { admin }
4141

spec/features/admin/custom_fields/work_packages/boolean_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
# ++
3030

3131
require "spec_helper"
32-
require "support/pages/custom_fields/index_page"
3332

3433
RSpec.describe "custom fields", :js do
3534
shared_let(:user) { create(:admin) }
36-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
35+
let(:cf_page) { Pages::CustomFields::Index.new }
3736

3837
current_user { user }
3938

spec/features/admin/custom_fields/work_packages/date_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
# ++
3030

3131
require "spec_helper"
32-
require "support/pages/custom_fields/index_page"
3332

3433
RSpec.describe "custom fields", :js do
3534
let(:user) { create(:admin) }
36-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
35+
let(:cf_page) { Pages::CustomFields::Index.new }
3736

3837
current_user { user }
3938

spec/features/admin/custom_fields/work_packages/float_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
# ++
3030

3131
require "spec_helper"
32-
require "support/pages/custom_fields/index_page"
3332

3433
RSpec.describe "custom fields", :js do
3534
let(:user) { create(:admin) }
36-
let(:cf_page) { Pages::CustomFields::IndexPage.new }
35+
let(:cf_page) { Pages::CustomFields::Index.new }
3736

3837
current_user { user }
3938

spec/features/admin/custom_fields/work_packages/hierarchy_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
RSpec.describe "work package custom fields of type hierarchy", :js do
3535
shared_let(:admin) { create(:admin) }
36-
let(:custom_field_index_page) { Pages::CustomFields::IndexPage.new }
37-
let(:new_custom_field_page) { Pages::CustomFields::NewPage.new }
38-
let(:hierarchy_page) { Pages::CustomFields::HierarchyPage.new }
36+
let(:custom_field_index_page) { Pages::CustomFields::Index.new }
37+
let(:new_custom_field_page) { Pages::CustomFields::New.new }
38+
let(:hierarchy_page) { Pages::CustomFields::Hierarchy.new }
3939

4040
current_user { admin }
4141

0 commit comments

Comments
 (0)