Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.
Ruby agplai-assistantdockerdsgvogdprhotwireissue-trackerjira-alternativeknowledge-basellmmcp-servermeeting-notesopen-sourceproject-managementredmine-alternativeruby-on-railsself-hostedticketingtime-tracking
Name the parent task in its error messages
Guido Boyke022fd2dbe441
diff --git a/config/locales/de.yml b/config/locales/de.ymlindex 6ce0e46..0a4310b 100644--- a/config/locales/de.yml+++ b/config/locales/de.yml@@ -109,6 +109,7 @@ de:created_at: Erstellt amcreator: Erstellernumber: Nummer+ parent_id: Übergeordnete Aufgabeproject: Projektsummary: Zusammenfassungtags: Tagsdiff --git a/config/locales/en.yml b/config/locales/en.ymlindex 31ede6c..461a52d 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -103,6 +103,7 @@ en:created_at: Created atcreator: Creatornumber: Number+ parent_id: Parent taskproject: Projectsummary: Summarytags: Tagsdiff --git a/config/locales/models.de.yml b/config/locales/models.de.ymlindex 7dfbd2c..266ae05 100644--- a/config/locales/models.de.yml+++ b/config/locales/models.de.yml@@ -149,9 +149,9 @@ de:ticket:attributes:parent_id:- cannot_be_self: "darf nicht auf sich selbst verweisen"- not_found: "übergeordnete Aufgabe nicht gefunden"- different_project: "übergeordnete Aufgabe muss im selben Projekt liegen"+ cannot_be_self: "darf nicht das Ticket selbst sein"+ not_found: "wurde nicht gefunden"+ different_project: "muss im selben Projekt liegen"cannot_change: "kann nach dem Anlegen nicht mehr geändert werden"reference:self_reference: "Eine Referenz darf nicht auf sich selbst zeigen"diff --git a/config/locales/models.en.yml b/config/locales/models.en.ymlindex ec43596..fc2b491 100644--- a/config/locales/models.en.yml+++ b/config/locales/models.en.yml@@ -141,9 +141,9 @@ en:ticket:attributes:parent_id:- cannot_be_self: "may not point to itself"- not_found: "parent task not found"- different_project: "parent task must be in the same project"+ cannot_be_self: "cannot be the ticket itself"+ not_found: "was not found"+ different_project: "must be in the same project"cannot_change: "cannot be changed once the ticket exists"reference:self_reference: "A reference may not point to itself"diff --git a/spec/models/ticket_subtasks_spec.rb b/spec/models/ticket_subtasks_spec.rbindex 60d517d..dd78c82 100644--- a/spec/models/ticket_subtasks_spec.rb+++ b/spec/models/ticket_subtasks_spec.rb@@ -128,6 +128,16 @@ RSpec.describe Ticket, 'sub-tasks', type: :model doexpect(b.reload.parent_id).to eq(a.id)end+ it 'names the parent task in the full message, in both languages' do+ ticket = create(:ticket, project: project)+ ticket.parent = create(:ticket, project: project)+ ticket.valid?++ full = ->(locale) { I18n.with_locale(locale) { ticket.errors.full_message(:parent_id, ticket.errors.generate_message(:parent_id, :cannot_change)) } }+ expect(full.call(:de)).to eq('Übergeordnete Aufgabe kann nach dem Anlegen nicht mehr geändert werden')+ expect(full.call(:en)).to eq('Parent task cannot be changed once the ticket exists')+ end+it 'still saves other changes of a ticket with a parent' doparent = create(:ticket, project: project)child = create(:ticket, project: project, parent: parent)diff --git a/spec/requests/organisations/tickets_subtasks_spec.rb b/spec/requests/organisations/tickets_subtasks_spec.rbindex e4465db..fe3066d 100644--- a/spec/requests/organisations/tickets_subtasks_spec.rb+++ b/spec/requests/organisations/tickets_subtasks_spec.rb@@ -79,6 +79,8 @@ RSpec.describe 'Tickets sub-tasks (create)', :ci_guard, type: :request doexpect(response).to have_http_status(:found)expect(flash[:notice]).to be_nilexpect(flash[:alert]).to include(cannot_change)+ # The whole sentence a German reader sees: field name and message, both German.+ expect(flash[:alert]).to include('Übergeordnete Aufgabe kann nach dem Anlegen nicht mehr geändert werden')expect(parent_id_of(ticket)).to be_nilend