Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

display calculated values form errors using flash

Ivan Kuchinbfb4f1436fd6
diff --git a/app/components/admin/custom_fields/calculated_values/details_component.html.erb b/app/components/admin/custom_fields/calculated_values/details_component.html.erb
index 00b49b65975..6873ea2c605 100644
--- a/app/components/admin/custom_fields/calculated_values/details_component.html.erb
+++ b/app/components/admin/custom_fields/calculated_values/details_component.html.erb
@@ -29,20 +29,12 @@ See COPYRIGHT and LICENSE files for more details.
<%=
component_wrapper do
- flex_layout do |content|
- content.with_row do
- render BaseErrorsComponent.new(model, keys: %w[field_format], mb: 3)
- end
-
- content.with_row do
- settings_primer_form_with(
- model:,
- scope: :custom_field,
- id: "custom_field_form",
- url: form_url,
- method: form_method
- ) { |form| render CustomFields::CalculatedValues::DetailsForm.new(form) }
- end
- end
+ settings_primer_form_with(
+ model:,
+ scope: :custom_field,
+ id: "custom_field_form",
+ url: form_url,
+ method: form_method
+ ) { |form| render CustomFields::CalculatedValues::DetailsForm.new(form) }
end
%>
diff --git a/app/views/admin/settings/project_custom_fields/edit.html.erb b/app/views/admin/settings/project_custom_fields/edit.html.erb
index 4e240c22976..9c5092917a8 100644
--- a/app/views/admin/settings/project_custom_fields/edit.html.erb
+++ b/app/views/admin/settings/project_custom_fields/edit.html.erb
@@ -38,13 +38,13 @@ See COPYRIGHT and LICENSE files for more details.
)
%>
+<%= error_messages_for "custom_field" %>
+
<% if @custom_field.field_format_calculated_value? %>
<%= render Admin::CustomFields::CalculatedValues::DetailsComponent.new(@custom_field) %>
<% elsif @custom_field.hierarchical_list? %>
<%= render CustomFields::DetailsComponent.new(@custom_field) %>
<% else %>
- <%= error_messages_for "custom_field" %>
-
<% content_controller "admin--custom-fields",
"admin--custom-fields-format-value": @custom_field.field_format,
"admin--custom-fields-format-config-value": OpenProject::CustomFieldFormatDependent.stimulus_config %>
diff --git a/app/views/admin/settings/project_custom_fields/new.html.erb b/app/views/admin/settings/project_custom_fields/new.html.erb
index 33dbea678b7..15b15441c4b 100644
--- a/app/views/admin/settings/project_custom_fields/new.html.erb
+++ b/app/views/admin/settings/project_custom_fields/new.html.erb
@@ -31,13 +31,13 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Settings::ProjectCustomFields::NewFormHeaderComponent.new(@custom_field)) %>
+<%= error_messages_for "custom_field" %>
+
<% if @custom_field.field_format_calculated_value? %>
<%= render Admin::CustomFields::CalculatedValues::DetailsComponent.new(@custom_field) %>
<% elsif @custom_field.hierarchical_list? %>
<%= render CustomFields::DetailsComponent.new(@custom_field) %>
<% else %>
- <%= error_messages_for "custom_field" %>
-
<% content_controller "admin--custom-fields",
"admin--custom-fields-format-value": @custom_field.field_format,
"admin--custom-fields-format-config-value": OpenProject::CustomFieldFormatDependent.stimulus_config %>