# 시험결과분석 57

This commit is contained in:
leejinho 2020-02-12 13:19:36 +09:00
parent dc2c254639
commit edb1388a42
3 changed files with 32 additions and 9 deletions

View File

@ -143,6 +143,7 @@
},
"presence": {
"settingOfAwayTime": "Setting of away time",
"offline": "Offline",
"online": "Online",
"away": "Away",
"statusMessage1": "Busy",

View File

@ -143,6 +143,7 @@
},
"presence": {
"settingOfAwayTime": "부재 중 시간 설정",
"offline": "오프라인",
"online": "온라인",
"away": "부재중",
"statusMessage1": "다른용무중",

View File

@ -20,6 +20,7 @@ import {
import { NGXLogger } from 'ngx-logger';
import { StatusCode, PresenceType } from '@ucap-webmessenger/core';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'ucap-profile-user-list-item',
@ -60,7 +61,10 @@ export class UserListItemComponent implements OnInit {
PresenceType = PresenceType;
constructor(private logger: NGXLogger) {}
constructor(
private logger: NGXLogger,
private translateService: TranslateService
) {}
ngOnInit() {
this.profileImageRoot =
@ -97,15 +101,32 @@ export class UserListItemComponent implements OnInit {
return rtnClass;
}
getPresenceMsg(): string {
if (
!!this.presence &&
!!this.presence.statusMessage &&
this.presence.statusMessage !== '.'
) {
return this.presence.statusMessage;
} else {
return '';
let presenceMsg = this.translateService.instant('presence.offline');
if (!!this.presence) {
switch (this.presence.pcStatus) {
case StatusCode.OnLine:
presenceMsg = this.translateService.instant('presence.online');
break;
case StatusCode.Away:
presenceMsg = this.translateService.instant('presence.away');
break;
case StatusCode.Busy:
if (
!!this.presence.statusMessage &&
this.presence.statusMessage !== '.'
) {
presenceMsg = this.presence.statusMessage;
} else {
presenceMsg = this.translateService.instant(
'presence.statusMessage1'
);
}
break;
}
}
return presenceMsg;
}
/** 리스트가 checkable 할 경우 checkbox 의 change 이벤트를 상위 컴포넌트로 전달한다. */