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

fix(app/properties): remove number of incoming links in pagination (DEV-2474) #1270

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -165,10 +165,15 @@ <h3 class="label mat-headline-6">
<!-- the value(s) of the incoming links -->
<a class="link link-value" *ngFor="let inRes of displayedIncomingLinkResources"
(click)="openResource(inRes.id)">{{inRes.resourceClassLabel}}: <strong>{{inRes.label}}</strong></a>
<mat-paginator *ngIf="numberOffAllIncomingLinkRes > amount_resources" [length]=numberOffAllIncomingLinkRes
<!-- <mat-paginator *ngIf="numberOffAllIncomingLinkRes > amount_resources" [length]=numberOffAllIncomingLinkRes
[pageSize]="amount_resources" [hidePageSize]="true" [pageIndex]="pageEvent.pageIndex"
(page)="goToPage($event)">
</mat-paginator>
</mat-paginator> -->
<div class="pagination" *ngIf="allIncomingLinkResources.length > amount_resources">
<p>Show more</p>
<button [disabled]="pageEvent.pageIndex < 1" (click)="handleIncomingLinkBackward()"><mat-icon>chevron_left</mat-icon></button>
<button [disabled]="allIncomingLinkResources.length/ amount_resources <= pageEvent.pageIndex + 1" (click)="handleIncomingLinkForward()"><mat-icon>chevron_right</mat-icon></button>
</div>
</div>
</div>
</div>
Expand Down
Expand Up @@ -169,6 +169,41 @@
margin: 0;
}

.pagination {
display: flex;
align-items: center;
button {
margin: 0 15px;
padding: 0;
background: transparent;
border: none;
cursor: pointer;
border-radius: 100%;
height: fit-content;
padding: 10px;
display: flex; //centers the icon

mat-icon {
color: $primary;
}

}

button:hover {
background-color: $cool_gray_300;
}

button:disabled {
opacity: 0.4;
cursor: not-allowed;
}

button:disabled:hover {
background-color: transparent;
}

}

@media screen and (max-width: 768px) {
.properties,
.incoming {
Expand Down
Expand Up @@ -325,6 +325,23 @@ export class PropertiesComponent implements OnInit, OnChanges, OnDestroy {
this._getDisplayedIncomingLinkRes();
}

handleIncomingLinkForward(){
if(this.allIncomingLinkResources.length / this.amount_resources > this.pageEvent.pageIndex + 1){
const newPage = new PageEvent();
newPage.pageIndex = this.pageEvent.pageIndex + 1;
this.goToPage(newPage);
}
}

handleIncomingLinkBackward(){
if (this.pageEvent.pageIndex > 0){
const newPage = new PageEvent();
newPage.pageIndex = this.pageEvent.pageIndex - 1;
this.goToPage(newPage);
}

}

/**
* opens resource
* @param linkValue
Expand Down