diff --git a/README.md b/README.md index 8a6bf638e..05b015d3d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ To regnerate http rune swaagger ``` -BASE=https://timo-redaction-dev.iqser.cloud/ +BASE=https://redapi-staging.iqser.cloud/ URL="$BASE"v2/api-docs?group=redaction-gateway-v1 mkdir -p /tmp/swagger swagger-codegen generate -i "$URL" -l typescript-angular -o /tmp/swagger diff --git a/apps/red-ui/src/app/app-config/app-config.service.ts b/apps/red-ui/src/app/app-config/app-config.service.ts index db28a6231..63206700c 100644 --- a/apps/red-ui/src/app/app-config/app-config.service.ts +++ b/apps/red-ui/src/app/app-config/app-config.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { tap } from 'rxjs/operators'; import { Observable } from 'rxjs'; +import { Title } from '@angular/platform-browser'; export enum AppConfigKey { OAUTH_URL = 'OAUTH_URL', @@ -10,7 +11,8 @@ export enum AppConfigKey { ADMIN_CONTACT_NAME = 'ADMIN_CONTACT_NAME', ADMIN_CONTACT_URL = 'ADMIN_CONTACT_URL', AUTO_READ_TIME = 'AUTO_READ_TIME', - MAX_FILE_SIZE_MB = 'MAX_FILE_SIZE_MB' + MAX_FILE_SIZE_MB = 'MAX_FILE_SIZE_MB', + APP_NAME = 'APP_NAME' } @Injectable({ @@ -19,18 +21,19 @@ export enum AppConfigKey { export class AppConfigService { private _config: { [key in AppConfigKey]?: any } = {}; - constructor(private readonly _httpClient: HttpClient) {} + constructor(private readonly _httpClient: HttpClient, private readonly _titleService: Title) {} loadAppConfig(): Observable { return this._httpClient.get('/assets/config/config.json').pipe( tap((config) => { console.log('[REDACTION] Started with config: ', config); this._config = config; + this._titleService.setTitle(this.getConfig(AppConfigKey.APP_NAME, 'DDA-R')); }) ); } - getConfig(key: AppConfigKey, defaultValue?: any) { + getConfig(key: AppConfigKey | string, defaultValue?: any) { return this._config[key] ? this._config[key] : defaultValue; } } diff --git a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html b/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html index 08e86e1a9..a5becd460 100644 --- a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html +++ b/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html @@ -16,4 +16,7 @@
+
+
+
diff --git a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts b/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts index 1e85cfc61..cd99a5d68 100644 --- a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts +++ b/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts @@ -7,6 +7,7 @@ import { StatusOverlayService } from '../../../upload-download/status-overlay.se import { FileDownloadService } from '../../../upload-download/file-download.service'; import { SingleFileDownloadService } from '../../../screens/file/service/single-file-download.service'; import { saveAs } from 'file-saver'; +import { UserPreferenceService } from '../../../common/service/user-preference.service'; export type MenuState = 'OPEN' | 'CLOSED'; @@ -28,6 +29,7 @@ export class FileDownloadBtnComponent { private readonly _permissionsService: PermissionsService, private readonly _fileDownloadService: FileDownloadService, private readonly _singleFileDownloadService: SingleFileDownloadService, + private readonly _userPreferencesService: UserPreferenceService, private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _statusOverlayService: StatusOverlayService, private readonly _fileManagementControllerService: FileManagementControllerService @@ -83,4 +85,14 @@ export class FileDownloadBtnComponent { this._singleFileDownloadService.loadFile('REDACTED', this.file).subscribe((data) => saveAs(data, (this.file).filename)); } } + + get canDownloadFlatRedactedFile() { + return this._userPreferencesService.areDevFeaturesEnabled && !Array.isArray(this.file); + } + + downloadFlatRedactedFiles($event: MouseEvent) { + this._singleFileDownloadService + .loadFile('FLAT_REDACTED', this.file) + .subscribe((data) => saveAs(data, (this.file).filename)); + } } diff --git a/apps/red-ui/src/app/screens/base-screen/base-screen.component.html b/apps/red-ui/src/app/screens/base-screen/base-screen.component.html index 3833b550c..2e51b9a86 100644 --- a/apps/red-ui/src/app/screens/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/screens/base-screen/base-screen.component.html @@ -64,7 +64,7 @@ -
+
{{ titleService.getTitle() }}