Manage the AskiaPortal sharing window.
Because the sharing mechanism is provided by AskiaPortal, the sharing window is standalone and will add/edit/delete the sharing directly without the requirement of an extra code from your side.
In order words, calling this window will all do the sharing job for you.
// Show the sharing option of the `template` named "My Beautiful Template" (with id = 12)
// and managed by the current module
portal.sharing.show({
type : "templace",
id : 12,
name : "My Beautiful Template",
moduleGuid : "current"
}).then(result => {
console.log(result);
});
// Show the sharing option of the AskiaPortal `survey` named "EX" (with id = 1)
portal.sharing.show({
type : "survey",
id : 1,
name : "EX",
moduleGuid : askiaportal
});
Dependencies:
- ./js/portal.channel.js
Methods
(static) show(object) → {Promise}
Display the sharing dialog window from AskiaPortal
// Show the sharing option of the `template` named "My Beautiful Template" (with id = 12)
// and managed by the current module
portal.sharing.show({
type : "templace",
id : 12,
name : "My Beautiful Template",
moduleGuid : "current"
}).then(result => {
console.log(result);
});
// Show the sharing option of the AskiaPortal `survey` named "EX" (with id = 1)
portal.sharing.show({
type : "survey",
id : 1,
name : "EX",
moduleGuid : askiaportal
}).then(result => {
console.log(result);
});
// Show the sharing option of the `entity` named "Entity name" (with id = 1)
// managed by the module with the GUID = "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
portal.sharing.show({
type : "entity",
id : 1,
name : "Entity name",
moduleGuid : "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
}).then(result => {
console.log(result);
});
// Show the sharing option of the `item` named "Item name" (with id = 1)
// managed by the module with the GUID = "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
// and part of the survey id = 12
portal.sharing.show({
type : "item",
id : 1,
name : "Item name",
moduleGuid : "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f",
surveyId : 12
}).then(result => {
console.log(result);
});
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
Object | Object to share. Properties
|
Returns:
- Type
- Promise