diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php index 148e0718538674781cb1f57ea15ebb8edcbb82a1..7de6e47553e6efdf756fe3d249002470610170ca 100755 --- a/src/app/resource/controllers/ResController.php +++ b/src/app/resource/controllers/ResController.php @@ -1377,7 +1377,7 @@ class ResController extends ResourceControlController $resource = ResModel::getById([ 'resId' => $args['resId'], - 'select' => ['format', 'fingerprint', 'filesize', 'fulltext_result', 'creation_date', 'filename', 'docserver_id', 'path'] + 'select' => ['format', 'fingerprint', 'filesize', 'fulltext_result', 'creation_date', 'filename', 'docserver_id', 'path', 'typist'] ]); if (!empty($resource['docserver_id'])) { @@ -1387,6 +1387,7 @@ class ResController extends ResourceControlController $resource['docserverPathFile'] = str_replace('#', '/', $resource['docserverPathFile']); } + $resource['typistLabel'] = UserModel::getLabelledUserById(['id' => $resource['typist']]); $resource['creationDate'] = $resource['creation_date']; unset($resource['creation_date']); diff --git a/src/frontend/app/indexation/technical-information/technical-information.component.html b/src/frontend/app/indexation/technical-information/technical-information.component.html index 926bbd77f88cbbb4263d4dc5cacd234143b9cb44..d04d32d85a7c5b55ebc300108214bdc21fa2edd9 100644 --- a/src/frontend/app/indexation/technical-information/technical-information.component.html +++ b/src/frontend/app/indexation/technical-information/technical-information.component.html @@ -10,7 +10,7 @@ <div *ngIf="loading" class="loading" color="primary"> <mat-spinner></mat-spinner> </div> - <ng-container *ngFor="let data of techData | keyvalue"> + <ng-container *ngFor="let data of techData | keyvalue: null"> <mat-form-field *ngIf="!functions.empty(data.value.value)" class="data-item"> <mat-icon matPrefix [class]="data.value.icon" color="primary" style="width: 35px;text-align: center;"> </mat-icon> diff --git a/src/frontend/app/indexation/technical-information/technical-information.component.ts b/src/frontend/app/indexation/technical-information/technical-information.component.ts index f14ba52b6ae55d861ff586c5b14f6077c60749fd..3a28eca37db8745b66daba2b605517a8195d46cf 100644 --- a/src/frontend/app/indexation/technical-information/technical-information.component.ts +++ b/src/frontend/app/indexation/technical-information/technical-information.component.ts @@ -19,35 +19,40 @@ export class TechnicalInformationComponent implements OnInit { loading: boolean = false; techData: any = { - format: { - label: 'fileFormat', + initiator: { + label: 'initiator', value: '', - icon: 'far fa-file-archive' + icon: 'fas fa-user' + }, + creationDate: { + label: 'creationDate', + value: '', + icon: 'fas fa-calendar-day' }, size: { label: 'filesize', value: '', icon: 'fas fa-cubes' }, - creationDate: { - label: 'creationDate', + format: { + label: 'fileFormat', value: '', - icon: 'fas fa-calendar-day' + icon: 'far fa-file-archive' }, - fingerprint: { - label: 'fingerprint', + filename: { + label: 'filename', value: '', - icon: 'fas fa-fingerprint' + icon: 'fas fa-quote-right' }, docserverPathFile: { label: 'docserverPathFile', value: '', icon: 'fas fa-terminal' }, - filename: { - label: 'filename', + fingerprint: { + label: 'fingerprint', value: '', - icon: 'fas fa-quote-right' + icon: 'fas fa-fingerprint' }, fulltext: { label: 'fulltext', @@ -79,14 +84,14 @@ export class TechnicalInformationComponent implements OnInit { this.http.get(`../rest/resources/${this.data.resId}/fileInformation`).pipe( tap((data: any) => { this.techData.format.value = data.information.format, - this.techData.fingerprint.value = data.information.fingerprint, - this.techData.size.value = this.functions.formatBytes(data.information.filesize), - this.techData.fulltext.value = data.information.fulltext_result, - this.techData.docserverPathFile.value = data.information.docserverPathFile, - this.techData.filename.value = data.information.filename, - this.techData.creationDate.value = this.datePipe.transform(data.information.creationDate, 'dd/MM/y HH:mm') , - this.loading = false; - + this.techData.fingerprint.value = data.information.fingerprint, + this.techData.size.value = this.functions.formatBytes(data.information.filesize), + this.techData.fulltext.value = data.information.fulltext_result, + this.techData.docserverPathFile.value = data.information.docserverPathFile, + this.techData.filename.value = data.information.filename, + this.techData.initiator.value = data.information.typistLabel, + this.techData.creationDate.value = this.datePipe.transform(data.information.creationDate, 'dd/MM/y HH:mm') , + this.loading = false; }), exhaustMap(() => this.http.get('../rest/customFields')), tap((data: any) => { diff --git a/test/unitTests/app/resource/ResControllerTest.php b/test/unitTests/app/resource/ResControllerTest.php index 42d60c3e019d44200e2256bb57609644e4154497..d881728842ded58b0ced15fbad6af0239551ec72 100755 --- a/test/unitTests/app/resource/ResControllerTest.php +++ b/test/unitTests/app/resource/ResControllerTest.php @@ -1954,6 +1954,9 @@ class ResControllerTest extends TestCase $this->assertSame('txt', $responseBody['information']['format']); $this->assertIsString($responseBody['information']['fingerprint']); $this->assertNotEmpty($responseBody['information']['fingerprint']); + $this->assertIsString($responseBody['information']['typistLabel']); + $this->assertNotEmpty($responseBody['information']['typistLabel']); + $this->assertNotEmpty($responseBody['information']['typist']); $this->assertSame(46, $responseBody['information']['filesize']); $this->assertSame('SUCCESS', $responseBody['information']['fulltext_result']); $this->assertSame(true, $responseBody['information']['canConvert']);