Skip to content

Commit 19d25c6

Browse files
committed
PR comments resolved
1 parent e4cd62d commit 19d25c6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div *ngIf="bVisible$">
88
<component-mapper
99
name="RichTextEditor"
10-
[props]="configProps$"
10+
[props]="{ placeholder, required: bRequired$, disabled: bDisabled$, label: label$, readonly: false, error, info, testId, value: value$ }"
1111
[parent]="this"
1212
[outputEvents]="{ onBlur: fieldOnBlur, onChange: fieldOnChange }"
1313
></component-mapper>
@@ -17,6 +17,6 @@
1717

1818
<ng-template #noEdit>
1919
<div *ngIf="bVisible$ !== false">
20-
<component-mapper name="RichTextEditor" [props]="configProps$" [parent]="this"></component-mapper>
20+
<component-mapper name="RichTextEditor" [props]="{ label: label$, value: value$, readonly: true, testId }" [parent]="this"></component-mapper>
2121
</div>
2222
</ng-template>

packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ export class RichTextComponent extends FieldBase {
2626
* Updates the component when there are changes in the state.
2727
*/
2828
override updateSelf(): void {
29-
//Resolve config properties
29+
// Resolve config properties
3030
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as RichTextProps;
3131

32-
//Update component common properties
32+
// Update component common properties
3333
this.updateComponentCommonProperties(this.configProps$);
3434

35-
//Extract and normalize the value property
35+
// Extract and normalize the value property
3636
const { value, helperText } = this.configProps$;
3737
this.value$ = value;
3838

@@ -44,13 +44,14 @@ export class RichTextComponent extends FieldBase {
4444

4545
fieldOnChange(editorValue: any) {
4646
const oldVal = this.value$ ?? '';
47-
const newVal = editorValue?.editor?.getBody()?.innerHTML ?? editorValue ?? '';
47+
const newVal = editorValue?.editor?.getBody()?.innerHTML ?? '';
4848

4949
const isValueChanged = newVal.toString() !== oldVal.toString();
5050

5151
if (isValueChanged || this.status === 'error') {
52+
const property = this.propName;
5253
this.pConn$.clearErrorMessages({
53-
property: this.propName,
54+
property,
5455
category: '',
5556
context: ''
5657
});

0 commit comments

Comments
 (0)