diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts index 4929a651b960ba6b52ecc480922ed9069b2e2c04..0109700810e90ffe04597e3cc753f0b5e3870255 100755 --- a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts +++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts @@ -18,7 +18,7 @@ import { RegisteredMailRecipientInputComponent } from '../../administration/regi @Component({ selector: 'app-indexing-form', - templateUrl: "indexing-form.component.html", + templateUrl: 'indexing-form.component.html', styleUrls: ['indexing-form.component.scss'], providers: [SortPipe] }) @@ -38,6 +38,7 @@ export class IndexingFormComponent implements OnInit { @Output() retrieveDocumentEvent = new EventEmitter<string>(); @Output() loadingFormEndEvent = new EventEmitter<string>(); + @Output() afterSaveEvent = new EventEmitter<string>(); @ViewChild('appDiffusionsList', { static: false }) appDiffusionsList: DiffusionsListComponent; @ViewChild('appIssuingSiteInput', { static: false }) appIssuingSiteInput: IssuingSiteInputComponent; @@ -454,6 +455,10 @@ export class IndexingFormComponent implements OnInit { recipient: formatdatas.registeredMail_recipient, reference: formatdatas.registeredMail_reference }).pipe( + tap(() => { + this.loadForm(this.indexingFormId); + this.afterSaveEvent.emit(); + }), catchError((err: any) => { this.notify.handleErrors(err); return of(false); @@ -787,6 +792,10 @@ export class IndexingFormComponent implements OnInit { fieldValue = data[elem.identifier]; } + if (elem.identifier === 'registeredMail_type') { + this.getIssuingSites(null, fieldValue); + } + if (elem.identifier === 'priority') { this.setPriorityColor(null, fieldValue); } else if (elem.identifier === 'processLimitDate' && !this.functions.empty(fieldValue)) { @@ -1205,9 +1214,12 @@ export class IndexingFormComponent implements OnInit { this.fieldCategories.forEach(element => { this['indexingModels_' + element].forEach((fieldItem: any) => { if (fieldItem.identifier === 'registeredMail_warranty') { - console.log(fieldItem); fieldItem.values[2].disabled = value === 'RW'; } + + if (fieldItem.identifier === 'registeredMail_issuingSite') { + this.arrFormControl['registeredMail_issuingSite'].setValue(''); + } }); if (value === 'RW' && this.arrFormControl['registeredMail_warranty'].value === 'R3') { this.arrFormControl['registeredMail_warranty'].setValue('R1'); diff --git a/src/frontend/app/process/process.component.html b/src/frontend/app/process/process.component.html index 02b1b6c28c0a32bd5831a7e168eed95d8f71419a..6331be4a89d701a2a20a3293d7d9deb8a2e1950f 100644 --- a/src/frontend/app/process/process.component.html +++ b/src/frontend/app/process/process.component.html @@ -107,7 +107,7 @@ [resId]="currentResourceInformations.resId" [indexingFormId]="currentResourceInformations.modelId" [mode]="'process'" [canEdit]="canEditData" [hideDiffusionList]="true" (loadingFormEndEvent)="triggerProcessAction()" - (retrieveDocumentEvent)="appDocumentViewer.saveDocService()"></app-indexing-form> + (retrieveDocumentEvent)="appDocumentViewer.saveDocService()" (afterSaveEvent)="refreshData()"></app-indexing-form> <div style="position: sticky;bottom: 0px;text-align:right;"> <button mat-fab [title]="this.translate.instant('lang.saveModifications')" *ngIf="isToolModified()" (click)="saveTool()" color="accent"> @@ -293,7 +293,7 @@ <app-indexing-form *ngIf="modal.id === 'info' && !loading" #indexingForm [groupId]="currentGroupId" [indexingFormId]="currentResourceInformations.modelId" [resId]="currentResourceInformations.resId" [mode]="'process'" [canEdit]="canEditData" [hideDiffusionList]="true" - (loadingFormEndEvent)="triggerProcessAction()" (retrieveDocumentEvent)="appDocumentViewer.saveDocService()"> + (loadingFormEndEvent)="triggerProcessAction()" (retrieveDocumentEvent)="appDocumentViewer.saveDocService()" (afterSaveEvent)="refreshData()"> </app-indexing-form> <div style="position: sticky;bottom: 0px;text-align:right;padding:15px;"> <button mat-fab diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index 7a9d5f0e59d440b646d64695052a984f79e62e68..6f6b48effd8eea949cd82fcca95892858e60faf8 100755 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -714,6 +714,12 @@ export class ProcessComponent implements OnInit, OnDestroy { } } + refreshData() { + console.log('fuuuu'); + + this.appDocumentViewer.loadRessource(this.currentResourceInformations.resId); + } + refreshBadge(nbRres: any, id: string) { this.processTool.filter(tool => tool.id === id)[0].count = nbRres; }