Commit f7fe5309 authored by Mark Harding's avatar Mark Harding

(fix): do not show pencil icon if only need to delete

parent c14a0032
Pipeline #69385823 passed with stages
in 27 minutes and 25 seconds
......@@ -58,7 +58,7 @@
<i class="material-icons">public</i>
</li>
<li class="m-commentRibbon__item"
*ngIf="comment.owner_guid == session.getLoggedInUser()?.guid || session.isAdmin() || parent.owner_guid == session.getLoggedInUser()?.guid || canEdit"
*ngIf="comment.owner_guid == session.getLoggedInUser()?.guid || session.isAdmin() || parent.owner_guid == session.getLoggedInUser()?.guid || canDelete"
(click)="delete(); toggle.value = false"
title="Delete"
i18n-title="@@M__ACTION__DELETE"
......
......@@ -78,6 +78,7 @@ export class CommentComponentV2 implements OnChanges {
translateToggle: boolean = false;
commentAge$: Observable<number>;
@Input() canEdit: boolean = false;
@Input() canDelete: boolean = false;
@Output() onReply = new EventEmitter();
......
......@@ -51,6 +51,7 @@
[parent]="parent"
[level]="level"
[canEdit]="canEdit"
[canDelete]="canDelete"
[showReplies]="comment.show_replies"
(delete)="delete(i)"
(saved)="edited(i, $event)"
......
......@@ -33,6 +33,7 @@ export class CommentsThreadComponent {
@Input() entity;
@Input() entityGuid;
@Input() canEdit: boolean = false;
@Input() canDelete: boolean = false;
@Input() readonly: boolean = false;
@Input() conversation: boolean = false;
@Input() limit: number = 12;
......
......@@ -2,6 +2,7 @@
[entity]="entity"
[parent]="entity"
[canEdit]="canEdit"
[canDelete]="canDelete"
[readonly]="readonly"
[level]="0"
[limit]="limit"
......
......@@ -56,6 +56,7 @@ export class CommentsTreeComponent {
@Input() scrollable: boolean = false;
@Input() readonly: boolean = false;
@Input() canEdit: boolean = false;
@Input() canDelete: boolean = false;
private shouldReuseRouteFn;
......@@ -89,8 +90,8 @@ export class CommentsTreeComponent {
if (this.entity.entity_guid)
this.guid = this.entity.entity_guid;
this.parent = this.entity;
if (!this.canEdit) {
this.canEdit = this.entity.owner_guid == this.session.getLoggedInUser().guid;
if (!this.canDelete) {
this.canDelete = this.entity.owner_guid == this.session.getLoggedInUser().guid;
}
}
......
......@@ -4,7 +4,7 @@
[limit]="24"
[entity]="group"
[conversation]="true"
[canEdit]="group['is:moderator'] || group['is:creator']"
[canDelete]="group['is:moderator'] || group['is:creator']"
[readonly]="!group['is:member']"
[scrollable]="true"
>
......
......@@ -240,7 +240,7 @@
<m-comments__tree
*ngIf="commentsToggle"
[entity]="activity"
[canEdit]="canDelete"
[canDelete]="canDelete"
>
</m-comments__tree>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment