This commit is contained in:
Richard Park 2020-01-15 13:53:22 +09:00
commit 704b2a0983
13 changed files with 296 additions and 77 deletions

View File

@ -149,6 +149,13 @@ export class MessageBoxComponent
// Badge Refresh in case Receive Message.. // Badge Refresh in case Receive Message..
if (info.msgInfo.type === MessageType.Receive) { if (info.msgInfo.type === MessageType.Receive) {
this.doRefreshUnReadCount.emit(); this.doRefreshUnReadCount.emit();
// Clear Receive Message New Badge..
this.store.dispatch(
MessageStore.clearNewFlagReceiveMessage({
msgId: info.msgInfo.msgId
})
);
} }
// detail view.. // detail view..

View File

@ -1303,6 +1303,33 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
} }
break; break;
case EventType.Translation: case EventType.Translation:
{
let trgtStr = '';
if (clicktype === 'translation') {
// translation
trgtStr = (message.sentMessageJson as TranslationEventJson)
.translation;
} else {
// original
trgtStr = (message.sentMessageJson as TranslationEventJson)
.original;
}
if (this.clipboardService.copyFromContent(trgtStr)) {
this.snackBarService.open(
this.translateService.instant(
'common.clipboard.results.copied'
),
'',
{
duration: 3000,
verticalPosition: 'top',
horizontalPosition: 'center'
}
);
}
}
break;
case EventType.MassTranslation: case EventType.MassTranslation:
{ {
const sentMessageJson: MassTranslationEventJson = message.sentMessageJson as MassTranslationEventJson; const sentMessageJson: MassTranslationEventJson = message.sentMessageJson as MassTranslationEventJson;

View File

@ -660,6 +660,10 @@ export class AppNotificationService {
// Remove one Receive Message // Remove one Receive Message
if (!!noti && !!noti.keyId) { if (!!noti && !!noti.keyId) {
// clear badge in left navi
this.store.dispatch(MessageStore.retrieveUnreadCount({}));
// delete message in receive message list
this.store.dispatch( this.store.dispatch(
deleteMessageSuccess({ deleteMessageSuccess({
messageType: MessageType.Receive, messageType: MessageType.Receive,

View File

@ -122,3 +122,8 @@ export const clearSearchMessage = createAction(
'[Messenger::Message] Clear Search Message', '[Messenger::Message] Clear Search Message',
props() props()
); );
export const clearNewFlagReceiveMessage = createAction(
'[Messenger::Message] Clear NewFlag Message',
props<{ msgId: number }>()
);

View File

@ -18,9 +18,10 @@ import {
detailMessageSuccess, detailMessageSuccess,
detailMessageClear, detailMessageClear,
detailMessage, detailMessage,
clearSearchMessage clearSearchMessage,
clearNewFlagReceiveMessage
} from './actions'; } from './actions';
import { MessageType } from '@ucap-webmessenger/api-message'; import { MessageType, MessageList } from '@ucap-webmessenger/api-message';
export const reducer = createReducer( export const reducer = createReducer(
initialState, initialState,
@ -149,6 +150,22 @@ export const reducer = createReducer(
}; };
}), }),
on(clearNewFlagReceiveMessage, (state, action) => {
const msgId = action.msgId;
const msgList: MessageList = {
...state.receiveList.entities[msgId],
readYn: true
};
return {
...state,
receiveList: adapterReceiveList.updateOne(
{ id: msgId, changes: msgList },
{ ...state.receiveList }
)
};
}),
on(cancelReservationMessageSuccess, (state, action) => { on(cancelReservationMessageSuccess, (state, action) => {
return { return {
...state, ...state,

View File

@ -198,6 +198,7 @@
"isRoomTypeSecret": "This room is secret type", "isRoomTypeSecret": "This room is secret type",
"notificationIsOn": "Notification is on", "notificationIsOn": "Notification is on",
"notificationIsOff": "Notification is off", "notificationIsOff": "Notification is off",
"typeMessage": "Type your message.",
"event": { "event": {
"inviteToRoomWith": "{{owner}} invited {{inviter}}.", "inviteToRoomWith": "{{owner}} invited {{inviter}}.",
"exitFromRoomWith": "{{exitor}} has left.", "exitFromRoomWith": "{{exitor}} has left.",
@ -276,6 +277,8 @@
"detailOfViewers": "Detail of viewers", "detailOfViewers": "Detail of viewers",
"selectRecipient": "Select recipient", "selectRecipient": "Select recipient",
"andOthers": "and {{count}}others", "andOthers": "and {{count}}others",
"addReceiver": "Add Reciever",
"countOfReceiver": "{{count}} total recipients",
"results": { "results": {
"successForSending": "Your message has been sent.", "successForSending": "Your message has been sent.",
"successForReservation": "You have scheduled a message transfer.", "successForReservation": "You have scheduled a message transfer.",

View File

@ -198,6 +198,7 @@
"isRoomTypeSecret": "비밀 대화방입니다.", "isRoomTypeSecret": "비밀 대화방입니다.",
"notificationIsOn": "알림 켜짐", "notificationIsOn": "알림 켜짐",
"notificationIsOff": "알림 꺼짐", "notificationIsOff": "알림 꺼짐",
"typeMessage": "대화를 입력하세요.",
"event": { "event": {
"inviteToRoomWith": "{{owner}}이 {{inviter}}을 초대했습니다.", "inviteToRoomWith": "{{owner}}이 {{inviter}}을 초대했습니다.",
"exitFromRoomWith": "{{exitor}}님이 퇴장하셨습니다.", "exitFromRoomWith": "{{exitor}}님이 퇴장하셨습니다.",
@ -266,7 +267,7 @@
"sendingTime": "보낸 시간", "sendingTime": "보낸 시간",
"reservationTime": "발송 예정 시간", "reservationTime": "발송 예정 시간",
"countOfReadUser": "읽은 사람", "countOfReadUser": "읽은 사람",
"countOfUnreadUser": "읽 않은 사람", "countOfUnreadUser": "읽 않은 사람",
"badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다.", "badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다.",
"cancelReservation": "예약 발송 취소", "cancelReservation": "예약 발송 취소",
"cancelSending": "발송 취소", "cancelSending": "발송 취소",
@ -276,6 +277,8 @@
"detailOfViewers": "읽음 확인", "detailOfViewers": "읽음 확인",
"selectRecipient": "수신자 선택", "selectRecipient": "수신자 선택",
"andOthers": "외 {{count}}명", "andOthers": "외 {{count}}명",
"addReceiver": "수신자 추가",
"countOfReceiver": "총 수신자 {{count}}명",
"results": { "results": {
"successForSending": "쪽지를 전송하였습니다.", "successForSending": "쪽지를 전송하였습니다.",
"successForReservation": "쪽지 전송을 예약 하였습니다.", "successForReservation": "쪽지 전송을 예약 하였습니다.",

View File

@ -50,7 +50,7 @@
<textarea <textarea
matInput matInput
#replyInput #replyInput
placeholder="Type your message" placeholder="{{ 'chat.typeMessage' | translate }}"
ngModel ngModel
name="message" name="message"
[matTextareaAutosize]="true" [matTextareaAutosize]="true"

View File

@ -61,7 +61,7 @@
</dd> </dd>
</dl> </dl>
<div class="date"> <div class="date">
<span>{{ message.regDate | ucapDate: 'MM:DD' }}</span> <span>{{ message.regDate | ucapDate: 'C' }}</span>
<span <span
*ngIf="message.type === MessageType.Receive && !message.readYn" *ngIf="message.type === MessageType.Receive && !message.readYn"
class="badge-new bg-warn-darkest" class="badge-new bg-warn-darkest"

View File

@ -1,41 +1,38 @@
<mat-card class="mat-elevation-z0 ucap-message-write"> <mat-card class="mat-elevation-z0 ucap-message-write">
<form name="messageWriteForm" [formGroup]="messageWriteForm" novalidate> <form name="messageWriteForm" [formGroup]="messageWriteForm" novalidate>
<mat-form-field class="message-title"> <div class="add-row">
<input <button
matInput mat-button
formControlName="title" (click)="onClickReceiverList()"
placeholder="{{ 'message.fieldTitle' | translate }}" class="mat-mini-fab mat-button-base mat-accent mat-elevation-z"
/> >
</mat-form-field> <mat-icon>add</mat-icon>
<span class="mat-fab__label">{{
'message.addReceiver' | translate
}}</span>
</button>
<span
*ngIf="receiverList.length > 0"
class="receiver-sum text-accent-color"
>
{{
'message.countOfReceiver' | translate: { count: receiverList.length }
}}
</span>
</div>
<mat-chip-list #chipList aria-label="receiver selection">
<mat-chip
*ngFor="let receiver of receiverList"
removable="true"
(removed)="onRemovedReceiver(receiver)"
>
{{ receiver.name }}
<span matChipRemove class="mdi mdi-close"></span>
</mat-chip>
</mat-chip-list>
<mat-card-content class="message-write-body"> <!--<mat-form-field class="message-receiver-list">
<div <perfect-scrollbar>
#editor
class="ucap-message-write-editor"
contenteditable="true"
(paste)="onPasteEditor($event)"
(input)="onInputEditor()"
></div>
<input type="file" #fileInput style="display: none" multiple />
<mat-list>
<mat-list-item *ngFor="let oldAttachment of oldAttachmentList">
{{ oldAttachment.resContent }}
<button
mat-button
aria-label="이미지삭제"
(click)="onClickDeleteOldAttachment(oldAttachment)"
>
<span class="mdi mdi-delete"></span>
</button>
</mat-list-item>
<mat-list-item *ngFor="let attachment of attachmentList">
{{ attachment.name }}
</mat-list-item>
</mat-list>
</mat-card-content>
<perfect-scrollbar>
<mat-form-field class="message-receiver-list">
<mat-chip-list #chipList aria-label="receiver selection"> <mat-chip-list #chipList aria-label="receiver selection">
<mat-chip <mat-chip
*ngFor="let receiver of receiverList" *ngFor="let receiver of receiverList"
@ -52,31 +49,80 @@
(click)="onClickReceiverList()" (click)="onClickReceiverList()"
/> />
</mat-chip-list> </mat-chip-list>
</mat-form-field> </perfect-scrollbar>
</perfect-scrollbar> </mat-form-field>
-->
<mat-form-field class="message-title">
<input
matInput
formControlName="title"
placeholder="{{ 'message.fieldTitle' | translate }}"
/>
</mat-form-field>
<div class="message-content">
<mat-card-content class="message-write-body">
<div
#editor
class="ucap-message-write-editor"
contenteditable="true"
(paste)="onPasteEditor($event)"
(input)="onInputEditor()"
></div>
<input type="file" #fileInput style="display: none" multiple />
<mat-list>
<mat-list-item *ngFor="let oldAttachment of oldAttachmentList">
{{ oldAttachment.resContent }}
<button
mat-button
aria-label="이미지삭제"
(click)="onClickDeleteOldAttachment(oldAttachment)"
>
<span class="mdi mdi-delete"></span>
</button>
</mat-list-item>
<mat-list-item *ngFor="let attachment of attachmentList">
{{ attachment.name }}
</mat-list-item>
</mat-list>
<div class="message-option">
<div class="editor-tools">
<button
mat-icon-button
aria-label="이미지"
(click)="onClickImage()"
>
<span class="mdi mdi-camera mdi-24px"></span>
</button>
<button
mat-icon-button
aria-label="첨부파일"
(click)="onClickAttachment()"
>
<span class="mdi mdi-attachment mdi-rotate-90 mdi-24px"></span>
</button>
</div>
<div class="length">
<span
[class.editor-length-invalid]="
0 === contentLength || 1000 < contentLength
"
>{{ contentLength }}</span
>/1000
</div>
</div>
</mat-card-content>
</div>
<mat-card-actions> <mat-card-actions>
<div class="editor-tools"> <!--<div>
<button mat-icon-button aria-label="이미지" (click)="onClickImage()">
<span class="mdi mdi-camera mdi-24px"></span>
</button>
<button
mat-icon-button
aria-label="첨부파일"
(click)="onClickAttachment()"
>
<span class="mdi mdi-attachment mdi-rotate-90 mdi-24px"></span>
</button>
</div>
<div class="editor-actions-spacer"></div>
<div>
<span <span
[class.editor-length-invalid]=" [class.editor-length-invalid]="
0 === contentLength || 1000 < contentLength 0 === contentLength || 1000 < contentLength
" "
>{{ contentLength }}</span >{{ contentLength }}</span
>/1000 >/1000
</div> </div>-->
<div class="editor-actions-spacer"></div> <div class="editor-actions-spacer"></div>
<div class="editor-actions"> <div class="editor-actions">
<button <button
@ -86,8 +132,36 @@
> >
{{ 'common.messages.cancel' | translate }} {{ 'common.messages.cancel' | translate }}
</button> </button>
<button
mat-flat-button
(click)="onClickSend()"
[disabled]="
messageWriteForm.invalid ||
!receiverList ||
0 === receiverList.length ||
0 === contentLength ||
1000 < contentLength
"
class="mat-primary"
>
{{ 'message.sendTo' | translate }}
</button>
<button
mat-flat-button
(click)="onClickSendSchedule()"
[disabled]="
messageWriteForm.invalid ||
!receiverList ||
0 === receiverList.length ||
0 === contentLength ||
1000 < contentLength
"
class="mat-primary"
>
{{ 'message.sendReservation' | translate }}
</button>
<mat-menu #appMenu="matMenu" yPosition="above"> <!-- <mat-menu #appMenu="matMenu" yPosition="above">
<button mat-menu-item (click)="onClickSendSchedule()"> <button mat-menu-item (click)="onClickSendSchedule()">
<span class="mdi mdi-send-clock"></span <span class="mdi mdi-send-clock"></span
><span>{{ 'message.sendReservation' | translate }}</span> ><span>{{ 'message.sendReservation' | translate }}</span>
@ -121,7 +195,7 @@
class="mat-primary" class="mat-primary"
> >
{{ 'message.sendReservation' | translate }} {{ 'message.sendReservation' | translate }}
</button> </button>-->
</div> </div>
</mat-card-actions> </mat-card-actions>
</form> </form>

View File

@ -7,20 +7,8 @@
height: 100px; height: 100px;
} }
.message-title {
width: 100%;
}
.message-write-body { .message-write-body {
overflow: auto;
height: 270px;
.ucap-message-write-editor {
display: inline-block;
width: 100%;
height: 100%;
min-height: 250px;
}
[contenteditable] { [contenteditable] {
} }
@ -45,14 +33,98 @@
mat-card-actions { mat-card-actions {
display: flex; display: flex;
width: 100%; width: 100%;
.editor-tools {
padding-left: 0px;
}
.editor-actions-spacer { .editor-actions-spacer {
flex: 1 1 auto; flex: 1 1 auto;
} }
.editor-actions { }
}
.message-content {
display: flex;
flex-flow: row;
position: relative;
width: 100%;
.message-receiver-list {
position: relative;
width: 30%;
height: 100%;
margin-right: 10px;
}
.message-write-body {
display: flex;
flex: 1 1 auto;
flex-flow: column;
margin: 0;
.ucap-message-write-editor {
display: inline-block;
width: 100%;
height: 100%;
padding: 10px;
height: 280px;
overflow: auto;
}
.message-option {
display: flex;
flex-flow: row;
flex: 1 1 auto;
height: 40px;
.editor-tools {
}
.length {
margin-left: auto;
align-self: center;
}
} }
} }
} }
.mat-card-actions {
margin: 0 0 20px;
border-top: 1px solid #dddddd;
.editor-actions {
display: flex;
flex-flow: row;
justify-content: space-between;
margin-left: auto;
button {
margin-left: 4px;
}
}
}
::ng-deep .ucap-message-write {
padding: 0;
.add-row {
display: flex;
align-items: center;
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #dddddd;
.mat-mini-fab {
.mat-button-wrapper {
padding: 0;
.mat-icon {
width: 40px;
height: 40px;
line-height: 40px;
}
.mat-fab__label {
color: #212121;
margin-left: 10px;
}
}
}
.receiver-sum {
margin-left: auto;
}
}
.mat-chip-list {
.mat-chip-list-wrapper {
max-height: 100px;
overflow: auto;
}
}
.message-title {
width: 100%;
margin-top: 10px;
}
}

View File

@ -78,6 +78,7 @@ export class GeneralComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.logger.debug('general setting', this.setting);
let themeIndex: number; let themeIndex: number;
switch (this.setting.appTheme) { switch (this.setting.appTheme) {
case 'theme-default': case 'theme-default':

View File

@ -10,6 +10,7 @@ import {
import { ucapAnimations } from '../animations'; import { ucapAnimations } from '../animations';
import { MatCalendar, DateAdapter } from '@angular/material'; import { MatCalendar, DateAdapter } from '@angular/material';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
selector: 'ucap-pick-date', selector: 'ucap-pick-date',
@ -34,7 +35,12 @@ export class PickDateComponent<D> implements OnInit {
calendar: MatCalendar<D>; calendar: MatCalendar<D>;
// tslint:disable-next-line: variable-name // tslint:disable-next-line: variable-name
constructor(@Optional() private _dateAdapter: DateAdapter<D>) {} constructor(
@Optional() private _dateAdapter: DateAdapter<D>,
private translateService: TranslateService
) {
this._dateAdapter.setLocale(this.translateService.currentLang);
}
ngOnInit() {} ngOnInit() {}