[ACS-3256] Add trigger / "when" section to rule details & edit rule dialog (#2603)

* Add triggers section with checkboxes

* Add some unit tests

* Changed Input property of rule details so that it takes a changeable value rather than just an initial value

* Made separate component with control value accessor for triggers

* Linting

* Change trigger values to lowercase to be in sync with the API

* Minor styling changes and add new rule button to manage rules screen

* Add option for unknown field to be selected

* Add read only to nested composite and simple conditions

* Added unknown field tests for simple condition

* Linting

* Change how the triggers component displays when disabled
This commit is contained in:
Thomas Hunter
2022-08-23 09:54:08 +01:00
committed by GitHub
parent 19b88458ef
commit 9cd616ff8c
25 changed files with 531 additions and 77 deletions

View File

@@ -57,6 +57,15 @@ export class RuleCompositeConditionUiComponent implements ControlValueAccessor,
simpleConditions: new FormArray([])
});
private _readOnly = false;
@Input()
get readOnly(): boolean {
return this._readOnly;
}
set readOnly(isReadOnly: boolean) {
this.setDisabledState(isReadOnly);
}
private formSubscription = this.form.valueChanges.subscribe((value) => {
this.onChange(value);
this.onTouch();
@@ -81,11 +90,6 @@ export class RuleCompositeConditionUiComponent implements ControlValueAccessor,
return this.conditionFormControls.length === 0;
}
private _readOnly = false;
get readOnly(): boolean {
return this._readOnly;
}
onChange: (condition: RuleCompositeCondition) => void = () => undefined;
onTouch: () => void = () => undefined;