From 16e32b51918388ebae9e9570b357a9be491a601a Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 24 May 2022 15:46:10 +0300 Subject: [PATCH] RED-3800 Cleanup of system preferences --- .../system-preferences-form.component.html | 18 ++++++++++++++++-- .../system-preferences-form.component.ts | 13 ++++++++----- .../system-preferences-translations.ts | 2 ++ apps/red-ui/src/assets/config/config.json | 4 ++-- apps/red-ui/src/assets/i18n/en.json | 6 ++++-- .../src/lib/shared/system-preferences.ts | 1 + 6 files changed, 33 insertions(+), 11 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.html b/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.html index 892cb080c..88d9f982b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.html @@ -5,8 +5,22 @@
- - + + + +
diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.ts index 4defe8ca9..ce49e8fd7 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/system-preferences-form/system-preferences-form.component.ts @@ -6,6 +6,8 @@ import { firstValueFrom } from 'rxjs'; import { SystemPreferencesService } from '@services/system-preferences.service'; import { systemPreferencesTranslations } from '@translations/system-preferences-translations'; +export type ValueType = 'number' | 'string' | 'boolean'; + @Component({ selector: 'redaction-system-preferences-form', templateUrl: './system-preferences-form.component.html', @@ -13,10 +15,11 @@ import { systemPreferencesTranslations } from '@translations/system-preferences- }) export class SystemPreferencesFormComponent extends BaseFormComponent { readonly translations = systemPreferencesTranslations; - readonly keys: KeysOf[] = [ - 'softDeleteCleanupTime', - 'downloadCleanupDownloadFilesHours', - 'downloadCleanupNotDownloadFilesHours', + readonly keys: { name: KeysOf; type: ValueType }[] = [ + { name: 'softDeleteCleanupTime', type: 'number' }, + { name: 'downloadCleanupDownloadFilesHours', type: 'number' }, + { name: 'downloadCleanupNotDownloadFilesHours', type: 'number' }, + { name: 'removeDigitalSignaturesOnUpload', type: 'boolean' }, ]; private _initialConfiguration: SystemPreferences; @@ -39,7 +42,7 @@ export class SystemPreferencesFormComponent extends BaseFormComponent { private _getForm(): FormGroup { const controlsConfig = {}; - this.keys.forEach(key => (controlsConfig[key] = [this._systemPreferencesService.values[key], Validators.required])); + this.keys.forEach(key => (controlsConfig[key.name] = [this._systemPreferencesService.values[key.name], Validators.required])); return this._formBuilder.group(controlsConfig); } diff --git a/apps/red-ui/src/app/translations/system-preferences-translations.ts b/apps/red-ui/src/app/translations/system-preferences-translations.ts index d2aaf0f93..d7a8b70c8 100644 --- a/apps/red-ui/src/app/translations/system-preferences-translations.ts +++ b/apps/red-ui/src/app/translations/system-preferences-translations.ts @@ -9,6 +9,7 @@ export const systemPreferencesTranslations: Record<'label' | 'placeholder', Reco downloadCleanupNotDownloadFilesHours: _( 'general-config-screen.system-preferences.labels.download-cleanup-not-download-files-hours', ), + removeDigitalSignaturesOnUpload: _('general-config-screen.system-preferences.labels.remove-digital-signature-on-upload'), }, placeholder: { softDeleteCleanupTime: _('general-config-screen.system-preferences.placeholders.soft-delete-cleanup-time'), @@ -16,5 +17,6 @@ export const systemPreferencesTranslations: Record<'label' | 'placeholder', Reco downloadCleanupNotDownloadFilesHours: _( 'general-config-screen.system-preferences.placeholders.download-cleanup-not-download-files-hours', ), + removeDigitalSignaturesOnUpload: _('general-config-screen.system-preferences.placeholders.remove-digital-signature-on-upload'), }, } as const; diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 322276d2f..f9a12cdad 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,7 +1,7 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1", + "API_URL": "https://dev-05.iqser.cloud/redaction-gateway-v1", "APP_NAME": "RedactManager", "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", @@ -16,7 +16,7 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction", + "OAUTH_URL": "https://dev-05.iqser.cloud/auth/realms/redaction", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview" diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 19137beac..7a3b57e08 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1448,12 +1448,14 @@ "labels": { "download-cleanup-download-files-hours": "Cleanup time for downloaded files (hours)", "download-cleanup-not-download-files-hours": "Cleanup time for not downloaded files (hours)", - "soft-delete-cleanup-time": "Soft delete cleanup time (hours)" + "soft-delete-cleanup-time": "Soft delete cleanup time (hours)", + "remove-digital-signature-on-upload": "Remove Digital Signature on Upload" }, "placeholders": { "download-cleanup-download-files-hours": "(hours)", "download-cleanup-not-download-files-hours": "(hours)", - "soft-delete-cleanup-time": "(hours)" + "soft-delete-cleanup-time": "(hours)", + "remove-digital-signature-on-upload": "True / False" }, "title": "System Preferences" }, diff --git a/libs/red-domain/src/lib/shared/system-preferences.ts b/libs/red-domain/src/lib/shared/system-preferences.ts index a0ff4c902..cea0591ff 100644 --- a/libs/red-domain/src/lib/shared/system-preferences.ts +++ b/libs/red-domain/src/lib/shared/system-preferences.ts @@ -2,4 +2,5 @@ export interface SystemPreferences { softDeleteCleanupTime: number; downloadCleanupDownloadFilesHours: number; downloadCleanupNotDownloadFilesHours: number; + removeDigitalSignaturesOnUpload: boolean; }