File

src/lib/services/sz-how-ui.service.ts

Description

Provides methods, eventing, and utilities used to display the result of a "How" operation. A "How" report displays all the steps that were taken to resolve multiple input streams to a single entity.

Index

Properties
Methods
Accessors

Constructor

constructor(configDataService: SzConfigDataService, entityDataService: SzEntityDataService, prefs: SzPrefsService)

Sets up the service class and sets the "entityDataService" injected in to it to a static reference so static methods can have access to the injected services.

Parameters :
Name Type Optional
configDataService SzConfigDataService No
entityDataService SzEntityDataService No
prefs SzPrefsService No

Methods

Public clear
clear()

clear out any data previously loaded. call this method when a new entity is loaded

Returns : void
Public collapseAll
collapseAll(idsToExclude?: string | string[], emitEvent?: boolean)

Collapse all nodes and groups currently expanded.

Parameters :
Name Type Optional Description
idsToExclude string | string[] Yes

id's of expanded steps that should not be collapsed.

emitEvent boolean Yes

if set does not emit the "onStepExpansionChange" and "onGroupExpansionChange" events (useful for initialization bulk stet)

Returns : void
Public collapseNode
collapseNode(id: string, itemType?: SzResolutionStepListItemType, debug?: boolean)

Collapse a node found in either "stepNodes" represents a step or "170e0833-0522-406d-bf07-1c50e7" uid string if step group wrapper that isn't an actual resolution step itself. actually "GROUP"'s, this parameter allows you to specify between node's and groups with the same ID's.

Parameters :
Name Type Optional Description
id string No

the id of the node or group. commonly in format of "V00000-S0" if node represents a step or "170e0833-0522-406d-bf07-1c50e7" uid string if step group wrapper that isn't an actual resolution step itself.

itemType SzResolutionStepListItemType Yes

some groups have the same id's as steps inside them(interim merge steps) which are actually "GROUP"'s, this parameter allows you to specify between node's and groups with the same ID's.

debug boolean Yes
Returns : void
Public expandChildNodes
expandChildNodes(groupId, itemType?: SzResolutionStepListItemType, childNodeTypes?: SzResolutionStepListItemType[])

Expand all children of a specific node group. an Interim entity might have the same Id as a step inside of that node. This allows you to specify that you want just the group or the node inside the group.

Parameters :
Name Type Optional Description
groupId No

the id of the node group that the children belong to

itemType SzResolutionStepListItemType Yes

optionally specify the type of node that the group is. For instance, an Interim entity might have the same Id as a step inside of that node. This allows you to specify that you want just the group or the node inside the group.

childNodeTypes SzResolutionStepListItemType[] Yes

optionally only expand children of this type.

Returns : void
expandNode
expandNode(id: string, itemType?: SzResolutionStepListItemType, debug?: boolean)

Expand a node found in "stepNodes" represents a step or "170e0833-0522-406d-bf07-1c50e7" uid string if step group wrapper that isn't an actual resolution step itself. actually "GROUP"'s, this parameter allows you to specify between node's and groups with the same ID's.

Parameters :
Name Type Optional Description
id string No

the id of the node or group. commonly in format of "V00000-S0" if node represents a step or "170e0833-0522-406d-bf07-1c50e7" uid string if step group wrapper that isn't an actual resolution step itself.

itemType SzResolutionStepListItemType Yes

some groups have the same id's as steps inside them(interim merge steps) which are actually "GROUP"'s, this parameter allows you to specify between node's and groups with the same ID's.

debug boolean Yes
Returns : void
Public getHowDataForEntity
getHowDataForEntity(entityId: SzEntityIdentifier)

Query the /entities/${entityId}/how api server endpoint for data on HOW an entity came together.

Parameters :
Name Type Optional
entityId SzEntityIdentifier No
Returns : Observable<SzHowEntityResponse>
Static getHowDataForEntity
getHowDataForEntity(entityId: SzEntityIdentifier)

Query the /entities/${entityId}/how api server endpoint for data on HOW an entity came together.

Parameters :
Name Type Optional
entityId SzEntityIdentifier No
Returns : Observable<SzHowEntityResponse>
Public getParentContainingNode
getParentContainingNode(childNodeId: string, childNodeItemType?: SzResolutionStepListItemType, parentItemType?: SzResolutionStepListItemType, debug?: boolean)

Get the direct ancestor of a child node. It is technically possible that there is more than 1 parent of a child but exceedingly unlikely except in cases that resolved to two separate final entities.

Parameters :
Name Type Optional Description
childNodeId string No

the id of the child

childNodeItemType SzResolutionStepListItemType Yes
parentItemType SzResolutionStepListItemType Yes
debug boolean Yes
Static getResolutionStepCardType
getResolutionStepCardType(step: SzResolutionStep, stepNumber?: number)

Get the type of CARD that should be displayed. Possible results are:

  • ADD when a step added a singleton record to resolution
  • CREATE when a step created a virtual entity
  • INTERIM a virtual entity used to temporily hold the result of previous steps that are then used in subsequent steps.
  • FINAL the final result of a series of other steps used to resolve an entity
  • MERGE when two virtual entities are merged together to form a new virtual entity
Parameters :
Name Type Optional Description
step SzResolutionStep No

the resolution step

stepNumber number Yes
Static getResolutionStepListItemType
getResolutionStepListItemType(item: SzResolutionStep | SzResolutionStepNode)

Used to get the itemType of a node or step. Potential results are:

  • FINAL a card representing a final result of previous steps that resulted in a entity.
  • GROUP used for nodes that have child nodes and/or groups. groups can expand and collapse child nodes.
  • STACK a special type of GROUP that displays a series of contiguous steps that can be collapsed and expanded only 1 level deep. Used to collapse multiple steps of the same type in to a meta group to declutter repetative steps.
  • STEP an individual card that has no child items.
Parameters :
Name Type Optional
item SzResolutionStep | SzResolutionStepNode No
Public getRootNodeContainingNode
getRootNodeContainingNode(childNodeId: string, debug?: boolean)

Get the Root level node group that contains a specific child step. So say if you have a add record step that is a child of an interim step that is a child of a merge step, that is a child of a final result card you can get the "FINAL" card from the child id of the record step.

Parameters :
Name Type Optional Description
childNodeId string No

the id of the child

debug boolean Yes
Public getStepNodeById
getStepNodeById(id: string, debug?: boolean)

Get an array of StepNodes that match a specific id.

Parameters :
Name Type Optional Description
id string No

The id of the node or group to return

debug boolean Yes

an array of SzResolutionStepNode that have the matching id

Public isGroupExpanded
isGroupExpanded(groupId: string)

is a specific group expanded

Parameters :
Name Type Optional
groupId string No
Returns : boolean
Public isStepExpanded
isStepExpanded(virtualEntityId: string)

is a specific step card expanded

Parameters :
Name Type Optional
virtualEntityId string No
Returns : boolean
Public isStepMemberOfStack
isStepMemberOfStack(vId: string, gId?: string, debug?: boolean)

is a step a child member of a group that is of itemType STACK.

Parameters :
Name Type Optional
vId string No
gId string Yes
debug boolean Yes
Returns : boolean
Public isStepPinned
isStepPinned(vId: string, gId?: string)

is a step that was a member of a stack group(or could be) pinned in place.

Parameters :
Name Type Optional
vId string No
gId string Yes
Returns : boolean
Public pinStep
pinStep(vId: string, gId: string)

Step nodes that are children of nodes with a itemType of STACK can be "pinned" in place. When a step in a stack is pinned in place we remove that node from the stack and place it in the stack's parent at the appropriate index. if there are steps after the step being pinned we remove those items too and place them in a new stack and place the new stack directly after or before the item being pinned.

Parameters :
Name Type Optional Description
vId string No

the id of the step to pin

gId string No

the id of the stack that contains the item to be pinned.

Public selectStep
selectStep(vId: string)

Expand a specific node and all parent nodes of node that need to be expanded in order for the node to be visible. Collapse all other nodes that are not the node or a direct decendent.

Parameters :
Name Type Optional
vId string No
Returns : void
Static setVirtualEntityIdsForNode
setVirtualEntityIdsForNode(isNested: boolean, step: SzResolutionStepNode)

Set the virtualEntityIds property of a node/step to an array of virtualEntityId's or resolvedEntityId's or Id's and recordId's for steps or nodes that are descendents of a step node. This is a recursive Tree traversal method and should not be used trivially. root level nodes.

Parameters :
Name Type Optional Description
isNested boolean No

is the step being passed as the step parameter a child of another card. pass false or undefined for root level nodes.

step SzResolutionStepNode No

the step to query for descendent steps/children

Returns : {}
Public stepCanBeUnPinned
stepCanBeUnPinned(vId: string, debug?: boolean)

Checks to see whether or not a specific step can become a child of a sibling stack or create one, and that the resulting stack would have at least 2 items it in.

Parameters :
Name Type Optional Description
vId string No

the id of the step to check

debug boolean Yes
Returns : boolean
Public toggleExpansion
toggleExpansion(id: string, groupId?: string, itemType?: SzResolutionStepListItemType, debug?: boolean)

Alternate the expanded state of a Step or Group Node. looking for a node with a type of "STEP" who's id matches the id parameter. Pass "undefined" with a groupId if you specifically want to toggle a group node.

Parameters :
Name Type Optional Description
id string No

Id of the step to expand/collapse. If groupId is not set and id is we assume that we are looking for a node with a type of "STEP" who's id matches the id parameter. Pass "undefined" with a groupId if you specifically want to toggle a group node.

groupId string Yes

Id of the group to toggle expansion on. Pass id as undefined to toggle a node with type STACK,GROUP, or FINAL.

itemType SzResolutionStepListItemType Yes

optionally specify the item type you want to toggle.

debug boolean Yes
Returns : void
Public unPinStep
unPinStep(vId: string, debug?: boolean)

Step nodes that are children of nodes with a itemType of STACK can be "pinned" in place. When a step in a stack is unpinned we check to see if we can add the item being unpinned to any stack groups either before or after the item being unpinned. If none exist we create them, if additional step items are before or after and those items are also not pinned we merge all the steps together in order to their new target STACK.

Parameters :
Name Type Optional Description
vId string No

the id of the step to pin

debug boolean Yes
Returns : void

Properties

Public configDataService
Type : SzConfigDataService
Public entityDataService
Type : SzEntityDataService
Public onGroupExpansionChange
Default value : this._onGroupExpansionChange.asObservable()

when a group is expanded or collapsed this observeable emits the id of the group that was changed

Public onStepExpansionChange
Default value : this._onStepExpansionChange.asObservable()

when a group is expanded or collapsed this observeable emits the id of the group that was changed

Public prefs
Type : SzPrefsService

Accessors

expandedGroups
getexpandedGroups()

An array of all the groups currently expanded. Groups include "Interim Entities" than can have children, Stacks of multiple "Add Record" Operations and "Final Entity" nodes

expandedNodes
getexpandedNodes()

An array of all step cards currently expanded. Cards can all be collapsed and are often children of Group nodes.

isNavExpanded
getisNavExpanded()

is the navigation rail expanded

Returns : boolean
setisNavExpanded(value: boolean)

is the navigation rail expanded

Parameters :
Name Type Optional
value boolean No
Returns : void
orderedFeatures
getorderedFeatures()

this is the features ordered by what is returned from the config request

Returns : [] | undefined
stepGroupStacks
getstepGroupStacks()

get just the nodes found in "stepNodeGroups" that are of type "STACK"

stepNodeGroups
setstepNodeGroups(value: Map<string | SzResolutionStepNode>)

set the step node groups present in an initial "how" presentation.

Parameters :
Name Type Optional
value Map<string | SzResolutionStepNode> No
Returns : void
stepNodes
getstepNodes()

get the step nodes present in the current "how" presentation. This input should be in the form of a fully nested array. The array should start at the top level with "Final Cards" and each final card should have "children" nodes, and each of those children nodes can have children etc.

setstepNodes(value: Array<SzResolutionStepNode>)

set the step nodes present in an initial "how" presentation. This input should be in the form of a fully nested array. The array should start at the top level with "Final Cards" and each final card should have "children" nodes, and each of those children nodes can have children etc.

Parameters :
Name Type Optional
value Array<SzResolutionStepNode> No
Returns : void

results matching ""

    No results matching ""