Pull request #99: RED-966: Allow watermark removal

Merge in RED/ui from RED-966 to master

* commit '34587f29b114ef8ed2d76ec31a8f144cfa7cce2e':
  Allow watermark removal
This commit is contained in:
Timo Bejan 2021-01-18 19:39:03 +01:00
commit 41e55c341b
2 changed files with 10 additions and 4 deletions

View File

@ -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],

View File

@ -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"