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

Merge branch 'feat/structure-owners-details' into 'dev'

add owners list to structure details

See merge request web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client!119
parents 8bf82fdb 6e303e79
Branches
Tags
3 merge requests!178release V1.10.0,!120Dev,!119add owners list to structure details
......@@ -121,6 +121,15 @@
</div>
</div>
</div>
<div *ngIf="profileService.isAdmin()" class="hide-on-print">
Administrateur(s) de cette structure:
<div *ngIf="structureAdmins.length === 0">Aucun administrateur</div>
<div *ngIf="structureAdmins.length > 0">
<div *ngFor="let structureAdmin of structureAdmins">
{{ structureAdmin.email }}
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="center center" class="hide-on-print">
<a *ngIf="!isClaimed" (click)="handleClaim()" class="primary" tabindex="0">Revendiquer cette structure</a>
<a *ngIf="displayJoin()" (click)="handleJoin()" class="primary" tabindex="0">Rejoindre cette structure</a>
......
......@@ -15,6 +15,7 @@ import { ProfileService } from '../../../profile/services/profile.service';
import { User } from '../../../models/user.model';
import { AuthService } from '../../../services/auth.service';
import { PublicCategorie } from '../../enum/public.enum';
import { Owner } from '../../../models/owner.model';
@Component({
selector: 'app-structure-details',
templateUrl: './structure-details.component.html',
......@@ -44,6 +45,7 @@ export class StructureDetailsComponent implements OnInit {
public claimModalOpenned = false;
public structureErrorModalOpenned = false;
public joinModalOpenned = false;
public structureAdmins: Owner[] = [];
constructor(
private printService: PrintService,
......@@ -67,8 +69,15 @@ export class StructureDetailsComponent implements OnInit {
this.isLoading = true;
if (this.userIsLoggedIn()) {
this.currentProfile = await this.profileService.getProfile();
if (this.profileService.isAdmin()) {
this.structureService.getStructureWithOwners(this.structure._id, this.currentProfile).subscribe((res) => {
this.structureAdmins = res.owners;
});
}
}
this.isClaimed = await this.structureService.isClaimed(this.structure._id, this.currentProfile).toPromise();
// GetTclStopPoints
this.getTclStopPoints();
this.searchService.getCategoriesTraining().subscribe((referentiels) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment