Skip to content
Snippets Groups Projects
Commit 70f03336 authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

feat(card) : add indicator claim to help admin

parent 2ada145e
No related branches found
No related tags found
3 merge requests!103Recette,!102Dev,!98feat(card) : add indicator claim to help admin
<div class="structure" fxLayout="column" (click)="cardClicked()" (mouseenter)="cardHover()">
<div class="headerStructure" fxLayout="row" fxLayoutAlign="space-between center" fxLayoutGap="16px">
<span class="structure-name">{{ structure.structureName }}</span>
<span class="structure-name" [ngClass]="{ notClaimed: !isClaimed }">{{ structure.structureName }}</span>
<div
*ngIf="structure.distance"
class="distanceStructure"
......
......@@ -17,6 +17,9 @@
font-style: italic;
}
.structure-name {
&.notClaimed {
color: $red-info;
}
color: $grey-1;
@include cn-bold-18;
padding-bottom: 5px;
......
import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Structure } from '../../../models/structure.model';
import { ProfileService } from '../../../profile/services/profile.service';
import { GeojsonService } from '../../../services/geojson.service';
import { StructureService } from '../../../services/structure.service';
@Component({
selector: 'app-card',
......@@ -12,9 +14,24 @@ export class CardComponent implements OnInit {
@Input() public structure: Structure;
@Output() public showDetails: EventEmitter<Structure> = new EventEmitter<Structure>();
@Output() public hover: EventEmitter<Structure> = new EventEmitter<Structure>();
public isClaimed = true;
constructor(private route: ActivatedRoute, private router: Router) {}
ngOnInit(): void {}
constructor(
private route: ActivatedRoute,
private router: Router,
private profileService: ProfileService,
private structureService: StructureService
) {}
ngOnInit(): void {
if (this.profileService.isAdmin()) {
this.setClaimIndicator();
}
}
// Check if structure haven't owners to help admin vision.
async setClaimIndicator() {
this.isClaimed = await this.structureService.isClaimed(this.structure._id, null).toPromise();
}
/**
* Display distance in m or km according to value
......
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