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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#61619] removed error banner for work package type forms
Eric Schubert18b9352e9473
diff --git a/app/components/work_packages/types/settings_component.rb b/app/components/work_packages/types/settings_component.rbindex 948af9a38df..97699f45cf6 100644--- a/app/components/work_packages/types/settings_component.rb+++ b/app/components/work_packages/types/settings_component.rb@@ -56,7 +56,7 @@ module WorkPackagesenddef update_form_options- { url: type_path(id: model.id), method: :patch, model: }+ { url: update_tab_type_path(id: model.id, tab: :settings), method: :patch, model: }endendenddiff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rbindex 57f61b72196..b7f5af4f812 100644--- a/app/controllers/types_controller.rb+++ b/app/controllers/types_controller.rb@@ -53,11 +53,7 @@ class TypesController < ApplicationControllerif params[:tab].blank?redirect_to tab: :settingselse- type = ::Type- .includes(:projects,- :custom_fields)- .find(params[:id])-+ type = ::Type.includes(:projects, :custom_fields).find(params[:id])render_edit_tab(type)endend@@ -82,14 +78,8 @@ class TypesController < ApplicationControllerUpdateTypeService.new(@type, current_user).call(permitted_type_params) do |call|- call.on_success do- redirect_to_type_tab_path(@type, t(:notice_successful_update))- end-- call.on_failure do |result|- flash[:error] = result.errors.full_messages.join("\n")- render_edit_tab(@type, status: :unprocessable_entity)- end+ call.on_success { redirect_to_type_tab_path(@type, t(:notice_successful_update)) }+ call.on_failure { render_edit_tab(@type, status: :unprocessable_entity) }endenddiff --git a/app/controllers/work_packages/types/subject_configuration_controller.rb b/app/controllers/work_packages/types/subject_configuration_controller.rbindex 240686626aa..4c5d8a6d322 100644--- a/app/controllers/work_packages/types/subject_configuration_controller.rb+++ b/app/controllers/work_packages/types/subject_configuration_controller.rb@@ -48,7 +48,7 @@ module WorkPackagesendcall.on_failure do- @default_tab = "subject_configuration"+ params[:tab] = "subject_configuration"render template: "types/edit", status: :unprocessable_entityendenddiff --git a/app/helpers/tabs_helper.rb b/app/helpers/tabs_helper.rbindex df8228f2e6f..bbb1ed2e6c6 100644--- a/app/helpers/tabs_helper.rb+++ b/app/helpers/tabs_helper.rb@@ -39,10 +39,8 @@ module TabsHelperendend- def selected_tab(tabs, default_tab = nil)- tabs.detect { |t| t[:name] == params[:tab] } ||- tabs.detect { |t| t[:name] == default_tab } ||- tabs.first+ def selected_tab(tabs)+ tabs.detect { |t| t[:name] == params[:tab] } || tabs.firstenddef tabs_for_key(key, params = {})diff --git a/app/views/types/edit.html.erb b/app/views/types/edit.html.erbindex abc54020da3..d8f4a99c7d9 100644--- a/app/views/types/edit.html.erb+++ b/app/views/types/edit.html.erb@@ -31,10 +31,10 @@ See COPYRIGHT and LICENSE files for more details.<% tabs = types_tabs %>-<%= render ::Types::EditPageHeaderComponent.new(type: @type, tabs: tabs) %>+<%= render Types::EditPageHeaderComponent.new(type: @type, tabs:) %><%=- selected_tab = selected_tab(tabs, @default_tab)+ selected_tab = selected_tab(tabs)if selected_tab.key?(:view_component)render selected_tab[:view_component].new(@type)@@ -47,6 +47,3 @@ See COPYRIGHT and LICENSE files for more details.endend%>--<!-- Remove those once all tab contents are using view components -->-<%= error_messages_for "type" %>