코끼리알림, TMS 알림 알림방 및 이벤트 처리.
This commit is contained in:
parent
0ac2717bbf
commit
36c2044747
|
@ -57,7 +57,14 @@
|
|||
<ng-container *ngSwitchCase="RoomType.Mytalk">
|
||||
MyTalk
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="RoomType.Bot || RoomType.Allim">
|
||||
<ng-container
|
||||
*ngSwitchCase="
|
||||
RoomType.Bot ||
|
||||
RoomType.Allim ||
|
||||
RoomType.Allim_Elephant ||
|
||||
RoomType.Allim_TMS
|
||||
"
|
||||
>
|
||||
{{ _roomUserInfos | ucapTranslate: 'name':',' }}
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchDefault>
|
||||
|
|
|
@ -386,7 +386,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
if (
|
||||
this.roomInfo.roomType === RoomType.Bot ||
|
||||
this.roomInfo.roomType === RoomType.Allim ||
|
||||
this.roomInfo.roomType === RoomType.Link
|
||||
this.roomInfo.roomType === RoomType.Link ||
|
||||
this.roomInfo.roomType === RoomType.Allim_Elephant ||
|
||||
this.roomInfo.roomType === RoomType.Allim_TMS
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -419,7 +421,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
this.roomInfo.roomType === RoomType.Mytalk ||
|
||||
this.roomInfo.roomType === RoomType.Allim ||
|
||||
this.roomInfo.roomType === RoomType.Bot ||
|
||||
this.roomInfo.roomType === RoomType.Link
|
||||
this.roomInfo.roomType === RoomType.Link ||
|
||||
this.roomInfo.roomType === RoomType.Allim_Elephant ||
|
||||
this.roomInfo.roomType === RoomType.Allim_TMS
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -434,8 +438,11 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
}
|
||||
if (
|
||||
this.roomInfo.roomType === RoomType.Mytalk ||
|
||||
this.roomInfo.roomType === RoomType.Allim ||
|
||||
this.roomInfo.roomType === RoomType.Bot ||
|
||||
this.roomInfo.roomType === RoomType.Allim
|
||||
this.roomInfo.roomType === RoomType.Link ||
|
||||
this.roomInfo.roomType === RoomType.Allim_Elephant ||
|
||||
this.roomInfo.roomType === RoomType.Allim_TMS
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1180,7 +1187,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
onClickOpenProfile(userInfo: UserInfo) {
|
||||
if (
|
||||
this.roomInfo.roomType !== RoomType.Allim &&
|
||||
this.roomInfo.roomType !== RoomType.Bot
|
||||
this.roomInfo.roomType !== RoomType.Bot &&
|
||||
this.roomInfo.roomType !== RoomType.Link &&
|
||||
this.roomInfo.roomType !== RoomType.Allim_Elephant &&
|
||||
this.roomInfo.roomType !== RoomType.Allim_TMS
|
||||
) {
|
||||
this.openProfile.emit(userInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import { JsonAnalization } from '@ucap-webmessenger/api';
|
||||
import { EventJsonDecoder } from './event-json';
|
||||
|
||||
export interface AllimEventJson {
|
||||
title?: string;
|
||||
content?: string;
|
||||
sendName?: string;
|
||||
postDate?: string;
|
||||
}
|
||||
|
||||
export const decodeAllimEventJson: EventJsonDecoder<AllimEventJson> = (
|
||||
message: string
|
||||
) => {
|
||||
try {
|
||||
const json = JsonAnalization.receiveAnalization(message);
|
||||
|
||||
return {
|
||||
title: json.title,
|
||||
content: json.content,
|
||||
sendName: json.send_name,
|
||||
postDate: json.post_date
|
||||
} as AllimEventJson;
|
||||
} catch (e) {
|
||||
return {} as AllimEventJson;
|
||||
}
|
||||
};
|
|
@ -46,6 +46,7 @@ import {
|
|||
NotificationForTimerRoomEventJson,
|
||||
decodeNotificationForTimerRoomEventJson
|
||||
} from './notification-for-timer-room.event-json';
|
||||
import { decodeAllimEventJson, AllimEventJson } from './allim.event-json';
|
||||
|
||||
export type EventJson =
|
||||
| string
|
||||
|
@ -65,7 +66,8 @@ export type EventJson =
|
|||
| TranslationEventJson
|
||||
| MassTranslationEventJson
|
||||
| VideoStreammingEventJson
|
||||
| GuideForRoomTimerChangedEventJson;
|
||||
| GuideForRoomTimerChangedEventJson
|
||||
| AllimEventJson;
|
||||
|
||||
export const decodeEventJson = (
|
||||
eventType: EventType,
|
||||
|
@ -118,6 +120,10 @@ export const decodeEventJson = (
|
|||
return message;
|
||||
case EventType.VideoStreamming:
|
||||
return decodeVideoStreammingEventJson(message);
|
||||
|
||||
case EventType.AllimElephant:
|
||||
case EventType.AllimTms:
|
||||
return decodeAllimEventJson(message);
|
||||
default:
|
||||
return message;
|
||||
}
|
||||
|
|
|
@ -44,5 +44,13 @@ export enum EventType {
|
|||
/** A: 챗봇 대용량 대화 전송 */
|
||||
ChatbotSendMass = 'A',
|
||||
/** M: 동영상 스트리밍 */
|
||||
VideoStreamming = 'M'
|
||||
VideoStreamming = 'M',
|
||||
/** O: SNS 공유 */
|
||||
SnsShare = 'O',
|
||||
|
||||
// [daesang]
|
||||
/** p: 코끼리 알림 */
|
||||
AllimElephant = 'p',
|
||||
/** g: TMS 알림 */
|
||||
AllimTms = 'g'
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ export * from './lib/protocols/send';
|
|||
|
||||
export * from './lib/protocols/event-json/event-json';
|
||||
|
||||
export * from './lib/protocols/event-json/allim.event-json';
|
||||
export * from './lib/protocols/event-json/character.event-json';
|
||||
export * from './lib/protocols/event-json/exit.event-json';
|
||||
export * from './lib/protocols/event-json/file.event-json';
|
||||
|
|
|
@ -16,7 +16,12 @@ export enum RoomType {
|
|||
/** L: 링크(Legacy) */
|
||||
Link = 'L',
|
||||
/** K: MyTalk(나와의 대화) */
|
||||
Mytalk = 'K'
|
||||
Mytalk = 'K',
|
||||
|
||||
/** [daesang - 코끼리 알림] */
|
||||
Allim_Elephant = 'k',
|
||||
/** [daesang - TMS 알림] */
|
||||
Allim_TMS = 't'
|
||||
}
|
||||
|
||||
export enum RoomExitType {
|
||||
|
@ -49,6 +54,8 @@ export function isReadCountRoom(roomType: RoomType): boolean {
|
|||
RoomType.Single === roomType ||
|
||||
RoomType.Multi === roomType ||
|
||||
RoomType.Bot === roomType ||
|
||||
RoomType.Allim === roomType
|
||||
RoomType.Allim === roomType ||
|
||||
RoomType.Allim_Elephant === roomType ||
|
||||
RoomType.Allim_TMS === roomType
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<div class="event-main">
|
||||
<div class="event-header">
|
||||
{{ message.sentMessageJson.title }}
|
||||
</div>
|
||||
<ul class="event-info">
|
||||
<li class="event-title">
|
||||
{{ message.sentMessageJson.content }}
|
||||
</li>
|
||||
<li class="event-date">
|
||||
<span>발송인</span>{{ message.sentMessageJson.sendName }}
|
||||
</li>
|
||||
<li class="event-time">
|
||||
<span>발송시간</span
|
||||
>{{ message.sentMessageJson.postDate | ucapDate: 'YYYY.MM.DD a hh:mm' }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- <div class="btn-box">
|
||||
<button mat-button (click)="onClickSave()">상세보기</button>
|
||||
</div> -->
|
||||
</div>
|
|
@ -0,0 +1,42 @@
|
|||
.event-main {
|
||||
flex-direction: column;
|
||||
text-align: left;
|
||||
.event-header {
|
||||
padding: 10px;
|
||||
background-color: #efefef;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.event-info {
|
||||
padding: 10px 14px;
|
||||
line-height: 1.6em;
|
||||
li {
|
||||
margin-bottom: 4px;
|
||||
&.event-title {
|
||||
border-bottom: 1px solid #dddddd;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
&.event-date,
|
||||
&.event-time {
|
||||
color: #666666;
|
||||
}
|
||||
span {
|
||||
padding: 2px 6px;
|
||||
background-color: #efefef;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
border-top: 1px solid #dddddd;
|
||||
height: 40px;
|
||||
.mat-button {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AllimComponent } from './allim.component';
|
||||
|
||||
describe('Chat::MessageBox::AllimComponent', () => {
|
||||
let component: AllimComponent;
|
||||
let fixture: ComponentFixture<AllimComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AllimComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AllimComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,16 @@
|
|||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Info, AllimEventJson } from '@ucap-webmessenger/protocol-event';
|
||||
|
||||
@Component({
|
||||
selector: 'ucap-chat-message-box-allim',
|
||||
templateUrl: './allim.component.html',
|
||||
styleUrls: ['./allim.component.scss']
|
||||
})
|
||||
export class AllimComponent implements OnInit {
|
||||
@Input()
|
||||
message: Info<AllimEventJson>;
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit() {}
|
||||
}
|
|
@ -167,6 +167,19 @@
|
|||
(contextmenu)="onContextMenuMessage($event, message)"
|
||||
>
|
||||
</ucap-chat-message-box-schedule>
|
||||
|
||||
<ucap-chat-message-box-allim
|
||||
*ngSwitchCase="EventType.AllimTms"
|
||||
[message]="message"
|
||||
class="information-msg"
|
||||
>
|
||||
</ucap-chat-message-box-allim>
|
||||
<ucap-chat-message-box-allim
|
||||
*ngSwitchCase="EventType.AllimElephant"
|
||||
[message]="message"
|
||||
class="information-msg"
|
||||
>
|
||||
</ucap-chat-message-box-allim>
|
||||
<div *ngSwitchDefault>
|
||||
<!-- mass-translation
|
||||
<ucap-chat-message-box-mass-translation></ucap-chat-message-box-mass-translation>
|
||||
|
|
|
@ -31,6 +31,7 @@ import { TextComponent as MBTextComponent } from './components/message-box/text.
|
|||
import { TranslationComponent as MBTranslationComponent } from './components/message-box/translation.component';
|
||||
import { VideoComponent as MBVideoComponent } from './components/message-box/video.component';
|
||||
import { VideoConferenceComponent as MBVideoConferenceComponent } from './components/message-box/video-conference.component';
|
||||
import { AllimComponent as MBAllimComponent } from './components/message-box/allim.component';
|
||||
import { SearchComponent } from './components/search.component';
|
||||
|
||||
const COMPONENTS = [
|
||||
|
@ -53,7 +54,8 @@ const COMPONENTS = [
|
|||
MBTextComponent,
|
||||
MBTranslationComponent,
|
||||
MBVideoComponent,
|
||||
MBVideoConferenceComponent
|
||||
MBVideoConferenceComponent,
|
||||
MBAllimComponent
|
||||
];
|
||||
const SERVICES = [];
|
||||
const PROVIDERS = [DatePipe];
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* Public API Surface of ucap-webmessenger-ui-chat
|
||||
*/
|
||||
|
||||
export * from './lib/components/message-box/allim.component';
|
||||
export * from './lib/components/message-box/date-splitter.component';
|
||||
export * from './lib/components/message-box/file.component';
|
||||
export * from './lib/components/message-box/image.component';
|
||||
|
|
|
@ -148,6 +148,9 @@ export class ProfileComponent implements OnInit {
|
|||
case 'V04':
|
||||
workstatus = '장기휴가';
|
||||
break;
|
||||
case 'V05':
|
||||
workstatus = '장기 리프레쉬';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,14 @@
|
|||
<ng-container *ngSwitchCase="RoomType.Mytalk">
|
||||
MyTalk
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="RoomType.Bot || RoomType.Allim">
|
||||
<ng-container
|
||||
*ngSwitchCase="
|
||||
RoomType.Bot ||
|
||||
RoomType.Allim ||
|
||||
RoomType.Allim_Elephant ||
|
||||
RoomType.Allim_TMS
|
||||
"
|
||||
>
|
||||
{{ _roomUserInfos | ucapTranslate: 'name':',' }}
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchDefault>
|
||||
|
|
|
@ -74,6 +74,8 @@ export class ListItemComponent implements OnInit {
|
|||
case RoomType.Single:
|
||||
case RoomType.Bot:
|
||||
case RoomType.Allim:
|
||||
case RoomType.Allim_Elephant:
|
||||
case RoomType.Allim_TMS:
|
||||
const others = this.roomUserInfo.filter(
|
||||
v => v.seq !== this.loginRes.userSeq
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user