Index

projects/netgrif-components-core/src/lib/allowed-nets/services/factory/allowed-nets-service-factory.ts

addAllowedNets
addAllowedNets(allowedNets, existingAllowedNets)
Parameters :
Name Optional
allowedNets No
existingAllowedNets No
navigationItemTaskAllowedNetsServiceFactory
navigationItemTaskAllowedNetsServiceFactory(factory, baseAllowedNets, navigationItemTaskData)

Convenience method that can be used as an allowed nets factory for views that are loaded from filter process instances. It has a dependency on this class and NAE_NAVIGATION_ITEM_TASK_DATA injection token.

Parameters :
Name Optional
factory No
baseAllowedNets No
navigationItemTaskData No
Returns : AllowedNetsService
tabbedAllowedNetsServiceFactory
tabbedAllowedNetsServiceFactory(factory, tabData)

Convenience method that can be used as an allowed nets factory for tabbed task views. If no allowed nets are provided in the injected data then an AllowedNetsService with no allowed nets is created. It has a dependency on this class and NAE_TAB_DATA injection token.

Parameters :
Name Optional
factory No
tabData No
Returns : AllowedNetsService

projects/netgrif-components-core/src/lib/utility/array-to-observable.ts

arrayToObservable
arrayToObservable(observables)
Parameters :
Name Optional Description
observables No

an array of items

Returns : Observable<T>

an observable that emits each item from the array in order.

projects/netgrif-components-core/src/lib/authentication/authentication.factory.ts

authenticationServiceFactory
authenticationServiceFactory(config, http)
Parameters :
Name Optional
config No
http No

projects/netgrif-components-core/src/commons/angular-cli-devkit-core-strings.ts

camelize
camelize(str)

Returns the lowerCamelCase form of a string.

```javascript

  • camelize('innerHTML'); // 'innerHTML'
  • camelize('action_name'); // 'actionName'
  • camelize('css-class-name'); // 'cssClassName'
  • camelize('my favorite items'); // 'myFavoriteItems'
  • camelize('My Favorite Items'); // 'myFavoriteItems'
  • ```
Parameters :
Name Optional Description
str No

The string to camelize.

Returns : string

the camelized string.

capitalize
capitalize(str)

Returns the Capitalized form of a string

```javascript

  • 'innerHTML'.capitalize() // 'InnerHTML'
  • 'action_name'.capitalize() // 'Action_name'
  • 'css-class-name'.capitalize() // 'Css-class-name'
  • 'my favorite items'.capitalize() // 'My favorite items'
  • ```
Parameters :
Name Optional Description
str No

The string to capitalize.

Returns : string

The capitalized string.

classify
classify(str)

Returns the UpperCamelCase form of a string.

```javascript

  • 'innerHTML'.classify(); // 'InnerHTML'
  • 'action_name'.classify(); // 'ActionName'
  • 'css-class-name'.classify(); // 'CssClassName'
  • 'my favorite items'.classify(); // 'MyFavoriteItems'
  • ```
Parameters :
Name Optional Description
str No

the string to classify

Returns : string

the classified string

dasherize
dasherize(str)

Replaces underscores, spaces, or camelCase with dashes.

```javascript

  • dasherize('innerHTML'); // 'inner-html'
  • dasherize('action_name'); // 'action-name'
  • dasherize('css-class-name'); // 'css-class-name'
  • dasherize('my favorite items'); // 'my-favorite-items'
  • ```
Parameters :
Name Optional Description
str No

The string to dasherize.

Returns : string

the dasherized string.

decamelize
decamelize(str)

Converts a camelized string into all lower case separated by underscores.

```javascript

  • decamelize('innerHTML'); // 'inner_html'
  • decamelize('action_name'); // 'action_name'
  • decamelize('css-class-name'); // 'css-class-name'
  • decamelize('my favorite items'); // 'my favorite items'
  • ```
Parameters :
Name Optional Description
str No

The string to decamelize.

Returns : string

the decamelized string.

levenshtein
levenshtein(a, b)

Calculate the levenshtein distance of two strings. See https://en.wikipedia.org/wiki/Levenshtein_distance. Based off https://gist.github.com/andrei-m/982927 (for using the faster dynamic programming version).

Parameters :
Name Optional Description
a No

String a.

b No

String b.

Returns : number

A number that represents the distance between the two strings. The greater the number the more distant the strings are from each others.

underscore
underscore(str)

More general than decamelize. Returns the lower_case_and_underscored form of a string.

```javascript

  • 'innerHTML'.underscore(); // 'inner_html'
  • 'action_name'.underscore(); // 'action_name'
  • 'css-class-name'.underscore(); // 'css_class_name'
  • 'my favorite items'.underscore(); // 'my_favorite_items'
  • ```
Parameters :
Name Optional Description
str No

The string to underscore.

Returns : string

the underscored string.

projects/netgrif-components-core/src/lib/utility/clear-time-information.ts

clearTimeInformation
clearTimeInformation(date)

Sets milliseconds, seconds, minutes and hours of the provided Moment object to 0

Parameters :
Name Optional Description
date No

object that we want to clear time information from

Returns : void

projects/netgrif-components-core/src/lib/utility/tests/utility/configure-category.ts

configureCategory
configureCategory(category, operatorService, operator, operands)

Configures the provided Category instance with the provided operator and operands.

Parameters :
Name Optional Description
category No

the object that should be configured

operatorService No

must be the same {

operator No

the desired operator class, must be one of the available operators for the provided category

operands No

the desired operands

Returns : void

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-case.ts

createMockCase
createMockCase(stringId: string, processIdentifier: string, title: string, petriNetId: string)

Creates a mock Case instance with the given attributes.

The attributes are filled with mostly empty values, if you want to make a test that uses some of them, we recommend setting them yourself, as the returned object might change between versions.

Parameters :
Name Type Optional
stringId string No
processIdentifier string No
title string No
petriNetId string No
Returns : Case

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-case-outcome.ts

createMockCaseOutcome
createMockCaseOutcome(aCase, net, outcomes)

Creates a mock CaseEventOutcome with given case, net and outcomes attributes.

If attributes are not specified, default values are used.

Parameters :
Name Optional
aCase No
net No
outcomes No

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-datagroup.ts

createMockDataGroup
createMockDataGroup(fields, title?, alignment, layoutType, compact?, hideRows?, stretch, cols: number, parentTaskId?, parentTaskRefId?, nestingLevel?)

Creates a mock DataGroup object instance containing the provided fields and having the provided configuration.

Parameters :
Name Type Optional Description
fields No

the {

title Yes

the optional title of the data group

alignment No

alignment of the fields in non-full rows within the data group (affects flow and legacy layout)

layoutType No

the layout type of the data group

compact Yes

compacting rule for the data group

hideRows Yes

row hiding rule for the data group

stretch No

whether the stretch property of the data group is enabled or not

cols number No

the number of columns of the data group layout

parentTaskId Yes

the ID of the parent task (if the data group is task-reffed)

parentTaskRefId Yes

the ID of the parent task ref (if the data group is task-reffed)

nestingLevel Yes

the nesting level of the data group (if the data group is task-reffed)

Returns : DataGroup

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-field.ts

createMockField
createMockField(visible, layout, counterOrStringId, fieldType, taskRefValue)

Creates a mock boolean or button field, with the specified properties

Parameters :
Name Optional Description
visible No

if true the fields behavior is set to editable, if false the fields behavior is set to hidden

layout No

position of the field in the grid layout

counterOrStringId No

if a string is provided its value will be used as the fields ID. If a number is provided the fields ID will be set to 'f'. If an {

fieldType No

determines what type of field should be generated. Currently only boolean, button and task ref fields are supported. If an unsupported field type is used an error is thrown.

taskRefValue No

determines the value of the task ref field if a task ref field is generated

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-get-data-outcome.ts

createMockGetDataOutcome
createMockGetDataOutcome(data, task, net, aCase, outcomes)
Parameters :
Name Optional
data No
task No
net No
aCase No
outcomes No

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-immediate-data.ts

createMockImmediateData
createMockImmediateData(importId: string, value: any, allowedNets?)

Creates a mock ImmediateData instance with the given attributes.

The attributes are filled with mostly empty values, if you want to make a test that uses some of them, we recommend setting them yourself, as the returned object might change between versions.

Parameters :
Name Type Optional
importId string No
value any No
allowedNets Yes
Returns : ImmediateData

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-net.ts

createMockNet
createMockNet(stringId: string, identifier: string, title: string, roles, transitions, immediateData, permissions)

Creates a mock Net instance with the given attributes.

The attributes are filled with mostly empty values, if you want to make a test that uses some of them, we recommend setting them yourself, as the returned object might change between versions.

Parameters :
Name Type Optional
stringId string No
identifier string No
title string No
roles No
transitions No
immediateData No
permissions No
Returns : Net

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-page.ts

createMockPage
createMockPage(content)
Parameters :
Name Optional Description
content No

the contents of the page

Returns : Page<T>

a mock Page object with the size equivalent to the number of elements provided in the attribute. If the content is empty the content attribute of the returned object is set to an empty object to mimic backend behavior.

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-petri-net-outcome.ts

createMockPetriNetOutcome
createMockPetriNetOutcome(net, outcomes)

Creates a mock PetriNetEventOutcome with given net and outcomes attributes.

If attributes are not specified, default values are used.

Parameters :
Name Optional
net No
outcomes No

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-set-data-outcome.ts

createMockSetDataOutcome
createMockSetDataOutcome(changedFields, task, net, aCase, outcomes)

Creates a mock TaskEventOutcome with given changedFields, task, net, case and outcomes attributes.

If attributes are not specified, default values are used.

Parameters :
Name Optional
changedFields No
task No
net No
aCase No
outcomes No

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-task.ts

createMockTask
createMockTask(stringId: string, title: string, transitionId: string, cols: number)

Creates a mock Task instance with the given attributes.

The attributes are filled with mostly empty values, if you want to make a test that uses some of them, we recommend setting them yourself, as the returned object might change between versions.

Parameters :
Name Type Optional
stringId string No
title string No
transitionId string No
cols number No
Returns : Task

projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-task-outcome.ts

createMockTaskOutcome
createMockTaskOutcome(task, net, aCase, outcomes)

Creates a mock TaskEventOutcome with given task, net, case and outcomes attributes.

If attributes are not specified, default values are used.

Parameters :
Name Optional
task No
net No
aCase No
outcomes No

projects/netgrif-components-core/src/lib/utility/pagination/pagination-sort.ts

createSortParam
createSortParam(attribute, direction)

Creates the configuration string for use with the PAGE_SORT configuration attribute

Parameters :
Name Optional Description
attribute No

the name of the attribute that should be used for sorting the results

direction No

the sorting direction

Returns : string

projects/netgrif-components-core/src/lib/task-content/model/task-event-notification.ts

createTaskEventNotification
createTaskEventNotification(task, event, success: boolean, outcome?)
Parameters :
Name Type Optional Description
task No

affected Task object

event No

the reported Task event

success boolean No

success state of the reported event

outcome Yes

TaskEventOutcome

the notification informing about the event

projects/netgrif-components-core/src/lib/utility/base64.ts

decodeBase64
decodeBase64(encoded)
Parameters :
Name Optional
encoded No
Returns : string
encodeBase64
encodeBase64(text)
Parameters :
Name Optional
text No
Returns : string

projects/netgrif-components-core/src/lib/search/category-factory/default-categories-factories.ts

defaultCaseSearchCategoriesFactory
in 5.6.0 - Use the {
defaultCaseSearchCategoriesFactory(factory)

Creates the default case search categories.

Depends on CategoryFactory.

The created categories cannot be used to generate any predicates, as their inner state is preemptively destroyed to avoid memory leaks caused by uncompleted Subjects. They should only be used to create new Category instances with the help of the duplicate() method.

Parameters :
Name Optional
factory No

an Array containing the default case search categories: {

defaultTaskSearchCategoriesFactory
in 5.6.0 - Use the {
defaultTaskSearchCategoriesFactory(factory)

Creates the default task search categories.

Depends on CategoryFactory.

The created categories cannot be used to generate any predicates, as their inner state is preemptively destroyed to avoid memory leaks caused by uncompleted Subjects. They should only be used to create new Category instances with the help of the duplicate() method.

Parameters :
Name Optional
factory No

an Array containing the default task search categories: {

projects/netgrif-components-core/src/lib/utility/destroy-subscription.ts

destroySubscription
destroySubscription(sub)

Unsubscribes the provided subscription, if it exists and is still opened

Parameters :
Name Optional Description
sub No

the subscription that should be destroyed

Returns : void

projects/netgrif-components-core/src/lib/navigation/utility/navigation-item-task-utility-methods.ts

extractFieldValueFromData
extractFieldValueFromData(dataSection, fieldId)

Extracts field value from data

Parameters :
Name Optional
dataSection No
fieldId No
Returns : T

value of extracted field

extractFilterFieldFromData
extractFilterFieldFromData(dataSection)

Extracts the filter field from the navigation item task data.

Parameters :
Name Optional Description
dataSection No

an array containing the data groups that correspond to a single navigation entry

Returns : FilterField | undefined

The extracted {

extractFilterFromData
extractFilterFromData(dataSection)

Extracts the data and creates a filter object from the navigation item task data.

Parameters :
Name Optional Description
dataSection No

an array containing the data groups that correspond to a single navigation entry

Returns : Filter
extractFilterFromFilterField
extractFilterFromFilterField(filterField)
Parameters :
Name Optional
filterField No
Returns : Filter

a {

extractIconAndTitle
extractIconAndTitle(dataSection, translateService)

Extracts the item name and item icon (if any) rom a section of the navigation item task data.

Parameters :
Name Optional Description
dataSection No

an array containing the data groups that correspond to a single navigation entry

translateService No

is a service to translate label name

extractRoles
extractRoles(dataSection, roleFieldId)

Based on provided parameter extracts allowed or banned roles into an Array of strings from a section of the navigation item task data. Each item has format ROLE_IMPORT_ID:NET_IMPORT_ID

Parameters :
Name Optional Description
dataSection No

an array containing the data groups that correspond to a single navigation entry

roleFieldId No

ID of field containing banned or allowed role IDs

Returns : Array<string>

an Array of string values representing role IDs

extractSearchTypeFromData
extractSearchTypeFromData(dataSection, typeFieldId)

Extracts the selected search type from enumeration field of the navigation item task data.

Parameters :
Name Optional
dataSection No
typeFieldId No
Returns : SearchMode

a {

projects/netgrif-components-core/src/lib/utility/get-field.ts

getField
getField(fields, fieldId)
Parameters :
Name Optional Description
fields No

a collection of data fields

fieldId No

the id of the desired field

a reference to the datafield with the specified id or undefined if such datafield could not be found

getFieldFromDataGroups
getFieldFromDataGroups(groups, fieldId)
Parameters :
Name Optional Description
groups No

a list of searched data groups

fieldId No

the id of the desired field

a reference to the first occurrence of the datafield with the specified id or undefined if such datafield could not be found

getFieldIndex
getFieldIndex(fields, fieldId)
Parameters :
Name Optional Description
fields No

a collection of data fields

fieldId No

the id of the desired field

Returns : number

the index of the datafield with the specified id or -1 if such datafield could not be found

getFieldIndexFromDataGroups
getFieldIndexFromDataGroups(groups, fieldId)
Parameters :
Name Optional Description
groups No

a list of searched data groups

fieldId No

the id of the desired field

Returns : DataGroupFieldIndex | undefined

an object containing the index of the data group and the field within it corresponding to the first occurrence of a datafield with the specified id or undefined if such datafield could not be found

projects/netgrif-components-core/src/lib/utility/get-immediate-data.ts

getImmediateData
getImmediateData(useCase, fieldId)
Parameters :
Name Optional Description
useCase No

the {

fieldId No

the identifier of the field we want to get

Returns : ImmediateData | undefined

the immediate data field if it exists on the case, undefined otherwise

projects/netgrif-components-core/src/lib/authentication/store/authentication.state.ts

getInitial
getInitial()
Returns : AuthState

projects/netgrif-components-core/src/lib/navigation/group-navigation-component-resolver/group-navigation-view-id-segment-factory.ts

groupNavigationViewIdSegmentFactory
groupNavigationViewIdSegmentFactory(activatedRoute)
Parameters :
Name Optional
activatedRoute No
Returns : string

projects/netgrif-components-core/src/lib/utility/pagination/page-has-content.ts

hasContent
hasContent(page)
Parameters :
Name Optional Description
page No

a {

Returns : boolean

returns true if the page is defined and has content with non-zero length. Returns false otherwise.

projects/netgrif-components-core/src/lib/translate/translate-lib.module.ts

HttpLoaderFactory
HttpLoaderFactory(http)
Parameters :
Name Optional
http No

projects/netgrif-components-core/src/lib/utility/pagination/load-all-pages.ts

loadAllPages
loadAllPages(source, filter: any, pagination?)

Loads all pages from the given endpoint and returns their content as one array

Parameters :
Name Type Optional Description
source No

the method that is used to load an individual page, it must support pagination parameters

filter any No

the filter/query object that is used to specify the requested objects. The source argument must accept this filter.

pagination Yes

configuration of the initial pagination. Pages will be loaded from the provided page number onwards, page size will be upheld.

Returns : Observable<Array<T>>

content of all pages from the given page onwards (or from the start if no pagination argument was provided) as a single Array

mapToContent
mapToContent(source, filter: any, pagination)
Parameters :
Name Type Optional
source No
filter any No
pagination No
Returns : Observable<Array<T>>
paginationParams
paginationParams(basePagination, pageNumber?)
Parameters :
Name Optional
basePagination No
pageNumber Yes
Returns : HttpParams

projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-user-autocomplete-value.ts

mockUserAutocompleteValue
mockUserAutocompleteValue(userName, normalUser, userId?)
Parameters :
Name Optional Description
userName No

name of the mock user value

normalUser No

if not the user is the special ME user option

userId Yes

id of the mock user value

Returns : SearchAutocompleteOption<Array<string>>

projects/netgrif-components-core/src/lib/utility/navigation-item-default-headers-factory.ts

navigationItemCaseViewDefaultHeadersFactory
navigationItemCaseViewDefaultHeadersFactory(navigationItemTaskData)
Parameters :
Name Optional
navigationItemTaskData No
Returns : Array | undefined
navigationItemDefaultHeadersFactory
navigationItemDefaultHeadersFactory(navigationItemTaskData, useFieldId, defaultHeadersFieldId)
Parameters :
Name Optional
navigationItemTaskData No
useFieldId No
defaultHeadersFieldId No
Returns : Array | undefined
navigationItemTaskViewDefaultHeadersFactory
navigationItemTaskViewDefaultHeadersFactory(navigationItemTaskData)
Parameters :
Name Optional
navigationItemTaskData No
Returns : Array | undefined

projects/netgrif-components-core/src/lib/utility/navigation-item-task-search-categories-factory.ts

navigationItemTaskCategoryFactory
navigationItemTaskCategoryFactory(categoryResolverService, navigationItemTaskData, defaultCaseSearchCategories, defaultTaskSearchCategories)

Creates search categories based on the metadata stored in the filter case

Parameters :
Name Optional Description
categoryResolverService No
navigationItemTaskData No

task data of a navigation item task, the data must contain a filter field, that is used to generate the categories

defaultCaseSearchCategories No

the default case search categories that should be merged with the categories provided by the filter field, if the filter metadata allow it and the filter is a case filter

defaultTaskSearchCategories No

the default task search categories that should be merged with the categories provided by the filter field, if the filter metadata allow it and the filter is a task filter

projects/netgrif-components-core/src/lib/utility/navigation-item-task-filter-factory.ts

navigationItemTaskFilterFactory
navigationItemTaskFilterFactory(extractionService, navigationItemTaskData, filterData?)

Converts an NAE_NAVIGATION_ITEM_TASK_DATA injection token into NAE_BASE_FILTER

Parameters :
Name Optional Description
extractionService No
navigationItemTaskData No

a navigation item task containing the aggregated data representing a navigation item

filterData Yes
Returns : BaseFilter

projects/netgrif-components-core/src/lib/utility/of-void.ts

ofVoid
ofVoid()

This function is meant to work as a call to rxjs's of function without any arguments

Returns : Observable<void>

a void Observable, that calls next once and then completes

projects/netgrif-components-core/src/lib/forms/models/password.validator.ts

passwordValidator
passwordValidator(control)

Validator to check that passwords are the same

Parameters :
Name Optional
control No
Returns : literal type | null

projects/netgrif-components-core/src/lib/utility/process-message-response.ts

processMessageResponse
processMessageResponse(message)

Transforms a MessageResource object into a stream containing either the message or an error if the message resource contains an error.

Can be used with rxjs' switchMap process responses from backend.

Parameters :
Name Optional Description
message No

a {

Returns : Observable<MessageResource>

projects/netgrif-components-core/src/lib/utility/refresh-tree.ts

refreshTree
refreshTree(tree)

Forces a re-render of the tree backed by the datasource

Parameters :
Name Optional
tree No

projects/netgrif-components-core/src/lib/utility/stop-propagation.ts

stopPropagation
stopPropagation($event)
Parameters :
Name Optional
$event No

projects/netgrif-components-core/src/lib/view/task-view/models/task-view-configuration-injection-token.ts

tabbedTaskViewConfigurationFactory
tabbedTaskViewConfigurationFactory(injectedTabData)

Convenience method that can be used as a task view configuration object factory for tabbed task views.

If the injected tab data contain information that is included in the TaskViewConfiguration interface, this factory will forward this information into the provided object.

Parameters :
Name Optional
injectedTabData No

projects/netgrif-components-core/src/lib/resources/types/nae-date-type.ts

toMoment
toMoment(date)
Parameters :
Name Optional
date No
Returns : Moment

result-matching ""

    No results matching ""