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

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

Merged
merged 2 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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