-
+
-
+
+
+
+
+ {{ 'Document information' | translate }}
+
+
{{ record.metadata.document.title }}
-
+
@if (record.metadata.document.authors; as authors) {
- - Authors
- - {{ authors }}
+ - Authors
+ - {{ authors }}
}
@if (record.metadata.document.publisher || record.metadata.document.year) {
- - Edition
- -
+
- Edition
+ -
@if (record.metadata.document.publisher; as publisher) {
{{ publisher }}
}
@@ -41,12 +43,12 @@
{{ record.metadata.document.title }}
}
@if (record.metadata.document.identifier; as identifier) {
- - Identifiers
- - {{ identifier }}
+ - Identifiers
+ - {{ identifier }}
}
@if (record.metadata.document.source; as source) {
- - Published in
- -
+
- Published in
+ -
{{ source.journal_title }}
@if (source.volume || source.number) {
(@if (source.volume) { Vol.{{ source.volume }} }
@@ -56,82 +58,87 @@
{{ record.metadata.document.title }}
}
-
-
+
-
-
-
-
- @if (record.metadata.found_in; as source) {
- - Found in
- -
- {{ source.source }} — {{ source.url }}
-
- }
- - Requester
- -
- @if (requester && requester.patron && requester.patron.barcode[0]) {
-
- {{ requester.last_name }}
- @if (requester.first_name; as firstName) {
- , {{ firstName }}
- }
-
- }
-
- - Request date
- - {{ record.created | dateTranslate : 'medium' }}
- - Request status
- -
-
- {{ record.metadata.status }}
-
-
- - Loan status
- -
-
- {{ record.metadata.loan_status || 'None' | translate }}
-
-
- - Pickup location
- -
- @if (record.metadata.pickup_location.pid | getRecord:'locations':'field':'ill_pickup_name' | async; as location_name) {
- {{ location_name }}
- }
+
+
+
+
+ {{ 'Request additional informations' | translate }}
+
+
+
+ @if (record.metadata.found_in; as source) {
+ - Found in
+ -
+ {{ source.source }} — {{ source.url }}
- - Scope
- -
- @if (record.metadata.copy) {
- Copy
- } @else {
- Loan
- }
+ }
+
- Requester
+ -
+ @if (requester && requester.patron && requester.patron.barcode[0]) {
+
+ {{ requester.last_name }}
+ @if (requester.first_name; as firstName) {
+ , {{ firstName }}
+ }
+
+ }
+
+ - Request date
+ - {{ record.created | dateTranslate : 'medium' }}
+ - Request status
+ -
+
+ {{ record.metadata.status | translate }}
+
+
+ @if (record.metadata.loan_status) {
+ - Loan status
+ -
+
+ {{ record.metadata.loan_status | translate}}
+
+ }
+ - Pickup location
+ -
+ @if (record.metadata.pickup_location.pid | getRecord:'locations':'field':'ill_pickup_name' | async; as location_name) {
+ {{ location_name }}
+ }
+
+ - Scope
+ -
@if (record.metadata.copy) {
-
- Pages
- - {{ record.metadata.pages }}
+ Copy
+ } @else {
+ Loan
}
-
-
-
- @if (record.metadata.notes) {
-
-
-
+
+ @if (record.metadata.copy) {
+ - Pages
+ - {{ record.metadata.pages }}
+ }
+
+
+
+
+ @if (record.metadata.notes) {
+
+
+
+
+ {{ 'Notes' | translate }}
+
+
+
@for (note of record.metadata.notes; track note) {
- - {{ note.type }}
-
+ - {{ note.type }}
+
}
-
- }
+
+ }
}
diff --git a/projects/admin/src/app/record/detail-view/ill-request-detail-view/ill-request-detail-view.component.ts b/projects/admin/src/app/record/detail-view/ill-request-detail-view/ill-request-detail-view.component.ts
index b4aef024b..3ed19d847 100644
--- a/projects/admin/src/app/record/detail-view/ill-request-detail-view/ill-request-detail-view.component.ts
+++ b/projects/admin/src/app/record/detail-view/ill-request-detail-view/ill-request-detail-view.component.ts
@@ -15,10 +15,10 @@
* along with this program. If not, see
.
*/
import { Component, inject, OnInit } from '@angular/core';
+import { getTagSeverityFromStatus } from '@app/admin/utils/utils';
import { RecordService } from '@rero/ng-core';
import { DetailRecord } from '@rero/ng-core/lib/record/detail/view/detail-record';
import { Observable } from 'rxjs';
-import { IllRequestsService } from '../../../service/ill-requests.service';
@Component({
selector: 'admin-ill-request-detail-view',
@@ -27,7 +27,6 @@ import { IllRequestsService } from '../../../service/ill-requests.service';
export class IllRequestDetailViewComponent implements DetailRecord, OnInit {
private recordService: RecordService = inject(RecordService);
- private illRequestService: IllRequestsService = inject(IllRequestsService);
// COMPONENT ATTRIBUTES =======================================================
/** The observable resolving record data */
@@ -40,20 +39,18 @@ export class IllRequestDetailViewComponent implements DetailRecord, OnInit {
/** the requester of the ILL request */
requester = null;
+ tagSeverity: string;
+ loanTagSeverity: string;
+
/** OnInit hook */
ngOnInit(): void {
this.record$.subscribe((record) => {
this.record = record;
+ this.tagSeverity = getTagSeverityFromStatus(record.metadata.status);
+ this.loanTagSeverity = getTagSeverityFromStatus(record.metadata.loan_status);
this.recordService.getRecord('patrons', this.record.metadata.patron.pid).subscribe(
(patron) => this.requester = patron.metadata
);
});
}
-
- // FUNCTIONS =================================================================
- /** get the bootstrap color to apply on the request status badge */
- badgeColor(status: string): string {
- return this.illRequestService.badgeColor(status);
- }
-
}
diff --git a/projects/admin/src/app/service/ill-requests.service.spec.ts b/projects/admin/src/app/service/ill-requests.service.spec.ts
deleted file mode 100644
index d41340a1f..000000000
--- a/projects/admin/src/app/service/ill-requests.service.spec.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * RERO ILS UI
- * Copyright (C) 2020 RERO
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see
.
- */
-import { TestBed } from '@angular/core/testing';
-
-import { IllRequestsService } from './ill-requests.service';
-
-describe('IllRequestsService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
-
- it('should be created', () => {
- const service: IllRequestsService = TestBed.inject(IllRequestsService);
- expect(service).toBeTruthy();
- });
-});
diff --git a/projects/admin/src/app/service/ill-requests.service.ts b/projects/admin/src/app/service/ill-requests.service.ts
deleted file mode 100644
index 72f4a8bbf..000000000
--- a/projects/admin/src/app/service/ill-requests.service.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * RERO ILS UI
- * Copyright (C) 2020 RERO
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see
.
- */
-import { Injectable } from '@angular/core';
-import { ILLRequestStatus } from '../classes/ill-request';
-import { LoanState } from '../classes/loans';
-
-@Injectable({
- providedIn: 'root'
-})
-export class IllRequestsService {
-
- /**
- * Get the bootstrap color to apply on the request status badge
- * @param status: the status to check
- * @return the bootstrap color to use for this request (badge, alert, ...).
- */
- badgeColor(status: any): string {
- if (status) {
- switch (status) {
- case ILLRequestStatus.PENDING:
- case LoanState.PENDING:
- return 'warning';
- case ILLRequestStatus.VALIDATED:
- case LoanState.ITEM_AT_DESK:
- return 'success';
- case ILLRequestStatus.DENIED:
- return 'danger';
- case LoanState.ITEM_ON_LOAN:
- case LoanState.ITEM_RETURNED:
- return 'info';
- default:
- return 'secondary';
- }
- }
- return 'secondary';
- }
-}
diff --git a/projects/admin/src/app/utils/utils.ts b/projects/admin/src/app/utils/utils.ts
index b7d6d182a..f3942a47d 100644
--- a/projects/admin/src/app/utils/utils.ts
+++ b/projects/admin/src/app/utils/utils.ts
@@ -16,6 +16,9 @@
* along with this program. If not, see
.
*/
+import { ILLRequestStatus } from "../classes/ill-request";
+import { LoanState } from "../classes/loans";
+
/** Convert a level string to boostrap level
* @param level - string: the level string to convert
* @return the severity of message (info by default)
@@ -32,3 +35,21 @@ export function getSeverity(level: string) {
return 'info';
}
}
+
+export function getTagSeverityFromStatus(status: string): string {
+ switch (status) {
+ case ILLRequestStatus.PENDING:
+ case LoanState.PENDING:
+ return 'warning';
+ case ILLRequestStatus.VALIDATED:
+ case LoanState.ITEM_AT_DESK:
+ return 'success';
+ case ILLRequestStatus.DENIED:
+ return 'danger';
+ case LoanState.ITEM_ON_LOAN:
+ case LoanState.ITEM_RETURNED:
+ return 'info';
+ default:
+ return 'secondary';
+ }
+}