Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
fix(account-actions): Remove action box in the card of account user (#…
Browse files Browse the repository at this point in the history
…726)

* fix(account-actions): Remove action box in the card of account user

* fix(account-actions): Remove action box in the card of account user - review fixes
  • Loading branch information
HeyRoach committed Dec 5, 2017
1 parent 4ab0bde commit 542df61
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="title-container">
<h4 class="details-header">{{ entity.name }}</h4>
<button
*ngIf="isAdmin()"
*ngIf="isAdmin() && !isSelf"
mat-icon-button
[matMenuTriggerFor]="actionsMenu"
>
Expand Down
8 changes: 6 additions & 2 deletions src/app/account/account-sidebar/account-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ import { AuthService } from '../../shared/services/auth.service';
styleUrls: ['account-sidebar.component.scss']
})
export class AccountSidebarComponent {
@Input() public entity: any;
@Input() public entity: Account;
@Output() public onAccountChanged = new EventEmitter<Account>();

public get isSelf() {
return this.authService.user.username === this.entity.name
&& this.authService.user.domainid === this.entity.domainid;
}

constructor(
protected notificationService: NotificationService,
protected route: ActivatedRoute,
Expand All @@ -30,5 +35,4 @@ export class AccountSidebarComponent {
public isAdmin() {
return this.authService.isAdmin();
}

}
5 changes: 5 additions & 0 deletions src/app/account/account/account-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export class AccountItemComponent {

readonly stateTranslations = stateTranslations;

public get isSelf() {
return this.authService.user.username === this.item.name
&& this.authService.user.domainid === this.item.domainid;
}

constructor(protected authService: AuthService) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
> {{ item.name }} </span>
</h2>
</mat-card-title>
<div class="mat-card-header-menu" *ngIf="isAdmin()">
<div class="mat-card-header-menu" *ngIf="isAdmin() && !isSelf">
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
<mat-icon>more_vert</mat-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2 class="row-title">
{{ 'ACCOUNT_PAGE.CARD.DOMAIN' | translate }}: {{item.domain}}
</div>

<button *ngIf="isAdmin()"
<button *ngIf="isAdmin() && !isSelf"
class="row-action"
mat-icon-button
[matMenuTriggerFor]="actionsMenu">
Expand Down

0 comments on commit 542df61

Please sign in to comment.