Index

src/app/utils/style-utils.ts

addAlphaToHexColor
addAlphaToHexColor(color: unknown, opacity: unknown)
Parameters :
Name Type Optional
color unknown No
opacity unknown No

src/app/features/change-history/change-history-normalize.ts

additions
additions(snapshot: Record)

every (non-hidden) field of a snapshot rendered as an addition

Parameters :
Name Type Optional
snapshot Record No
Returns : FieldChange[]
applyDelta
applyDelta(state: Record, delta)

apply a jsondiffpatch delta to a deep clone of the current state

Parameters :
Name Type Optional
state Record No
delta No
Returns : Record<string, unknown>
buildChangeEvents
buildChangeEvents(rawDocs)

Build the displayable change history for one entity from its raw audit docs.

A jsondiffpatch update-delta only encodes what changed (e.g. items added to an array by index), not the full prior value — so per-field before/after cannot be read from a single delta. Instead the full document state is replayed: starting from the create/baseline snapshot and applying each update delta in chronological order, the before/after of every field (including multi-value arrays) is the difference between consecutive full states.

Parameters :
Name Optional
rawDocs No
Returns : ChangeEvent[]

events newest-first

byChronology
byChronology(a: RawAuditDoc, b: RawAuditDoc)

chronological: by server timestamp, then by revision generation

Parameters :
Name Type Optional
a RawAuditDoc No
b RawAuditDoc No
Returns : number
fieldChanges
fieldChanges(prev: Record, next: Record)

the (non-hidden) fields whose full value differs between two states

Parameters :
Name Type Optional
prev Record No
next Record No
Returns : FieldChange[]
isHidden
isHidden(field: string)
Parameters :
Name Type Optional
field string No
Returns : boolean
revGeneration
revGeneration(rev?: string)
Parameters :
Name Type Optional
rev string Yes
Returns : number
snapshotOf
snapshotOf(doc: RawAuditDoc)

the full document snapshot carried by a baseline (raw doc) or create ([doc]) record

Parameters :
Name Type Optional
doc RawAuditDoc No
Returns : Record<string, unknown>

src/app/core/entity/database-field.decorator.ts

addPropertySchema
addPropertySchema(target: unknown, propertyName: string, propertySchema: EntitySchemaField)
Parameters :
Name Type Optional
target unknown No
propertyName string No
propertySchema EntitySchemaField No
DatabaseField
DatabaseField(propertySchema: EntitySchemaField)

Decorator (Annotation @DatabaseField()) to mark a property of an Entity that should be persisted in the database.

also see

Parameters :
Name Type Optional Default value Description
propertySchema EntitySchemaField No {}

(optional) SchemaField definition that configures additional options regarding this field

getEntitySchema
getEntitySchema(ctor: unknown)

Returns the schema map of this entity (not the superclass). Creates and assigns a new one if it doesn't exist yet.

Parameters :
Name Type Optional
ctor unknown No
Returns : EntitySchema

src/app/utils/utils.ts

addToGroup
addToGroup(allGroups: unknown, currentValue: unknown, currentElement: unknown)
Parameters :
Name Type Optional
allGroups unknown No
currentValue unknown No
currentElement unknown No
calculateAge
calculateAge(dateOfBirth: Date)
Parameters :
Name Type Optional
dateOfBirth Date No
Returns : number
compareEnums
compareEnums(a: ConfigurableEnumValue, b: ConfigurableEnumValue)
Parameters :
Name Type Optional
a ConfigurableEnumValue No
b ConfigurableEnumValue No
Returns : boolean
dateToString
dateToString(value: Date)
Parameters :
Name Type Optional
value Date No
equals
equals(a: unknown, b: unknown)

Comparing two values for equality that might be different than just object equality

Parameters :
Name Type Optional
a unknown No
b unknown No
Returns : boolean
getParentUrl
getParentUrl(router: Router)
Parameters :
Name Type Optional
router Router No
Returns : string
getUrlWithoutParams
getUrlWithoutParams(router: Router)
Parameters :
Name Type Optional
router Router No
Returns : string
groupBy
groupBy<T, P extends keyof T, E>(array, propertyToGroupBy: P)
Type parameters :
  • T
  • P extends keyof T
  • E

Group an array by the given property.

Parameters :
Name Type Optional Description
array No

A simple array to be grouped.

propertyToGroupBy P No

The key of the property in the elements by whose value the result is grouped. If this is an array, grouped by individual elements.

Returns : unknown[]

an array where the first entry is the value of this group and the second all entries that have this value.

isValidDate
isValidDate(date: any)
Parameters :
Name Type Optional
date any No
Returns : boolean
readFile
readFile(file: Blob)
Parameters :
Name Type Optional
file Blob No
Returns : Promise<string>
readFileAsArrayBuffer
readFileAsArrayBuffer(file: Blob)

Read the contents of a Blob into an ArrayBuffer. Use this for binary formats (e.g. xlsx) where reading as text would corrupt the payload.

Parameters :
Name Type Optional
file Blob No
Returns : Promise<ArrayBuffer>
serviceProvider
serviceProvider<T>(service, factory)
Type parameters :
  • T

This is a simple shorthand function to create factories for services. The use case is, when multiple services extend the same class and one of these services will be provided.

Parameters :
Name Optional Description
service No

the token for which a service is provided

factory No

factory which returns a subtype of class

Returns : FactoryProvider
sortByAttribute
sortByAttribute<OBJECT>(attribute, order)
Type parameters :
  • OBJECT
Parameters :
Name Optional Default value
attribute No
order No "asc"
Returns : number

src/app/features/skill/link-external-profile/link-external-profile-dialog/link-external-profile-dialog.component.ts

addTooltip
addTooltip(profile: ExternalProfile)
Parameters :
Name Type Optional
profile ExternalProfile No

src/app/core/config/config-migrations.ts

applyConfigMigrations
applyConfigMigrations<E>(doc: E)
Type parameters :
  • E

Apply all config migrations to a plain JSON document. Returns the migrated document as a plain object (no Angular entity re-hydration). Used by the admin CLI; ConfigService wraps this and also applies defaultConfigs (addDefaultNoteDetailsConfig, addDefaultTodoViews) before calling this, so the migrations above can see those default-added view configs too.

Parameters :
Name Type Optional
doc E No
Returns : E
buildEntityBasePaths
buildEntityBasePaths(data: Record)
Parameters :
Name Type Optional
data Record No
Returns : Set<string>
migrateNavMenuItem
migrateNavMenuItem(item: any, data: Record)
Parameters :
Name Type Optional
item any No
data Record No
Returns : any
migrateNavMenuItems
migrateNavMenuItems(items, data: Record)
Parameters :
Name Type Optional
items No
data Record No
Returns : any[]
migrateShortcutItem
migrateShortcutItem(item: any, entityBasePaths: Set)
Parameters :
Name Type Optional
item any No
entityBasePaths Set No
Returns : any
rewriteNavMenuLinks
rewriteNavMenuLinks(items, oldLink: string, newLink: string)
Parameters :
Name Type Optional
items No
oldLink string No
newLink string No
Returns : any[]

src/bootstrap-environment.ts

applyOnlineOnlyPreference
applyOnlineOnlyPreference()

If the user previously opted into online-only mode, override session_type early so that database instances are created with the correct type from the start.

This MUST run before Angular bootstraps, because DatabaseFactoryService reads environment.session_type the first time a database is lazily accessed (during Angular DI startup, before LoginComponent even exists). If we waited until LoginComponent ran, the wrong DB class would already have been instantiated.

The flow is:

  1. User toggles checkbox on login page → LoginComponent writes localStorage
  2. Keycloak login triggers a full page reload (redirectUri: location.href)
  3. On reload, this function runs and applies the preference to environment
  4. Angular DI starts → correct DB class (RemotePouchDatabase) is created

See also: LoginComponent.applyOnlineOnlyMode() and ONLINE_ONLY_KEY.

applyPublicFormSession
applyPublicFormSession()

Force online-only mode when bootstrapping a public-form route, so the database factory creates a RemotePouchDatabase from the first lazy access rather than a SyncedPouchDatabase that would never be initialized.

initConfigJsonToEnvironment
initConfigJsonToEnvironment()

Load basic config values from assets/keycloak.json into environment

initEnvironmentConfig
initEnvironmentConfig()

Overwrite environment settings with the settings from the config.json if present. If no file is found, the environment settings are kept.

initFirebaseConfigToEnvironment
initFirebaseConfigToEnvironment()

Load Push Notifications config for Firebase. Please add assets/firebase-config.json with your own Firebase config

initKeycloakConfigToEnvironment
initKeycloakConfigToEnvironment()

Load Keycloak server URL from assets/keycloak.json into environment

isPublicFormRoute
isPublicFormRoute()
Returns : boolean

src/app/core/common-components/entities-table/entities-table-selection.ts

applyRangeSelection
applyRangeSelection<T extends Entity>(selectedRecords, rows, range, shouldCheck: boolean)
Type parameters :
  • T extends Entity

Applies a contiguous shift-selection update over a row index range.

Parameters :
Name Type Optional
selectedRecords No
rows No
range No
shouldCheck boolean No
Returns : T[]
isCheckboxTarget
isCheckboxTarget(target)

Detects whether the click originated from a checkbox input.

Parameters :
Name Optional
target No
Returns : boolean
isClickableTarget
isClickableTarget(target)

Detects whether the click target is inside an element marked as .clickable.

Parameters :
Name Optional
target No
Returns : boolean
shouldSkipRowInteraction
shouldSkipRowInteraction<T extends Entity>(target, row: TableRow)
Type parameters :
  • T extends Entity

Determines whether row-click handling should be skipped for this interaction.

Parameters :
Name Type Optional
target No
row TableRow No
Returns : boolean
toggleRecordSelection
toggleRecordSelection<T extends Entity>(selectedRecords, record: T, checked: boolean)
Type parameters :
  • T extends Entity

Adds or removes a single record from the selected records collection.

Parameters :
Name Type Optional
selectedRecords No
record T No
checked boolean No
Returns : T[]
updateSelectionFromMouseDown
updateSelectionFromMouseDown<T extends Entity>(input: MouseSelectionInput)
Type parameters :
  • T extends Entity

Computes the next selection state for a row mousedown, including shift-range behavior.

Parameters :
Name Type Optional
input MouseSelectionInput No

src/app/core/common-components/entities-table/entities-table-sort.store.ts

applySortingRules
applySortingRules(columns, getDatatypeOrDefault)

Applies sorting rules to columns: disables sorting for entity references, untyped columns, and arrays (unless the datatype provides custom sort logic).

Parameters :
Name Optional
columns No
getDatatypeOrDefault No
Returns : FormFieldConfig[]
inferDefaultSort
inferDefaultSort(colsToDisplay, columns, getDatatypeOrDefault)

Infers a stable default sort from visible sortable columns. Date-like columns default to descending order.

Parameters :
Name Optional
colsToDisplay No
columns No
getDatatypeOrDefault No
Returns : Sort | undefined
resolveAgeSourceField
resolveAgeSourceField(column: FormFieldConfig)

Resolve the source field for virtual DisplayAge columns.

These columns display an age from another field, e.g. age reads record.dateOfBirth.age, so datatype sorting cannot use the column value directly. The legacy age and age_<field> conventions remain supported for existing configs.

Parameters :
Name Type Optional
column FormFieldConfig No
Returns : string | undefined

src/app/core/basic-datatypes/entity/edit-entity/edit-entity.component.ts

applyTextToCreatedEntity
applyTextToCreatedEntity(entity: Entity, input: string)

Update the given entity by applying the text entered by a user to the most likely appropriate entity field, inferred from the toString representation.

Parameters :
Name Type Optional
entity Entity No
input string No

src/app/core/entity/model/entity-update.ts

applyUpdate
applyUpdate<T extends Entity>(entities, next: UpdatedEntity, addIfMissing: boolean)
Type parameters :
  • T extends Entity

Updates a list of entities given an updated version of the entity. This updated version can either be a new entity (that should be inserted into the list), or an existing entity that should be updated or deleted. The given array will not be mutated but will be returned when the given new entity or type is illegal

Parameters :
Name Type Optional Default value Description
entities No

The entities to update, must be defined

next UpdatedEntity No

An entity that should be updated as well as the type of update. This, as well as the entity may be undefined or null. In this event, the entities-array is returned as is.

addIfMissing boolean No true

(Optional) whether to add an entity that comes through an update event but is not part of the array yet, default is to add, disable this if you do special filtering or calculations on the data

Returns : T[]

An array of the given entities with the update applied

src/app/utils/asArray.ts

asArray
asArray<T>(x)
Type parameters :
  • T

Convert wrap a value in an array if it is not already an array.

Parameters :
Name Optional
x No
Returns : T[]

src/app/features/change-history/change-history.module.ts

asSingle
asSingle(entity)
Parameters :
Name Optional
entity No
Returns : Entity | undefined

src/main.ts

bootstrap
bootstrap()

src/app/core/export/download-service/download.service.ts

buildExportColumnResolvers
buildExportColumnResolvers(schema: Map, entitySchemaService: EntitySchemaService, useFieldIdAsFallbackLabel: unknown)

Build export column resolvers for all fields in a schema.

Iterates the schema, looks up each field's datatype, and collects the columns the datatype contributes via getExportColumns.

Parameters :
Name Type Optional Default value Description
schema Map No
entitySchemaService EntitySchemaService No
useFieldIdAsFallbackLabel unknown No false

When true, fields without an explicit label use the field id as label (useful for embedded schemas like attendance items).

src/app/features/matching-entities/matching-entities/matching-entities.component.ts

buildMatchingSideConfig
buildMatchingSideConfig(side: MatchingSideConfig, columns, sideIndex: number)

Create a MatchingSideConfig object and fill it with columns from comparison array if necessary

Parameters :
Name Type Optional Description
side MatchingSideConfig No

Base side configuration

columns No

columns array from the overall matching configuration

sideIndex number No

index (0 or 1) of the side in the columns array

Returns : MatchingSideConfig

src/app/core/common-components/entity-form/dynamic-form-validators/permission-condition-validators.ts

buildPermissionConditionValidator
buildPermissionConditionValidator(rules, fieldId: string, toDbFormat, formatValue?)

Create a form validator that checks a single field's value against the permission rule conditions restricting it, so that users see a normal field error instead of only a technical rejection when saving.

The rules are evaluated in the given priority order (as returned by ability.rulesFor): the first rule whose condition matches the value decides, mirroring CASL's own precedence.

Returns null if the field's value cannot be the reason for a denied save. Inverted ("cannot") rules with conditions on several fields and conditions on properties without a form control (e.g. "created.by") are not covered here and remain handled by the save-time permission check.

Parameters :
Name Type Optional Default value Description
rules No

The relevant CASL rules for the action and entity type (ability.rulesFor(...))

fieldId string No

The form field / entity property to validate

toDbFormat No (value) => value

Transformation of the control value into database format, as rule conditions are evaluated against database-format entities

formatValue Yes

Lookup of a human-readable display for a single (database-format) condition value, e.g. resolving enum ids to labels

Returns : ValidatorFn | null
createFieldDecision
createFieldDecision(rule: RuleWithConditions, fieldId: string)
Parameters :
Name Type Optional
rule RuleWithConditions No
fieldId string No
Returns : FieldDecision
describeConditionFragment
describeConditionFragment(fragment: any, formatValue)

Human-readable summary of a single permission condition fragment (the value of one key in a CASL rule's conditions object).

Parameters :
Name Type Optional Default value Description
fragment any No

The condition fragment to describe

formatValue No (value) => String(value)

Lookup of a human-readable display for a single value, e.g. resolving enum ids to labels

Returns : string

src/app/core/common-components/entity-form/dynamic-form-validators/readonly-after-set.validator.ts

buildReadonlyValidator
buildReadonlyValidator(entity: Entity)

Validator to ensure a field becomes readonly after it has been saved once.

Parameters :
Name Type Optional
entity Entity No
Returns : { fn: ValidatorFn }

src/app/core/basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-utils.ts

calculateDateRange
calculateDateRange(dateRangeOption: DateRangeFilterConfigOption)
Parameters :
Name Type Optional
dateRangeOption DateRangeFilterConfigOption No
Returns : DateRange<Date>

src/app/utils/test-utils/vitest-proxy-zone-compat.ts

callbackIndex
callbackIndex(args)
Parameters :
Name Optional
args No
Returns : number | null
enableVitestProxyZoneCompat
enableVitestProxyZoneCompat()
Returns : void
isFunction
isFunction(value)

Wraps Vitest lifecycle and test callbacks in Angular's ProxyZone when it is available.

Angular test utilities such as waitForAsync() and fakeAsync() still rely on Zone context even when the test runner is Vitest. This patch keeps those helpers working without rewriting every existing spec immediately.

Parameters :
Name Optional
value No
Returns : TestFunction
patchCallable
patchCallable(target: Record, key: string)
Parameters :
Name Type Optional
target Record No
key string No
Returns : void
wrapWithProxyZone
wrapWithProxyZone(fn: TestFunction)
Parameters :
Name Type Optional
fn TestFunction No
Returns : TestFunction

src/app/core/default-values/default-value-service/default-value.service.test-utils.ts

cleanUpTemporarySchemaFields
cleanUpTemporarySchemaFields()

Helper function to remove custom schema fields from Entity that have been created using getDefaultInheritedForm().

getDefaultInheritedForm
getDefaultInheritedForm(additionalSchemaConfig)

Helper function to add some custom schema fields to Entity for testing. Use in combination with a call to cleanUpTemporarySchemaFields() in afterEach.

Parameters :
Name Optional Default value
additionalSchemaConfig No {}
Returns : EntityForm<any>
testDefaultValueCase
testDefaultValueCase(service: DefaultValueService, fieldSchema: EntitySchemaField, expected: any)
Parameters :
Name Type Optional
service DefaultValueService No
fieldSchema EntitySchemaField No
expected any No

src/bootstrap-reset.ts

clearLastSyncMarkers
clearLastSyncMarkers()

Remove the "last sync" marker of every database, so that no previous sync is assumed to have happened on this device.

This accesses the real localStorage directly rather than the injectable LOCAL_STORAGE_TOKEN, because it also runs before Angular exists. Callers that need this mockable should wrap it in an instance method first.

runPendingReset
runPendingReset()

Run pending reset cleanup before Angular bootstraps. Called from main.ts so that IndexedDB databases are deleted while no PouchDB connections are open (eliminating race conditions).

Returns : Promise<void>

src/app/features/notification/close-only-submenu.ts

closeOnlySubmenu
closeOnlySubmenu(menu: MatMenuTrigger, event: MouseEvent)

Close the mat-menu of the given menu trigger and stop propagation of the event to avoid closing parent menus as well.

Parameters :
Name Type Optional
menu MatMenuTrigger No
event MouseEvent No

src/app/features/reporting/report-config.ts

collectQueryStrings
collectQueryStrings(node)

Recursively collect every query string value from a report definition tree.

Parameters :
Name Optional
node No
Returns : string[]
isHierarchicalReport
isHierarchicalReport(report)

Whether a report's results should be rendered as a hierarchical group/count table (sql-v2-table) rather than a flat tabular table (object-table).

Derived purely from the canonical config structure (no version flag): a report is hierarchical when its reportDefinition contains a group (groupTitle) or more than one top-level item; otherwise it is tabular. Legacy v1 configs (normalized to a single ungrouped query) resolve to tabular.

Parameters :
Name Optional
report No
Returns : boolean
reportUsesDateRange
reportUsesDateRange(report)

Whether running this report offers a date-range (start & end date) input, derived from the date placeholders used in its queries so it stays in sync with the actual report definition:

  • "sql": the query uses the $startDate / $endDate placeholders.
  • "reporting"/"exporting": the in-browser query uses positional ? placeholders (date args).
Parameters :
Name Optional
report No
Returns : boolean

src/app/utils/filter-compare-utils.ts

compareDates
compareDates(a: Date, b: string)

Compare dates at day precision

Parameters :
Name Type Optional
a Date No
b string No
Returns : "1" | unknown | "0"
extendedCompare
extendedCompare<T>(a: T, b: T)
Type parameters :
  • T

Handles special cases like ConfigurableEnum objects and Dates. Used for filter evaluation and conditional color matching.

This utility is kept separate to avoid circular dependencies between Entity and FilterService.

Parameters :
Name Type Optional
a T No
b T No
Returns : "1" | unknown | "0"

-1 if a < b, 0 if a === b, 1 if a > b

src/app/core/common-components/entities-table/table-sort/table-sort.ts

compareValues
compareValues(a: unknown, b: unknown)
Parameters :
Name Type Optional
a unknown No
b unknown No
getComparableValue
getComparableValue<OBJECT, PROPERTY extends keyof OBJECT>(obj: OBJECT, key: PROPERTY, sortValueFns?: SortValueFns)
Type parameters :
  • OBJECT
  • PROPERTY extends keyof OBJECT
Parameters :
Name Type Optional
obj OBJECT No
key PROPERTY No
sortValueFns SortValueFns Yes
Returns : number | string | Symbol
tableSort
tableSort<OBJECT extends Entity, PROPERTY extends keyof OBJECT>(data, __namedParameters: {direction: "asc" | "desc" | string, active: PROPERTY | string, sortValueFns: SortValueFns<OBJECT>})
Type parameters :
  • OBJECT extends Entity
  • PROPERTY extends keyof OBJECT

Custom sort implementation for a MatTableDataSource<TableRow>

Parameters :
Name Type Optional Description
data No

The data of the data source

direction "asc" | "desc" | string No

direction "asc", "desc" or "" meaning none

active PROPERTY | string No

the property of T for which it should be sorted

sortValueFns SortValueFns<OBJECT> No
Returns : TableRow[]

the sorted table rows

src/app/core/database/db-name-helpers.ts

computeDbNames
computeDbNames(session: SessionInfo)

Compute new-format database names (using Keycloak UUID + dash separator). Used after migration to the "indexeddb" adapter.

Parameters :
Name Type Optional
session SessionInfo No
Returns : { app: string; notifications: string }
computeLegacyDbNames
computeLegacyDbNames(session: SessionInfo)

Compute legacy-format database names (username for app, underscore for notifications). Used with the old "idb" adapter before migration.

Parameters :
Name Type Optional
session SessionInfo No
Returns : { app: string; notifications: string }

src/app/core/basic-datatypes/date/date.static.ts

convertToMomentFormat
convertToMomentFormat(angularFormat: string)

Converts an Angular DatePipe format string to the equivalent Moment.js format string. Angular uses lowercase tokens (dd, yyyy), Moment.js uses uppercase (DD, YYYY). Exported for testing only.

Parameters :
Name Type Optional
angularFormat string No
Returns : string
setGlobalDateFormat
setGlobalDateFormat(format: string)

Set the global date format at runtime based on configuration. This is called by SiteSettingsService during initialization.

Parameters :
Name Type Optional Description
format string No

Angular DatePipe format string (e.g., "dd.MM.yyyy", "MM/dd/yyyy")

Returns : void

src/app/core/common-components/entity-form/dynamic-form-validators/age-validators.ts

createAgeComparisonValidator
createAgeComparisonValidator(ageParamValue, comparator, errorKey: string, paramName, rangeConfig?)

Creates an age range validator (min or max age).

Parameters :
Name Type Optional
ageParamValue No
comparator No
errorKey string No
paramName No
rangeConfig Yes
Returns : ValidatorFn
descriptionForAgeValidator
descriptionForAgeValidator(validator, validationValue: any)
Parameters :
Name Type Optional
validator No
validationValue any No
Returns : string
maxAgeValidator
maxAgeValidator(maxAgeValue, minAgeValue?)

Validator for maximum age.

Parameters :
Name Optional
maxAgeValue No
minAgeValue Yes
Returns : ValidatorFn
minAgeValidator
minAgeValidator(minAgeValue, maxAgeValue?)

Validator for minimum age.

Parameters :
Name Optional
minAgeValue No
maxAgeValue Yes
Returns : ValidatorFn

src/app/features/location/map-utils.ts

createColoredDivIcon
createColoredDivIcon(color: string)

Creates a custom colored marker icon using Leaflet's DivIcon. This approach ensures accurate color representation for all colors, overcoming the limitations of the hue-rotate filter which cannot properly handle achromatic colors or accurately represent all RGB values.

Based on: https://stackoverflow.com/a/40870439/1473411

Parameters :
Name Type Optional Description
color string No

Hex or RGB color string for the marker

Returns : L.DivIcon

Leaflet DivIcon with the specified color

getKmDistance
getKmDistance(x: Coordinates, y: Coordinates)

Calculate distance between two points Source ://henry-rossiter.medium.com/calculating-distance-between-geographic-coordinates-with-javascript-5f3097b61898https

Parameters :
Name Type Optional
x Coordinates No
y Coordinates No
getLocationProperties
getLocationProperties(entity: EntityConstructor)

Get all properties of an entity that represent a geographic location

Parameters :
Name Type Optional
entity EntityConstructor No
getMinDistanceKm
getMinDistanceKm(entity: Entity, coordinatesProperties, compareCoordinates)

Calculate the minimum distance (km) between an entity's location fields and a list of comparison coordinates. Returns null if no distance can be computed.

Parameters :
Name Type Optional
entity Entity No
coordinatesProperties No
compareCoordinates No
Returns : number | null

src/app/core/common-components/entity-form/dynamic-form-validators/date-validators.ts

createDateComparisonValidator
createDateComparisonValidator(dateParamValue, comparator, errorKey: string, paramName)

Creates a date range validator (min or max).

Parameters :
Name Type Optional
dateParamValue No
comparator No
errorKey string No
paramName No
Returns : ValidatorFn
descriptionForDateValidator
descriptionForDateValidator(validator, validationValue: any)
Parameters :
Name Type Optional
validator No
validationValue any No
Returns : string
formatDateAsDayMonthYear
formatDateAsDayMonthYear(value: Date)
Parameters :
Name Type Optional
value Date No
Returns : string
maxDateValidator
maxDateValidator(maxDateValue)

Validator for maximum date.

Parameters :
Name Optional
maxDateValue No
Returns : ValidatorFn
minDateValidator
minDateValidator(minDateValue)

Validator for minimum date.

Parameters :
Name Optional
minDateValue No
Returns : ValidatorFn
normalizeDateOnly
normalizeDateOnly(value: Date)

Normalizes a date to just the date portion (no time).

Parameters :
Name Type Optional
value Date No
Returns : Date
parseToDate
parseToDate(value)

Parses a value to a Date object. Handles Date objects, date strings (YYYY-MM-DD), timestamps, and special value "$now".

Parameters :
Name Optional
value No
Returns : Date | undefined

src/app/core/filter/filters/filters.ts

createEmptyValueFilter
createEmptyValueFilter<T extends Entity>(fieldName: string, includeNestedId: unknown, includeEmptyArray: unknown)
Type parameters :
  • T extends Entity
Parameters :
Name Type Optional Default value
fieldName string No
includeNestedId unknown No false
includeEmptyArray unknown No false
Returns : DataFilter<T>

src/app/core/entity/entity-mapper/mock-entity-mapper-service.ts

createEntityMapperSpyObj
createEntityMapperSpyObj()
mockEntityMapperProvider
mockEntityMapperProvider(withData, customDatabaseResolverService)
Parameters :
Name Optional Default value
withData No []
customDatabaseResolverService No { resetSync: () => Promise.resolve(), isIndexedDbAdapterSupported: () => false, getDatabase: () => ({ purge: () => Promise.resolve(false) }), }
Returns : Provider[]

src/app/core/demo-data/create-entity-of-type.ts

createEntityOfType
createEntityOfType(type: string, id: string)

"Simulate" a custom entity type that saves all fields without transformations through a mocked EntitySchema.

This is a utility function to help demo data creation because the dynamically migrated config is not ready at the time of demo data generation yet.

Parameters :
Name Type Optional Default value
type string No
id string No uuid()
Returns : Entity & { }

src/app/utils/test-utils/fake-storage.ts

createFakeStorage
createFakeStorage(initial: Record)

An in-memory stand-in for localStorage, to be provided for LOCAL_STORAGE_TOKEN in tests.

Prefer this over vi.spyOn(Storage.prototype, ...): Storage.prototype lives in the worker process rather than the module registry, so Vitest's isolate does not undo such a stub. An unrestored one leaks into every later spec file and silently makes unrelated tests read a fake localStorage.

Parameters :
Name Type Optional Default value
initial Record No {}
Returns : Storage

src/app/features/skill/skill-api/skill-api-mock.ts

createSkillApiDummyData
createSkillApiDummyData(externalId: string)
Parameters :
Name Type Optional
externalId string No
Returns : ExternalProfile

src/app/core/common-components/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.ts

CustomYesNoButtons
CustomYesNoButtons(yesLabel: string, noLabel: string)
Parameters :
Name Type Optional
yesLabel string No
noLabel string No

src/app/core/entity/database-entity.decorator.ts

DatabaseEntity
DatabaseEntity(entityType: string)

Decorator (Annotation @DatabaseEntity()) to set the string ENTITY_TYPE to an Entity Type. The entity should also be added to the databaseEntities array of the surrounding module.

also see

Parameters :
Name Type Optional Description
entityType string No

The string key for this Entity Type, used as id prefix.

src/app/core/basic-datatypes/string/edit-email/edit-email.component.ts

emailValidatorWithMessage
emailValidatorWithMessage(control: AbstractControl)
Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null

src/app/core/logging/logging.service.ts

enhanceSentryBreadcrumb
enhanceSentryBreadcrumb(breadcrumb, hint: SentryBreadcrumbHint)

Add more human-readable descriptions to Sentry breadcrumbs for debugging.

see https://docs.sentry.io/platforms/javascript/enriching-events/breadcrumbs/

Parameters :
Name Type Optional
breadcrumb No
hint SentryBreadcrumbHint No
enrichSentryEvent
enrichSentryEvent(event, hint)

Enrich events with structured extra data from custom Error properties (e.g. DatabaseException's entityId, status, reason).

Parameters :
Name Optional
event No
hint No
Returns : Sentry.ErrorEvent
fingerprintSentryEvent
fingerprintSentryEvent(event)

Group events of our own wrapper error classes (see CAUSE_GROUPED_ERROR_TYPES) by their error chain instead of by stack trace, so that one problem shows up as one issue.

exception.values is ordered innermost-first: values[0] is the deepest cause, the originally thrown error is last. Both ends matter - the thrown error says which operation failed, the root cause says why (e.g. a config load failing because the device is offline is a different problem from the same load failing because the user is unauthorized).

The route remains available as the transaction tag, so a failure can still be filtered by where it happened without splitting it into separate issues.

Parameters :
Name Optional
event No
Returns : Sentry.ErrorEvent
isExcessiveRepeat
isExcessiveRepeat(event)

Count occurrences of an event and check whether it exceeded the session cap.

The key is deliberately coarse: error class + normalized message of the root cause (values[0] is the deepest cause in the chain; the originally thrown, outermost error is last), without any stack information. Consequences:

  • Same-message errors from different code paths share one budget, and all wrappers of a cascading failure are capped via their common root cause. This is a flood guard, not a grouping mechanism - see fingerprintSentryEvent for how issues are separated.
  • Errors that interpolate data (e.g. entity IDs) into their message still share one budget, because the key is normalized the same way as the grouping fingerprint.
Parameters :
Name Optional
event No
Returns : boolean
isOfflineNetworkError
isOfflineNetworkError(event)

Whether the event is a network-layer fetch failure that occurred while the device was offline. In an offline-first app this is a normal state without diagnostic value (server outages still surface through online users).

Parameters :
Name Optional
event No
Returns : boolean
normalizeErrorValue
normalizeErrorValue(value)

Mask volatile details (ids, urls, numbers) so that different occurrences of the same problem produce the same string.

Parameters :
Name Optional
value No
Returns : string
processSentryEvent
processSentryEvent(event, hint)

Sentry beforeSend hook: drops network failures of offline devices and excessive repeats of an identical event, and enriches the remaining events with structured extra data and a stable grouping fingerprint.

Parameters :
Name Optional
event No
hint No
Returns : Sentry.ErrorEvent | null

src/app/features/location/geo-location.ts

enrichGeoLocation
enrichGeoLocation(location)
Parameters :
Name Optional
location No

src/app/core/filter/filter-generator/filter-predicate.ts

entityFilterPredicate
entityFilterPredicate(data: Entity, filter: string)
Parameters :
Name Type Optional
data Entity No
filter string No
Returns : boolean

src/app/core/database/pouchdb/pouchdb-corruption-recovery.service.ts

errorToText
errorToText(error)
Parameters :
Name Optional
error No
Returns : string
isKnownMultiTabDatabaseCorruption
isKnownMultiTabDatabaseCorruption(error)

Detect IndexedDB/PouchDB corruption symptoms commonly observed when the app is used in multiple tabs with concurrent writes.

We intentionally match on transaction was aborted because this is the reliable signal present on the actual error object propagated to app code after IndexedDB global-failure cases. The unknown_error label is too generic and may appear for unrelated failures.

Parameters :
Name Optional
error No
Returns : boolean

src/app/core/filter/filters/stringFilter.ts

escapeRegExp
escapeRegExp(text: string)

Escape all special regex characters so the given text can be used as a literal search string inside a regular expression.

Parameters :
Name Type Optional
text string No
Returns : string

src/app/utils/test-utils/array-test-utils.ts

expectArrayWithExactContents
expectArrayWithExactContents(actual, expected)

Assert that two arrays contain the same items, regardless of order, while still supporting asymmetric matchers such as expect.objectContaining(...).

Parameters :
Name Optional
actual No
expected No
Returns : void
matches
matches(actual, expected)
Parameters :
Name Optional
actual No
expected No
Returns : boolean

src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts

extractGroupId
extractGroupId(group: any)

Extract a group ID from a group value (string, object, etc.)

Parameters :
Name Type Optional
group any No
Returns : string
extractHumanReadableLabel
extractHumanReadableLabel(value)

Get a human-readable string from the given value as a label.

Parameters :
Name Optional
value No
Returns : string | undefined

src/app/core/database/pouchdb/version-comparison.utils.ts

extractNumericParts
extractNumericParts(version: string)
Parameters :
Name Type Optional
version string No
Returns : number[]
isVersionNewer
isVersionNewer(leftVersion: string, rightVersion: string)

Returns true when leftVersion is newer than rightVersion.

The comparison is based on numeric segments to avoid lexicographic issues, e.g. 9.0.0 < 10.0.0.

Parameters :
Name Type Optional
leftVersion string No
rightVersion string No
Returns : boolean

src/app/features/attendance/model/participant-id-extractor.ts

extractParticipantIds
extractParticipantIds(value)

Normalize participant sources into plain participant IDs.

Supports both configured participants field shapes used in attendance:

  • string[] with direct entity IDs (datatype entity)
  • attendance-like entries containing a participant ID (datatype attendance)
Parameters :
Name Optional
value No
Returns : string[]

src/bootstrap-i18n.ts

fetchTranslations
fetchTranslations(locale: string)
Parameters :
Name Type Optional
locale string No
Returns : Promise<Record | undefined>
initLanguage
initLanguage(locale?: string)

Load translation files and apply them to angular localize system.

Parameters :
Name Type Optional Description
locale string Yes

(Optional) overwrite the locale to use (otherwise loaded from local storage)

Returns : Promise<void>

src/app/core/entity/entity-mapper/entity-relations.service.ts

fieldsIncludingId
fieldsIncludingId(entity: Entity, refId: string, relevantFields)

Return the fields of entity that contain the given refId. If there is no such referenced ID, the array will be empty.

Parameters :
Name Type Optional Description
entity Entity No
refId string No
relevantFields No

The entity fields to check for the refId

Returns : FormFieldConfig[]
getInnerEntityReferenceFields
getInnerEntityReferenceFields(field?: EntitySchemaField)

From a field's additional embedded schema, return the entries whose dataType is "entity" (i.e. inner entity-reference properties).

Returns an empty array when the field has no embedded schema.

Parameters :
Name Type Optional
field EntitySchemaField Yes
Returns : unknown[]
itemReferencesId
itemReferencesId(item: any, refId: string, field?: EntitySchemaField)

Check whether a single value (a plain ID string or an embedded object) references the given entity ID.

When a field schema is provided and its additional defines an embedded schema, only the inner properties declared as entity references (dataType: "entity") are inspected. Without schema info the function falls back to checking all object values (backward-compatible).

Parameters :
Name Type Optional
item any No
refId string No
field EntitySchemaField Yes
Returns : boolean

src/app/utils/flat-tree/flat-tree.ts

flattenTree
flattenTree<T>(nodes, adapter: FlatTreeAdapter, level: number)
Type parameters :
  • T

Flatten a nested tree into rows (pre-order), carrying the depth as level.

Parameters :
Name Type Optional Default value
nodes No
adapter FlatTreeAdapter No
level number No 0
Returns : FlatTreeRow[]
insertChild
insertChild<T>(rows, parentIndex: number, node: T, adapter: FlatTreeAdapter, options?: FlatTreeOptions)
Type parameters :
  • T

Insert node as the first child of the row at parentIndex.

Parameters :
Name Type Optional
rows No
parentIndex number No
node T No
adapter FlatTreeAdapter No
options FlatTreeOptions Yes
Returns : FlatTreeRow[]
maxLevelBelow
maxLevelBelow<T>(above, adapter: FlatTreeAdapter, options?: FlatTreeOptions)
Type parameters :
  • T

The deepest level a row directly below above may have (0 if there is no row above).

Parameters :
Name Type Optional
above No
adapter FlatTreeAdapter No
options FlatTreeOptions Yes
Returns : number
moveSubtree
moveSubtree<T>(rows, previousIndex: number, currentIndex: number, adapter: FlatTreeAdapter, options?)
Type parameters :
  • T

Move the subtree rooted at previousIndex to currentIndex (as reported by a cdkDropList, which only moves the dragged row itself — its descendants follow it here) and re-nest it by levelDelta levels, within what the rows it comes to rest between allow.

Parameters :
Name Type Optional
rows No
previousIndex number No
currentIndex number No
adapter FlatTreeAdapter No
options Yes
Returns : FlatTreeRow[]
normalizeLevels
normalizeLevels<T>(rows, adapter: FlatTreeAdapter, options?: FlatTreeOptions)
Type parameters :
  • T

Clamp levels so the flat list always describes a valid tree: the first row is at level 0, every other row is at most one level deeper than the row above it — and only deeper if that row can have children at all — and no row is deeper than maxLevel.

Parameters :
Name Type Optional
rows No
adapter FlatTreeAdapter No
options FlatTreeOptions Yes
Returns : FlatTreeRow[]
rebuildTree
rebuildTree<T>(rows, adapter: FlatTreeAdapter)
Type parameters :
  • T

Reconstruct the nested tree from flat rows: each row owns the following rows of greater level.

Parameters :
Name Type Optional
rows No
adapter FlatTreeAdapter No
Returns : T[]
removeSubtree
removeSubtree<T>(rows, index: number, adapter: FlatTreeAdapter, options?: FlatTreeOptions)
Type parameters :
  • T

Remove the row at index together with its whole subtree.

Parameters :
Name Type Optional
rows No
index number No
adapter FlatTreeAdapter No
options FlatTreeOptions Yes
Returns : FlatTreeRow[]
subtreeLength
subtreeLength<T>(rows, index: number)
Type parameters :
  • T

Number of rows forming the subtree rooted at index (the row itself plus its descendants).

Parameters :
Name Type Optional
rows No
index number No
Returns : number
updateRow
updateRow<T>(rows, index: number, node: T)
Type parameters :
  • T

Replace the node of the row at index, keeping its position and nesting.

Parameters :
Name Type Optional
rows No
index number No
node T No
Returns : FlatTreeRow[]

src/app/features/attendance/demo-data/demo-activity-generator.service.ts

generateActivity
generateActivity(__namedParameters: {participants: Entity[], assignedUser: Entity, title: string, entityType: string})
Parameters :
Name Type Optional Default value
participants Entity[] No
assignedUser Entity No
title string No
entityType string No "RecurringActivity"
Returns : ActivityEntity

src/app/child-dev-project/children/demo-data-generators/demo-child-generator.service.ts

generateChild
generateChild(opts)
Parameters :
Name Optional Default value
opts No {}

src/app/features/notification/notification-settings/notification-settings.component.ts

generateDefaultNotificationConfig
generateDefaultNotificationConfig(userId: string, userEntity: string)
Parameters :
Name Type Optional
userId string No
userEntity string No

src/app/core/entity/entity-field-edit/dynamic-edit/edit-component-story-utils.ts

generateFormFieldStory
generateFormFieldStory<T>(editComponent: unknown, defaultValue: unknown, withTooltip: unknown, additionalSchema: object, additionalProviders: [])
Type parameters :
  • T
Parameters :
Name Type Optional Default value Description
editComponent unknown No
defaultValue unknown No
withTooltip unknown No true

set to false to disable tooltip (?) button

additionalSchema object No {}

an object that is applied to the schema field and allows to overwrite or add schema properties

additionalProviders [] No []

Angular service providers that should be initialized in addition to defaults

src/app/child-dev-project/notes/demo-data/demo-note-generator.service.ts

generateGroupNote
generateGroupNote(params)
Parameters :
Name Optional
params No
generateNote
generateNote(params)
Parameters :
Name Optional
params No
Returns : Note
generateNotes
generateNotes(params)
Parameters :
Name Optional
params No
Returns : Note[]
removeFollowUpMarkerForOldNotes
removeFollowUpMarkerForOldNotes(note: Note)

Set all older notes to be "resolved" in order to keep the list of notes needing follow-up limited in the demo.

Parameters :
Name Type Optional
note Note No

src/app/utils/generate-id-from-label/generate-id-from-label.ts

generateIdFromLabel
generateIdFromLabel(label: string)

Create a simplified id string from the given text. This generates a camelCase string, removing special characters.

Parameters :
Name Type Optional Description
label string No

The input string to be transformed

Returns : string | undefined

src/app/features/todos/recurring-interval/time-interval.ts

generateLabelFromInterval
generateLabelFromInterval(interval: TimeInterval)
Parameters :
Name Type Optional
interval TimeInterval No

src/app/features/todos/model/demo-todo-generator.service.ts

generateTodo
generateTodo(__namedParameters: {entity: Entity, assignedTo: Entity[], isDue: boolean})
Parameters :
Name Type Optional
entity Entity No
assignedTo Entity[] No
isDue boolean No
Returns : Todo
generateTodos
generateTodos(params)
Parameters :
Name Optional
params No
Returns : Todo[]

src/app/core/user/demo-user-generator.service.ts

generateUsers
generateUsers()

src/app/features/inherited-field/inherited-value.service.ts

getConfigsForInheritedMode
getConfigsForInheritedMode(fieldConfigs)

Get the default value configs filtered for the given mode.

Parameters :
Name Optional
fieldConfigs No

src/app/core/config/testing-config-service.ts

getDefaultConfigEntity
getDefaultConfigEntity(configsObject: any)
Parameters :
Name Type Optional Default value
configsObject any No defaultJsonConfig
provideTestingConfigService
provideTestingConfigService(configsObject: any)
Parameters :
Name Type Optional Default value
configsObject any No defaultJsonConfig

src/app/core/basic-datatypes/configurable-enum/configurable-enum-testing.ts

getDefaultEnumEntities
getDefaultEnumEntities()
Returns : ConfigurableEnum[]

src/app/child-dev-project/notes/add-default-note-views.ts

getDefaultNoteDetailsConfig
getDefaultNoteDetailsConfig()

Default configuration for Note Details.

Returns : NoteDetailsConfig

src/bootstrap-pwa-install.ts

getDeferredInstallPrompt
getDeferredInstallPrompt()

The deferred install prompt, if the browser has offered one already.

registerPWAInstallListener
registerPWAInstallListener()

Start listening for the browser's beforeinstallprompt event and defer it, so that the app can offer an install button at any later point.

Must be called before any async operation during bootstrap, because the browser fires the event early and does not replay it for later listeners.

Returns : void
resetPWAInstallListener
resetPWAInstallListener()

Discard the deferred prompt and the listener's promise, and remove the beforeinstallprompt listener from window. Only needed in tests, to undo the module-level state of a previous case.

Returns : void
whenCanInstallDirectly
whenCanInstallDirectly()

Resolves once/if the app can be installed directly. undefined if registerPWAInstallListener has not run.

Returns : Promise | undefined

src/app/core/entity/entity-config.service.ts

getEntityRuntimeDetailsRoutePath
getEntityRuntimeDetailsRoutePath(entityType: EntityConstructor)
Parameters :
Name Type Optional
entityType EntityConstructor No
Returns : string
getEntityRuntimeRoute
getEntityRuntimeRoute(entityType: EntityConstructor)
Parameters :
Name Type Optional
entityType EntityConstructor No
Returns : string

src/app/core/config/dynamic-routing/route-paths.ts

getEntityRuntimePath
getEntityRuntimePath(path: string)

Build the canonical runtime path for config-driven entity routes.

Parameters :
Name Type Optional
path string No
Returns : string
getRuntimePathFromViewConfig
getRuntimePathFromViewConfig(view: ViewConfig)

Resolve the effective route path for a view config at runtime. Entity views are always placed under CONFIG_ENTITY_ROUTE_PREFIX.

Parameters :
Name Type Optional
view ViewConfig No
Returns : string
getViewPathFromConfigId
getViewPathFromConfigId(viewConfigId: string)

Convert a view:* config id into a plain route path.

Parameters :
Name Type Optional
viewConfigId string No
Returns : string
isEntityViewConfig
isEntityViewConfig(view: ViewConfig)

Heuristic to identify config views that represent entity navigation. Includes views with an explicit entityType config and detail views (path ending with /:id).

Parameters :
Name Type Optional
view ViewConfig No
Returns : boolean
normalizeRoutePath
normalizeRoutePath(path: string)

Normalize a route path for internal comparisons. Removes a single leading slash and keeps nested segments unchanged.

Parameters :
Name Type Optional
path string No
Returns : string

src/app/features/reporting/report-row.ts

getGroupingInformationString
getGroupingInformationString(groupedBy)
Parameters :
Name Optional
groupedBy No
Returns : string
getValueDescription
getValueDescription(value: any, property: string)
Parameters :
Name Type Optional
value any No
property string No
Returns : string

src/app/core/import/import-inheritance-warning.util.ts

getInheritanceSourceReferenceFields
getInheritanceSourceReferenceFields(entityCtor?: EntityConstructor)

Shared helper for import warnings related to inherited fields.

It centralizes detection of source-reference fields used by inherited-field defaults so mapping dialogs and import summary can show consistent hints without duplicating schema-scanning logic.

Parameters :
Name Type Optional
entityCtor EntityConstructor Yes
Returns : Set<string>
hasMappedInheritedSourceField
hasMappedInheritedSourceField(entityCtor: EntityConstructor, columnMappings)
Parameters :
Name Type Optional
entityCtor EntityConstructor No
columnMappings No
Returns : boolean
isInheritanceSourceReferenceField
isInheritanceSourceReferenceField(entityCtor: EntityConstructor, propertyName?: string)
Parameters :
Name Type Optional
entityCtor EntityConstructor No
propertyName string Yes
Returns : boolean

src/app/core/common-components/entities-table/value-accessor/value-accessor.ts

getReadableValue
getReadableValue(value: any)

An enhanced sortingDataAccessor function that can be set for a MatTableDataSource in order to support sorting by ConfigurableEnum columns and other Entity specific values.

Parameters :
Name Type Optional Description
value any No

the object for which a readable string should be returned

Returns : any
isConfigurableEnum
isConfigurableEnum(value: any)
Parameters :
Name Type Optional
value any No
isGeoLocation
isGeoLocation(value: any)
Parameters :
Name Type Optional
value any No
Returns : GeoLocation
transformToReadableFormat
transformToReadableFormat(obj: any)

Transform a whole object into a readable format. This also transforms date objects to YYYY-MM-DD format.

Parameters :
Name Type Optional
obj any No

src/app/child-dev-project/warning-level.ts

getWarningLevelColor
getWarningLevelColor(warningLevel: WarningLevel)
Parameters :
Name Type Optional
warningLevel WarningLevel No

src/app/core/basic-datatypes/configurable-enum/configurable-enum-ordering.ts

hasOrdinalValue
hasOrdinalValue(value: any)
Parameters :
Name Type Optional
value any No
Returns : HasOrdinal
imposeTotalOrdering
imposeTotalOrdering<T extends ConfigurableEnumValue>(values: Array)
Type parameters :
  • T extends ConfigurableEnumValue

Extends an array of configurable enum values with an ordinal value so that the ordinal value of each enum value matches the position of the element in the array.

Note that this should be used 'early' in the pipeline, i.e. when the ConfigurableEnumConfig is just created. It is technically not incorrect to use this function on any array that contains configurable enum values, but it doesn't make sense to apply this function to 'scrambled' arrays, i.e. arrays where the ordering of values is not the natural order of these values.

Parameters :
Name Type Optional Description
values Array No

The values to impose a total ordering on

src/app/core/session/session-type.ts

hasRemoteSession
hasRemoteSession(sessionType: SessionType)

Check whether the given session type has a remote server connection. This is true for both "synced" (local+remote) and "online" (remote-only) modes.

Parameters :
Name Type Optional
sessionType SessionType No
Returns : boolean

src/app/utils/connectivity-error.ts

isConnectivityError
isConnectivityError(err: any)

Check whether an error represents a transient network/connectivity failure.

Matches common browser fetch errors, timeout errors, and HTTP 5xx gateway errors. Callers can layer additional domain-specific checks on top.

Parameters :
Name Type Optional
err any No
Returns : boolean

src/app/core/common-components/entity-form/unique-property-validator/unique-property-validator.ts

isDuplicate
isDuplicate(currentValue, existingValues, shouldNormalize: boolean)
Parameters :
Name Type Optional
currentValue No
existingValues No
shouldNormalize boolean No
Returns : boolean
normalizeValue
normalizeValue(value)
Parameters :
Name Optional
value No
Returns : unknown
uniquePropertyValidator
uniquePropertyValidator(config: UniquePropertyValidatorConfig)

Generic validator to ensure a property value is unique within a collection. Can be configured to validate different properties (id, label, etc.) with optional normalization.

Parameters :
Name Type Optional Description
config UniquePropertyValidatorConfig No

Configuration object for the validator

An async validator function

src/app/features/reporting/edit-report-definition/report-definition-ui-node.ts

isGroupNode
isGroupNode(node: ReportDefinitionUiNode)

A node is a group when it carries an items array; otherwise it is a query.

Parameters :
Name Type Optional
node ReportDefinitionUiNode No
Returns : boolean
newGroupNode
newGroupNode()

A new, empty group node.

newQueryNode
newQueryNode()

A new, empty query node.

toReportDefinition
toReportDefinition(nodes)

Convert UI nodes back to plain report-definition DTOs (dropping the transient ids).

Parameters :
Name Optional
nodes No
toUiNodes
toUiNodes(dtos)

Convert persisted report-definition DTOs into UI nodes with transient ids.

Parameters :
Name Optional
dtos No

src/app/core/admin/admin-menu/menu-item-for-admin-ui.ts

isManualItemWithoutLink
isManualItemWithoutLink(item)

True when an item is in manual mode (no entity type) and no link has been set.

Parameters :
Name Optional
item No
Returns : boolean

src/app/core/session/auth/keycloak/keycloak-auth.service.ts

isRetryableNetworkError
isRetryableNetworkError(err: any)

Check whether an error is a retryable network/connectivity error, including keycloak-specific transient failures.

Parameters :
Name Type Optional
err any No
Returns : boolean

src/app/core/admin/admin-entity-details/admin-entity-field/configure-entity-field-validator/configure-entity-field-validator.component.ts

isValidRegex
isValidRegex(pattern: string)
Parameters :
Name Type Optional
pattern string No
Returns : boolean
validRegexValidator
validRegexValidator(control: AbstractControl)

Marks the control as invalid if its value cannot be compiled as a regular expression.

Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null

src/app/core/basic-datatypes/date-only/date-only.datatype.ts

migrateIsoDatesToInferredDateOnly
migrateIsoDatesToInferredDateOnly(value: string)
Parameters :
Name Type Optional
value string No
Returns : string

src/app/features/public-form/public-form.component.ts

migratePublicFormConfig
migratePublicFormConfig(formConfig: PublicFormConfig)
Parameters :
Name Type Optional
formConfig PublicFormConfig No
Returns : PublicFormConfig

src/app/features/reporting/report-config-migration.ts

migrateReportConfig
migrateReportConfig<T extends MigratableReportConfig>(report: T)
Type parameters :
  • T extends MigratableReportConfig

Consolidate a ReportConfig's legacy definition fields into the unified reportDefinition, so all report modes share a single definition property.

Mode-aware, because the canonical definition differs per mode:

  • "reporting"/"exporting" (and unset, which defaults to reporting): the definition lives in aggregationDefinitions; any reportDefinition present is stale (e.g. left over from a mode switch in the old two-field form) → overwrite it with aggregationDefinitions.
  • "sql": reportDefinition (v2) is canonical when present; a legacy v1 aggregationDefinition (a single SQL query string) is folded into reportDefinition as [{ query }].

Non-destructive: the legacy fields are intentionally kept, so this migration is safe to run before the code that reads reportDefinition is deployed (both coexist; old code keeps reading the old fields). A follow-up migration removes the legacy fields once every environment runs the new code. Idempotent and safe to re-run.

Parameters :
Name Type Optional
report T No
Returns : T

src/app/core/admin/admin-entity-details/admin-entity-form/admin-entity-form.component.ts

moveFieldBetweenGroups
moveFieldBetweenGroups(groups, field: ColumnConfig, from: FieldDropTarget, fromIndex: number, to: FieldDropTarget, toIndex: number)

Move field from one drop target to another, returning new group objects for the groups that changed (all others are kept as they are).

A target of "available" is the toolbar of fields not used in the form: it holds no state of its own (it is derived from the form's groups), so a field moved there is simply removed from the form and a field moved from there is simply added.

Parameters :
Name Type Optional
groups No
field ColumnConfig No
from FieldDropTarget No
fromIndex number No
to FieldDropTarget No
toIndex number No
Returns : FieldGroup[]

src/app/core/common-components/parsed-file-input/parsed-file-input.component.ts

normalizeCellValue
normalizeCellValue(value)

Unwraps exceljs's rich cell value shapes (e.g. hyperlinks expose text, formulas expose result) into a primitive suitable for the import flow.

Parameters :
Name Optional
value No
Returns : unknown

src/app/core/basic-datatypes/entity/entity.datatype.ts

normalizeEntityAdditional
normalizeEntityAdditional(additional)

Normalizes the additional config of an entity reference column mapping. Accepts legacy string format or new object format.

Parameters :
Name Optional
additional No
normalizeValue
normalizeValue(val: any)

Normalizes a value for comparison, converting it to a standardized string format. Ensures both numbers and strings are treated consistently.

Parameters :
Name Type Optional Description
val any No

The value to normalize.

Returns : string

The normalized value as a string.

src/app/core/export/data-transformation-service/export-column-config.ts

normalizeQueryKey
normalizeQueryKey(query: string)

Normalize a query key used in export column configs. Strips a leading dot if present so callers can compare logical field keys.

Parameters :
Name Type Optional
query string No
Returns : string

src/app/core/session/session-utils.ts

parseJwt
parseJwt(token: unknown)

Parses and returns the payload of a JWT into a JSON object. For me info see ://jwt.iohttps.

Parameters :
Name Type Optional Description
token unknown No

a valid JWT

Returns : ParsedJWT

src/app/core/common-components/entity-form/dynamic-form-validators/dynamic-validators.service.ts

patternWithMessage
patternWithMessage(pattern, message: string)

creates a pattern validator that also carries a predefined message

Parameters :
Name Type Optional Description
pattern No

The pattern to check

message string No

The custom message to display when the pattern fails

Returns : ValidatorFn

src/app/utils/performance-analysis-logging.ts

PerformanceAnalysisLogging
PerformanceAnalysisLogging(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor)

Extend any class method to measure the duration it takes to finish and log it to the console.

Parameters :
Name Type Optional
target Object No
propertyKey string No
descriptor TypedPropertyDescriptor No

src/app/core/config/config.app-initializer.ts

preloadDynamicComponents
preloadDynamicComponents(registry: ComponentRegistry, destroyRef: DestroyRef)
Parameters :
Name Type Optional
registry ComponentRegistry No
destroyRef DestroyRef No

src/app/utils/retry-on-server-error.rxjs-pipe.ts

random
random(min: number, max: number)
Parameters :
Name Type Optional
min number No
max number No
retryOnServerError
retryOnServerError<T>(maxRetries: number)
Type parameters :
  • T

Retry a request on server error (status code 5xx). Use this in pipe(retryOnServerError(2)).

Retries are done with exponential backoff delays that are randomized (in case there are many parallel requests to be spread out).

Parameters :
Name Type Optional
maxRetries number No
Returns : MonoTypeOperatorFunction<T>

src/app/features/file/file-utils.ts

resizeImage
resizeImage(file: File, maxSize: number)
Parameters :
Name Type Optional Default value
file File No
maxSize number No 360
Returns : Promise<HTMLCanvasElement>

src/app/utils/resourceWithRetention.ts

resourceWithRetention
resourceWithRetention<T, R>(options: ResourceOptions)
Type parameters :
  • T
  • R

Creates a resource that retains its previous value when reloading.

This function is similar to resource except while reloading. When isLoading() is true, value() holds the previously loaded value instead of undefined or defaultValue.

Parameters :
Name Type Optional
options ResourceOptions No
Returns : ResourceRef<T | undefined>

src/app/utils/reuse-first-async.ts

reuseFirstAsync
reuseFirstAsync<T>(fn)
Type parameters :
  • T

Wraps a function to ensure only one async operation runs at a time.

If called while the first async operation is still pending, returns the same promise. Once the operation completes (success or failure), subsequent calls will start a new operation.

Parameters :
Name Optional
fn No
Returns : Promise<T>

src/app/core/entity/entity-field-edit/dynamic-edit/edit-component-test-utils.ts

setupCustomFormControlEditComponent
setupCustomFormControlEditComponent<T>(component: CustomFormControlDirective, propertyName: string, schema: any, fixture?: ComponentFixture)
Type parameters :
  • T

Helper function for modern Angular components that extend CustomFormControlDirective.

Pass the fixture parameter for components that use signal input() for formFieldConfig, as direct property assignment does not work with signal inputs.

Parameters :
Name Type Optional Default value Description
component CustomFormControlDirective No

that extends CustomFormControlDirective

propertyName string No "testProperty"

(optional) the name of the property for which the edit component is created

schema any No {}

(optional) additional schema information for the entity field

fixture ComponentFixture Yes

(optional) required for components using signal input() for formFieldConfig

Returns : UntypedFormGroup

src/app/core/import/additional-actions/import-additional/import-additional-actions.component.ts

sortExportOnlyLast
sortExportOnlyLast(a: AdditionalImportAction, b: AdditionalImportAction)
Parameters :
Name Type Optional
a AdditionalImportAction No
b AdditionalImportAction No

src/app/core/import/split-array-value.ts

splitArrayValue
splitArrayValue(val: any, separator: string)

Split a raw value into an array of individual values. Supports JSON arrays and separator-delimited strings.

Parameters :
Name Type Optional Default value Description
val any No

The raw value to split

separator string No ","

The separator character to use for splitting (default: ",")

Returns : string[]

Array of individual string values

src/app/child-dev-project/notes/dashboard-widgets/notes-dashboard/notes-dashboard.component.ts

statsToEntityWithRecentNoteInfo
statsToEntityWithRecentNoteInfo(stat, queryRange: number)

Map a result entry from getDaysSinceLastNoteOfEachEntity to the EntityWithRecentNoteInfo interface

Parameters :
Name Type Optional Description
stat No

Array of [entityId, daysSinceLastNote]

queryRange number No

The query range (the maximum of days that exactly calculated)

src/app/core/entity/schema/entity-schema.service.test-utils.ts

testDatatype
testDatatype<D extends DefaultDatatype>(dataType, objectValue: unknown, databaseValue: unknown, additionalSchemaFieldConfig?: any, additionalProviders?)
Type parameters :
  • D extends DefaultDatatype
Parameters :
Name Type Optional
dataType No
objectValue unknown No
databaseValue unknown No
additionalSchemaFieldConfig any Yes
additionalProviders Yes

src/app/core/entity/model/entity.test-utils.ts

testEntitySubclass
testEntitySubclass(entityType: string, entityClass: EntityConstructor, expectedDatabaseFormat: any, skipTestbedConfiguration: unknown, additionalProviders)

Shared entity subclass test cases for model classes extending Entity.

Parameters :
Name Type Optional Default value Description
entityType string No
entityClass EntityConstructor No
expectedDatabaseFormat any No
skipTestbedConfiguration unknown No false
additionalProviders No []

the datatypes (and their dependencies) used by the entity's schema. Provide the individual DefaultDatatype implementations rather than a module, so the spec does not boot the whole AppModule - see #4192.

src/app/core/common-components/entity-form/FormConfig.ts

toFormFieldConfig
toFormFieldConfig(column: ColumnConfig)
Parameters :
Name Type Optional
column ColumnConfig No
Returns : FormFieldConfig

src/app/core/language/TranslatableMatPaginator.ts

TranslatableMatPaginator
TranslatableMatPaginator()

src/app/core/session/session-states/session-utils.ts

waitForChangeTo
waitForChangeTo<State>(state: State)
Type parameters :
  • State

Waits until the state of a source observable is equal to the given state, then emit that state. All other states are discarded.
After the state has changed to the desired state, subsequent states are let through. if this desire is not intended, use the filter function

Parameters :
Name Type Optional Description
state State No

The state to wait on otherwise continues to emit values from the source observable

Returns : MonoTypeOperatorFunction<State>

results matching ""

    No results matching ""