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

View File

@ -287,7 +287,25 @@ export class GroupComponent implements OnInit, OnDestroy {
this.searchUserInfos = []; 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, menuType: string,
userInfo: UserInfo | UserInfoF, userInfo: UserInfo | UserInfoF,
group?: GroupDetailData group?: GroupDetailData

View File

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