From 3d27d11d6b2eb997ef4d20b3d1acec51271173bd Mon Sep 17 00:00:00 2001
From: Passam KASSEM <passam.kassem@focati-solutions.com>
Date: Mon, 20 Dec 2021 11:02:19 +0100
Subject: [PATCH] [VAS] 8331 : Retours PR

---
 .../AccessionRegisterDetailInternalService.java     | 13 ++++++++++---
 .../AccessionRegisterSummaryInternalService.java    |  9 ++++++---
 .../src/app/modules/vitamui-common.module.ts        |  3 ---
 .../src/sass/icons/vitamui-icons.css                |  3 +++
 .../accession-register-list.component.ts            |  3 ---
 .../projects/referential/src/assets/i18n/en.json    |  2 +-
 .../projects/referential/src/assets/i18n/fr.json    |  2 +-
 7 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/details/AccessionRegisterDetailInternalService.java b/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/details/AccessionRegisterDetailInternalService.java
index 05b4a7024..89e9f7042 100644
--- a/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/details/AccessionRegisterDetailInternalService.java
+++ b/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/details/AccessionRegisterDetailInternalService.java
@@ -106,7 +106,7 @@ public class AccessionRegisterDetailInternalService {
 
         //Fetching data from vitam
         AccessionRegisterDetailResponseDto results = fetchingAllPaginatedDataFromVitam(vitamContext, query);
-        LOGGER.info("Fetched accession register data : {} ", results);
+        LOGGER.debug("Fetched accession register data : {} ", results);
 
         //Fetch agencies to complete return Dto 'originatingAgencyLabel' property
         Map<String, String> agenciesMap = findAgencies(vitamContext, results);
@@ -131,15 +131,17 @@ public class AccessionRegisterDetailInternalService {
         JsonNode query;
         try {
             Map<String, Object> vitamCriteria = new HashMap<>();
-            LOGGER.info("List of Accession Registers EvIdAppSession : {} ", vitamContext.getApplicationSessionId());
+            LOGGER.debug("List of Accession Registers EvIdAppSession : {} ", vitamContext.getApplicationSessionId());
             if (criteria.isPresent()) {
                 vitamCriteria = objectMapper.readValue(criteria.get(), new TypeReference<HashMap<String, Object>>() {});
             }
             query = VitamQueryHelper.createQueryDSL(vitamCriteria, pageNumber, size, orderBy, direction);
-            LOGGER.info("jsonQuery: {}", query);
+            LOGGER.debug("jsonQuery: {}", query);
         } catch (InvalidParseOperationException | InvalidCreateOperationException ioe) {
+            LOGGER.error("Can't create dsl query to get paginated accession registers : {}", ioe);
             throw new InternalServerException("Can't create dsl query to get paginated accession registers", ioe);
         } catch (IOException e) {
+            LOGGER.error("Can't read value from criteria entries : {}", e);
             throw new InternalServerException("Can't read value from criteria entries", e);
         }
         return query;
@@ -151,8 +153,10 @@ public class AccessionRegisterDetailInternalService {
             RequestResponse<AccessionRegisterDetailModel> accessionRegisterDetails = adminExternalClient.findAccessionRegisterDetails(vitamContext, query);
             results = objectMapper.treeToValue(accessionRegisterDetails.toJsonNode(), AccessionRegisterDetailResponseDto.class);
         } catch (VitamClientException e) {
+            LOGGER.error("Can't fetch data from VITAM : {}", e);
             throw new InternalServerException("Can't fetch data from VITAM", e);
         } catch (JsonProcessingException e) {
+            LOGGER.error("Can't process Json Parsing : {}", e);
             throw new InternalServerException("Can't process Json Parsing", e);
         }
         return results;
@@ -167,10 +171,13 @@ public class AccessionRegisterDetailInternalService {
             RequestResponse<AgenciesModel> requestResponse = agencyService.findAgencies(vitamContext, originatingAgencyQuery);
             agencies = objectMapper.treeToValue(requestResponse.toJsonNode(), AgencyResponseDto.class).getResults();
         } catch (JsonProcessingException e) {
+            LOGGER.error("Error parsing query : {}", e);
             throw new InternalServerException("Error parsing query", e);
         } catch (VitamClientException e) {
+            LOGGER.error("Error fetching agencies from vitam : {}", e);
             throw new InternalServerException("Error fetching agencies from vitam", e);
         } catch (InvalidCreateOperationException e) {
+            LOGGER.error("Invalid Select vitam query : {}", e);
             throw new InternalServerException("Invalid Select vitam query", e);
         }
 
diff --git a/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/summary/AccessionRegisterSummaryInternalService.java b/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/summary/AccessionRegisterSummaryInternalService.java
index 2ac646173..43cdc97aa 100644
--- a/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/summary/AccessionRegisterSummaryInternalService.java
+++ b/api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/accessionregister/summary/AccessionRegisterSummaryInternalService.java
@@ -123,12 +123,13 @@ public class AccessionRegisterSummaryInternalService {
     public List<AccessionRegisterSummaryDto> getAll(VitamContext context) {
         RequestResponse<AccessionRegisterSummaryModel> requestResponse;
         try {
-            LOGGER.info("List of Accession Register EvIdAppSession : {} " , context.getApplicationSessionId());
+            LOGGER.debug("List of Accession Register EvIdAppSession : {} " , context.getApplicationSessionId());
             requestResponse = accessionRegisterService.findAccessionRegisterSummary(context);
             final AccessionRegisterSummaryResponseDto accessionRegisterSymbolicResponseDto = objectMapper
                 .treeToValue(requestResponse.toJsonNode(), AccessionRegisterSummaryResponseDto.class);
             return AccessionRegisterSummaryConverter.convertVitamsToDtos(accessionRegisterSymbolicResponseDto.getResults());
         } catch (JsonProcessingException | VitamClientException e) {
+            LOGGER.error("Error when getting Accession Register summaries : {} " , e);
             throw new InternalServerException("Unable to find accessionRegisterSymbolic", e);
         }
     }
@@ -139,7 +140,8 @@ public class AccessionRegisterSummaryInternalService {
             getCustomAccessionRegisterSummaries(vitamContext, detailsSearchDto);
 
         if(customAccessionRegisterSummaries == null) {
-            throw new InternalServerException("Unable to find accessionRegister Summaries");
+            LOGGER.debug("Unable to find accessionRegister Summaries stats");
+            throw new InternalServerException("Unable to find accessionRegister Summaries stats");
         }
 
         long totalUnits = customAccessionRegisterSummaries.stream().parallel()
@@ -192,6 +194,7 @@ public class AccessionRegisterSummaryInternalService {
 
             return AccessionRegisterSummaryConverter.convertVitamsToDtos(accessionRegisterSummaryResponseDto.getResults());
         } catch (JsonProcessingException | VitamClientException | InvalidCreateOperationException | ParseException e) {
+            LOGGER.error("Unable to find accessionRegister Summaries : {} " , e);
             throw new InternalServerException("Unable to find accessionRegister Summaries", e);
         }
     }
@@ -301,7 +304,7 @@ public class AccessionRegisterSummaryInternalService {
         try {
             select.setProjection(JsonHandler.toJsonNode(queryProjection));
         } catch (InvalidParseOperationException e) {
-            LOGGER.info("Error constructing vitam query");
+            LOGGER.error("Error constructing vitam query");
             throw new InvalidCreateOperationException("Error constructing vitam query", e);
         }
         return select.getFinalSelect();
diff --git a/ui/ui-frontend-common/src/app/modules/vitamui-common.module.ts b/ui/ui-frontend-common/src/app/modules/vitamui-common.module.ts
index 969387e4d..719de6782 100644
--- a/ui/ui-frontend-common/src/app/modules/vitamui-common.module.ts
+++ b/ui/ui-frontend-common/src/app/modules/vitamui-common.module.ts
@@ -51,7 +51,6 @@ import { ConfirmDialogModule } from './components/confirm-dialog/confirm-dialog.
 import { CustomerSelectContentModule } from './components/customer-select-content/customer-select-content.module';
 import { DownloadSnackBarModule } from './components/download-snack-bar/download-snack-bar.module';
 import { EditableFieldModule } from './components/editable-field/editable-field.module';
-// import { LevelInputModule } from './components/editable-field/level-input/level-input.module';
 import { FooterModule } from './components/footer/footer.module';
 import { HeaderModule } from './components/header/header.module';
 import { SelectLanguageModule } from './components/header/select-language/select-language.module';
@@ -145,7 +144,6 @@ export function startupServiceFactory(startupService: StartupService) {
     DragAndDropModule,
     EditableFieldModule,
     InfiniteScrollModule,
-    // LevelInputModule,
     LogbookModule,
     LoggerModule,
     NavbarModule,
@@ -202,7 +200,6 @@ export function startupServiceFactory(startupService: StartupService) {
     DragAndDropModule,
     EditableFieldModule,
     InfiniteScrollModule,
-    // LevelInputModule,
     LogbookModule,
     LoggerModule,
     NavbarModule,
diff --git a/ui/ui-frontend-common/src/sass/icons/vitamui-icons.css b/ui/ui-frontend-common/src/sass/icons/vitamui-icons.css
index 6e9c22826..b8b774054 100644
--- a/ui/ui-frontend-common/src/sass/icons/vitamui-icons.css
+++ b/ui/ui-frontend-common/src/sass/icons/vitamui-icons.css
@@ -773,6 +773,9 @@ i.vitamui-icon {
 .vitamui-icon-support-keys:before {
   content: "\e91c";
 }
+.vitamui-icon-bin:before {
+  content: "\e9ac";
+}
 .vitamui-icon-cross:before {
   content: "\ea0f";
 }
diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts
index 6daa464cd..61726c2d4 100644
--- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts
+++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts
@@ -102,7 +102,6 @@ export class AccessionRegisterListComponent extends InfiniteScrollTable<Accessio
     this.advancedSearchSub?.unsubscribe();
   }
 
-  // Gestion de la recherche
   searchRequest() {
     const dateInterval: { endDateMin: string; endDateMax: string } = this.accessionRegistersService.getDateIntervalChanges().getValue();
     const avancedSearchData: any = this.accessionRegistersService.getAdvancedSearchData().getValue();
@@ -169,13 +168,11 @@ export class AccessionRegisterListComponent extends InfiniteScrollTable<Accessio
     }
   }
 
-  // Gestion du tri
   emitOrderChange(event: string) {
     this.orderChange.next(event);
     this.accessionRegistersService.notifyOrderChange();
   }
 
-  // Gestion des filtres
   onFilterChange(key: string, values: any[]) {
     this.filterMap[key] = values;
     this.filterChange.next(this.filterMap);
diff --git a/ui/ui-frontend/projects/referential/src/assets/i18n/en.json b/ui/ui-frontend/projects/referential/src/assets/i18n/en.json
index d80940cb3..261a108b6 100644
--- a/ui/ui-frontend/projects/referential/src/assets/i18n/en.json
+++ b/ui/ui-frontend/projects/referential/src/assets/i18n/en.json
@@ -102,7 +102,7 @@
     "ADVANCED_SEARCH_FILTERS_ACTIVATED": "Some advanced search filters are activated",
     "LIST": {
       "NB_ENTRIES": "{{nb}} entries",
-      "DATE": "Date",
+      "DATE": "Pick-up date",
       "OPERATION_IDENTIFIER": "Operation identifier",
       "ORIGINATING_AGENCY": "Originating Agency",
       "ARCHIVAL_AGREEMENT": "Archival Agreement",
diff --git a/ui/ui-frontend/projects/referential/src/assets/i18n/fr.json b/ui/ui-frontend/projects/referential/src/assets/i18n/fr.json
index e8b21af65..cf3a23489 100644
--- a/ui/ui-frontend/projects/referential/src/assets/i18n/fr.json
+++ b/ui/ui-frontend/projects/referential/src/assets/i18n/fr.json
@@ -102,7 +102,7 @@
     "ADVANCED_SEARCH_FILTERS_ACTIVATED": "Des filtres de recherche avancée sont activées",
     "LIST": {
       "NB_ENTRIES": "{{nb}} entrées",
-      "DATE": "Date",
+      "DATE": "Date de prise en charge",
       "OPERATION_IDENTIFIER": "Identifiant de l'entrée",
       "ORIGINATING_AGENCY": "Service producteur",
       "ARCHIVAL_AGREEMENT": "Contrat d'entrée",
-- 
GitLab