diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts index 77f88d2a4..348992579 100644 --- a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts +++ b/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts @@ -92,11 +92,16 @@ export class WatermarkScreenComponent implements OnInit { const watermark = { ...this.configForm.getRawValue() }; - this._watermarkControllerService.saveWatermark(watermark, this.appStateService.activeRuleSetId).subscribe( + + const observable = watermark.text + ? this._watermarkControllerService.saveWatermark(watermark, this.appStateService.activeRuleSetId) + : this._watermarkControllerService.deleteWatermark(this.appStateService.activeRuleSetId); + + observable.subscribe( () => { this._loadWatermark(); this._notificationService.showToastNotification( - this._translateService.instant('watermark-screen.action.success'), + this._translateService.instant(watermark.text ? 'watermark-screen.action.change-success' : 'watermark-screen.action.delete-success'), null, NotificationType.SUCCESS ); @@ -190,7 +195,7 @@ export class WatermarkScreenComponent implements OnInit { private _initForm() { this.configForm = this._formBuilder.group({ - text: [{ value: null, disabled: !this.permissionsService.isAdmin() }, Validators.required], + text: [{ value: null, disabled: !this.permissionsService.isAdmin() }], hexColor: [{ value: null, disabled: !this.permissionsService.isAdmin() }, Validators.required], opacity: [{ value: null, disabled: !this.permissionsService.isAdmin() }, Validators.required], fontSize: [{ value: null, disabled: !this.permissionsService.isAdmin() }, Validators.required], diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index dda113198..46b3ce3e6 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -704,7 +704,8 @@ "action": { "save": "Save Changes", "revert": "Revert", - "success": "Watermark updated!", + "change-success": "Watermark updated!", + "delete-success": "Watermark deleted.", "error": "Failed to update Watermark" }, "title": "Watermark"