|
|
|
@ -127,19 +127,23 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
|
|
|
actionSourceId: [this.action.actionSourceId, Validators.required], |
|
|
|
columnIndex: [{value: this.checkColumnIndex(this.action.columnIndex), disabled: true}, Validators.required], |
|
|
|
name: [this.action.name, [this.validateActionName(), Validators.required]], |
|
|
|
buttonType: [isDefinedAndNotNull(this.action.buttonType) ? this.action.buttonType : WidgetHeaderActionButtonType.icon, []], |
|
|
|
showIcon: [isDefinedAndNotNull(this.action.showIcon) ? this.action.showIcon : true, []], |
|
|
|
buttonType: [{ value: this.action.buttonType ?? WidgetHeaderActionButtonType.icon, disabled: true}, []], |
|
|
|
showIcon: [{ value: this.action.showIcon ?? true, disabled: true}, []], |
|
|
|
icon: [this.action.icon, Validators.required], |
|
|
|
buttonColor: [isDefinedAndNotNull(this.action.buttonColor) ? this.action.buttonColor : 'rgba(0, 0, 0, 0.87)', []], |
|
|
|
buttonFillColor: [isDefinedAndNotNull(this.action.buttonFillColor) ? this.action.buttonFillColor : '#3F52DD', []], |
|
|
|
buttonBorderColor: [isDefinedAndNotNull(this.action.buttonBorderColor) ? this.action.buttonBorderColor : '#3F52DD', []], |
|
|
|
customButtonStyle: [isDefinedAndNotNull(this.action.customButtonStyle) ? this.action.customButtonStyle : null, []], |
|
|
|
buttonColor: [{ value: this.action.buttonColor ?? 'rgba(0, 0, 0, 0.87)', disabled: true}, []], |
|
|
|
buttonFillColor: [{ value: this.action.buttonFillColor ?? '#3F52DD', disabled: true}, []], |
|
|
|
buttonBorderColor: [{ value: this.action.buttonBorderColor ?? '#3F52DD', disabled: true}, []], |
|
|
|
customButtonStyle: [{ value: this.action.customButtonStyle ?? {}, disabled: true}, []], |
|
|
|
useShowWidgetActionFunction: [this.action.useShowWidgetActionFunction], |
|
|
|
showWidgetActionFunction: [this.action.showWidgetActionFunction || 'return true;'], |
|
|
|
widgetAction: [actionDescriptorToAction(toWidgetActionDescriptor(this.action)), Validators.required] |
|
|
|
}); |
|
|
|
this.updateShowWidgetActionForm(); |
|
|
|
this.widgetHeaderButtonValidators(); |
|
|
|
if (this.widgetActionFormGroup.get('actionSourceId').value === 'headerButton') { |
|
|
|
this.widgetActionFormGroup.get('buttonType').enable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonColor').enable({emitEvent: false}); |
|
|
|
this.widgetHeaderButtonValidators(); |
|
|
|
} |
|
|
|
this.widgetActionFormGroup.get('actionSourceId').valueChanges.pipe( |
|
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
|
).subscribe((value) => { |
|
|
|
@ -151,6 +155,17 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
|
|
|
} else { |
|
|
|
this.widgetActionFormGroup.get('columnIndex').disable(); |
|
|
|
} |
|
|
|
if (value === 'headerButton') { |
|
|
|
this.widgetActionFormGroup.get('buttonType').enable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonColor').enable({emitEvent: false}); |
|
|
|
this.widgetHeaderButtonValidators(); |
|
|
|
} else { |
|
|
|
this.widgetActionFormGroup.get('buttonType').disable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('showIcon').disable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonColor').disable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonFillColor').disable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonBorderColor').disable({emitEvent: false}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.widgetActionFormGroup.get('useShowWidgetActionFunction').valueChanges.pipe( |
|
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
|
@ -185,10 +200,12 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
|
|
|
this.widgetActionFormGroup.get('buttonFillColor').enable({emitEvent: false}); |
|
|
|
break; |
|
|
|
case WidgetHeaderActionButtonType.stroked: |
|
|
|
this.widgetActionFormGroup.get('showIcon').enable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonBorderColor').enable({emitEvent: false}); |
|
|
|
break; |
|
|
|
case WidgetHeaderActionButtonType.flat: |
|
|
|
this.widgetActionFormGroup.get('showIcon').enable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonFillColor').enable({emitEvent: false}); |
|
|
|
this.widgetActionFormGroup.get('buttonBorderColor').enable({emitEvent: false}); |
|
|
|
break; |
|
|
|
case WidgetHeaderActionButtonType.miniFab: |
|
|
|
this.widgetActionFormGroup.get('buttonFillColor').enable({emitEvent: false}); |
|
|
|
|