그룹 > 즐겨찾기 영역 생성

This commit is contained in:
leejh 2019-10-10 18:35:23 +09:00
parent 90dee1da8b
commit 9c21041c42
4 changed files with 21 additions and 6 deletions

View File

@ -36,11 +36,8 @@
</mat-menu> </mat-menu>
</div> </div>
<div> <div>
<ucap-group-expansion-panel <ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async"
#groupExpansionPanel [favoritBuddyList]="favoritBuddyList$ | async" (selectBuddy)="onSelectBuddy($event)">
[groupBuddyList]="groupBuddyList$ | async"
(selectBuddy)="onSelectBuddy($event)"
>
</ucap-group-expansion-panel> </ucap-group-expansion-panel>
</div> </div>
</div> </div>

View File

@ -37,6 +37,7 @@ export class GroupComponent implements OnInit {
groupBuddyList$: Observable< groupBuddyList$: Observable<
{ group: GroupDetailData; buddyList: UserInfo[] }[] { group: GroupDetailData; buddyList: UserInfo[] }[]
>; >;
favoritBuddyList$: Observable<UserInfo[]>;
companyList$: Observable<Company[]>; companyList$: Observable<Company[]>;
companyCode: string; companyCode: string;
@ -110,6 +111,16 @@ export class GroupComponent implements OnInit {
return groupBuddyList; return groupBuddyList;
}) })
); );
this.favoritBuddyList$ = this.store
.pipe(select(AppStore.MessengerSelector.SyncSelector.buddyInfoList))
.pipe(
map(buddyInfoList => {
return buddyInfoList
.filter(buddy => buddy.isFavorit)
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
})
);
} }
async onClickGroupMenu(menuType: string) { async onClickGroupMenu(menuType: string) {

View File

@ -1,9 +1,13 @@
<mat-accordion #groupAccordion="matAccordion" [multi]="true"> <mat-accordion #groupAccordion="matAccordion" [multi]="true">
<mat-expansion-panel *ngIf="true"> <mat-expansion-panel *ngIf="favoritBuddyList.length > 0">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> 즐겨찾기 </mat-panel-title> <mat-panel-title> 즐겨찾기 </mat-panel-title>
<mat-panel-description> </mat-panel-description> <mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ucap-profile-user-list-item *ngFor="let favUserList of favoritBuddyList" [userInfo]="favUserList"
(click)="onClickBuddy(favUserList)">
</ucap-profile-user-list-item>
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel *ngFor="let groupBuddy of groupBuddyList"> <mat-expansion-panel *ngFor="let groupBuddy of groupBuddyList">

View File

@ -22,6 +22,9 @@ export class ExpansionPanelComponent implements OnInit {
@Input() @Input()
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] }[]; groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] }[];
@Input()
favoritBuddyList: UserInfo[];
@Output() @Output()
selectBuddy = new EventEmitter<UserInfo>(); selectBuddy = new EventEmitter<UserInfo>();