그룹 > 즐겨찾기 영역 생성

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>
</div>
<div>
<ucap-group-expansion-panel
#groupExpansionPanel
[groupBuddyList]="groupBuddyList$ | async"
(selectBuddy)="onSelectBuddy($event)"
>
<ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async" (selectBuddy)="onSelectBuddy($event)">
</ucap-group-expansion-panel>
</div>
</div>

View File

@ -37,6 +37,7 @@ export class GroupComponent implements OnInit {
groupBuddyList$: Observable<
{ group: GroupDetailData; buddyList: UserInfo[] }[]
>;
favoritBuddyList$: Observable<UserInfo[]>;
companyList$: Observable<Company[]>;
companyCode: string;
@ -110,6 +111,16 @@ export class GroupComponent implements OnInit {
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) {

View File

@ -1,9 +1,13 @@
<mat-accordion #groupAccordion="matAccordion" [multi]="true">
<mat-expansion-panel *ngIf="true">
<mat-expansion-panel *ngIf="favoritBuddyList.length > 0">
<mat-expansion-panel-header>
<mat-panel-title> 즐겨찾기 </mat-panel-title>
<mat-panel-description> </mat-panel-description>
</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 *ngFor="let groupBuddy of groupBuddyList">

View File

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