This commit is contained in:
Richard Park 2020-01-08 16:13:04 +09:00
commit c0742039d1
7 changed files with 259 additions and 40 deletions

View File

@ -5,7 +5,6 @@ import {
APIEncoder, APIEncoder,
APIDecoder, APIDecoder,
ParameterUtil, ParameterUtil,
JsonAnalization,
StatusCode StatusCode
} from '@ucap-webmessenger/api'; } from '@ucap-webmessenger/api';
@ -51,20 +50,19 @@ export const decodeFileTalkShare: APIDecoder<FileTalkShareResponse> = (
res: any res: any
) => { ) => {
try { try {
const json = JsonAnalization.receiveAnalization(res);
return { return {
statusCode: json.StatusCode, statusCode: res.StatusCode,
roomSeq: json.RoomID, roomSeq: res.RoomID,
fileName: json.FileName, fileName: res.FileName,
fileExt: json.FileExt, fileExt: res.FileExt,
fileType: json.FileType, fileType: res.FileType,
thumbnailUrl: json.ThumbURL, thumbnailUrl: res.ThumbURL,
attachmentSeq: json.AttSEQ, attachmentSeq: res.AttSEQ,
attachmentSize: json.AttSize, attachmentSize: res.AttSize,
attachmentRegDate: json.AttRegDate, attachmentRegDate: res.AttRegDate,
companyCode: json.CompanyCode, companyCode: res.CompanyCode,
synapKey: json.SynapKey, synapKey: res.SynapKey,
returnJson: res returnJson: JSON.stringify(res)
} as FileTalkShareResponse; } as FileTalkShareResponse;
} catch (e) { } catch (e) {
return { return {

View File

@ -46,6 +46,7 @@
.responsive-chats-button { .responsive-chats-button {
display: none; display: none;
line-height: normal;
&:last-child { &:last-child {
display: block; display: block;
padding: 0; padding: 0;
@ -54,7 +55,6 @@
border-radius: 50%; border-radius: 50%;
color: #efefef; color: #efefef;
font-size: 16px; font-size: 16px;
line-height: 40px;
} }
} }
width: 50px; width: 50px;
@ -84,7 +84,7 @@
height: 20px; height: 20px;
span { span {
border-radius: 10px; border-radius: 10px;
padding: 2px 10px; padding: 1px 10px;
margin-right: 6px; margin-right: 6px;
font-size: 13px; font-size: 13px;
} }

View File

@ -46,7 +46,8 @@ import {
import { import {
RoomInfo, RoomInfo,
UserInfoShort, UserInfoShort,
UserInfo as RoomUserInfo UserInfo as RoomUserInfo,
RoomType
} from '@ucap-webmessenger/protocol-room'; } from '@ucap-webmessenger/protocol-room';
import { import {
ConfirmDialogComponent, ConfirmDialogComponent,
@ -547,6 +548,10 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
} }
} }
onToggleRoom(roomInfo: RoomInfo) { onToggleRoom(roomInfo: RoomInfo) {
if (!this.getCheckableRoom(roomInfo)) {
return;
}
if (!!this.selectedRoom) { if (!!this.selectedRoom) {
if (this.selectedRoom.roomSeq === roomInfo.roomSeq) { if (this.selectedRoom.roomSeq === roomInfo.roomSeq) {
this.selectedRoom = null; this.selectedRoom = null;
@ -591,6 +596,16 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
// .length > 0 // .length > 0
// ); // );
// } // }
if (
roomInfo.roomType === RoomType.Bot ||
roomInfo.roomType === RoomType.Allim ||
roomInfo.roomType === RoomType.Link ||
roomInfo.roomType === RoomType.Allim_Elephant ||
roomInfo.roomType === RoomType.Allim_TMS
) {
return false;
}
return true; return true;
} }
getCheckedRoom(roomInfo: RoomInfo) { getCheckedRoom(roomInfo: RoomInfo) {
@ -611,6 +626,12 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
getBtnValid() { getBtnValid() {
if (this.data.type === UserSelectDialogType.NewGroup) { if (this.data.type === UserSelectDialogType.NewGroup) {
return this.inputForm.invalid; return this.inputForm.invalid;
} else if (this.data.type === UserSelectDialogType.MessageForward) {
if (this.selectedUserList.length === 0 && !this.selectedRoom) {
return true;
}
return false;
} else { } else {
return false; return false;
} }

View File

@ -1,6 +1,7 @@
import { import {
CommonApiService, CommonApiService,
MassTalkSaveRequest MassTalkSaveRequest,
FileTalkShareRequest
} from '@ucap-webmessenger/api-common'; } from '@ucap-webmessenger/api-common';
import { KEY_ENVIRONMENTS_INFO } from './../../../types/environment.type'; import { KEY_ENVIRONMENTS_INFO } from './../../../types/environment.type';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
@ -19,7 +20,8 @@ import {
catchError, catchError,
exhaustMap, exhaustMap,
withLatestFrom, withLatestFrom,
concatMap concatMap,
take
} from 'rxjs/operators'; } from 'rxjs/operators';
import moment from 'moment'; import moment from 'moment';
import { import {
@ -43,7 +45,8 @@ import {
FileEventJson, FileEventJson,
MassTextEventJson, MassTextEventJson,
TranslationEventJson, TranslationEventJson,
MassTranslationEventJson MassTranslationEventJson,
decodeFileEventJson
} from '@ucap-webmessenger/protocol-event'; } from '@ucap-webmessenger/protocol-event';
import * as ChatStore from '@app/store/messenger/chat'; import * as ChatStore from '@app/store/messenger/chat';
@ -83,7 +86,8 @@ import {
roomOpenAfterForward, roomOpenAfterForward,
infoForSearch, infoForSearch,
infoForSearchEnd, infoForSearchEnd,
infoAll infoAll,
forwardFailure
} from './actions'; } from './actions';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { import {
@ -663,8 +667,52 @@ export class Effects {
ofType(forward), ofType(forward),
tap(action => { tap(action => {
if (!!action.trgtRoomSeq) { if (!!action.trgtRoomSeq) {
// 대화전달 후 방오픈. // 대화전달 후 방오픈. Exist roomSeq.
if (action.req.eventType === EventType.File) {
const loginResInfo: LoginResponse = this.sessionStorageService.get<
LoginResponse
>(KEY_LOGIN_RES_INFO);
const environmentsInfo = this.sessionStorageService.get<
EnvironmentsInfo
>(KEY_ENVIRONMENTS_INFO);
const fileEventJson: FileEventJson = decodeFileEventJson(
action.req.sentMessage
);
const req: FileTalkShareRequest = {
userSeq: loginResInfo.userSeq,
deviceType: environmentsInfo.deviceType,
token: loginResInfo.tokenString,
attachmentsSeq: fileEventJson.attachmentSeq.toString(),
roomSeq: action.trgtRoomSeq,
synapKey: ''
};
this.commonApiService
.fileTalkShare(req)
.pipe(
take(1),
map(res => {
if (res.statusCode === StatusCode.Success) {
action = {
...action,
req: {
...action.req,
sentMessage: res.returnJson
}
};
this.store.dispatch(roomOpenAfterForward(action)); this.store.dispatch(roomOpenAfterForward(action));
} else {
this.store.dispatch(forwardFailure({ error: res }));
}
}),
catchError(error => of(forwardFailure({ error })))
)
.subscribe();
} else {
this.store.dispatch(roomOpenAfterForward(action));
}
} else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) { } else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) {
// 방오픈 후 대화전달. // 방오픈 후 대화전달.
this.store.dispatch(forwardAfterRoomOpen(action)); this.store.dispatch(forwardAfterRoomOpen(action));
@ -689,6 +737,40 @@ export class Effects {
return openSuccess({ res }); return openSuccess({ res });
}), }),
map(res => { map(res => {
if (action.req.eventType === EventType.File) {
const loginResInfo: LoginResponse = this.sessionStorageService.get<
LoginResponse
>(KEY_LOGIN_RES_INFO);
const environmentsInfo = this.sessionStorageService.get<
EnvironmentsInfo
>(KEY_ENVIRONMENTS_INFO);
const fileEventJson: FileEventJson = decodeFileEventJson(
action.req.sentMessage
);
const req: FileTalkShareRequest = {
userSeq: loginResInfo.userSeq,
deviceType: environmentsInfo.deviceType,
token: loginResInfo.tokenString,
attachmentsSeq: fileEventJson.attachmentSeq.toString(),
roomSeq: action.trgtRoomSeq,
synapKey: ''
};
this.commonApiService
.fileTalkShare(req)
.pipe(
take(1),
map(resFileShare => {
if (resFileShare.statusCode === StatusCode.Success) {
action = {
...action,
req: {
...action.req,
sentMessage: resFileShare.returnJson
}
};
this.store.dispatch( this.store.dispatch(
send({ send({
senderSeq: action.senderSeq, senderSeq: action.senderSeq,
@ -699,6 +781,26 @@ export class Effects {
} }
}) })
); );
} else {
this.store.dispatch(forwardFailure({ error: res }));
}
}),
catchError(error => of(forwardFailure({ error })))
)
.subscribe();
} else {
this.store.dispatch(
send({
senderSeq: action.senderSeq,
req: {
roomSeq: res.res.roomSeq,
eventType: action.req.eventType,
sentMessage: action.req.sentMessage
}
})
);
}
return res; return res;
}), }),
catchError(error => of(openFailure({ error }))) catchError(error => of(openFailure({ error })))

View File

@ -282,6 +282,10 @@ $daesang-grey: (
} }
} }
.load-container .loader:after {
background-color: mat-color($accent, 300);
}
.global-menu { .global-menu {
.mat-tab-label[aria-selected='true'] { .mat-tab-label[aria-selected='true'] {
.mat-tab-label-content { .mat-tab-label-content {

View File

@ -1,17 +1,19 @@
.wrapper-splash { .wrapper-splash {
position: absolute; position: absolute;
display: flex;
justify-content: center;
justify-items: center;
z-index: 99999; z-index: 99999;
width: 100%; width: 100%;
height: 100%; height: 100%;
pointer-events: none; pointer-events: none;
background-size: cover; background-size: cover;
height: 100%; height: 100%;
background: #eaeff1; /*background: linear-gradient(to top, #93a3af, #eaeff1);*/
background: linear-gradient(to top, #93a3af, #eaeff1);
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.svg-img { /*.svg-img {
position: absolute; position: absolute;
width: 240px; width: 240px;
height: 120px; height: 120px;
@ -45,4 +47,93 @@
#loop-offset { #loop-offset {
display: none; display: none;
}*/
.load-container {
display: flex;
flex-flow: column;
justify-content: center;
justify-items: center;
transform: translateY(-60px);
}
.load-container .loader {
font-size: 10px;
margin: 50px auto;
text-indent: -9999em;
width: 11em;
height: 11em;
border-radius: 50%;
background: #ffffff;
background: -moz-linear-gradient(
left,
#ffffff 10%,
rgba(255, 255, 255, 0) 42%
);
background: -webkit-linear-gradient(
left,
#ffffff 10%,
rgba(255, 255, 255, 0) 42%
);
background: -o-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
background: -ms-linear-gradient(
left,
#ffffff 10%,
rgba(255, 255, 255, 0) 42%
);
background: linear-gradient(to right, #00b6d5 10%, #fb8c00, 42%);
position: relative;
-webkit-animation: load3 1.4s infinite linear;
animation: load3 1.4s infinite linear;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.load-container .loader:before {
width: 50%;
height: 50%;
background: #ffffff;
border-radius: 100% 0 0 0;
position: absolute;
top: 0;
left: 0;
content: '';
}
.load-container .loader:after {
width: 75%;
height: 75%;
border-radius: 50%;
content: '';
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.credit {
color: #ffffff;
margin: 0 auto;
font-size: 1.3em;
font-weight: 500;
}
@-webkit-keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
} }

View File

@ -12,8 +12,8 @@
<body class="theme-default"> <body class="theme-default">
<app-root app-version="0.0.1"></app-root> <app-root app-version="0.0.1"></app-root>
<div class="wrapper-splash" id="splash-screen"> <div class="wrapper-splash bg-accent-light " id="splash-screen">
<svg <!--<svg
version="1.1" version="1.1"
id="preloader" id="preloader"
x="0px" x="0px"
@ -89,8 +89,11 @@
> >
<mpath xlink:href="#loop-offset" /> <mpath xlink:href="#loop-offset" />
</animateMotion> </animateMotion>
</svg> </svg>-->
<div class="credit">Welcome to DS Talk</div> <div class="load-container">
<div class="loader"></div>
<span class="credit">Welcome to DS Talk</span>
</div>
</div> </div>
</body> </body>
</html> </html>