Skip to content

Commit df22535

Browse files
authored
Merge branch 'release/16.5' into oidc-provider-create-message
2 parents c952c20 + 8108de9 commit df22535

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+212
-144
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ updates:
3939
patterns:
4040
- "aws-*"
4141
ignore:
42-
- dependency_name: "openproject-octicons"
42+
- dependency-name: "openproject-octicons"
4343
- dependency-name: "openproject-octicons_helper"
4444
- dependency-name: "openproject-primer_view_components"
4545
- package-ecosystem: "github-actions"

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,4 +419,4 @@ end
419419

420420
gem "openproject-octicons", "~>19.29.0"
421421
gem "openproject-octicons_helper", "~>19.29.0"
422-
gem "openproject-primer_view_components", "~>0.73.0"
422+
gem "openproject-primer_view_components", "~>0.73.1"

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ GEM
880880
actionview
881881
openproject-octicons (= 19.29.0)
882882
railties
883-
openproject-primer_view_components (0.73.0)
883+
openproject-primer_view_components (0.73.1)
884884
actionview (>= 7.2.0)
885885
activesupport (>= 7.2.0)
886886
openproject-octicons (>= 19.29.0)
@@ -1696,7 +1696,7 @@ DEPENDENCIES
16961696
openproject-octicons (~> 19.29.0)
16971697
openproject-octicons_helper (~> 19.29.0)
16981698
openproject-openid_connect!
1699-
openproject-primer_view_components (~> 0.73.0)
1699+
openproject-primer_view_components (~> 0.73.1)
17001700
openproject-recaptcha!
17011701
openproject-reporting!
17021702
openproject-storages!
@@ -2076,7 +2076,7 @@ CHECKSUMS
20762076
openproject-octicons (19.29.0) sha256=9d9106a276d140a2ba975052688b0c92e404af0df5db87d322265ac5c15e8815
20772077
openproject-octicons_helper (19.29.0) sha256=d093d91163b27d1624841590a8e6b202186d165ad7d006ceadc8bdc3b09830e6
20782078
openproject-openid_connect (1.0.0)
2079-
openproject-primer_view_components (0.73.0) sha256=cd0f25ce22107e5a72745f5e69b599a633263275c78cbc25fb6c40ff75f0c610
2079+
openproject-primer_view_components (0.73.1) sha256=591d1803255a8d02b6a53a846efd67535cb1739d44ba20b124d0e2707a20932f
20802080
openproject-recaptcha (1.0.0)
20812081
openproject-reporting (1.0.0)
20822082
openproject-storages (1.0.0)

app/components/enterprise_edition/plan_for_feature.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def plan
8181
end
8282

8383
def plan_text
84-
plan_name = render(Primer::Beta::Text.new(font_weight: :bold, classes: "upsell-colored")) do
84+
plan_name = render(Primer::Beta::Text.new(font_weight: :bold, classes: "upsell-colored-text")) do
8585
I18n.t("ee.upsell.plan_name", plan: plan.capitalize)
8686
end
8787

app/components/enterprise_edition/trial_teaser_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def description
6969
end
7070

7171
def plan_name
72-
render(Primer::Beta::Text.new(font_weight: :bold, classes: "upsell-colored")) do
72+
render(Primer::Beta::Text.new(font_weight: :bold, classes: "upsell-colored-text")) do
7373
I18n.t("ee.upsell.plan_name", plan: token.plan.capitalize)
7474
end
7575
end

app/controllers/concerns/custom_fields/shared_actions.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ def create # rubocop:disable Metrics/AbcSize
5555
.call(get_custom_field_params.merge(type: permitted_params.custom_field_type))
5656

5757
if call.success?
58+
custom_field = call.result
5859
flash[:notice] = t(:notice_successful_create)
59-
call_hook(:controller_custom_fields_new_after_save, custom_field: call.result)
60-
redirect_to index_path(call.result, tab: call.result.class.name)
60+
call_hook(:controller_custom_fields_new_after_save, custom_field:)
61+
redirect_to edit_path(custom_field, id: custom_field.id)
6162
else
6263
@custom_field = call.result || new_custom_field
6364
render action: :new, status: :unprocessable_entity
@@ -142,7 +143,7 @@ def prepare_custom_option_position
142143

143144
index = 0
144145

145-
params[:custom_field][:custom_options_attributes].each do |_id, attributes|
146+
params[:custom_field][:custom_options_attributes].each_value do |attributes|
146147
attributes[:position] = (index = index + 1)
147148
end
148149
end

app/models/custom_value/calculated_value_strategy.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,26 @@ def typed_value
3838
end
3939

4040
def formatted_value
41-
integer_value? ? value.to_s : number_with_delimiter(value.to_s)
41+
return "" if value.blank?
42+
43+
if integer_value?
44+
number_with_delimiter(value.to_i)
45+
else
46+
delimiter = I18n.t("number.format.delimiter")
47+
separator = I18n.t("number.format.separator")
48+
formatted = number_with_precision(value.to_f,
49+
precision: 3,
50+
strip_insignificant_zeros: true,
51+
delimiter:,
52+
separator:)
53+
54+
# Ensure at least one decimal place for floats
55+
if formatted.exclude?(separator)
56+
"#{formatted}#{separator}0"
57+
else
58+
formatted
59+
end
60+
end
4261
end
4362

4463
def validate_type_of_value
@@ -51,6 +70,6 @@ def validate_type_of_value
5170
private
5271

5372
def integer_value?
54-
value && value =~ /\A\d+\z/
73+
value =~ /\A[-+]?\d+\z/
5574
end
5675
end

app/models/custom_value/float_strategy.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def typed_value
3838
end
3939

4040
def formatted_value
41+
return "" if value.blank?
42+
4143
number_with_delimiter(value.to_s)
4244
end
4345

app/models/custom_value/int_strategy.rb

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

3131
class CustomValue::IntStrategy < CustomValue::FormatStrategy
32+
include ActionView::Helpers::NumberHelper
33+
3234
def typed_value
33-
if value.present?
34-
value.to_i
35-
end
35+
value.to_i if value.present?
36+
end
37+
38+
def formatted_value
39+
return "" if value.blank?
40+
41+
number_with_delimiter(value.to_s)
3642
end
3743

3844
def validate_type_of_value

app/views/custom_styles/_primer_color_mapping.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
--ck-color-button-on-disabled-background: var(--button-default-bgColor-disabled);
9292
--ck-color-labeled-field-label-background: var(--overlay-bgColor);
9393
--ck-color-input-disabled-background: var(--bgColor-disabled);
94+
--enterprise-upsell-text-color: var(--enterprise-upsell-color);
9495
}
9596

9697
[data-dark-theme=dark_high_contrast] {

0 commit comments

Comments
 (0)