@Mentions
1. Update Contact List
- By default, the contact list is generated using the users in the organization and the document.
- However, if you do not want to use that feature or want to provide a custom list of contacts, you can use this method.
- By default, it will overwrite the current contact list. You can merge the provided contacts with the existing list by passing the merge flag as
{merge:true}
. - This method will only update the contact list in the current user session. It doens’t update the user contacts in the database or change the access control.
2. Callback on Contact Selection
- This event is triggered when a contact is selected from the contact dropdown in the Comment Dialog.
- Use the event object to determine if the selected contact has access to the document using fields like
isOrganizationContact
,isDocumentContact
anddocumentAccessType
. - If the selected contact doesn’t have access to the document, you can show an invite dialog to the user to invite the contact to the document.
The returned data will be in the following schema:
3. Enable @here feature
- This allows you to notify all the users explicitly added to the current document.
- It won’t notify users in the organization who are not explicitly added to the document.
4. Change @here label to custom text
- This allows you to modify the default text of the @here feature. eg: @all, @everyone, @team, etc.
Using Props:
Using API Method:
5. Change @here description
- Customize the description that appears for the @here mention.
Using Props:
Using API Method:
6. Enable user @mentions
Whether user @mentions are enabled.
Default: true
Using props:
Using API Method:
7. Update Contact List Visibility For Organization Users
- Sometimes you may want to show only certain types of contacts in the contact dropdown.
- By default, organization users will see all contacts in the organization, any user groups and any contacts added to the document.
- Using this method, you can restrict the contacts shown in the dropdown to only certain types.
- This only affects the Organization Users and not the Document Users. Document Users will always only see contacts added to the document.
Here are the available options:
all
: Show all the contactsorganization
: Show organization contacts.organizationUserGroup
: Show organization user groups.document
: Show document contacts.
Was this page helpful?