Skip to content
Snippets Groups Projects
Commit 862522c1 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat(profile): add loader on member loading

parent 78586183
No related branches found
No related tags found
3 merge requests!418V2.1.0,!400V2.0,!230V2.0
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
></app-button> ></app-button>
</div> </div>
<div *ngIf="isLoading" class="loader">
<img class="loader-gif" src="/assets/gif/loader_circle.gif" alt />
</div>
<div *ngIf="structureWithOwners && tempUsers" class="membersList"> <div *ngIf="structureWithOwners && tempUsers" class="membersList">
<div *ngFor="let member of structureWithOwners.owners" class="member-card"> <div *ngFor="let member of structureWithOwners.owners" class="member-card">
<div class="user"> <div class="user">
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { finalize } from 'rxjs';
import { Owner } from '../../models/owner.model'; import { Owner } from '../../models/owner.model';
import { Structure } from '../../models/structure.model'; import { Structure } from '../../models/structure.model';
import { StructureWithOwners } from '../../models/structureWithOwners.model'; import { StructureWithOwners } from '../../models/structureWithOwners.model';
...@@ -26,6 +27,7 @@ export class StructureMembersManagementComponent implements OnInit { ...@@ -26,6 +27,7 @@ export class StructureMembersManagementComponent implements OnInit {
public excludeModalOpenned = false; public excludeModalOpenned = false;
public cancelAddTempUserModalOpenned = false; public cancelAddTempUserModalOpenned = false;
public buttonTypeEnum = ButtonType; public buttonTypeEnum = ButtonType;
public isLoading = true;
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
...@@ -39,9 +41,12 @@ export class StructureMembersManagementComponent implements OnInit { ...@@ -39,9 +41,12 @@ export class StructureMembersManagementComponent implements OnInit {
if (data.structure) { if (data.structure) {
this.structure = new Structure(data.structure); this.structure = new Structure(data.structure);
let currentProfile = await this.profileService.getProfile(); let currentProfile = await this.profileService.getProfile();
this.structureService.getStructureWithOwners(data.structure._id, currentProfile).subscribe((s) => { this.structureService
this.structureWithOwners = s; .getStructureWithOwners(data.structure._id, currentProfile)
}); .pipe(finalize(() => (this.isLoading = false)))
.subscribe((s) => {
this.structureWithOwners = s;
});
this.structureService.getTempUsers(data.structure._id).subscribe((data) => { this.structureService.getTempUsers(data.structure._id).subscribe((data) => {
this.tempUsers = data; this.tempUsers = data;
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment