Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

holding: fix holding display problem. #378

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<div class="col-sm-2" translate>Call number</div>
</div>
<admin-default-holding-item
*ngFor="let item of items"
*ngFor="let item of items | slice:0: displayItemsCounter"
class="row mt-1"
[holding]="holding"
[item]="item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class HoldingComponent implements OnInit, OnDestroy {
/** Holding record */
@Input() holding: any;

/** Document harvested */
@Input() holdingType: 'electronic' | 'serial' | 'standard';
/** shortcut for holding type */
holdingType: 'electronic' | 'serial' | 'standard';

/** Items */
items: any = null;
Expand Down Expand Up @@ -70,6 +70,7 @@ export class HoldingComponent implements OnInit, OnDestroy {

/** Init */
ngOnInit() {
this.holdingType = this.holding.metadata.holdings_type;
if (this.holdingType !== 'electronic') {
this._loadItems();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<div class="row" *ngIf="canAdd">
<div class="col" [ngSwitch]="holdingType">
<a *ngSwitchCase="'standard'" class="btn btn-sm btn-outline-primary mt-2 float-right"
[routerLink]="['/', 'records', 'items', 'new']" [queryParams]="{ document: documentPid }">
<i class="fa fa-plus-square-o"></i> {{ 'Add' | translate }}...
</a>
<a *ngSwitchCase="'serial'" class="btn btn-sm btn-outline-primary float-right"
[routerLink]="['/', 'records', 'holdings', 'new']" [queryParams]="{ document: documentPid }">
<i class="fa fa-plus-square-o"></i> {{ 'Add' | translate }}...
</a>
</div>
<div class="row" *ngIf="canAdd">
<div class="col" [ngSwitch]="holdingType">
<a *ngSwitchCase="'standard'" class="btn btn-sm btn-outline-primary mt-2 float-right"
[routerLink]="['/', 'records', 'items', 'new']" [queryParams]="{ document: documentPid }">
<i class="fa fa-plus-square-o"></i> {{ 'Add' | translate }}...
</a>
<a *ngSwitchCase="'serial'" class="btn btn-sm btn-outline-primary float-right"
[routerLink]="['/', 'records', 'holdings', 'new']" [queryParams]="{ document: documentPid }">
<i class="fa fa-plus-square-o"></i> {{ 'Add' | translate }}...
</a>
</div>
</div>

<ng-container *ngIf="holdings">
<admin-document-holding *ngFor="let holding of holdings" [holding]="holding" [holdingType]="holdingType"
(deleteHolding)="deleteHolding($event)">
<admin-document-holding *ngFor="let holding of holdings" [holding]="holding" (deleteHolding)="deleteHolding($event)">
</admin-document-holding>
</ng-container>