From 004025636cc1c6b6b547c29217a92819e47378dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominique=20Eifl=C3=A4nder?= Date: Tue, 24 Sep 2024 10:51:59 +0200 Subject: [PATCH] RED-10011: Show stmp configuration only if license feature configurableSMTPServer is set to true --- .../general-config-screen.component.html | 11 ++++++++--- .../general-config/general-config-screen.component.ts | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html index d7d1b7230..09565c8ee 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html @@ -11,7 +11,12 @@
-
- -
+ + @if (smtpLicenseFeatureEnabled) { +
+ +
+ } @else { + + } diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts index 6d0470579..e12195ba4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts @@ -6,6 +6,8 @@ import { BaseFormComponent, IqserListingModule } from '@iqser/common-ui'; import { SystemPreferencesFormComponent } from './system-preferences-form/system-preferences-form.component'; import { RouterHistoryService } from '@services/router-history.service'; import { TranslateModule } from '@ngx-translate/core'; +import { LicenseService } from '@services/license.service'; +import { ILicenseFeature } from '@red/domain'; @Component({ selector: 'redaction-general-config-screen', @@ -17,11 +19,13 @@ import { TranslateModule } from '@ngx-translate/core'; export class GeneralConfigScreenComponent extends BaseFormComponent implements AfterViewInit { readonly currentUser = inject(UserService).currentUser; readonly routerHistoryService = inject(RouterHistoryService); + readonly licenseService = inject(LicenseService); @ViewChild(GeneralConfigFormComponent) generalConfigFormComponent: GeneralConfigFormComponent; @ViewChild(SystemPreferencesFormComponent) systemPreferencesFormComponent: SystemPreferencesFormComponent; @ViewChild(SmtpFormComponent) smtpFormComponent: SmtpFormComponent; children: BaseFormComponent[]; + smtpLicenseFeatureEnabled: boolean; get changed(): boolean { for (const child of this.children) { @@ -43,6 +47,8 @@ export class GeneralConfigScreenComponent extends BaseFormComponent implements A ngAfterViewInit() { this.children = [this.generalConfigFormComponent, this.systemPreferencesFormComponent, this.smtpFormComponent]; + let licenseFeature: ILicenseFeature = this.licenseService.getFeature('configurableSMTPServer'); + this.smtpLicenseFeatureEnabled = licenseFeature != null && licenseFeature.value === true; } async save(): Promise {