Skip to content

Commit

Permalink
Release OpenProject 12.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Mar 28, 2023
2 parents 16c06b9 + 2691e5f commit 7b699a7
Show file tree
Hide file tree
Showing 133 changed files with 397 additions and 167 deletions.
3 changes: 2 additions & 1 deletion app/mailers/project_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
#++

class ProjectMailer < ApplicationMailer
def delete_project_completed(project, user:)
def delete_project_completed(project, user:, dependent_projects: [])
open_project_headers Project: project.identifier,
Author: user.login

message_id project, user
with_locale_for(user) do
@project = project
@dependent_projects = dependent_projects
mail to: user.mail, subject: I18n.t('projects.delete.completed', name: project.name)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/mail_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def mail_as_hash(email)
subject: email.subject,
from: email.from&.first || '(unknown from address)',
quote: incoming_email_quote(email),
text: incoming_email_text(email)
text: plain_text_body || incoming_email_text(email)
}
end

Expand Down
12 changes: 11 additions & 1 deletion app/services/projects/delete_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ module Projects
class DeleteService < ::BaseServices::Delete
include Projects::Concerns::UpdateDemoData

##
# Reference to the dependent projects that we're deleting
attr_accessor :dependent_projects

def initialize(user:, model:, contract_class: nil, contract_options: {})
self.dependent_projects = model.descendants.to_a # Store an Array instead of a Project::ActiveRecord_Relation

super
end

def call(*)
super.tap do |service_call|
notify(service_call.success?)
Expand Down Expand Up @@ -68,7 +78,7 @@ def destroy_all_work_packages

def notify(success)
if success
ProjectMailer.delete_project_completed(model, user:).deliver_now
ProjectMailer.delete_project_completed(model, user:, dependent_projects:).deliver_now
else
ProjectMailer.delete_project_failed(model, user:).deliver_now
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/custom_styles/_inline_css.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
--main-menu-border-width: 1px;
<% end %>
<% if design_color.variable == "alternative-color" %>
--button--alt-highlight-background-hover-color: <%= design_color.darken 0.82 %>;
--button--alt-highlight-background-hover-color: <%= design_color.darken 0.18 %>;
<% end %>
<% if design_color.variable == "primary-color" %>
--primary-color--minor1: <%= design_color.lighten 0.3 %>;
Expand Down
13 changes: 12 additions & 1 deletion app/views/project_mailer/delete_project_completed.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ See COPYRIGHT and LICENSE files for more details.

<h1><%= @project.name %></h1>

<p><%= t('projects.delete.completed_text', name: @project.name) %></p>
<p>
<%= t('projects.delete.completed_text', name: @project.name) %>
<% if @dependent_projects.any? %>
<br />
<%= t('projects.delete.completed_text_children') %>
<ul>
<% @dependent_projects.each do |subproject| %>
<li><%= subproject.name %></li>
<% end %>
</ul>
<% end %>
</p>
9 changes: 9 additions & 0 deletions app/views/project_mailer/delete_project_completed.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ See COPYRIGHT and LICENSE files for more details.
<%= project_url(@project) %>

<%= t('projects.delete.completed_text', name: @project.name) %>

<% if @dependent_projects.any? %>
<%= t('projects.delete.completed_text_children') %>

<% @dependent_projects.each do |subproject| %>
- <%= subproject.name %>
<%= project_url(subproject) %>
<% end %>
<% end %>
1 change: 1 addition & 0 deletions config/locales/crowdin/af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ af:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ ar:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ az:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ be:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ bg:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Отваря се като изглед на Гант'
open_as_gantt_title: "Използвайте този бутон, за да генерирате изглед на Гант, който филтрира работни пакети за проектите, видими на тази страница."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ ca:
failed_text: "La petició per a eliminar el projecte %{name} ha fallat. El projecte s'ha arxivat."
completed: "S'ha completat l'eliminació del projecte %{name}"
completed_text: "La petició d'eliminació del projecte '%{name}' s'ha completat."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Obre com a diagrama de Gantt'
open_as_gantt_title: "Utilitza aquest botó per a generar un diagrama de Gantt que filtra paquets de treball pels projectes visibles en aquesta pàgina."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/ckb-IR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ ckb-IR:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ cs:
failed_text: "Požadavek na smazání projektu %{name} se nezdařil. Projekt zůstal archivován."
completed: "Smazání projektu %{name} dokončeno"
completed_text: "Požadavek na smazání projektu '%{name}' byl dokončen."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Otevřít jako Gantt diagram'
open_as_gantt_title: "Použijte toto tlačítko pro generování Ganttova zobrazení, které filtruje pracovní balíčky pro projekty viditelné na této stránce."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ da:
failed_text: "Anmodningen om at slette projektet %{name} mislykkedes. Projektet blev arkiveret."
completed: "Sletning af projektet %{name} udført"
completed_text: "Anmodningen om at slette projektet '%{name}' er gennemført."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ de:
failed_text: "Die Anfrage zum Löschen des Projekts %{name} ist fehlgeschlagen. Das Projekt wurde archiviert."
completed: "Löschen des Projekts %{name} abgeschlossen"
completed_text: "Die Anfrage zum Löschen des Projekts '%{name}' wurde abgeschlossen."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Als Gantt-Ansicht öffnen'
open_as_gantt_title: "Eine Gantt-Ansicht für Arbeitspakete aus den auf dieser Seite sichtbaren Projekten erzeugen."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ el:
failed_text: "Το αίτημα για διαγραφή του έργου %{name} απέτυχε. Το έργο παρέμεινε αρχειοθετημένο."
completed: "Η διαγραφή του έργου %{name} ολοκληρώθηκε"
completed_text: "Το αίτημα για διαγραφή του έργου %{name} έχει ολοκληρωθεί."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Άνοιγμα ως προβολή Gantt'
open_as_gantt_title: "Χρησιμοποιήστε αυτό το κουμπί για να δημιουργήσετε μια προβολή Gantt που φιλτράρει τα πακέτα εργασίας για τα έργα που εμφανίζονται σε αυτή τη σελίδα."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/eo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ eo:
failed_text: "La peto por forigi la projekton %{name} malsukcesis. La projekto estis arkivita."
completed: "Forigo de la projekto %{name} estis kompletigita"
completed_text: "La peto por forigi la projekton %{name} estis kompletigita."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ es:
failed_text: "La petición de borrado del proyecto %{name} ha fallado. El proyecto ha sido archivado."
completed: "Borrado del proyecto %{name} completado"
completed_text: "La petición para borrar el proyecto '%{name}' se ha completado."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Abrir como diagrama de Gantt'
open_as_gantt_title: "Use este botón para generar un diagrama de Gantt donde se filtren los paquetes de trabajo de los proyectos visibles en esta página."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ et:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ eu:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fa:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fi:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Avaa Gantt-näkymässä'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/fil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fil:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fr:
failed_text: "La demande de suppression du projet %{name} a échoué. Le projet a été archivé."
completed: "Suppression du projet %{name} terminée"
completed_text: "La demande de suppression du projet '%{name}' a été terminée."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Ouvrir comme vue Gantt'
open_as_gantt_title: "Utilisez ce bouton pour générer une vue Gantt qui filtre les lots de travaux des projets visibles sur cette page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ he:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ hi:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ hr:
failed_text: "The request to delete project %{name} has failed. The project was left archived."
completed: "Deletion of project %{name} completed"
completed_text: "The request to delete project '%{name}' has been completed."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Open as Gantt view'
open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ hu:
failed_text: "A projekt%{name} törlése sikertelen. A projekt archiválva van."
completed: "A projekt %{name} törlölve"
completed_text: "A projekt%{name} törlése sikeres."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Gantt nézet megnyitása'
open_as_gantt_title: "Használja ezt a gombot hogy egy szűrt Gantt nézetet generáljon a projekthez"
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ id:
failed_text: "Permintaan untuk menghapus proyek %{name} telah gagal. Proyek dibiarkan diarsipkan."
completed: "Penghapusan proyek %{name} selesai"
completed_text: "Permintaan untuk menghapus proyek '%{name}' telah selesai."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Buka sebagai tampilan Gantt'
open_as_gantt_title: "Gunakan tombol ini untuk membuat tampilan Gantt yang memfilter paket kerja untuk proyek yang terlihat di halaman ini."
Expand Down
1 change: 1 addition & 0 deletions config/locales/crowdin/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ it:
failed_text: "La richiesta di eliminare il progetto %{name} non è riuscita. Il progetto è stato lasciato in archivio."
completed: "Eliminazione del progetto %{name} completata"
completed_text: "La richiesta di cancellare il progetto '%{name}' è stata completata."
completed_text_children: "Additionally, the following subprojects have been deleted:"
index:
open_as_gantt: 'Apri come vista Gantt'
open_as_gantt_title: "Usa questo pulsante per generare una vista Gantt che filtra le macro-attività per i progetti visibili in questa pagina."
Expand Down
Loading

0 comments on commit 7b699a7

Please sign in to comment.