Merge branch 'RED-10011' into 'master'

RED-10011: Show stmp configuration only if license feature configurableSMTPServer is set to true

Closes RED-10011

See merge request redactmanager/red-ui!584
This commit is contained in:
Dan Percic 2024-09-24 10:56:34 +02:00
commit dc063218ff
2 changed files with 14 additions and 3 deletions

View File

@ -11,7 +11,12 @@
<div class="dialog mt-24 mb-0">
<redaction-system-preferences-form></redaction-system-preferences-form>
</div>
<div class="dialog mt-24">
<redaction-smtp-form></redaction-smtp-form>
</div>
@if (smtpLicenseFeatureEnabled) {
<div class="dialog mt-24">
<redaction-smtp-form></redaction-smtp-form>
</div>
} @else {
<div style="visibility: hidden" class="dialog mt-24"></div>
}
</div>

View File

@ -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<void> {