Allow watermark removal
This commit is contained in:
parent
78a5117f8b
commit
34587f29b1
@ -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],
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user