diff --git a/README.md b/README.md index 28ce2da2a..49fa5d365 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ To re-generate http rune swagger YOu need swagger-codegen installed `brew install swagger-codegen` ``` -BASE=https://red-staging.iqser.cloud/ +BASE=https://dev-06.iqser.cloud/ URL="$BASE"redaction-gateway-v1/v2/api-docs?group=redaction-gateway-v1 rm -Rf /tmp/swagger mkdir -p /tmp/swagger diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 268c5efa5..d27d555d9 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -8,6 +8,7 @@ export class AnnotationWrapper { | 'remove-only-here' | 'change-legal-basis' | 'suggestion-change-legal-basis' + | 'suggestion-recategorize-image' | 'suggestion-add-dictionary' | 'suggestion-force-redaction' | 'suggestion-remove-dictionary' @@ -137,7 +138,11 @@ export class AnnotationWrapper { } get isSuggestion() { - return this.isSuggestionAdd || this.isSuggestionRemove || this.isSuggestionChangeLegalBasis; + return this.isSuggestionAdd || this.isSuggestionRemove || this.isSuggestionChangeLegalBasis || this.isSuggestionRecategorizeImage; + } + + get isSuggestionRecategorizeImage() { + return this.superType === 'suggestion-recategorize-image'; } get isSuggestionChangeLegalBasis() { @@ -229,6 +234,11 @@ export class AnnotationWrapper { return; } + if (redactionLogEntryWrapper.status === 'DECLINED') { + annotationWrapper.superType = 'declined-suggestion'; + return; + } + if (redactionLogEntryWrapper.manualRedactionType === 'FORCE_REDACT') { annotationWrapper.force = true; @@ -251,9 +261,10 @@ export class AnnotationWrapper { return; } - if (redactionLogEntryWrapper.status === 'DECLINED') { - annotationWrapper.superType = 'declined-suggestion'; - return; + if (redactionLogEntryWrapper.manualRedactionType === 'RECATEGORIZE') { + if (redactionLogEntryWrapper.status === 'REQUESTED') { + annotationWrapper.superType = 'suggestion-recategorize-image'; + } } if (annotationWrapper.dictionary?.toLowerCase() === 'false_positive') { diff --git a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts index a9592e82e..2ddc9d003 100644 --- a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts @@ -8,7 +8,7 @@ export interface RedactionLogEntryWrapper { legalBasis?: string; legalBasisMapping?: Array; manual?: boolean; - manualRedactionType?: 'ADD' | 'REMOVE' | 'UNDO' | 'LEGAL_BASIS_CHANGE' | 'FORCE_REDACT'; + manualRedactionType?: 'ADD' | 'REMOVE' | 'UNDO' | 'LEGAL_BASIS_CHANGE' | 'FORCE_REDACT' | 'RECATEGORIZE'; matchedRule?: number; positions?: Array; reason?: string; diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 4956972b8..f8117c4ea 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -521,6 +521,14 @@ export class AppStateService { null, true ); + dictionaryData['suggestion-recategorize-image'] = new TypeValueWrapper( + { + hexColor: colors.requestAdd, + type: 'suggestion-recategorize-image' + }, + null, + true + ); dictionaryData['suggestion-add-dictionary'] = new TypeValueWrapper( { hexColor: colors.dictionaryRequestColor, diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 2f6041703..d6747a580 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -242,6 +242,7 @@ "suggestion-add": "Suggested redaction", "suggestion-add-dictionary": "Suggested dictionary add", "suggestion-change-legal-basis": "Suggested change legal basis", + "suggestion-recategorize-image": "Suggested recategorize image", "suggestion-force-redaction": "Suggestion force redaction", "suggestion-remove": "Suggested redaction removal", "suggestion-remove-dictionary": "Suggested dictionary removal" diff --git a/libs/red-ui-http/src/lib/api.module.ts b/libs/red-ui-http/src/lib/api.module.ts index 167564021..58c8de3fb 100644 --- a/libs/red-ui-http/src/lib/api.module.ts +++ b/libs/red-ui-http/src/lib/api.module.ts @@ -28,6 +28,7 @@ import { UserPreferenceControllerService } from './api/userPreferenceController. import { VersionsControllerService } from './api/versionsController.service'; import { ViewedPagesControllerService } from './api/viewedPagesController.service'; import { WatermarkControllerService } from './api/watermarkController.service'; +import { SearchControllerService } from './api/searchController.service'; @NgModule({ imports: [], @@ -59,7 +60,8 @@ import { WatermarkControllerService } from './api/watermarkController.service'; UserPreferenceControllerService, VersionsControllerService, ViewedPagesControllerService, - WatermarkControllerService + WatermarkControllerService, + SearchControllerService ] }) 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 f693a3c29..c633876c4 100644 --- a/libs/red-ui-http/src/lib/api/api.ts +++ b/libs/red-ui-http/src/lib/api/api.ts @@ -25,6 +25,7 @@ import { ReportTemplateControllerService } from './reportTemplateController.serv import { UploadControllerService } from './uploadController.service'; import { GeneralSettingsControllerService } from './generalSettingsController.service'; import { DossierAttributesControllerService } from './dossierAttributesController.service'; +import { SearchControllerService } from './searchController.service'; export * from './auditController.service'; @@ -80,6 +81,8 @@ export * from './generalSettingsController.service'; export * from './dossierAttributesController.service'; +export * from './searchController.service'; + export const APIS = [ AuditControllerService, DebugControllerService, @@ -107,5 +110,6 @@ export const APIS = [ ReportTemplateControllerService, UploadControllerService, GeneralSettingsControllerService, - DossierAttributesControllerService + DossierAttributesControllerService, + SearchControllerService ]; diff --git a/libs/red-ui-http/src/lib/api/searchController.service.ts b/libs/red-ui-http/src/lib/api/searchController.service.ts new file mode 100644 index 000000000..be3e16fdb --- /dev/null +++ b/libs/red-ui-http/src/lib/api/searchController.service.ts @@ -0,0 +1,90 @@ +/** + * 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 { SearchRequest } from '../model/searchRequest'; +import { SearchResult } from '../model/searchResult'; + +import { BASE_PATH } from '../variables'; +import { Configuration } from '../configuration'; + +@Injectable() +export class SearchControllerService { + 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; + } + } + + /** + * Search for contents of documents + * None + * @param body searchRequest + * @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 search(body: SearchRequest, observe?: 'body', reportProgress?: boolean): Observable; + public search(body: SearchRequest, observe?: 'response', reportProgress?: boolean): Observable>; + public search(body: SearchRequest, observe?: 'events', reportProgress?: boolean): Observable>; + public search(body: SearchRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling search.'); + } + + 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}/search`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } +} diff --git a/libs/red-ui-http/src/lib/model/imageRecategorizationRequest.ts b/libs/red-ui-http/src/lib/model/imageRecategorizationRequest.ts index 64c71ca5d..11931772e 100644 --- a/libs/red-ui-http/src/lib/model/imageRecategorizationRequest.ts +++ b/libs/red-ui-http/src/lib/model/imageRecategorizationRequest.ts @@ -13,7 +13,5 @@ export interface ImageRecategorizationRequest { annotationId?: string; comment?: string; - legalBasis?: string; - redacted?: boolean; type?: string; } diff --git a/libs/red-ui-http/src/lib/model/matchedDocument.ts b/libs/red-ui-http/src/lib/model/matchedDocument.ts new file mode 100644 index 000000000..097231ac7 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/matchedDocument.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ +import { MatchedSection } from './matchedSection'; + +export interface MatchedDocument { + containsAllMatchedSections?: boolean; + dossierId?: string; + fileId?: string; + highlights?: { [key: string]: Array }; + matchedSections?: Array; + matchedTerms?: Array; + score?: number; + unmatchedTerms?: Array; +} diff --git a/libs/red-ui-http/src/lib/model/matchedSection.ts b/libs/red-ui-http/src/lib/model/matchedSection.ts new file mode 100644 index 000000000..0a6caaca3 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/matchedSection.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ + +export interface MatchedSection { + headline?: string; + matchedTerms?: Array; + pages?: Array; + sectionNumber?: number; +} diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 234aa0a5c..84c0c04f4 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -76,3 +76,5 @@ export * from './watermarkModelReq'; export * from './watermarkModelRes'; export * from './legalBasisChangeRequest'; export * from './manualLegalBasisChange'; +export * from './searchRequest'; +export * from './searchResult'; diff --git a/libs/red-ui-http/src/lib/model/searchRequest.ts b/libs/red-ui-http/src/lib/model/searchRequest.ts new file mode 100644 index 000000000..9391dd6ad --- /dev/null +++ b/libs/red-ui-http/src/lib/model/searchRequest.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +export interface SearchRequest { + dossierId?: string; + fileId?: string; + from?: number; + queryString?: string; + returnSections?: boolean; + size?: number; +} diff --git a/libs/red-ui-http/src/lib/model/searchResult.ts b/libs/red-ui-http/src/lib/model/searchResult.ts new file mode 100644 index 000000000..8a63fc012 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/searchResult.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ +import { MatchedDocument } from './matchedDocument'; + +export interface SearchResult { + matchedDocuments?: Array; + maxScore?: number; + total?: number; +} diff --git a/libs/red-ui-http/src/lib/model/typeValue.ts b/libs/red-ui-http/src/lib/model/typeValue.ts index d92d7db52..c46a17a52 100644 --- a/libs/red-ui-http/src/lib/model/typeValue.ts +++ b/libs/red-ui-http/src/lib/model/typeValue.ts @@ -50,4 +50,8 @@ export interface TypeValue { * The nonnull entry type. */ type?: string; + /** + * The label of this type + */ + label?: string; } diff --git a/libs/red-ui-http/src/lib/model/updateTypeValue.ts b/libs/red-ui-http/src/lib/model/updateTypeValue.ts index 4543aad5d..358251343 100644 --- a/libs/red-ui-http/src/lib/model/updateTypeValue.ts +++ b/libs/red-ui-http/src/lib/model/updateTypeValue.ts @@ -42,4 +42,8 @@ export interface UpdateTypeValue { * True if the type just for recommendations, not for redaction, default is false. */ recommendation?: boolean; + /** + * The label of this type + */ + label?: string; } diff --git a/package.json b/package.json index 9cd3c3949..878b9d817 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redaction", - "version": "2.126.0", + "version": "2.129.0", "private": true, "license": "MIT", "scripts": { diff --git a/paligo-theme.tar.gz b/paligo-theme.tar.gz index 1c781918c..253338b6d 100644 Binary files a/paligo-theme.tar.gz and b/paligo-theme.tar.gz differ