Restrict delete visibiity for user to MT+ level (CC-67)

pull/47/head
HardiReady 2018-10-20 22:50:46 +02:00
parent 859df0359d
commit ac83629824
7 changed files with 12 additions and 10 deletions

View File

@ -3,7 +3,7 @@ import {Rank} from '../../../models/model-interfaces';
import {Fraction} from '../../../utils/fraction.enum';
@Component({
selector: 'pjm-rank-item',
selector: 'cc-rank-item',
templateUrl: './rank-item.component.html',
styleUrls: ['./rank-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush

View File

@ -12,11 +12,11 @@
(executeSearch)="filterRanks()">
</cc-list-search>
<pjm-rank-item *ngFor="let rank of ranks$ | async"
<cc-rank-item *ngFor="let rank of ranks$ | async"
[rank]="rank"
(rankDelete)="deleteRank(rank)"
(rankSelected)="selectRank($event)"
[selected]="rank._id == selectedRankId">
</pjm-rank-item>
</cc-rank-item>
</div>

View File

@ -3,7 +3,7 @@ import {Squad} from '../../../models/model-interfaces';
import {Fraction} from '../../../utils/fraction.enum';
@Component({
selector: 'pjm-squad-item',
selector: 'cc-squad-item',
templateUrl: './squad-item.component.html',
styleUrls: ['./squad-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush

View File

@ -12,10 +12,10 @@
(executeSearch)="filterSquads()">
</cc-list-search>
<pjm-squad-item *ngFor="let squad of squads$ | async"
<cc-squad-item *ngFor="let squad of squads$ | async"
[squad]="squad"
(squadDelete)="deleteSquad(squad)"
(squadSelected)="selectSquad($event)"
[selected]="squad._id == selectedSquadId">
</pjm-squad-item>
</cc-squad-item>
</div>

View File

@ -14,6 +14,7 @@
<div class="col-sm-4">
<mat-icon (click)="delete(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.delete' | translate}}"
*ngIf="loginService.hasPermission(3)"
class="pull-right" style="margin-top: 8px;" svgIcon="delete"></mat-icon>
<mat-icon (click)="award(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.awards' | translate}}"
class="icon-award pull-right" svgIcon="award"></mat-icon>

View File

@ -1,9 +1,10 @@
import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';
import {User} from '../../../models/model-interfaces';
import {Fraction} from '../../../utils/fraction.enum';
import {LoginService} from '../../../services/app-user-service/login-service';
@Component({
selector: 'pjm-user-item',
selector: 'cc-user-item',
templateUrl: './user-item.component.html',
styleUrls: ['./user-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush
@ -20,7 +21,7 @@ export class UserItemComponent {
readonly fraction = Fraction;
constructor() {
constructor(public loginService: LoginService) {
}
select() {

View File

@ -19,12 +19,12 @@
[infiniteScrollDistance]="scrollDistance"
[infiniteScrollThrottle]="throttle"
(scrolled)="onScrollDown()">
<pjm-user-item *ngFor="let user of users$ | async"
<cc-user-item *ngFor="let user of users$ | async"
[user]="user"
(userDelete)="deleteUser(user)"
(userSelected)="selectUser($event)"
(userAward)="awardUser($event)"
[selected]="user._id == selectedUserId">
</pjm-user-item>
</cc-user-item>
</div>
</div>