From e2fde4ceb0a89cc686f21a45fb7fbfbce2d43646 Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:30:25 +0900 Subject: [PATCH 1/4] bug of search is fixed --- .../components/messages.component.html | 123 +++++++++--------- .../components/messages.component.ts | 10 +- .../src/lib/components/messages.component.ts | 11 +- 3 files changed, 79 insertions(+), 65 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index 0d3b73fa..474b3ae8 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -145,65 +145,6 @@ > more_vert - - - - - - - - - - -
@@ -251,6 +192,7 @@ [eventRemained$]="eventRemainedSubject.asObservable()" [userInfos$]="userInfoListSubject.asObservable()" [loginRes$]="loginResSubject.asObservable()" + [lock$]="lockSubject.asObservable()" [sessionVerInfo]="sessionVerInfo" [isShowUnreadCount]="getShowUnreadCount()" [clearReadHere]="clearReadHere" @@ -335,6 +277,65 @@
+ + + + + + + + + + +
{{ 'chat.forwardEventTo' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index b3cca3fc..1831165f 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -177,6 +177,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { eventRemainedSubscription: Subscription; eventRemainedSubject = new BehaviorSubject(false); // 이전대화가 남아 있는지 여부 + lockSubject = new BehaviorSubject(false); + sessionVerInfo: VersionInfo2Response; baseEventSeq = 0; @@ -305,6 +307,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { ) ) .subscribe(process => { + this.lockSubject.next(process); this.searchEventListProcessing = process; if (!process && this.isShowSearchArea) { this.doSearchTextInEvent(this.searchText); @@ -1355,7 +1358,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } } break; - case 'REPLAY': + case 'FORWARD': { const result = await this.dialogService.open< CreateChatDialogComponent, @@ -1401,7 +1404,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } } break; - case 'REPLAY_TO_ME': + case 'FORWARD_TO_ME': { if (this.loginResSubject.value.talkWithMeBotSeq > -1) { this.store.dispatch( @@ -1795,7 +1798,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { this.store.dispatch(EventStore.infoForSearchEnd({})); - this.chatMessages.gotoPosition(this.searchedFocusEvent.seq); + // this.chatMessages.gotoPosition(this.searchedFocusEvent.seq); + this.chatMessages.initEventMore(this.searchedFocusEvent.seq); } else { this.searchTotalCount = 0; this.searchCurrentIndex = 0; diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index f48c3fda..c9c1b5d7 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -60,6 +60,9 @@ export class MessagesComponent implements OnInit, OnDestroy { @Input() userInfos$: Observable; + @Input() + lock$: Observable; + @Input() isShowUnreadCount = true; @Input() @@ -129,6 +132,7 @@ export class MessagesComponent implements OnInit, OnDestroy { firstCheckReadHere = true; initRoomLastEventSeq: number; baseEventSeq = 0; + gotoEventSeq: number; loginRes: LoginResponse; loginResSubscription: Subscription; @@ -536,6 +540,10 @@ export class MessagesComponent implements OnInit, OnDestroy { () => {}, () => { this.initalized = true; + if (!!this.gotoEventSeq) { + this.gotoPosition(this.gotoEventSeq); + this.gotoEventSeq = undefined; + } }, -1 === this.virtualScroller.viewPortInfo.endIndex || !isInViewPortItems, @@ -545,11 +553,12 @@ export class MessagesComponent implements OnInit, OnDestroy { } } - initEventMore() { + initEventMore(gotoEventSeq?: number) { // 방정보가 바뀌면 이전대화 보기 관련 값들을 초기화 한다. this.scrollUpInitalized = false; this.storedScrollItem = undefined; this.storedScrollItemOffsetTop = undefined; + this.gotoEventSeq = gotoEventSeq; } clear() {} From 389997dee3afd13c643c1f0c72cf8b91770bf203 Mon Sep 17 00:00:00 2001 From: khk Date: Thu, 6 Feb 2020 15:53:06 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EB=8C=80=ED=99=94=EB=B0=A9=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC=20-=20=EB=8C=80=ED=99=94=ED=83=AD=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/create-chat.dialog.component.html | 9 ++---- .../chat/create-chat.dialog.component.scss | 31 +++++++++++++------ .../components/login.page.component.scss | 9 ------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html index f6a91939..0249e670 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html @@ -146,15 +146,11 @@ - -
+
-
+
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.scss index 9455060d..e6b231c4 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.scss @@ -8,6 +8,12 @@ color: #444444; } } + & > .mat-card-content { + height: 568px; + } + & > .mat-tab-body-wrapper { + height: calc(100% - 50px); + } } .dialog-tab-grouplist { @@ -27,6 +33,14 @@ } } +.dialog-tab-chatlist { + height: 518px; + width: 100%; + .chat { + width: 100%; + } +} + ::ng-deep .dialog-tab-orglist { width: 100%; height: 380px; @@ -102,10 +116,8 @@ } } -/*::ng-deep .mat-dialog-container { +:ng-deep .mat-dialog-container { .mat-tab-body-wrapper { - height: 380px; - width: 100%; .mat-tab-body { width: 100%; height: 100%; @@ -116,7 +128,12 @@ } } } - +::ng-deep .ps-content { + .cdk-virtual-scroll-viewport { + height: 100%; + } +} +/*: .mat-tab-frame { width: 100%; height: 100%; @@ -133,11 +150,7 @@ ::ng-deep .mat-card > .mat-tab-labels { border-bottom: 2px solid #dddddd; } -::ng-deep .ps-content { - .cdk-virtual-scroll-viewport { - height: 100%; - } -} + .list-item-frame { width: 100%; diff --git a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.scss b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.scss index 0860127b..68733339 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.scss +++ b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.scss @@ -327,15 +327,6 @@ $ease-in-out: cubic-bezier(0.785, 0.135, 0.15, 0.86); } } -.mat-card-content { - .notice { - p { - line-height: 1.4em; - margin-bottom: 10px; - } - } -} - @media all and (max-width: 1400px) { .slider { &_content { From 91cc673d806fe7bf010a23d6e77f02a398841efa Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Thu, 6 Feb 2020 16:00:56 +0900 Subject: [PATCH 3/4] bug of search is fixed --- .../src/lib/components/messages.component.ts | 64 ++++++++++++------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index c9c1b5d7..6511a7f3 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -425,29 +425,39 @@ export class MessagesComponent implements OnInit, OnDestroy { useSwap: boolean, addtionalOffset?: number ) { - this.preSwapScroll(useHide, useSwap); - if (!!preCallback) { - preCallback(); - } - - this.virtualScroller.scrollInto( - to, - true, - undefined !== this.storedScrollItemOffsetTop - ? -this.storedScrollItemOffsetTop - : undefined !== addtionalOffset - ? -addtionalOffset - : 0, - 0, - () => { - setTimeout(() => { - if (!!postCallback) { - postCallback(); - } - this.postSwapScroll(useHide, useSwap); - }); + if (!!to) { + this.preSwapScroll(useHide, useSwap); + if (!!preCallback) { + preCallback(); } - ); + + this.virtualScroller.scrollInto( + to, + true, + undefined !== this.storedScrollItemOffsetTop + ? -this.storedScrollItemOffsetTop + : undefined !== addtionalOffset + ? -addtionalOffset + : 0, + 0, + () => { + setTimeout(() => { + if (!!postCallback) { + postCallback(); + } + this.postSwapScroll(useHide, useSwap); + }); + } + ); + } else { + if (!!preCallback) { + preCallback(); + } + + if (!!postCallback) { + postCallback(); + } + } } preSwapScroll(useHide: boolean, useSwap: boolean) { @@ -526,6 +536,10 @@ export class MessagesComponent implements OnInit, OnDestroy { false ); } else { + if (!this.eventList || 0 === this.eventList.length) { + return; + } + const lastEvent = !!this.eventList && 0 < this.eventList.length ? this.eventList[this.eventList.length - 1] @@ -536,7 +550,9 @@ export class MessagesComponent implements OnInit, OnDestroy { } const isInViewPortItems = this.isInViewPortItems(lastEvent.seq); this.swapScrollTo( - this.eventList[this.eventList.length - 1], + !!this.gotoEventSeq + ? undefined + : this.eventList[this.eventList.length - 1], () => {}, () => { this.initalized = true; @@ -547,7 +563,7 @@ export class MessagesComponent implements OnInit, OnDestroy { }, -1 === this.virtualScroller.viewPortInfo.endIndex || !isInViewPortItems, - !isInViewPortItems + !isInViewPortItems || !!this.gotoEventSeq ); } } From e518ed386ecfc74dbaed762f4e85896874325d03 Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Thu, 6 Feb 2020 16:15:52 +0900 Subject: [PATCH 4/4] bug fixed --- .../src/lib/components/messages.component.ts | 70 ++++++++----------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 6511a7f3..56af380a 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -425,39 +425,29 @@ export class MessagesComponent implements OnInit, OnDestroy { useSwap: boolean, addtionalOffset?: number ) { - if (!!to) { - this.preSwapScroll(useHide, useSwap); - if (!!preCallback) { - preCallback(); - } - - this.virtualScroller.scrollInto( - to, - true, - undefined !== this.storedScrollItemOffsetTop - ? -this.storedScrollItemOffsetTop - : undefined !== addtionalOffset - ? -addtionalOffset - : 0, - 0, - () => { - setTimeout(() => { - if (!!postCallback) { - postCallback(); - } - this.postSwapScroll(useHide, useSwap); - }); - } - ); - } else { - if (!!preCallback) { - preCallback(); - } - - if (!!postCallback) { - postCallback(); - } + this.preSwapScroll(useHide, useSwap); + if (!!preCallback) { + preCallback(); } + + this.virtualScroller.scrollInto( + to, + true, + undefined !== this.storedScrollItemOffsetTop + ? -this.storedScrollItemOffsetTop + : undefined !== addtionalOffset + ? -addtionalOffset + : 0, + 0, + () => { + setTimeout(() => { + if (!!postCallback) { + postCallback(); + } + this.postSwapScroll(useHide, useSwap); + }); + } + ); } preSwapScroll(useHide: boolean, useSwap: boolean) { @@ -540,6 +530,12 @@ export class MessagesComponent implements OnInit, OnDestroy { return; } + if (!!this.gotoEventSeq) { + this.gotoPosition(this.gotoEventSeq); + this.gotoEventSeq = undefined; + return; + } + const lastEvent = !!this.eventList && 0 < this.eventList.length ? this.eventList[this.eventList.length - 1] @@ -550,20 +546,14 @@ export class MessagesComponent implements OnInit, OnDestroy { } const isInViewPortItems = this.isInViewPortItems(lastEvent.seq); this.swapScrollTo( - !!this.gotoEventSeq - ? undefined - : this.eventList[this.eventList.length - 1], + this.eventList[this.eventList.length - 1], () => {}, () => { this.initalized = true; - if (!!this.gotoEventSeq) { - this.gotoPosition(this.gotoEventSeq); - this.gotoEventSeq = undefined; - } }, -1 === this.virtualScroller.viewPortInfo.endIndex || !isInViewPortItems, - !isInViewPortItems || !!this.gotoEventSeq + !isInViewPortItems ); } }