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'; import {Fraction} from '../../../utils/fraction.enum';
@Component({ @Component({
selector: 'pjm-rank-item', selector: 'cc-rank-item',
templateUrl: './rank-item.component.html', templateUrl: './rank-item.component.html',
styleUrls: ['./rank-item.component.css', '../../../style/list-entry.css'], styleUrls: ['./rank-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush changeDetection: ChangeDetectionStrategy.OnPush

View File

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

View File

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

View File

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

View File

@ -14,6 +14,7 @@
<div class="col-sm-4"> <div class="col-sm-4">
<mat-icon (click)="delete(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.delete' | translate}}" <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> class="pull-right" style="margin-top: 8px;" svgIcon="delete"></mat-icon>
<mat-icon (click)="award(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.awards' | translate}}" <mat-icon (click)="award(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.awards' | translate}}"
class="icon-award pull-right" svgIcon="award"></mat-icon> 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 {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';
import {User} from '../../../models/model-interfaces'; import {User} from '../../../models/model-interfaces';
import {Fraction} from '../../../utils/fraction.enum'; import {Fraction} from '../../../utils/fraction.enum';
import {LoginService} from '../../../services/app-user-service/login-service';
@Component({ @Component({
selector: 'pjm-user-item', selector: 'cc-user-item',
templateUrl: './user-item.component.html', templateUrl: './user-item.component.html',
styleUrls: ['./user-item.component.css', '../../../style/list-entry.css'], styleUrls: ['./user-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush changeDetection: ChangeDetectionStrategy.OnPush
@ -20,7 +21,7 @@ export class UserItemComponent {
readonly fraction = Fraction; readonly fraction = Fraction;
constructor() { constructor(public loginService: LoginService) {
} }
select() { select() {

View File

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