SUPPORT-8576 fixed file upload error
This commit is contained in:
parent
2d8ea9dce9
commit
f8d280665e
1 changed files with 7 additions and 1 deletions
|
|
@ -4,7 +4,8 @@ import {
|
|||
Visible,
|
||||
Event,
|
||||
MessagesService,
|
||||
UnsupportedOperationError
|
||||
UnsupportedOperationError,
|
||||
AppConfigService
|
||||
} from "@webbpm/base-package";
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef} from "@angular/core";
|
||||
import {FileItem, FileUploader} from "ng2-file-upload";
|
||||
|
|
@ -18,6 +19,8 @@ import {EmployeeInfoFileFormType} from "./EmployeeInfoFileFormType";
|
|||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ErvuFileUpload extends InputControl {
|
||||
private static readonly BACKEND_URL: string = "backend.context";
|
||||
|
||||
@NotNull("true")
|
||||
public selectFileFieldText: string;
|
||||
@NotNull("true")
|
||||
|
|
@ -55,6 +58,7 @@ export class ErvuFileUpload extends InputControl {
|
|||
private url: string = '/backend/employee/document';
|
||||
private messagesService: MessagesService;
|
||||
private isUploadErrorOccurred = false;
|
||||
private appConfigService: AppConfigService;
|
||||
|
||||
constructor(el: ElementRef, cd: ChangeDetectorRef) {
|
||||
super(el, cd);
|
||||
|
|
@ -64,6 +68,8 @@ export class ErvuFileUpload extends InputControl {
|
|||
initialize() {
|
||||
super.initialize();
|
||||
this.messagesService = this.injector.get(MessagesService);
|
||||
this.appConfigService = this.injector.get(AppConfigService);
|
||||
this.url = `/${this.appConfigService.getParamValue(ErvuFileUpload.BACKEND_URL)}/employee/document`;
|
||||
|
||||
this.uploader.setOptions({
|
||||
url: this.url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue