move file upload result to red-domain

This commit is contained in:
Dan Percic 2021-10-29 13:17:27 +03:00
parent c27fc9f823
commit f12bb20b39
5 changed files with 23 additions and 33 deletions

View File

@ -6,7 +6,7 @@ import { interval, Subscription } from 'rxjs';
import { ConfigService } from '@services/config.service';
import { TranslateService } from '@ngx-translate/core';
import { UploadDownloadDialogService } from './upload-download-dialog.service';
import { FileUploadResult } from '@redaction/red-ui-http';
import { IFileUploadResult } from '@red/domain';
import { isCsv } from '@utils/file-drop-utils';
import { ErrorMessageService, GenericService, HeadersConfiguration, RequiredParam, Validate } from '@iqser/common-ui';
import { DossiersService } from '@services/entity-services/dossiers.service';
@ -17,7 +17,7 @@ export interface ActiveUpload {
}
@Injectable()
export class FileUploadService extends GenericService<FileUploadResult> {
export class FileUploadService extends GenericService<IFileUploadResult> {
static readonly MAX_PARALLEL_UPLOADS = 5;
files: FileUploadModel[] = [];
groupedFiles: { [key: string]: FileUploadModel[] } = {};
@ -130,7 +130,7 @@ export class FileUploadService extends GenericService<FileUploadResult> {
const headers = HeadersConfiguration.getHeaders({ contentType: false }).append('ngsw-bypass', 'true');
return this._http.post<FileUploadResult>(`/${this._defaultModelPath}/${dossierId}`, formParams, {
return this._http.post<IFileUploadResult>(`/${this._defaultModelPath}/${dossierId}`, formParams, {
headers,
observe: 'events',
reportProgress: true,

View File

@ -0,0 +1,19 @@
/**
* Object containing information about a successfully uploaded file.
*/
import { List } from '@iqser/common-ui';
export interface IFileUploadResult {
/**
* List of fileIds generated for uploaded file(s).
*/
fileIds?: List;
/**
* List processed file attributes, in case the upload contained a CSV.
*/
processedAttributes?: List;
/**
* List processed fileIds, in case the upload contained a CSV.
*/
processedFileIds?: List;
}

View File

@ -1,3 +1,4 @@
export * from './file';
export * from './file.model';
export * from './types';
export * from './file-upload-result';

View File

@ -1,29 +0,0 @@
/**
* API Documentation for Redaction Gateway
* Description for redaction
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
* Object containing information about a successfully uploaded file.
*/
export interface FileUploadResult {
/**
* List of fileIds generated for uploaded file(s).
*/
fileIds?: Array<string>;
/**
* List processed file attributes, in case the upload contained a CSV.
*/
processedAttributes?: Array<string>;
/**
* List processed fileIds, in case the upload contained a CSV.
*/
processedFileIds?: Array<string>;
}

View File

@ -7,7 +7,6 @@ export * from './digitalSignatureViewModel';
export * from './downloadResponse';
export * from './downloadStatus';
export * from './downloadStatusResponse';
export * from './fileUploadResult';
export * from './generalConfigurationModel';
export * from './idRemoval';
export * from './imageRecategorizationRequest';