그룹 > 그룹 타이틀의 more 버튼 및 context menu 분기 처리.

This commit is contained in:
leejinho 2019-11-21 16:15:15 +09:00
parent 81397401b9
commit 3e11d4e4a2
3 changed files with 56 additions and 21 deletions

View File

@ -99,14 +99,14 @@
<mat-icon>expand_less</mat-icon>
<span>그룹 전체 닫기</span>
</button>
<button mat-menu-item (click)="onClickGroupMenu('GROUP_SAVE')">
<!-- <button mat-menu-item (click)="onClickGroupMenu('GROUP_SAVE')">
<mat-icon>save</mat-icon>
<span>그룹 저장하기</span>
</button>
<button mat-menu-item (click)="onClickGroupMenu('GROUP_RESTORE')">
<mat-icon>restore</mat-icon>
<span>그룹 가져오기</span>
</button>
</button> -->
</mat-menu>
<div
@ -130,7 +130,7 @@
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('REGISTER_FAVORITE', userInfo, group)"
*ngIf="getShowProfileContextMenu('REGISTER_FAVORITE', userInfo, group)"
(click)="onClickProfileContextMenu('REGISTER_FAVORITE', userInfo)"
>
즐겨찾기 {{ userInfo.isFavorit ? '해제' : '등록' }}
@ -140,35 +140,35 @@
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('REMOVE_FROM_GROUP', userInfo, group)"
*ngIf="getShowProfileContextMenu('REMOVE_FROM_GROUP', userInfo, group)"
(click)="onClickProfileContextMenu('REMOVE_FROM_GROUP', userInfo, group)"
>
이 그룹에서 삭제
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('COPY_BUDDY', userInfo, group)"
*ngIf="getShowProfileContextMenu('COPY_BUDDY', userInfo, group)"
(click)="onClickProfileContextMenu('COPY_BUDDY', userInfo)"
>
대화 상대 복사
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('MOVE_BUDDY', userInfo, group)"
*ngIf="getShowProfileContextMenu('MOVE_BUDDY', userInfo, group)"
(click)="onClickProfileContextMenu('MOVE_BUDDY', userInfo, group)"
>
대화 상대 이동
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('SEND_NOTE', userInfo, group)"
*ngIf="getShowProfileContextMenu('SEND_NOTE', userInfo, group)"
(click)="onClickProfileContextMenu('SEND_NOTE', userInfo)"
>
쪽지 보내기
</button>
<!-- <button
mat-menu-item
*ngIf="getShowContextMenu('REGISTER_NICKNAME', userInfo, group)"
*ngIf="getShowProfileContextMenu('REGISTER_NICKNAME', userInfo, group)"
(click)="onClickProfileContextMenu('REGISTER_NICKNAME', userInfo)"
>
닉네임 설정
@ -189,23 +189,40 @@
(ucapClickOutside)="groupContextMenuTrigger.closeMenu()"
>
<ng-template matMenuContent let-group="group">
<button mat-menu-item (click)="onClickGroupContextMenu('CHAT', group)">
그룹 대화하기
</button>
<button mat-menu-item (click)="onClickGroupContextMenu('SEND_NOTE', group)">
그룹 쪽지 보내기
</button>
<button mat-menu-item (click)="onClickGroupContextMenu('RENAME', group)">
그룹 이름 바꾸기
</button>
<mat-divider></mat-divider>
<button
mat-menu-item
*ngIf="getShowGroupContextMenu('CHAT', group)"
(click)="onClickGroupContextMenu('CHAT', group)"
>
그룹 대화하기
</button>
<button
mat-menu-item
*ngIf="getShowGroupContextMenu('SEND_NOTE', group)"
(click)="onClickGroupContextMenu('SEND_NOTE', group)"
>
그룹 쪽지 보내기
</button>
<button
mat-menu-item
*ngIf="getShowGroupContextMenu('RENAME', group)"
(click)="onClickGroupContextMenu('RENAME', group)"
>
그룹 이름 바꾸기
</button>
<mat-divider *ngIf="getShowGroupContextMenu('DIV1', group)"></mat-divider>
<button
mat-menu-item
*ngIf="getShowGroupContextMenu('EDIT_MEMBER', group)"
(click)="onClickGroupContextMenu('EDIT_MEMBER', group)"
>
그룹 멤버 변경
</button>
<button mat-menu-item (click)="onClickGroupContextMenu('DELETE', group)">
<button
mat-menu-item
*ngIf="getShowGroupContextMenu('DELETE', group)"
(click)="onClickGroupContextMenu('DELETE', group)"
>
그룹 삭제
</button>
</ng-template>

View File

@ -287,7 +287,25 @@ export class GroupComponent implements OnInit, OnDestroy {
this.searchUserInfos = [];
}
getShowContextMenu(
/** 그룹 header > more 버튼 > visible of context menu */
getShowGroupContextMenu(menuType: string, group: GroupDetailData) {
if (
menuType === 'DIV1' ||
menuType === 'RENAME' ||
menuType === 'EDIT_MEMBER' ||
menuType === 'DELETE'
) {
if (!group || group === undefined) {
// 현재는 즐겨찾기에 해당함.
return false;
}
}
return true;
}
/** 그룹 > 그룹원 > visible of context menu */
getShowProfileContextMenu(
menuType: string,
userInfo: UserInfo | UserInfoF,
group?: GroupDetailData

View File

@ -67,7 +67,7 @@
<button
mat-icon-button
aria-label="group menu"
*ngIf="!checkable"
*ngIf="node.nodeType !== NodeType.Profile"
(click)="onClickMore($event, node.groupDetail)"
class="group-menu"
>