Fix #478 - Rename 'onValueChange' to 'onAnyLogic'

- update default to `onDependencyChange`
This commit is contained in:
Jack Anderson 2024-09-18 08:07:44 +01:00 committed by y.yerli
parent 1ebf1390cd
commit 3adb99624d
9 changed files with 18 additions and 6 deletions

View file

@ -174,7 +174,7 @@ export class BaseFieldComponent implements FieldComponentInterface, OnInit, OnDe
return;
}
this.logic.runLogic(attribute, this.mode as ViewMode, this.record, 'onValueChange');
this.logic.runLogic(attribute, this.mode as ViewMode, this.record, 'onDependencyChange');
});
}));

View file

@ -160,7 +160,7 @@ export class DisplayTypeBackendAction extends FieldLogicActionHandler {
}
getTriggeringStatus(): string[] {
return ['onValueChange', 'onFieldInitialize'];
return ['onAnyLogic', 'onFieldInitialize'];
}
}

View file

@ -232,6 +232,6 @@ export class FieldLogicDisplayTypeAction extends FieldLogicActionHandler {
}
getTriggeringStatus() : string[] {
return ['onValueChange', 'onFieldInitialize'];
return ['onAnyLogic', 'onFieldInitialize'];
}
}

View file

@ -46,6 +46,6 @@ export abstract class FieldLogicActionHandler extends ActionHandler<FieldLogicAc
};
getTriggeringStatus() : string[] {
return ['onValueChange'];
return ['onDependencyChange'];
}
}

View file

@ -177,7 +177,7 @@ export class FieldLogicManager extends BaseActionManager<FieldLogicActionData> {
}
const actions = [];
const defaultTriggeringStatus = ['onValueChange'];
const defaultTriggeringStatus = ['onDependencyChange'];
availableActions[mode].forEach(action => {

View file

@ -91,6 +91,6 @@ export class RequiredAction extends FieldLogicActionHandler {
}
getTriggeringStatus(): string[] {
return ['onValueChange', 'onFieldInitialize'];
return ['onAnyLogic', 'onFieldInitialize'];
}
}

View file

@ -73,4 +73,8 @@ export class UpdateFlexRelateModuleAction extends FieldLogicActionHandler {
// re-validate the parent form-control after value update
record.formGroup.updateValueAndValidity({onlySelf: true, emitEvent: true});
}
getTriggeringStatus(): string[] {
return ['onDependencyChange'];
}
}

View file

@ -123,6 +123,10 @@ export class UpdateValueBackendAction extends FieldLogicActionHandler {
}
}
getTriggeringStatus(): string[] {
return ['onDependencyChange'];
}
getBaseRecord(record: Record): Record {
if (!record) {
return null;

View file

@ -90,6 +90,10 @@ export class UpdateValueAction extends FieldLogicActionHandler {
}
getTriggeringStatus(): string[] {
return ['onDependencyChange'];
}
/**
* Update the new value
* @param {object} field