open file is added

This commit is contained in:
richard-loafle 2020-02-06 10:26:39 +09:00
parent 57fc605679
commit d1698a28e6
4 changed files with 20 additions and 5 deletions

View File

@ -9,7 +9,8 @@ import {
Inject,
ChangeDetectorRef,
ChangeDetectionStrategy,
ElementRef
ElementRef,
NgZone
} from '@angular/core';
import {
ucapAnimations,
@ -248,6 +249,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
private dialogService: DialogService,
private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private ngZone: NgZone,
private logger: NGXLogger
) {
this.sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>(
@ -1080,19 +1082,30 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
.saveFile(buffer, value.fileInfo.fileName, mimeType, savePath)
.then(result => {
if (!!result) {
this.snackBarService.open(
const snackBarRef = this.snackBarService.open(
this.translateService.instant(
'common.file.results.savedToPath',
{
path: result
}
),
'',
this.translateService.instant('common.file.open'),
{
duration: 3000,
verticalPosition: 'bottom'
verticalPosition: 'bottom',
horizontalPosition: 'center'
}
);
snackBarRef.onAction().subscribe(() => {
this.ngZone.runOutsideAngular(() => {
this.nativeService
.openTargetItem(result)
.catch(reason => {
this.logger.warn(reason);
});
});
});
} else {
this.snackBarService.openFromComponent<
AlertSnackbarComponent,

View File

@ -501,7 +501,7 @@
</span>
<span class="version-info-button">
<button
*ngIf="checkingUpdateIsExist"
mat-flat-button
class="mat-primary"
(click)="onClickApplyUpdate($event)"

View File

@ -402,6 +402,7 @@
"save": "Save",
"saveAs": "Save as",
"saveAll": "Save all",
"open": "Open",
"downloadSelected": "Download selected",
"openDownloadFolder": "Open download folder",
"selectFiles": "Select files",

View File

@ -402,6 +402,7 @@
"save": "저장",
"saveAs": "다른 이름으로 저장",
"saveAll": "파일 모두 저장",
"open": "열기",
"downloadSelected": "선택된 파일 다운로드",
"openDownloadFolder": "다운로드 폴더 열기",
"selectFiles": "파일을 선택하세요",