From ec7b4b0dc850736d7031afa5feea44f5d268802b Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 14 Dec 2020 15:51:37 +0200 Subject: [PATCH] API Rework --- .../watermark-screen.component.html | 13 +- .../watermark-screen.component.ts | 107 +++++++---- libs/red-ui-http/src/lib/api.module.ts | 6 +- libs/red-ui-http/src/lib/api/api.ts | 10 +- ...MetaDataConfigurationController.service.ts | 180 ------------------ .../lib/api/watermarkController.service.ts | 171 +++++++++++++++++ libs/red-ui-http/src/lib/model/dictionary.ts | 8 + libs/red-ui-http/src/lib/model/fileStatus.ts | 6 +- libs/red-ui-http/src/lib/model/models.ts | 15 +- .../src/lib/model/redactionLogEntry.ts | 2 + libs/red-ui-http/src/lib/model/reportData.ts | 11 +- .../model/{pdfMetaData.ts => rolesRequest.ts} | 17 +- libs/red-ui-http/src/lib/model/typeValue.ts | 14 +- .../src/lib/model/updateTypeValue.ts | 8 + .../{defaultColor.ts => watermarkModel.ts} | 11 +- 15 files changed, 315 insertions(+), 264 deletions(-) delete mode 100644 libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/watermarkController.service.ts rename libs/red-ui-http/src/lib/model/{pdfMetaData.ts => rolesRequest.ts} (56%) rename libs/red-ui-http/src/lib/model/{defaultColor.ts => watermarkModel.ts} (52%) diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html index 4bd0681fe..489689f81 100644 --- a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html +++ b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html @@ -26,16 +26,21 @@
- +
- +
diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts index 4f68d0f6f..b5b69060b 100644 --- a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts +++ b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts @@ -7,6 +7,21 @@ import { environment } from '../../../../environments/environment'; import { HttpClient } from '@angular/common/http'; import { FormBuilder, FormGroup } from '@angular/forms'; import { debounce } from '../../../utils/debounce'; +import { WatermarkControllerService, WatermarkModel } from '@redaction/red-ui-http'; +import { NotificationService, NotificationType } from '../../../notification/notification.service'; + +export const DEFAULT_WATERMARK: WatermarkModel = { + text: + 'This document was submitted to the European Food Safety Authority by a Syngenta Group company.\n' + + 'It may be subject to rights such as intellectual property and copy rights of the owner and third parties.\n' + + 'Furthermore, this document may fall under a regulatory data protection regime.\n' + + 'Consequently, any publication, distribution, reproduction and/or publishing and any commercial exploitation \n' + + 'and use of this document or its contents without the permission of the owner of this document\n' + + 'may therefore be prohibited and violate the rights of its owner.', + hexColor: '#dd4d50', + opacity: 70, + fontSize: 11 +}; @Component({ selector: 'redaction-watermark-screen', @@ -15,12 +30,8 @@ import { debounce } from '../../../utils/debounce'; }) export class WatermarkScreenComponent implements OnInit { private _instance: WebViewerInstance; - private _initialConfig = { - text: 'Watermark\nWatermark line 2\nWatermark line3', - color: '#000000', - opacity: 50, - fontSize: 40 - }; + + private _watermark: WatermarkModel = {}; @ViewChild('viewer', { static: true }) private _viewer: ElementRef; @@ -28,34 +39,65 @@ export class WatermarkScreenComponent implements OnInit { public viewReady = false; public configForm: FormGroup; + get changed(): boolean { + for (const key of Object.keys(this._watermark)) { + if (this._watermark[key] !== this.configForm.get(key).value) { + return true; + } + } + return false; + } + constructor( public readonly permissionsService: PermissionsService, public readonly appStateService: AppStateService, + private readonly _watermarkControllerService: WatermarkControllerService, + private readonly _notificationService: NotificationService, private readonly _fileDownloadService: FileDownloadService, private readonly _http: HttpClient, private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _formBuilder: FormBuilder ) { - this.configForm = this._formBuilder.group({ - text: [this._initialConfig.text], - color: [this._initialConfig.color], - opacity: [this._initialConfig.opacity], - fontSize: [this._initialConfig.fontSize] - }); + this._initForm(); } ngOnInit(): void { - this._loadViewer(); + this._watermarkControllerService.getWatermark().subscribe( + (watermark) => { + this._watermark = watermark; + this.configForm.setValue(this._watermark); + this._loadViewer(); + }, + () => { + this._watermark = DEFAULT_WATERMARK; + this.configForm.setValue(this._watermark); + this._loadViewer(); + } + ); } - public get changed(): boolean { - for (const key of Object.keys(this._initialConfig)) { - if (this._initialConfig[key] !== this.configForm.get(key).value) { - return true; - } - } + @debounce() + public configChanged() { + this._drawWatermark(); + } - return false; + public save() { + const watermark = { + ...this.configForm.getRawValue() + }; + this._watermarkControllerService.saveWatermark(watermark).subscribe( + () => { + this._notificationService.showToastNotification('Watermark Saved', null, NotificationType.SUCCESS); + }, + () => { + this._notificationService.showToastNotification('Failed to update Watermark', null, NotificationType.ERROR); + } + ); + } + + public revert() { + this.configForm.setValue(this._watermark); + this.configChanged(); } private _loadViewer() { @@ -91,8 +133,8 @@ export class WatermarkScreenComponent implements OnInit { this._instance.docViewer.setWatermark({ custom: (ctx, pageNumber, pageWidth, pageHeight) => { - ctx.fillStyle = this.configForm.get('color').value; - ctx.font = `${fontSize}pt Arial`; + ctx.fillStyle = this.configForm.get('hexColor').value; + ctx.font = `${fontSize}pt Times`; ctx.globalAlpha = this.configForm.get('opacity').value / 100; for (let idx = 0; idx < lines.length; ++idx) { @@ -110,19 +152,12 @@ export class WatermarkScreenComponent implements OnInit { this._instance.docViewer.updateView([0], 0); } - @debounce() - public configChanged() { - this._drawWatermark(); - } - - public save() { - this._initialConfig = { - ...this.configForm.getRawValue() - }; - } - - public revert() { - this.configForm.setValue(this._initialConfig); - this.configChanged(); + private _initForm() { + this.configForm = this._formBuilder.group({ + text: null, + hexColor: null, + opacity: null, + fontSize: null + }); } } diff --git a/libs/red-ui-http/src/lib/api.module.ts b/libs/red-ui-http/src/lib/api.module.ts index 235a6f927..3411fd296 100644 --- a/libs/red-ui-http/src/lib/api.module.ts +++ b/libs/red-ui-http/src/lib/api.module.ts @@ -7,7 +7,6 @@ import { DictionaryControllerService } from './api/dictionaryController.service' import { FileManagementControllerService } from './api/fileManagementController.service'; import { LicenseReportControllerService } from './api/licenseReportController.service'; import { ManualRedactionControllerService } from './api/manualRedactionController.service'; -import { PdfMetaDataConfigurationControllerService } from './api/pdfMetaDataConfigurationController.service'; import { ProjectControllerService } from './api/projectController.service'; import { ReanalysisControllerService } from './api/reanalysisController.service'; import { RedactionLogControllerService } from './api/redactionLogController.service'; @@ -17,6 +16,7 @@ import { UserControllerService } from './api/userController.service'; import { VersionsControllerService } from './api/versionsController.service'; import { ViewedPagesControllerService } from './api/viewedPagesController.service'; import { LegalBasisMappingControllerService } from './api/legalBasisMappingController.service'; +import { WatermarkControllerService } from './api/watermarkController.service'; @NgModule({ imports: [], @@ -28,7 +28,6 @@ import { LegalBasisMappingControllerService } from './api/legalBasisMappingContr FileManagementControllerService, LicenseReportControllerService, ManualRedactionControllerService, - PdfMetaDataConfigurationControllerService, ProjectControllerService, ReanalysisControllerService, RedactionLogControllerService, @@ -37,7 +36,8 @@ import { LegalBasisMappingControllerService } from './api/legalBasisMappingContr StatusControllerService, VersionsControllerService, ViewedPagesControllerService, - LegalBasisMappingControllerService + LegalBasisMappingControllerService, + WatermarkControllerService ] }) export class ApiModule { diff --git a/libs/red-ui-http/src/lib/api/api.ts b/libs/red-ui-http/src/lib/api/api.ts index bf0d17fe4..702c2f624 100644 --- a/libs/red-ui-http/src/lib/api/api.ts +++ b/libs/red-ui-http/src/lib/api/api.ts @@ -6,7 +6,6 @@ import { DictionaryControllerService } from './dictionaryController.service'; import { FileManagementControllerService } from './fileManagementController.service'; import { LicenseReportControllerService } from './licenseReportController.service'; import { ManualRedactionControllerService } from './manualRedactionController.service'; -import { PdfMetaDataConfigurationControllerService } from './pdfMetaDataConfigurationController.service'; import { ProjectControllerService } from './projectController.service'; import { ReanalysisControllerService } from './reanalysisController.service'; import { RedactionLogControllerService } from './redactionLogController.service'; @@ -15,6 +14,7 @@ import { StatusControllerService } from './statusController.service'; import { UserControllerService } from './userController.service'; import { ViewedPagesControllerService } from './viewedPagesController.service'; import { LegalBasisMappingControllerService } from './legalBasisMappingController.service'; +import { WatermarkControllerService } from './watermarkController.service'; export * from './dictionaryController.service'; @@ -24,8 +24,6 @@ export * from './licenseReportController.service'; export * from './manualRedactionController.service'; -export * from './pdfMetaDataConfigurationController.service'; - export * from './projectController.service'; export * from './reanalysisController.service'; @@ -44,13 +42,14 @@ export * from './viewedPagesController.service'; export * from './legalBasisMappingController.service'; +export * from './watermarkController.service'; + export const APIS = [ DebugControllerService, DictionaryControllerService, FileManagementControllerService, LicenseReportControllerService, ManualRedactionControllerService, - PdfMetaDataConfigurationControllerService, ProjectControllerService, ReanalysisControllerService, RedactionLogControllerService, @@ -59,5 +58,6 @@ export const APIS = [ UserControllerService, VersionsControllerService, ViewedPagesControllerService, - LegalBasisMappingControllerService + LegalBasisMappingControllerService, + WatermarkControllerService ]; diff --git a/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts b/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts deleted file mode 100644 index 833f16993..000000000 --- a/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts +++ /dev/null @@ -1,180 +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. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { PdfMetaData } from '../model/pdfMetaData'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class PdfMetaDataConfigurationControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Get the currently configured meta data that will be included in the redacted pdf. - * None - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPdfMetaData(observe?: 'body', reportProgress?: boolean): Observable; - - public getPdfMetaData( - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getPdfMetaData( - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getPdfMetaData(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept( - httpHeaderAccepts - ); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request('get', `${this.basePath}/metaData`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); - } - - /** - * Configured which meta data will be included in the redacted pdf. - * None - * @param body pdfMetaData - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public setPdfMetaData( - body: PdfMetaData, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setPdfMetaData( - body: PdfMetaData, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setPdfMetaData( - body: PdfMetaData, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setPdfMetaData( - body: PdfMetaData, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { - if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setPdfMetaData.' - ); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept( - httpHeaderAccepts - ); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: - | string - | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/metaData`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/watermarkController.service.ts b/libs/red-ui-http/src/lib/api/watermarkController.service.ts new file mode 100644 index 000000000..1a7d4561c --- /dev/null +++ b/libs/red-ui-http/src/lib/api/watermarkController.service.ts @@ -0,0 +1,171 @@ +/** + * 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. + */ /* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { WatermarkModel } from '../model/watermarkModel'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + +@Injectable() +export class WatermarkControllerService { + protected basePath = ''; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (basePath) { + this.basePath = basePath; + } + if (configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + /** + * Remove watermark configuration + * None + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteWatermark(observe?: 'body', reportProgress?: boolean): Observable; + public deleteWatermark(observe?: 'response', reportProgress?: boolean): Observable>; + public deleteWatermark(observe?: 'events', reportProgress?: boolean): Observable>; + public deleteWatermark(observe: any = 'body', reportProgress: boolean = false): Observable { + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = []; + + return this.httpClient.request('delete', `${this.basePath}/watermark`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + + /** + * Get the current watermark configuration + * None + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWatermark(observe?: 'body', reportProgress?: boolean): Observable; + public getWatermark(observe?: 'response', reportProgress?: boolean): Observable>; + public getWatermark(observe?: 'events', reportProgress?: boolean): Observable>; + public getWatermark(observe: any = 'body', reportProgress: boolean = false): Observable { + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json']; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = []; + + return this.httpClient.request('get', `${this.basePath}/watermark`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + + /** + * Save/Update watermark configuration + * None + * @param body watermark + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public saveWatermark(body: WatermarkModel, observe?: 'body', reportProgress?: boolean): Observable; + public saveWatermark(body: WatermarkModel, observe?: 'response', reportProgress?: boolean): Observable>; + public saveWatermark(body: WatermarkModel, observe?: 'events', reportProgress?: boolean): Observable>; + public saveWatermark(body: WatermarkModel, observe: any = 'body', reportProgress: boolean = false): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling saveWatermark.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json']; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request('post', `${this.basePath}/watermark`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } +} diff --git a/libs/red-ui-http/src/lib/model/dictionary.ts b/libs/red-ui-http/src/lib/model/dictionary.ts index 618944b56..85eaf981f 100644 --- a/libs/red-ui-http/src/lib/model/dictionary.ts +++ b/libs/red-ui-http/src/lib/model/dictionary.ts @@ -30,4 +30,12 @@ export interface Dictionary { * True if the type just for hint, not for redaction, default is false. */ hint?: boolean; + /** + * The rank of this dictionary, higher rank means higher importance. + */ + rank?: number; + /** + * True if the type just for recommendations, not for redaction, default is false. + */ + recommendation?: boolean; } diff --git a/libs/red-ui-http/src/lib/model/fileStatus.ts b/libs/red-ui-http/src/lib/model/fileStatus.ts index 0f0709c86..761d906d5 100644 --- a/libs/red-ui-http/src/lib/model/fileStatus.ts +++ b/libs/red-ui-http/src/lib/model/fileStatus.ts @@ -22,6 +22,10 @@ export interface FileStatus { * Shows if all manual changes have been applied by a reanalysis. */ allManualRedactionsApplied?: boolean; + /** + * Shows the date of approval, if approved. + */ + approvalDate?: string; /** * The current reviewer's (if any) user id. */ @@ -63,7 +67,7 @@ export interface FileStatus { */ lastUpdated?: string; /** - * Date and time when the file was last uploaded. + * Shows last date the document was uploaded. */ lastUploaded?: string; /** diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 8dddf2752..4b80e558e 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -1,6 +1,9 @@ export * from './addCommentRequest'; export * from './addRedactionRequest'; +export * from './approveRequest'; export * from './authInfo'; +export * from './bulkDownloadRedactedRequest'; +export * from './cellRectangle'; export * from './colors'; export * from './comment'; export * from './commentResponse'; @@ -9,13 +12,13 @@ export * from './fileIds'; export * from './fileStatus'; export * from './fileUploadResult'; export * from './idRemoval'; +export * from './legalBasisMapping'; export * from './licenseReport'; export * from './licenseReportRequest'; export * from './manualAddResponse'; export * from './manualRedactionEntry'; export * from './manualRedactions'; export * from './modelFile'; -export * from './pdfMetaData'; export * from './point'; export * from './project'; export * from './projectRequest'; @@ -24,7 +27,10 @@ export * from './redactionLog'; export * from './redactionLogEntry'; export * from './removeRedactionRequest'; export * from './reportData'; +export * from './rolesRequest'; export * from './rules'; +export * from './sectionGrid'; +export * from './sectionRectangle'; export * from './typeResponse'; export * from './typeValue'; export * from './updateTypeValue'; @@ -34,9 +40,4 @@ export * from './userResponse'; export * from './versionsResponse'; export * from './viewedPages'; export * from './viewedPagesRequest'; -export * from './approveRequest'; -export * from './bulkDownloadRedactedRequest'; -export * from './sectionGrid'; -export * from './sectionRectangle'; -export * from './legalBasisMapping'; -export * from './cellRectangle'; +export * from './watermarkModel'; diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts index f7e397654..310a51c8d 100644 --- a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts +++ b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts @@ -13,6 +13,7 @@ import { Rectangle } from './rectangle'; export interface RedactionLogEntry { color?: Array; + dictionaryEntry?: boolean; hint?: boolean; id?: string; legalBasis?: string; @@ -21,6 +22,7 @@ export interface RedactionLogEntry { matchedRule?: number; positions?: Array; reason?: string; + recommendation?: boolean; redacted?: boolean; section?: string; sectionNumber?: number; diff --git a/libs/red-ui-http/src/lib/model/reportData.ts b/libs/red-ui-http/src/lib/model/reportData.ts index 73aa61bf0..af9ed5956 100644 --- a/libs/red-ui-http/src/lib/model/reportData.ts +++ b/libs/red-ui-http/src/lib/model/reportData.ts @@ -21,16 +21,7 @@ export interface ReportData { status?: ReportData.StatusEnum; } export namespace ReportData { - export type StatusEnum = - | 'UNPROCESSED' - | 'REPROCESS' - | 'PROCESSING' - | 'ERROR' - | 'DELETED' - | 'UNASSIGNED' - | 'UNDER_REVIEW' - | 'UNDER_APPROVAL' - | 'APPROVED'; + export type StatusEnum = 'UNPROCESSED' | 'REPROCESS' | 'PROCESSING' | 'ERROR' | 'DELETED' | 'UNASSIGNED' | 'UNDER_REVIEW' | 'UNDER_APPROVAL' | 'APPROVED'; export const StatusEnum = { UNPROCESSED: 'UNPROCESSED' as StatusEnum, REPROCESS: 'REPROCESS' as StatusEnum, diff --git a/libs/red-ui-http/src/lib/model/pdfMetaData.ts b/libs/red-ui-http/src/lib/model/rolesRequest.ts similarity index 56% rename from libs/red-ui-http/src/lib/model/pdfMetaData.ts rename to libs/red-ui-http/src/lib/model/rolesRequest.ts index 2d1be2bbd..895132356 100644 --- a/libs/red-ui-http/src/lib/model/pdfMetaData.ts +++ b/libs/red-ui-http/src/lib/model/rolesRequest.ts @@ -10,13 +10,12 @@ * Do not edit the class manually. */ -export interface PdfMetaData { - author?: boolean; - creationDate?: boolean; - creator?: boolean; - keywords?: boolean; - modDate?: boolean; - producer?: boolean; - subject?: boolean; - title?: boolean; +/** + * Object containing information about roles request. + */ +export interface RolesRequest { + /** + * The users' ids to whom the request is applied. + */ + userIds?: Array; } diff --git a/libs/red-ui-http/src/lib/model/typeValue.ts b/libs/red-ui-http/src/lib/model/typeValue.ts index 69e95624e..7692c3268 100644 --- a/libs/red-ui-http/src/lib/model/typeValue.ts +++ b/libs/red-ui-http/src/lib/model/typeValue.ts @@ -27,16 +27,20 @@ export interface TypeValue { * True if the type just for hint, not for redaction, default is false. */ hint?: boolean; + /** + * The rank of this dictionary, higher rank means higher importance. + */ + rank?: number; + /** + * True if the type just for recommendations, not for redaction, default is false. + */ + recommendation?: boolean; /** * The nonnull entry type. */ type?: string; - /** - * Rank of this dictionary - */ - rank?: number; - isDefaultFilter?: boolean; + virtual?: boolean; label?: string; entries?: string[]; diff --git a/libs/red-ui-http/src/lib/model/updateTypeValue.ts b/libs/red-ui-http/src/lib/model/updateTypeValue.ts index 3ac0845a8..f289e6a16 100644 --- a/libs/red-ui-http/src/lib/model/updateTypeValue.ts +++ b/libs/red-ui-http/src/lib/model/updateTypeValue.ts @@ -26,4 +26,12 @@ export interface UpdateTypeValue { * True if the type just for hint, not for redaction, default is false. */ hint?: boolean; + /** + * The rank of this dictionary, higher rank means higher importance. + */ + rank?: number; + /** + * True if the type just for recommendations, not for redaction, default is false. + */ + recommendation?: boolean; } diff --git a/libs/red-ui-http/src/lib/model/defaultColor.ts b/libs/red-ui-http/src/lib/model/watermarkModel.ts similarity index 52% rename from libs/red-ui-http/src/lib/model/defaultColor.ts rename to libs/red-ui-http/src/lib/model/watermarkModel.ts index f09d585fb..224991b67 100644 --- a/libs/red-ui-http/src/lib/model/defaultColor.ts +++ b/libs/red-ui-http/src/lib/model/watermarkModel.ts @@ -1,6 +1,6 @@ /** - * Api Documentation - * Api Documentation + * API Documentation for Redaction Gateway + * Description for redaction * * OpenAPI spec version: 1.0 * @@ -10,6 +10,9 @@ * Do not edit the class manually. */ -export interface DefaultColor { - color?: Array; +export interface WatermarkModel { + fontSize?: number; + hexColor?: string; + opacity?: number; + text?: string; }