[ADF-5580] emit commentAdded event from adf-comments component (#10966)

* [ADF-5580] emit commentAdded event from adf-comments component

* [ADF-5580] Emit commentAdded event from adf-comments and expose it in adf-node-comments

* [ADF-5580] Emit commentAdded event from NodeCommentsComponent, add unit test, and update docs

* [ADF-5580] Add unit test for commentAdded output in NodeCommentsComponent, update docs and create testing utils

* [ADF-5580] Mark debugElement as readOnly

* [ADF-5580] Add mock services and fix unit test setup

* [ADF-5580] Reuse shared comment mocks across multiple test files

* [ADF-5580] Align comments component documentation

* [ADF-5580] Remove redundant setup and use ContentTestingModule in comment components tests
This commit is contained in:
Shivangi Shree
2025-07-01 13:54:07 +05:30
committed by GitHub
parent 5d043e6987
commit 6dafcb4447
7 changed files with 126 additions and 15 deletions

View File

@@ -15,7 +15,8 @@ Displays comments from users involved in a specified content and allows an invol
```html
<adf-node-comments
[nodeId]="YOUR_NODE_ID"
[readOnly]="YOUR_READ_ONLY_FLAG">
[readOnly]="YOUR_READ_ONLY_FLAG"
(commentAdded)="onCommentAdded($event)">
</adf-node-comments>
```
@@ -23,7 +24,13 @@ Displays comments from users involved in a specified content and allows an invol
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| nodeId | `string` | | nodeId of the document that has comments |
| readOnly | `boolean` | | make the [comments component](../../core/components/comments.component.md) readOnly |
| Name | Type | Default value | Description |
| -------- | --------- | ------------- | ----------------------------------------------------------------------------------- |
| nodeId | `string` | | nodeId of the document that has comments |
| readOnly | `boolean` | | make the [comments component](../../core/components/comments.component.md) readOnly |
### Events
| Name | Type | Description |
| ------------ | ------------------------------------------------------------------------ | ------------------------------------------------- |
| commentAdded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)<CommentModel> | Emitted when a new comment is successfully added. |