Group provider
Group provider
"Group" or "project" provider has the project
ID and is implemented by the class Bitrix\Socialnetwork\Integration\UI\EntitySelector\ProjectProvider
.
Provider automatically adds to dialog the "Group" tab with the list of groups that include current user. Additionally, provider can complete the "Recent" tab with data (to avoid it being empty), if dialog shows only the "groups" entity or the option fillRecentTab: true
is indicated.
Selecting social network groups
const tagSelector = new TagSelector({ dialogOptions: { context: 'MY_MODULE_CONTEXT', entities: [ { id: 'project', // groups and projects }, ], } }); tagSelector.renderTo(document.getElementById('container'));
Extranet group selection dialog, having the "Tasks" service
const button = document.getElementById('select-project'); const dialog = new Dialog({ targetNode: button, enableSearch: true, context: 'MY_MODULE_CONTEXT', entities: [ { id: 'project', options: { extranet: true, // extranet only features: { tasks: ['view'] // access permissions to group } } }, ], }); button.addEventListener('click', function() { dialog.show(); });
Provider settings
extranet: bool
Select extranet groups only. When set as
false
, selects only intranet groups. Not specified by default.project: bool
Select only groups with "project" mark. Any groups are selected by default.
landing: bool
Select only groups "for publication". Not specified by default.
features: array
Sets list of features for selected groups.
fillRecentTab: bool
When set as
true
, provider completes the "Recent" tab with data.createProjectLink: bool
Show the "Create group" link. By default, value is not indicated, link is displayed when dialog shows only a single entity "groups".
projectId: string | int | string[] | int[]
Group identifier(-s) to be selected (whitelist).
!projectId: string | int | string[] | int[]
Group identifier(-s) to be excluded (blacklist).