HubInitiative
Hub Initiative Class
Implements
- IWithStoreBehavior
- IWithSharingBehavior
- IWithThumbnailBehavior
- IWithFeaturedImageBehavior
- IWithPermissionBehavior
- IWithDiscussionsBehavior
- IWithFollowersBehavior
- IWithStoreBehavior
- IWithCatalogBehavior
- IWithMetricsBehavior
- IWithSharingBehavior
- IWithCardBehavior
- IWithEditorBehavior
Extends
Constructors
Constructor Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
entity Required | IHubInitiative | ||
context Required | IArcGISContext |
Properties
Property | Type | Notes |
---|---|---|
Protected Inherited | IArcGISContext | |
Protected Inherited | IHubInitiative | |
Protected Inherited | false | |
Protected Inherited | null |
Accessors
Accessor | Type | Notes |
---|---|---|
Catalog |
Catalog instance for this Initiative. Note: Do not hold direct references to this object; always access it from the Initiative. |
|
Inherited | boolean |
Can the current user delete the Entity? In order to delete an item, the user must be the owner of the item or a full org_admin in the owner's organization. |
Inherited | boolean |
Can the current user edit the Entity? In order to edit an item, the user must be the owner of the item or be a member of a shared editing group, to which the item is shared. |
Inherited | string |
Return the entity id |
Inherited | string |
The orgId of the Entity, if available |
Inherited | string |
Return the entity owner |
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<HubInitiative> |
Create a new HubInitiative, returning a HubInitiative instance. Note: This does not persist the Initiative into the backing store |
|
Promise<HubInitiative> |
Fetch an Initiative from the backing store and return a HubInitiative instance. |
|
HubInitiative |
Create an instance from an IHubInitiative object |
|
IHubCardViewModel |
Convert the initiative entity into a card view model that can be consumed by the suite of hub gallery components |
|
Promise<void> |
Delete the HubInitiative from the store set a flag to indicate that it is destroyed |
|
Promise<IHubInitiative> |
Load the initiative from the editor object |
|
Promise<IEditorConfig> | |
|
Promise<IResolvedMetric> |
Resolve a single metric for this metric |
|
Promise<void> |
Save the HubInitiative to the backing store. Currently Initiatives are stored as Items in Portal |
|
Promise<IHubInitiativeEditor> |
Return the initiative as an editor object |
|
void |
Apply a new state to the instance |
|
void |
Add a policy to the entity |
|
Promise<void> |
Hook that subclasses should call to invoke shared post-save behavior |
|
IPermissionAccessResponse |
Check if current user has a specific permission, accounting for both system and entity level policies |
|
Promise<void> |
Remove the featured image from the item |
|
void |
Clear the thumbnail from the item, if one exists. Persisted on next |
|
Promise<IGroup> |
Returns the followers group |
|
IEntityPermissionPolicy[] |
Get all policies related to a specific permission |
|
string |
Return the full url to the thumbnail, optionally with a width parameter |
|
void |
Remove a policy from the entity |
|
Promise<void> |
Set the access level of the backing item |
|
Promise<void> |
Set a featured image on the Entity, if one already exists it is cleared out before the new one is set to keep the number of resources in control |
|
Promise<void> |
Sets the access level of the followers group |
|
Promise<void> |
Sets whether or not the followers group is discussable |
|
void |
Store thumbnail information to be sent with the next |
|
Promise<void> |
Share the Entity with the specified group id |
|
Promise<void> |
Share the Entity with the specified group ids |
|
Promise<IGroup[]> |
Return a list of groups the Entity is shared to. |
|
IHubInitiative |
Return the backing entity as an object literal |
|
Promise<void> |
Unshare the Entity with the specified group id |
|
Promise<void> |
Unshare the Entity with the specified group ids |
|
void |
Updates the isDiscussable property |
create
StaticParameters
Parameter | Type | Default | Notes |
---|---|---|---|
partialInitiative Required | Partial<IHubInitiative> | ||
context Required | IArcGISContext | ||
save Optional | boolean | false |
Returns
fetch
StaticFetch an Initiative from the backing store and return a HubInitiative instance.
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
identifier Required | string |
slug or item id |
|
context Required | IArcGISContext |
Returns
fromJson
StaticCreate an instance from an IHubInitiative object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
json Required | Partial<IHubInitiative> |
JSON object to create a HubInitiative from |
|
context Required | IArcGISContext |
ArcGIS context |
Returns
convertToCardModel
Convert the initiative entity into a card view model that can be consumed by the suite of hub gallery components
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
opts Optional | IConvertToCardModelOpts |
view model options |
Returns
delete
Delete the HubInitiative from the store set a flag to indicate that it is destroyed
Returns
fromEditor
Load the initiative from the editor object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editor Required | IHubInitiativeEditor |
Returns
getEditorConfig
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
i18nScope Required | string | ||
type Required | InitiativeEditorType |
Returns
save
Save the HubInitiative to the backing store. Currently Initiatives are stored as Items in Portal
Returns
toEditor
Return the initiative as an editor object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editorContext Optional | IEntityEditorContext | {} | |
include Optional | string[] | [] |
Returns
update
Apply a new state to the instance
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
changes Required | Partial<IHubInitiative> |
Returns
addPermissionPolicy
Add a policy to the entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
policy Required | IEntityPermissionPolicy |
Returns
afterSave
Hook that subclasses should call to invoke shared post-save behavior
Returns
checkPermission
Check if current user has a specific permission, accounting for both system and entity level policies
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission |
Returns
clearThumbnail
Clear the thumbnail from the item, if one exists. Persisted on next .save()
call
Returns
getPermissionPolicies
Get all policies related to a specific permission
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission |
Returns
getThumbnailUrl
Return the full url to the thumbnail, optionally with a width parameter
Parameters
Returns
removePermissionPolicy
Remove a policy from the entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission | ||
id Required | string |
Returns
setAccess
Set the access level of the backing item
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
access Required | SettableAccessLevel |
Returns
setFeaturedImage
Set a featured image on the Entity, if one already exists it is cleared out before the new one is set to keep the number of resources in control
Parameters
Returns
setFollowersGroupAccess
Sets the access level of the followers group
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
access Required | SettableAccessLevel |
Returns
setFollowersGroupIsDiscussable
Sets whether or not the followers group is discussable
Parameters
Returns
setThumbnail
Store thumbnail information to be sent with the next .save()
call
Parameters
Returns
updateIsDiscussable
Updates the isDiscussable property
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
isDiscussable Required | boolean |
whether to enable or disable discussions |
Returns
Class defined in common/src/initiatives/HubInitiative.ts:53
Create a new HubInitiative, returning a HubInitiative instance. Note: This does not persist the Initiative into the backing store