Commit 12088d70 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #20773 TIME 0:10 don't call url request

parent 16d4deb9
......@@ -29,59 +29,61 @@
</ion-button>
</ion-item>
</div>
<ion-item lines="none" *ngIf="!creationMode">
<ion-label color="secondary">{{'lang.linkedUsers' | translate}} :</ion-label>
</ion-item>
<ion-searchbar [placeholder]="'lang.filter' | translate" style="margin-left: 4x; display: flex; width: 50%;"
(ionChange)="applyFilter($event.detail.value)">
</ion-searchbar>
<ion-content *ngIf="!creationMode" style="height: 400px; overflow-y: auto;">
<ion-list>
<ion-item style="position: sticky;top:0px;z-index:1;">
<ng-container style="display: flex;align-items: center;justify-content: center;width: 100%;background: white;">
<ion-label color="primary" matSort [matSortActive]="displayedColumns[1]" matSortDirection='asc'
style="display: flex;font-size: 12px;align-items: center;" (matSortChange)="sortData($event)">
<ng-container *ngFor="let col of displayedColumns">
<div [mat-sort-header]="col" disableClear style="flex: 1" *ngIf="col!=='actions'">
{{'lang.' + col | translate}}
</div>
</ng-container>
<div style="flex: 1;text-align: right;" *ngIf="displayedColumns.indexOf('actions') > -1">
<ion-button slot="end" color="primary" fille="outline" shape="round"
(click)="openUserList()">
{{'lang.add' | translate}}
</ion-button>
</div>
</ion-label>
</ng-container>
<ion-button slot="end" fill="clear" shape="round" disabled>
<ion-icon></ion-icon>
</ion-button>
</ion-item>
<ion-virtual-scroll [items]="sortedData" approxItemHeight="50px">
<ion-item *virtualItem="let element" style="display: flex;">
<ion-label style="display: flex;cursor: pointer;"
routerLink="/administration/users/{{element.id}}">
<div style="flex: 1" *ngFor="let col of displayedColumns">
{{element[col]}}
<ng-container *ngIf="!creationMode">
<ion-item lines="none">
<ion-label color="secondary">{{'lang.linkedUsers' | translate}} :</ion-label>
</ion-item>
<ion-searchbar [placeholder]="'lang.filter' | translate" style="margin-left: 4x; display: flex; width: 50%;"
(ionChange)="applyFilter($event.detail.value)">
</ion-searchbar>
<ion-content style="height: 400px; overflow-y: auto;">
<ion-list>
<ion-item style="position: sticky;top:0px;z-index:1;">
<ng-container style="display: flex;align-items: center;justify-content: center;width: 100%;background: white;">
<ion-label color="primary" matSort [matSortActive]="displayedColumns[1]" matSortDirection='asc'
style="display: flex;font-size: 12px;align-items: center;" (matSortChange)="sortData($event)">
<ng-container *ngFor="let col of displayedColumns">
<div [mat-sort-header]="col" disableClear style="flex: 1" *ngIf="col!=='actions'">
{{'lang.' + col | translate}}
</div>
</ng-container>
<div style="flex: 1;text-align: right;" *ngIf="displayedColumns.indexOf('actions') > -1">
<ion-button slot="end" color="primary" fille="outline" shape="round"
(click)="openUserList()">
{{'lang.add' | translate}}
</ion-button>
</div>
</ion-label>
<ion-button slot="end" fill="clear" shape="round"
(click)="$event.stopPropagation();unlinkUser(element)"
title="{{'lang.unlinkUser' | translate}}">
<ion-icon color="danger" slot="icon-only" name="close-outline"></ion-icon>
</ng-container>
<ion-button slot="end" fill="clear" shape="round" disabled>
<ion-icon></ion-icon>
</ion-button>
</ion-item>
</ion-virtual-scroll>
<ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)" *ngIf="group.users.length > 7">
<ion-infinite-scroll-content loadingSpinner="bubbles" [loadingText]="'lang.loadingMoreData' | translate">
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-list>
<ion-item lines="none" *ngIf="group.users.length === 0" style="text-align: center; font-size: 20px; color: gray; margin-top: 5px;">
<ion-label>{{ 'lang.emptyGroupUsers' | translate }}</ion-label>
</ion-item>
</ion-content>
<ion-virtual-scroll [items]="sortedData" approxItemHeight="50px">
<ion-item *virtualItem="let element" style="display: flex;">
<ion-label style="display: flex;cursor: pointer;"
routerLink="/administration/users/{{element.id}}">
<div style="flex: 1" *ngFor="let col of displayedColumns">
{{element[col]}}
</div>
</ion-label>
<ion-button slot="end" fill="clear" shape="round"
(click)="$event.stopPropagation();unlinkUser(element)"
title="{{'lang.unlinkUser' | translate}}">
<ion-icon color="danger" slot="icon-only" name="close-outline"></ion-icon>
</ion-button>
</ion-item>
</ion-virtual-scroll>
<ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)" *ngIf="group.users.length > 7">
<ion-infinite-scroll-content loadingSpinner="bubbles" [loadingText]="'lang.loadingMoreData' | translate">
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-list>
<ion-item lines="none" *ngIf="group.users.length === 0" style="text-align: center; font-size: 20px; color: gray; margin-top: 5px;">
<ion-label>{{ 'lang.emptyGroupUsers' | translate }}</ion-label>
</ion-item>
</ion-content>
</ng-container>
<ion-item text-center lines="none" style="position: sticky;bottom:0px;z-index:1;">
<div style="display: flex;align-items: center;justify-content: center;width: 100%;background: white;">
<ion-button type="submit" shape="round" size="large" fill="outline" color="primary"
......
......@@ -464,13 +464,8 @@ export class GroupComponent implements OnInit {
}
loadData(event: any) {
this.http.get(`../rest/groups/${this.group.id}`).pipe(
tap((data: any) => {
this.group.users = data.group.users;
event.target.complete();
event.target.disabled = true;
})
).subscribe();
event.target.complete();
event.target.disabled = true;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment