()
| 100 | } |
| 101 | |
| 102 | ngOnInit() { |
| 103 | this.addSubscription( |
| 104 | this.jsonFormsService.$state.subscribe({ |
| 105 | next: (state: JsonFormsState) => { |
| 106 | const props = this.mapToProps(state); |
| 107 | const { |
| 108 | data, |
| 109 | enabled, |
| 110 | errors, |
| 111 | label, |
| 112 | required, |
| 113 | schema, |
| 114 | rootSchema, |
| 115 | visible, |
| 116 | path, |
| 117 | config, |
| 118 | } = props; |
| 119 | this.label = computeLabel( |
| 120 | label, |
| 121 | required, |
| 122 | config ? config.hideRequiredAsterisk : false |
| 123 | ); |
| 124 | this.data = data; |
| 125 | this.error = errors; |
| 126 | this.enabled = enabled; |
| 127 | this.isEnabled() ? this.form.enable() : this.form.disable(); |
| 128 | this.hidden = !visible; |
| 129 | this.scopedSchema = schema; |
| 130 | this.rootSchema = rootSchema; |
| 131 | this.description = props.description ?? ''; |
| 132 | this.id = props.id; |
| 133 | this.form.setValue(data); |
| 134 | this.propsPath = path; |
| 135 | this.mapAdditionalProps(props); |
| 136 | }, |
| 137 | }) |
| 138 | ); |
| 139 | this.triggerValidation(); |
| 140 | } |
| 141 | |
| 142 | validator: ValidatorFn = (_c: AbstractControl): ValidationErrors | null => { |
| 143 | return this.error ? { error: this.error } : null; |
nothing calls this directly
no test coverage detected
searching dependent graphs…