From 371c79d0496f7dbcec2b79999fe134fa8d1b805d Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 29 Oct 2024 17:48:49 +0100 Subject: [PATCH] Fix #13237: Pastis typo, i18n & UI bugfixes --- .../projects/pastis/src/app/main/main.component.ts | 1 - .../profile/edit-profile/edit-profile.component.html | 4 +++- .../pastis-popup-option.component.ts | 4 ++-- .../save-profile/save-profile.component.ts | 12 ++++++------ .../projects/pastis/src/assets/css/_toaster.scss | 7 +------ .../projects/pastis/src/assets/i18n/en.json | 9 ++++++--- .../projects/pastis/src/assets/i18n/fr.json | 11 +++++++---- .../projects/pastis/src/sass/_toaster.scss | 7 +------ 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts index 1b3f824389e..38ed095cb56 100644 --- a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts @@ -106,7 +106,6 @@ export class MainComponent implements OnInit, OnDestroy { } else { // Otherwise we must have an user uploaded profile this.uploadedProfileResponse.id = null; - this.uploadedProfileResponse.name = 'Nouveau Profil'; this.fileService.updateTreeWithProfile(this.uploadedProfileResponse); } }); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html index 99847c8fba1..9221d8540d9 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html @@ -5,7 +5,9 @@

- {{ this.profileService.profileName }} + {{ + this.profileService.profileId ? this.profileService.profileName : ('PROFILE.EDIT_PROFILE.NEW_PROFILE' | translate) + }}

diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts index 65a1303ee73..e4002a45a17 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts @@ -162,7 +162,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy { const profileDescription = this.noticeService.puaNotice(retour); this.profileService.createArchivalUnitProfile(profileDescription).subscribe(() => { this.changeExpand(); - this.notificationService.showSuccess('La création de notice a bien été effectué'); + this.notificationService.showSuccess(this.translateService.instant('PASTIS_POPUP_OPTION.MODIFICATION_SUCCESS')); this.profileService.refreshListProfiles(); }); } else if (result.mode === ProfileType.PA) { @@ -170,7 +170,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy { // STEP 1 : Create Notice this.profileService.createProfilePa(profile).subscribe(() => { this.changeExpand(); - this.notificationService.showSuccess('La création de notice a bien été effectué'); + this.notificationService.showSuccess(this.translateService.instant('PASTIS_POPUP_OPTION.MODIFICATION_SUCCESS')); this.profileService.refreshListProfiles(); }); } diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts index c41dad0f68b..7f39113456e 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts @@ -250,13 +250,13 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy { if (!this.editProfile) { this.profileService.createArchivalUnitProfile(this.archivalProfileUnit).subscribe(() => { this.toggleService.hidePending(); - this.success('La création du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.CREATION_SUCCESS')); }); } else { this.profileService.updateProfilePua(this.archivalProfileUnit).subscribe( () => { this.toggleService.hidePending(); - this.success('La modification du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.MODIFICATION_SUCCESS')); }, (error) => { this.toggleService.hidePending(); @@ -323,7 +323,7 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy { this.profileService.updateProfilePua(this.archivalProfileUnit).subscribe( () => { this.toggleService.hidePending(); - this.success('La modification du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.MODIFICATION_SUCCESS')); }, (_) => { this.toggleService.hidePending(); @@ -340,7 +340,7 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy { .updateProfileFilePa(this.noticeService.paNotice(profileDescription, false), myFile) .subscribe(() => { this.toggleService.hidePending(); - this.success('La modification du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.MODIFICATION_SUCCESS')); }); }); } @@ -385,7 +385,7 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy { const myFile = this.blobToFile(retrievedData, 'file'); this.profileService.updateProfileFilePa(createdProfile, myFile).subscribe(() => { this.toggleService.hidePending(); - this.success('La création du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.CREATION_SUCCESS')); }); }); } @@ -397,7 +397,7 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy { const myFile = this.blobToFile(retrievedData, 'file'); this.profileService.updateProfileFilePa(this.noticeService.paNotice(this.profileDescription, false), myFile).subscribe(() => { this.toggleService.hidePending(); - this.success('La modification du profil a bien été effectué'); + this.success(this.translateService.instant('PROFILE.LIST_PROFILE.PROFILE_PREVIEW.MODIFICATION_SUCCESS')); }); }); }); diff --git a/ui/ui-frontend/projects/pastis/src/assets/css/_toaster.scss b/ui/ui-frontend/projects/pastis/src/assets/css/_toaster.scss index 21869ff11e1..d2a31614e98 100644 --- a/ui/ui-frontend/projects/pastis/src/assets/css/_toaster.scss +++ b/ui/ui-frontend/projects/pastis/src/assets/css/_toaster.scss @@ -64,7 +64,7 @@ button.toast-close-button { position: relative; overflow: hidden; //margin: 0 0 6px; - padding: 15px 15px 15px 50px; + padding: 20px 20px 20px 190px; width: 300px; //border-radius: 3px 3px 3px 3px; background-position: 120px center; @@ -72,11 +72,6 @@ button.toast-close-button { background-size: 24px; box-shadow: 0 0 12px #999999; color: #ffffff; - - font-family: Roboto; - font-style: normal; - font-weight: normal; - padding-left: 190px; } .toast-container .ngx-toastr:hover { box-shadow: 0 0 12px #000000; diff --git a/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json b/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json index c84608361c4..f1fb942d0d3 100644 --- a/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json +++ b/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json @@ -30,7 +30,8 @@ "PASTIS_POPUP_OPTION": { "OPEN_PROFIL": "Open a profile from my workstation", "CREATE_NOTICE": "Create a profile notice", - "SEDAVIEW": "View the structure of SEDA 2.1" + "SEDAVIEW": "View the structure of SEDA 2.1", + "CREATION_SUCCESS": "Notice creation successful" }, "SHARED": { "PASTIS_POP_UP_METADATA_LANGUAGE": { @@ -126,6 +127,7 @@ "POPUP_CREATION_OK_LABEL": "CONFIRM" }, "EDIT_PROFILE": { + "NEW_PROFILE": "New profile", "NOTICE_TAB": "Notice", "ENTETE": "Header", "REGLES": "Rules", @@ -174,8 +176,8 @@ "POPUP_DUPLICATE_TITRE_TWO": "its content and configuration (cardinalities and comments)" }, "FILE_TREE_METADATA": { - "PUA": "Archiving Unit Profile", - "PA": "Archiving Profile", + "PUA": "Archiving unit profile", + "PA": "Archiving profile", "SEARCH_PLACEHOLDER": "Find metadata in the table", "NOTIFICATION_AJOUT_METADONNEE": "ArchiveUnit metadata has been added", "BOUTON_AJOUT_METADONNEE": "Add metadata", @@ -234,6 +236,7 @@ "MODIFIER_PROFIL_TOOLTIP": "Modify the profile", "LOAD_PROFILE": "Load a profile", "PROFILE_PREVIEW": { + "CREATION_SUCCESS": "The creation of the profile has been carried out successfully", "MODIFICATION_SUCCESS": "The modification of the profile has been carried out successfully ", "MODIFICATION_ERROR": "Failed to edit profile" } diff --git a/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json b/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json index c5426afc1ac..736d1c803d0 100644 --- a/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json +++ b/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json @@ -30,7 +30,8 @@ "PASTIS_POPUP_OPTION": { "OPEN_PROFIL": "Ouvrir un profil depuis mon poste", "CREATE_NOTICE": "Créer une notice de profil", - "SEDAVIEW": "Visualiser la structure du SEDA 2.1" + "SEDAVIEW": "Visualiser la structure du SEDA 2.1", + "CREATION_SUCCESS": "La création de notice a bien été effectuée" }, "SHARED": { "PASTIS_POP_UP_METADATA_LANGUAGE": { @@ -127,6 +128,7 @@ "POPUP_CREATION_OK_LABEL": "VALIDER" }, "EDIT_PROFILE": { + "NEW_PROFILE": "Nouveau profil", "NOTICE_TAB": "Notice", "ENTETE": "Entête", "REGLES": "Règles", @@ -175,8 +177,8 @@ "POPUP_DUPLICATE_TITRE_TWO": "son contenu et son paramétrage (cardinalités et commentaire)" }, "FILE_TREE_METADATA": { - "PUA": "Profil d'Unité Archivistique", - "PA": "Profil d'Archivage", + "PUA": "Profil d'unité archivistique", + "PA": "Profil d'archivage", "SEARCH_PLACEHOLDER": "Rechercher une métadonnée dans le tableau", "NOTIFICATION_AJOUT_METADONNEE": "La métadonnée ArchiveUnit a été ajoutée", "BOUTON_AJOUT_METADONNEE": "Ajouter une métadonnée", @@ -235,7 +237,8 @@ "MODIFIER_PROFIL_TOOLTIP": "Modifier le profil", "LOAD_PROFILE": "Charger un profil", "PROFILE_PREVIEW": { - "MODIFICATION_SUCCESS": "La modification du profil a bien été effectué", + "CREATION_SUCCESS": "La création du profil a bien été effectuée", + "MODIFICATION_SUCCESS": "La modification du profil a bien été effectuée", "MODIFICATION_ERROR": "Echec de la modification du profil" } }, diff --git a/ui/ui-frontend/projects/pastis/src/sass/_toaster.scss b/ui/ui-frontend/projects/pastis/src/sass/_toaster.scss index 21869ff11e1..d2a31614e98 100644 --- a/ui/ui-frontend/projects/pastis/src/sass/_toaster.scss +++ b/ui/ui-frontend/projects/pastis/src/sass/_toaster.scss @@ -64,7 +64,7 @@ button.toast-close-button { position: relative; overflow: hidden; //margin: 0 0 6px; - padding: 15px 15px 15px 50px; + padding: 20px 20px 20px 190px; width: 300px; //border-radius: 3px 3px 3px 3px; background-position: 120px center; @@ -72,11 +72,6 @@ button.toast-close-button { background-size: 24px; box-shadow: 0 0 12px #999999; color: #ffffff; - - font-family: Roboto; - font-style: normal; - font-weight: normal; - padding-left: 190px; } .toast-container .ngx-toastr:hover { box-shadow: 0 0 12px #000000;