diff --git a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.ts b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.ts index 75c2e520b..a0321fd54 100644 --- a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.ts @@ -12,10 +12,7 @@ import { DossierWrapper } from '@state/model/dossier.wrapper'; export class NeedsWorkBadgeComponent { @Input() needsWorkInput: FileStatusWrapper | DossierWrapper; - constructor( - private readonly _appStateService: AppStateService, - private readonly _permissionsService: PermissionsService - ) {} + constructor(private readonly _appStateService: AppStateService, private readonly _permissionsService: PermissionsService) {} get suggestionColor() { return this._getDictionaryColor('suggestion'); @@ -50,10 +47,7 @@ export class NeedsWorkBadgeComponent { } get hasAnnotationComments(): boolean { - return ( - this.needsWorkInput instanceof FileStatusWrapper && - (this.needsWorkInput).hasAnnotationComments - ); + return this.needsWorkInput instanceof FileStatusWrapper && (this.needsWorkInput).hasAnnotationComments; } reanalysisRequired() { @@ -65,11 +59,6 @@ export class NeedsWorkBadgeComponent { } private _getDictionaryColor(type: string) { - let dossierTemplateId = null; - if (this.needsWorkInput instanceof DossierWrapper) { - dossierTemplateId = this.needsWorkInput.dossierTemplateId; - } - - return this._appStateService.getDictionaryColor(type, dossierTemplateId); + return this._appStateService.getDictionaryColor(type); } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 95f10728e..0b28de2a6 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -583,7 +583,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme /* Get the documentElement () to display the page in fullscreen */ private _cleanupAndRedrawManualAnnotations() { - this._fileDownloadService.loadActiveFileRedactionLogPreview().subscribe(redactionLogPreview => { + this._fileDownloadService.loadActiveFileRedactionLog().subscribe(redactionLogPreview => { this.fileData.redactionLog = redactionLogPreview; this._annotationDrawService.drawAnnotations( this._instance, @@ -599,7 +599,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme const currentPageAnnotationIds = currentPageAnnotations.map(a => a.id); this.fileData.fileStatus = await this.appStateService.reloadActiveFile(); - this._fileDownloadService.loadActiveFileRedactionLogPreview().subscribe(redactionLogPreview => { + this._fileDownloadService.loadActiveFileRedactionLog().subscribe(redactionLogPreview => { this.fileData.redactionLog = redactionLogPreview; this.rebuildFilters(); if (this.viewMode === 'STANDARD') { diff --git a/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts b/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts index 64a9e00d5..f07debfe0 100644 --- a/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts @@ -23,8 +23,8 @@ export class PdfViewerDataService { private readonly _viewedPagesControllerService: ViewedPagesControllerService ) {} - loadActiveFileRedactionLogPreview() { - return this._redactionLogControllerService.getRedactionLogPreview( + loadActiveFileRedactionLog() { + return this._redactionLogControllerService.getRedactionLog( this._appStateService.activeDossierId, this._appStateService.activeFileId ); @@ -37,9 +37,7 @@ export class PdfViewerDataService { this._man.getManualRedaction(dossierId, fileId).subscribe(); const file$ = this.downloadOriginalFile(this._appStateService.activeFile); - const reactionLog$ = this._redactionLogControllerService - .getRedactionLogPreview(dossierId, fileId) - .pipe(catchError(() => of({}))); + const reactionLog$ = this._redactionLogControllerService.getRedactionLog(dossierId, fileId).pipe(catchError(() => of({}))); const redactionChangeLog$ = this._redactionLogControllerService .getRedactionChangeLog(dossierId, fileId) .pipe(catchError(() => of({}))); @@ -53,10 +51,7 @@ export class PdfViewerDataService { getViewedPagesForActiveFile() { if (this._permissionsService.canMarkPagesAsViewed()) { return this._viewedPagesControllerService - .getViewedPages( - this._appStateService.activeDossierId, - this._appStateService.activeFileId - ) + .getViewedPages(this._appStateService.activeDossierId, this._appStateService.activeFileId) .pipe(catchError(() => of({ pages: [] }))); } return of({ pages: [] }); 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 3d2ac93f5..d2415c8ac 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -174,7 +174,7 @@ export class AppStateService { dossierTemplateId = this.dossierTemplates[0]?.dossierTemplateId; } if (!dossierTemplateId) { - return undefined; + return '#cccccc'; } const color = this._dictionaryData[dossierTemplateId][type]?.hexColor; return color ?? this._dictionaryData[dossierTemplateId]['default'].hexColor; diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 4b001a0b1..6cfc820ed 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,6 +1,6 @@ { - "OAUTH_URL": "https://red-staging.iqser.cloud/auth/realms/redaction", - "API_URL": "https://red-staging.iqser.cloud/redaction-gateway-v1", + "OAUTH_URL": "https://dev-06.iqser.cloud/auth/realms/redaction", + "API_URL": "https://dev-06.iqser.cloud/redaction-gateway-v1", "OAUTH_CLIENT_ID": "redaction", "BACKEND_APP_VERSION": "4.4.40", "FRONTEND_APP_VERSION": "1.1", diff --git a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts index 501789180..26b7adc72 100644 --- a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts +++ b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts @@ -78,15 +78,11 @@ export class RedactionLogControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLog.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLog.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLog.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getRedactionLog.'); } let headers = this.defaultHeaders; @@ -94,25 +90,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'get', - `${this.basePath}/redactionChnageLog/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/redactionChnageLog/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -130,12 +121,7 @@ export class RedactionLogControllerService { * @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 getRedactionLog( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getRedactionLog(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getRedactionLog( dossierId: string, @@ -151,22 +137,13 @@ export class RedactionLogControllerService { reportProgress?: boolean ): Observable>; - public getRedactionLog( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getRedactionLog(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLog1.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLog1.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLog1.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getRedactionLog1.'); } let headers = this.defaultHeaders; @@ -174,101 +151,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'get', - `${this.basePath}/redactionLog/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - /** - * Gets the redaction log preview - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 getRedactionLogPreview( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public getRedactionLogPreview( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public getRedactionLogPreview( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public getRedactionLogPreview( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLogPreview.' - ); - } - - if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLogPreview.' - ); - } - - 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); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/sectionGrid/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/preview`, + `${this.basePath}/redactionLog/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -286,12 +182,7 @@ export class RedactionLogControllerService { * @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 getSectionGrid( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getSectionGrid(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getSectionGrid( dossierId: string, @@ -307,22 +198,13 @@ export class RedactionLogControllerService { reportProgress?: boolean ): Observable>; - public getSectionGrid( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getSectionGrid(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getSectionGrid.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getSectionGrid.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getSectionGrid.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getSectionGrid.'); } let headers = this.defaultHeaders; @@ -330,25 +212,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'get', - `${this.basePath}/sectionGrid/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/sectionGrid/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers,