# 시험결과분석 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": { "presence": {
"settingOfAwayTime": "Setting of away time", "settingOfAwayTime": "Setting of away time",
"offline": "Offline",
"online": "Online", "online": "Online",
"away": "Away", "away": "Away",
"statusMessage1": "Busy", "statusMessage1": "Busy",

View File

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

View File

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