download original file dev feature
This commit is contained in:
parent
bbafad9d07
commit
1baace9e22
@ -120,6 +120,15 @@
|
||||
></redaction-circle-button>
|
||||
|
||||
<!-- Dev Mode Features-->
|
||||
<redaction-circle-button
|
||||
*ngIf="userPreferenceService.areDevFeaturesEnabled"
|
||||
(action)="downloadOriginalFile()"
|
||||
icon="red:download"
|
||||
type="primary"
|
||||
class="ml-8"
|
||||
tooltip="file-preview.download-original-file"
|
||||
tooltipPosition="before"
|
||||
></redaction-circle-button>
|
||||
<redaction-circle-button
|
||||
*ngIf="userPreferenceService.areDevFeaturesEnabled"
|
||||
(action)="openSSRFilePreview()"
|
||||
|
||||
@ -26,8 +26,9 @@ import { handleFilterDelta, processFilters } from '../../../common/filter/utils/
|
||||
import { UserPreferenceService } from '../../../common/service/user-preference.service';
|
||||
import { UserService } from '../../../user/user.service';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { FileManagementControllerService, StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { PdfViewerDataService } from '../service/pdf-viewer-data.service';
|
||||
import { download } from '../../../utils/file-download-utils';
|
||||
|
||||
const KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'f', 'F', 'Escape'];
|
||||
|
||||
@ -81,7 +82,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
private readonly _fileDownloadService: PdfViewerDataService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _statusControllerService: StatusControllerService,
|
||||
private readonly ngZone: NgZone
|
||||
private readonly ngZone: NgZone,
|
||||
private readonly _fileManagementControllerService: FileManagementControllerService
|
||||
) {
|
||||
this._activatedRoute.params.subscribe((params) => {
|
||||
this.projectId = params.projectId;
|
||||
@ -617,5 +619,13 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
window.open(`/html-debug/${this.projectId}/${this.fileId}`, '_blank');
|
||||
}
|
||||
|
||||
downloadOriginalFile() {
|
||||
this._fileManagementControllerService
|
||||
.downloadOriginalFile(this.projectId, this.fileId, true, this.fileData.fileStatus.lastUploaded, 'response')
|
||||
.subscribe((data) => {
|
||||
download(data, this.fileData.fileStatus.filename);
|
||||
});
|
||||
}
|
||||
|
||||
// <!-- End Dev Mode Features-->
|
||||
}
|
||||
|
||||
@ -298,6 +298,7 @@
|
||||
"fullscreen": "Full Screen (F)",
|
||||
"new-tab-ssr": "Open Document in Server Side Rendering Mode",
|
||||
"html-debug": "Open Document HTML Debug",
|
||||
"download-original-file": "Download Original File",
|
||||
"exit-fullscreen": "Exit Full Screen (F)"
|
||||
},
|
||||
"annotation-actions": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user