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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import {
CommonApiService,
MassTalkSaveRequest
MassTalkSaveRequest,
FileTalkShareRequest
} from '@ucap-webmessenger/api-common';
import { KEY_ENVIRONMENTS_INFO } from './../../../types/environment.type';
import { Injectable } from '@angular/core';
@ -19,7 +20,8 @@ import {
catchError,
exhaustMap,
withLatestFrom,
concatMap
concatMap,
take
} from 'rxjs/operators';
import moment from 'moment';
import {
@ -43,7 +45,8 @@ import {
FileEventJson,
MassTextEventJson,
TranslationEventJson,
MassTranslationEventJson
MassTranslationEventJson,
decodeFileEventJson
} from '@ucap-webmessenger/protocol-event';
import * as ChatStore from '@app/store/messenger/chat';
@ -83,7 +86,8 @@ import {
roomOpenAfterForward,
infoForSearch,
infoForSearchEnd,
infoAll
infoAll,
forwardFailure
} from './actions';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import {
@ -663,8 +667,52 @@ export class Effects {
ofType(forward),
tap(action => {
if (!!action.trgtRoomSeq) {
// 대화전달 후 방오픈.
this.store.dispatch(roomOpenAfterForward(action));
// 대화전달 후 방오픈. 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));
} 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) {
// 방오픈 후 대화전달.
this.store.dispatch(forwardAfterRoomOpen(action));
@ -689,16 +737,70 @@ export class Effects {
return openSuccess({ res });
}),
map(res => {
this.store.dispatch(
send({
senderSeq: action.senderSeq,
req: {
roomSeq: res.res.roomSeq,
eventType: action.req.eventType,
sentMessage: action.req.sentMessage
}
})
);
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(
send({
senderSeq: action.senderSeq,
req: {
roomSeq: res.res.roomSeq,
eventType: action.req.eventType,
sentMessage: action.req.sentMessage
}
})
);
} 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;
}),
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 {
.mat-tab-label[aria-selected='true'] {
.mat-tab-label-content {

View File

@ -1,17 +1,19 @@
.wrapper-splash {
position: absolute;
display: flex;
justify-content: center;
justify-items: center;
z-index: 99999;
width: 100%;
height: 100%;
pointer-events: none;
background-size: cover;
height: 100%;
background: #eaeff1;
background: linear-gradient(to top, #93a3af, #eaeff1);
/*background: linear-gradient(to top, #93a3af, #eaeff1);*/
margin: 0;
padding: 0;
}
.svg-img {
/*.svg-img {
position: absolute;
width: 240px;
height: 120px;
@ -45,4 +47,93 @@
#loop-offset {
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">
<app-root app-version="0.0.1"></app-root>
<div class="wrapper-splash" id="splash-screen">
<svg
<div class="wrapper-splash bg-accent-light " id="splash-screen">
<!--<svg
version="1.1"
id="preloader"
x="0px"
@ -89,8 +89,11 @@
>
<mpath xlink:href="#loop-offset" />
</animateMotion>
</svg>
<div class="credit">Welcome to DS Talk</div>
</svg>-->
<div class="load-container">
<div class="loader"></div>
<span class="credit">Welcome to DS Talk</span>
</div>
</div>
</body>
</html>