diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts index aa49b093..489bd5fc 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts @@ -1,10 +1,4 @@ -import { - Component, - OnInit, - OnDestroy, - Inject, - EventEmitter -} from '@angular/core'; +import { Component, OnInit, OnDestroy, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { NGXLogger } from 'ngx-logger'; @@ -20,6 +14,7 @@ import { import { FileDownloadItem } from '@ucap-webmessenger/api'; import { CommonApiService } from '@ucap-webmessenger/api-common'; import { TranslateService } from '@ngx-translate/core'; +import { FileProtocolService } from '@ucap-webmessenger/protocol-file'; export interface FileViewerDialogData { fileInfo: FileEventJson; @@ -55,6 +50,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { private translateService: TranslateService, private snackBarService: SnackBarService, private commonApiService: CommonApiService, + private fileProtocolService: FileProtocolService, private logger: NGXLogger ) { this.fileInfo = data.fileInfo; @@ -98,6 +94,14 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { FileUtil.fromBlobToBuffer(blob) .then(buffer => { + /** download check */ + this.fileProtocolService + .downCheck({ + seq: this.fileInfo.attachmentSeq + }) + .pipe(take(1)) + .subscribe(); + this.nativeService .saveFile(buffer, this.fileInfo.fileName, mimeType) .then(result => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index fb1be996..89a2aa32 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -481,20 +481,7 @@ export class GroupComponent implements OnInit, OnDestroy { ); switch (menuType) { case 'VIEW_PROFILE': - let useBuddyButton = false; - if ( - !!group && - environment.productConfig.CommonSetting.useMyDeptGroup && - environment.productConfig.CommonSetting.myDeptGroupSeq !== group.seq - ) { - useBuddyButton = true; - } - this.openProfile.emit({ - userSeq: userInfo.seq, - openProfileOptions: { - useBuddyButton - } - }); + this.onClickOpenProfile(userInfo.seq, group); break; case 'CHAT': this.onSelectBuddy(userInfo); @@ -630,21 +617,27 @@ export class GroupComponent implements OnInit, OnDestroy { } onClickOpenProfile(userSeq: number, group: GroupDetailData) { - let useBuddyButton = false; - if ( - !!group && - environment.productConfig.CommonSetting.useMyDeptGroup && - environment.productConfig.CommonSetting.myDeptGroupSeq !== group.seq - ) { - useBuddyButton = true; - } - - this.openProfile.emit({ - userSeq, - openProfileOptions: { - useBuddyButton + if (this.isShowSearch) { + this.openProfile.emit({ + userSeq + }); + } else { + let useBuddyButton = false; + if ( + !!group && + environment.productConfig.CommonSetting.useMyDeptGroup && + environment.productConfig.CommonSetting.myDeptGroupSeq !== group.seq + ) { + useBuddyButton = true; } - }); + + this.openProfile.emit({ + userSeq, + openProfileOptions: { + useBuddyButton + } + }); + } } onContextMenuProfile( 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 eb3af649..f5b78937 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 @@ -127,6 +127,7 @@ import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; import { TranslateService } from '@ngx-translate/core'; import { TranslatePipe } from 'projects/ucap-webmessenger-ui/src/lib/pipes/translate.pipe'; import { TranslateService as UiTranslateService } from '@ucap-webmessenger/ui'; +import { FileProtocolService } from '@ucap-webmessenger/protocol-file'; @Component({ selector: 'app-layout-messenger-messages', @@ -230,6 +231,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { private sessionStorageService: SessionStorageService, private localStorageService: LocalStorageService, private commonApiService: CommonApiService, + private fileProtocolService: FileProtocolService, private clipboardService: ClipboardService, private uiTranslateService: UiTranslateService, private translateService: TranslateService, @@ -979,6 +981,14 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { FileUtil.fromBlobToBuffer(blob) .then(buffer => { + /** download check */ + this.fileProtocolService + .downCheck({ + seq: value.fileInfo.attachmentSeq + }) + .pipe(take(1)) + .subscribe(); + this.nativeService .saveFile(buffer, value.fileInfo.fileName, mimeType, savePath) .then(result => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts index 7abc2530..f5045111 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts @@ -2,14 +2,15 @@ import { Component, OnInit, OnDestroy, Inject } from '@angular/core'; import { FileInfo, FileDownloadInfo, - FileType + FileType, + FileProtocolService } from '@ucap-webmessenger/protocol-file'; import { Subscription, combineLatest } from 'rxjs'; import { Store, select } from '@ngrx/store'; import * as AppStore from '@app/store'; import { tap, map, take, finalize } from 'rxjs/operators'; -import { FileUtil, MimeUtil, DeviceType } from '@ucap-webmessenger/core'; +import { FileUtil, MimeUtil } from '@ucap-webmessenger/core'; import { CommonApiService } from '@ucap-webmessenger/api-common'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; @@ -65,6 +66,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { private store: Store, private sessionStorageService: SessionStorageService, private commonApiService: CommonApiService, + private fileProtocolService: FileProtocolService, private translateService: TranslateService, private snackBarService: SnackBarService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @@ -232,6 +234,14 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { FileUtil.fromBlobToBuffer(blob) .then(buffer => { + /** download check */ + this.fileProtocolService + .downCheck({ + seq: fileInfo.info.seq + }) + .pipe(take(1)) + .subscribe(); + this.nativeService .saveFile(buffer, fileInfo.info.name, mimeType) .then(result => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts index 93383516..54ae3229 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts @@ -3,7 +3,8 @@ import { MatPaginator, MatTableDataSource, MatSort } from '@angular/material'; import { FileInfo, FileDownloadInfo, - FileType + FileType, + FileProtocolService } from '@ucap-webmessenger/protocol-file'; import { Subscription, combineLatest } from 'rxjs'; import { Store, select } from '@ngrx/store'; @@ -11,7 +12,7 @@ import { Store, select } from '@ngrx/store'; import * as AppStore from '@app/store'; import * as EventStore from '@app/store/messenger/event'; import { tap, map, take, finalize } from 'rxjs/operators'; -import { FileUtil, MimeUtil, DeviceType } from '@ucap-webmessenger/core'; +import { FileUtil, MimeUtil } from '@ucap-webmessenger/core'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; @@ -78,6 +79,7 @@ export class FileBoxComponent implements OnInit, OnDestroy { private store: Store, private sessionStorageService: SessionStorageService, private commonApiService: CommonApiService, + private fileProtocolService: FileProtocolService, private translateService: TranslateService, private snackBarService: SnackBarService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @@ -275,6 +277,14 @@ export class FileBoxComponent implements OnInit, OnDestroy { FileUtil.fromBlobToBuffer(blob) .then(buffer => { + /** download check */ + this.fileProtocolService + .downCheck({ + seq: fileInfo.info.seq + }) + .pipe(take(1)) + .subscribe(); + this.nativeService .saveFile(buffer, fileInfo.info.name, mimeType) .then(result => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html index ebe936ed..4bdc69e7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html @@ -350,6 +350,7 @@ " (edit)="$event.stopPropagation()" (cancel)="$event.stopPropagation()" + class="form-eidt" > {{ loginRes?.statusMessage1 }} @@ -373,6 +375,7 @@ " (edit)="$event.stopPropagation()" (cancel)="$event.stopPropagation()" + class="form-eidt" > {{ loginRes?.statusMessage2 }} {{ loginRes?.statusMessage3 }} = ( ) => { const bodyList: PacketBody[] = []; - bodyList.push({ type: PacketBodyValue.Integer, value: req.seq }); + bodyList.push({ type: PacketBodyValue.String, value: req.seq }); return bodyList; };