Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Control List item comments #979

Merged
merged 18 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions docs/documentation/docs/controls/ListItemComments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ListItemComments control

This control allows you to manage list item comments, you can add or delete comments to an item. The comments are listed in tile view.
user can scroll to load more comments if they exist (infinite scroll);


Here is an example of the control:

![ListItemComments](../assets/ListItemComments.gif)

![ListItemComments](../assets/ListItemComments01.png)

![ListItemComments](../assets/ListItemComments02.png)

![ListItemComments](../assets/ListItemComments03.png)

![ListItemComments](../assets/ListItemComments04.png)

## How to use this control in your solutions

- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency.
- Import the control into your component:

```TypeScript
import { ListItemComments } from '@pnp/spfx-controls-react/lib/ListItemComments';
```
- Use the `ListItemComments` control in your code as follows:

```TypeScript
<ListItemComments webUrl='{"https://contoso.sharepoint.com/sites/ThePerspective"}'
listId='dfa283f4-5faf-4d54-b6b8-5bcaf2725af5'
itemId={1}
serviceScope={serviceScope}
numberCommentsPerPage={10}
label="ListItem Comments"
/>
```


## Implementation

The `ListItemComments` control can be configured with the following properties:


| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| serviceScope | ServiceScope | yes | SPFx Service Scope |
| itemId | number | yes | List Item Id |
| listId | string | yes | Guid of the list. |
| webUrl | string | no | URL of the site. By default it uses the current site URL. |
| label | string | no | Label for control |
| numberCommentsPerPage | number | no | number of comments per page possible values 5 | 10 | 15 | 20 default 10 |

## MSGraph Permissions required

This control required the flowing scopes:
at least : People.Read

![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/ListItemComments)
Loading