Skip to content

Commit

Permalink
item: fix circulation info in detail view
Browse files Browse the repository at this point in the history
* Removes redundant requests information.
* Adds item status.
* Displays requests for items at desk.
* Closes rero/rero-ils#798.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Mar 2, 2020
1 parent bd85eb5 commit 540fd32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
 You should have received a copy of the GNU Affero General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<ng-container *ngIf="record">
<header class="row">
<h1>{{ 'Barcode' | translate }} {{ record.metadata.barcode }}</h1>
Expand Down Expand Up @@ -64,21 +65,6 @@ <h1>{{ 'Barcode' | translate }} {{ record.metadata.barcode }}</h1>
<dd class="col-sm-7 col-md-8 mb-0">
<admin-item-availability [item]="record"></admin-item-availability>
</dd>
<!-- NUMBER OF REQUEST -->
<ng-container *ngIf="numberOfRequests > 0">
<dt class="col-sm-3 offset-sm-2 offset-md-0">
{{ 'Request queue' | translate }}:
</dt>
<dd class="col-sm-7 col-md-8 mb-0">
{{ numberOfRequests }}
<ng-container *ngIf="numberOfRequests > 1; else request">
{{ 'requests' | translate }}
</ng-container>
<ng-template #request>
{{ 'request' | translate }}
</ng-template>
</dd>
</ng-container>
</dl>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
-->
<ng-container *ngIf="item">
<i class="fa fa-circle text-{{ item.metadata.available ? 'success': 'danger' }}"></i>
<ng-container *ngIf="item.metadata.available; else unavailable">
<!-- TODO: There will be a US to uniformize the display of availability. Remove or modify this component accordingly: -->
<!-- <ng-container *ngIf="item.metadata.available; else unavailable">
{{ 'available' | translate }}
</ng-container>
<ng-template #unavailable>
{{ 'unavailable' | translate }}
</ng-template>
</ng-template> -->
({{ item.metadata.status | translate }})
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
import { Component, Input } from '@angular/core';


@Component({
selector: 'admin-item-availability',
templateUrl: './item-availability.component.html',
Expand Down
4 changes: 2 additions & 2 deletions projects/admin/src/app/service/loan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class LoanService {
};

statusRequest = {
ON_DESK: 'ITEM_ON_DESK',
AT_DESK: 'ITEM_AT_DESK',
PENDING: 'PENDING',
IN_TRANSIT_FOR_PICKUP: 'ITEM_IN_TRANSIT_FOR_PICKUP'
};
Expand Down Expand Up @@ -73,7 +73,7 @@ export class LoanService {
requestedBy$(itemPid: string) {
return this.loans$(itemPid).pipe(
map(results => results.hits.hits.filter((data: any) =>
data.metadata.state === this.statusRequest.ON_DESK
data.metadata.state === this.statusRequest.AT_DESK
|| data.metadata.state === this.statusRequest.PENDING
|| data.metadata.state === this.statusRequest.IN_TRANSIT_FOR_PICKUP
))
Expand Down

0 comments on commit 540fd32

Please sign in to comment.