Skip to content

Commit

Permalink
Merge pull request #996 from Gepardgame/feat/warn-user-about-projet-d…
Browse files Browse the repository at this point in the history
…eletion

Confirmation prompt for projet deletion
  • Loading branch information
nscuro authored Sep 17, 2024
2 parents 0c57f1a + 1ad17b4 commit 4bf7818
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Profil aktualisiert",
"project_cloning_in_progress": "Das Projekt wird mit den angegebenen Klonoptionen erstellt",
"project_created": "Projekt erstellt",
"project_delete_message": "Durch das Löschen dieses Projekts werden auch alle zugehörigen untergeordneten Projekte dauerhaft gelöscht. \nDiese Aktion kann nicht rückgängig gemacht werden. \nSind Sie sicher, dass Sie fortfahren möchten?",
"project_delete_title": "Bestätigen Sie die Projektlöschung",
"project_deleted": "Projekt gelöscht",
"project_details": "Projekt Details",
"project_metadata_supplier_name_desc": "Die Organisation, die die BOM bereitgestellt hat",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Profile updated",
"project_cloning_in_progress": "The project is being created with the cloning options specified",
"project_created": "Project created",
"project_delete_message": "Deleting this project will also permanently delete all associated child projects. This action cannot be undone. Are you sure you want to proceed?",
"project_delete_title": "Confirm Project Deletion",
"project_deleted": "Project deleted",
"project_details": "Project Details",
"project_metadata_supplier_name_desc": "The organization that supplied the BOM",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Perfil actualizado",
"project_cloning_in_progress": "El proyecto se está creando con las opciones de clonación especificadas.",
"project_created": "Proyecto creado",
"project_delete_message": "Al eliminar este proyecto, también se eliminarán permanentemente todos los proyectos secundarios asociados. \nEsta acción no se puede deshacer. \n¿Estás seguro de que quieres continuar?",
"project_delete_title": "Confirmar la eliminación del proyecto",
"project_deleted": "Proyecto eliminado",
"project_details": "detalles del proyecto",
"project_metadata_supplier_name_desc": "La organización que suministró el BOM.",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Profil mis à jour",
"project_cloning_in_progress": "Le projet est en cours de création avec les options de clonage spécifiées",
"project_created": "Projet créé",
"project_delete_message": "La suppression de ce projet supprimera également définitivement tous les projets enfants associés. \nCette action ne peut pas être annulée. \nÊtes-vous sûr de vouloir continuer ?",
"project_delete_title": "Confirmer la suppression du projet",
"project_deleted": "Projet supprimé",
"project_details": "Détails du projet",
"project_metadata_supplier_name_desc": "L'organisation qui a fourni la nomenclature",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "प्रोफाइल अद्यतन किया गया",
"project_cloning_in_progress": "परियोजना को निर्दिष्ट क्लोनिंग विकल्पों के साथ बनाया जा रहा है",
"project_created": "प्रोजेक्ट बनाया गया",
"project_delete_message": "इस प्रोजेक्ट को हटाने से सभी संबद्ध चाइल्ड प्रोजेक्ट भी स्थायी रूप से हटा दिए जाएंगे। \nइस एक्शन को वापस नहीं किया जा सकता। \nक्या आप सुनिश्चित रूप से आगे बढ़ना चाहते हैं?",
"project_delete_title": "प्रोजेक्ट विलोपन की पुष्टि करें",
"project_deleted": "परियोजना हटा दी गई",
"project_details": "परियोजना विवरण",
"project_metadata_supplier_name_desc": "वह संगठन जिसने BOM की आपूर्ति की",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "profilo aggiornato",
"project_cloning_in_progress": "Il progetto viene creato con le opzioni di clonazione specificate",
"project_created": "Progetto creato",
"project_delete_message": "L'eliminazione di questo progetto eliminerà definitivamente anche tutti i progetti secondari associati. \nQuesta azione non può essere annullata. \nSei sicuro di voler procedere?",
"project_delete_title": "Conferma l'eliminazione del progetto",
"project_deleted": "Progetto eliminato",
"project_details": "Dettagli del progetto",
"project_metadata_supplier_name_desc": "L'organizzazione che ha fornito la distinta base",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "プロフィール更新",
"project_cloning_in_progress": "プロジェクトは指定されたクローンオプションで作成されています",
"project_created": "プロジェクトが作成されました",
"project_delete_message": "このプロジェクトを削除すると、関連するすべての子プロジェクトも完全に削除されます。\nこの操作は元に戻すことができません。\n続行してもよろしいですか?",
"project_delete_title": "プロジェクトの削除の確認",
"project_deleted": "プロジェクトが削除されました",
"project_details": "プロジェクトの詳細",
"project_metadata_supplier_name_desc": "BOMを提供した組織",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Profil zaktualizowany",
"project_cloning_in_progress": "Projekt jest tworzony z określonymi opcjami klonowania",
"project_created": "Projekt stworzony",
"project_delete_message": "Usunięcie tego projektu spowoduje również trwałe usunięcie wszystkich powiązanych projektów podrzędnych. \nTej akcji nie można cofnąć. \nCzy na pewno chcesz kontynuować?",
"project_delete_title": "Potwierdź usunięcie projektu",
"project_deleted": "Projekt usunięty",
"project_details": "Szczegóły Projektu",
"project_metadata_supplier_name_desc": "Organizacja, która dostarczyła BOM",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "perfil atualizado",
"project_cloning_in_progress": "O projeto está sendo criado com as opções de clonagem especificadas",
"project_created": "Projeto criado",
"project_delete_message": "A exclusão deste projeto também excluirá permanentemente todos os projetos secundários associados. \nEsta ação não pode ser desfeita. \nTem certeza de que deseja prosseguir?",
"project_delete_title": "Confirmar exclusão do projeto",
"project_deleted": "Projeto excluído",
"project_details": "Detalhes do Projeto",
"project_metadata_supplier_name_desc": "A organização que forneceu a lista técnica",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "perfil atualizado",
"project_cloning_in_progress": "O projeto está sendo criado com as opções de clonagem especificadas",
"project_created": "Projeto criado",
"project_delete_message": "A exclusão deste projeto também excluirá permanentemente todos os projetos secundários associados. \nEsta ação não pode ser desfeita. \nTem certeza de que deseja prosseguir?",
"project_delete_title": "Confirmar exclusão do projeto",
"project_deleted": "Projeto excluído",
"project_details": "Detalhes do Projeto",
"project_metadata_supplier_name_desc": "A organização que forneceu a lista técnica",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Профиль обновлен",
"project_cloning_in_progress": "Проект создается с указанными параметрами клонирования.",
"project_created": "Проект создан",
"project_delete_message": "Удаление этого проекта также приведет к безвозвратному удалению всех связанных с ним дочерних проектов. \nЭто действие невозможно отменить. \nВы уверены, что хотите продолжить?",
"project_delete_title": "Подтвердить удаление проекта",
"project_deleted": "Проект удален",
"project_details": "Детали проекта",
"project_metadata_supplier_name_desc": "Организация, предоставившая спецификацию",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "Профіль оновлено",
"project_cloning_in_progress": "Проект створюється із зазначеними параметрами клонування",
"project_created": "Проект створено",
"project_delete_message": "Видалення цього проекту призведе до остаточного видалення всіх пов’язаних дочірніх проектів. \nЦю дію не можна скасувати. \nВи впевнені, що бажаєте продовжити?",
"project_delete_title": "Підтвердити видалення проекту",
"project_deleted": "Проект видалено",
"project_details": "Деталі проекту",
"project_metadata_supplier_name_desc": "Організація, яка надала специфікацію",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@
"profile_updated": "个人资料已更新",
"project_cloning_in_progress": "正在使用指定的克隆选项创建项目",
"project_created": "项目已创建",
"project_delete_message": "删除此项目还将永久删除所有关联的子项目。\n此操作无法撤消。\n您确定要继续吗?",
"project_delete_title": "确认项目删除",
"project_deleted": "项目已删除",
"project_details": "项目细节",
"project_metadata_supplier_name_desc": "提供 BOM 的组织",
Expand Down
32 changes: 20 additions & 12 deletions src/views/portfolio/projects/ProjectDetailsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -708,19 +708,27 @@ export default {
this.$root.$emit('bv::hide::modal', 'projectDetailsModal');
});
},
deleteProject: function () {
deleteProject: async function () {
this.$root.$emit('bv::hide::modal', 'projectDetailsModal');
let url =
`${this.$api.BASE_URL}/${this.$api.URL_PROJECT}/` + this.project.uuid;
this.axios
.delete(url)
.then((response) => {
this.$toastr.s(this.$t('message.project_deleted'));
this.$router.replace({ name: 'Projects' });
})
.catch((error) => {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
});
let confirmed = await this.$bvModal.msgBoxConfirm(
this.$t('message.project_delete_message'),
{
title: this.$t('message.project_delete_title'),
},
);
if (confirmed) {
let url =
`${this.$api.BASE_URL}/${this.$api.URL_PROJECT}/` + this.project.uuid;
this.axios
.delete(url)
.then((response) => {
this.$toastr.s(this.$t('message.project_deleted'));
this.$router.replace({ name: 'Projects' });
})
.catch((error) => {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
});
}
},
hasActiveChild: function (project) {
return (
Expand Down

0 comments on commit 4bf7818

Please sign in to comment.