presence is implemented

This commit is contained in:
병준 박 2019-10-11 18:24:57 +09:00
parent fee7aa70b0
commit 65fa631bfa
5 changed files with 35 additions and 6 deletions

View File

@ -44,6 +44,7 @@
<ucap-profile-user-list-item
*ucapGroupExpansionPanelItem="let userInfo"
[userInfo]="userInfo"
[presence]="getStatusBulkInfo(userInfo) | async"
(click)="onSelectBuddy(userInfo)"
>
</ucap-profile-user-list-item>

View File

@ -148,6 +148,17 @@ export class GroupComponent implements OnInit {
this.logger.debug('onSelectBuddy', buddy);
}
getStatusBulkInfo(buddy: UserInfo) {
return this.store.pipe(
select(
AppStore.MessengerSelector.StatusSelector.selectEntitiesStatusBulkInfo
),
map(statusBulkInfo =>
!!statusBulkInfo ? statusBulkInfo[buddy.seq] : undefined
)
);
}
onKeyDownEnterOrganizationTenantSearch(params: {
companyCode: string;
searchWord: string;

View File

@ -38,11 +38,15 @@ export function selectors<S>(selector: Selector<any, State>) {
selectStatusBulkInfo,
ngeSelectAllStatusBulkInfo
),
selectEntitiesStatusBulkInfo: createSelector(
selectStatusBulkInfo,
ngeSelectEntitiesStatusBulkInfo
),
selectStatusBulkInfo: (userSeq: number) =>
createSelector(
selectStatusBulkInfo,
ngeSelectEntitiesStatusBulkInfo,
(_, entities) => entities[userSeq]
(_, entities) => (!!entities ? entities[userSeq] : undefined)
)
};
}

View File

@ -1,11 +1,16 @@
<!--체크박스 보여줄때는 <div class="list-item checkbox" matRipple> 클래스에 checkbox만 추가-->
<div class="list-item" matRipple>
<!--pcOn , pcOut pcOff , pcOther-->
<span class="presence pcOn" *ngIf="presence">{{ presence.pcStatus }} </span>
<span class="presence pcOn" *ngIf="userPresence"
>{{ userPresence.pcStatus }}
</span>
<dl class="item-default">
<dt>
<img class="thumbnail" [src]="profileImageRoot + userInfo.profileImageFile"
onerror="this.src='assets/images/img_nophoto_50.png'" />
<img
class="thumbnail"
[src]="profileImageRoot + userInfo.profileImageFile"
onerror="this.src='assets/images/img_nophoto_50.png'"
/>
</dt>
<dd class="info">
<div class="detail">
@ -17,7 +22,10 @@
{{ userInfo.deptName }}
</span>
</div>
<div class="msg-status" *ngIf="!checkable && userInfo.intro.trim() && !compactable">
<div
class="msg-status"
*ngIf="!checkable && userInfo.intro.trim() && !compactable"
>
{{ userInfo.intro }}
</div>
</dd>

View File

@ -25,12 +25,17 @@ export class UserListItemComponent implements OnInit, OnDestroy {
@Input()
profileImageRoot?: string;
@Input()
presence?: StatusBulkInfo | StatusInfo;
set presence(value: StatusBulkInfo | StatusInfo) {
this.logger.debug('presence', value);
this.userPresence = value;
}
@Input()
checkable = false;
@Input()
compactable = false;
userPresence: StatusBulkInfo | StatusInfo;
// private profileImageRootSubscription: Subscription;
constructor(