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

remove success banner

Klaus Zandersc18f3fe5442d
diff --git a/modules/costs/app/controllers/time_entries_controller.rb b/modules/costs/app/controllers/time_entries_controller.rb
index 5462ad8c385..9dfce83a6c8 100644
--- a/modules/costs/app/controllers/time_entries_controller.rb
+++ b/modules/costs/app/controllers/time_entries_controller.rb
@@ -104,14 +104,14 @@ class TimeEntriesController < ApplicationController
@time_entry = call.result
- if call.success?
- render_success_flash_message_via_turbo_stream(message: t("notice_updated_successfully"))
- elsif params[:no_dialog]
- render_error_flash_message_via_turbo_stream(message: t("notice_update_failed",
- errors: call.errors.full_messages.join(", ")))
- else
- form_component = TimeEntries::TimeEntryFormComponent.new(time_entry: @time_entry, **form_config_options)
- update_via_turbo_stream(component: form_component, status: :bad_request)
+ if call.failure?
+ if params[:no_dialog]
+ render_error_flash_message_via_turbo_stream(message: t("notice_time_entry_update_failed",
+ errors: call.errors.full_messages.join(", ")))
+ else
+ form_component = TimeEntries::TimeEntryFormComponent.new(time_entry: @time_entry, **form_config_options)
+ update_via_turbo_stream(component: form_component, status: :bad_request)
+ end
end
respond_with_turbo_streams(status: call.success? ? :ok : :bad_request)
diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml
index 7be9e5fe9f5..6e0d3bf9f4c 100644
--- a/modules/costs/config/locales/en.yml
+++ b/modules/costs/config/locales/en.yml
@@ -184,8 +184,7 @@ en:
notice_successful_lock: "Locked successfully."
notice_cost_logged_successfully: "Unit cost logged successfully."
notice_different_time_zones: "This user has a different time zone (%{tz}). Time will be logged using their time zone."
- notice_updated_successfully: "Time entry updated successfully."
- notice_update_failed: "Failed to update time entry. Errors: %{errors}"
+ notice_time_entry_update_failed: "Failed to update time entry. Errors: %{errors}"
permission_edit_cost_entries: "Edit booked unit costs"
permission_edit_own_cost_entries: "Edit own booked unit costs"