Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TaskContentComponent

Hierarchy

  • AbstractTaskContentComponent
    • TaskContentComponent

Index

Constructors

  • new TaskContentComponent(_fieldConverter: FieldConverterService, taskContentService: TaskContentService, _paperView: PaperViewService, _logger: LoggerService, _taskEventService: TaskEventService, config: any): TaskContentComponent

Properties

DEFAULT_ASYNC_RENDERING_CONFIGURATION: AsyncRenderingConfiguration
DEFAULT_COMPACT_DIRECTION: NONE = DataGroupCompact.NONE
DEFAULT_FIELD_ALIGNMENT: CENTER = FieldAlignment.CENTER
DEFAULT_HIDE_EMPTY_ROWS: ALL = DataGroupHideEmptyRows.ALL
DEFAULT_LAYOUT_TYPE: LEGACY = DataGroupLayoutType.LEGACY
_asyncRenderTimeout: number
_asyncRenderingConfig: AsyncRenderingConfiguration
_dataSource$: BehaviorSubject<Subgrid[]>

The data fields that are currently displayed

_defaultAlignment: FieldAlignment
_defaultCompactDirection: DataGroupCompact
_defaultHideEmptyRows: DataGroupHideEmptyRows
_defaultNumberOfCols: number
_existingSubgridIds: Set<string>
_fieldConverter: FieldConverterService
_logger: LoggerService
_paperView: PaperViewService
_subTaskContent: Subscription
_subTaskEvent: Subscription
_subgridIdCounter: IncrementingCounter
_taskEventService: TaskEventService
displayNoDataIcon: boolean

Whether an icon should be displayed when the no data message is shown.

An icon is displayed by default

fieldTypeResource: typeof FieldTypeResource

Exists to allow references to the enum in the HTML

hasDataToDisplay$: Observable<boolean>

Emits true if there is at least one data field, that should be displayed. Emits false otherwise.

loading$: LoadingEmitter

Indicates whether data is being loaded from backend, or if it is being processed.

noDataIcon: string

The icon that should be displayed when the task contains no data.

If a falsy value is provided the default icon is displayed

noDataText: string

The translate text that should be displayed when the task contains no data.

If a falsy value is provided the default text is displayed

rowHeight: number

Defines the row height of one row in task content

taskContentComponentClass: typeof TaskContentComponent = TaskContentComponent
taskContentService: TaskContentService
taskEvent: EventEmitter<TaskEventNotification>

Emits notifications about task events

trackByFn: ((index: number, element: DatafieldGridLayoutElement) => string)

Type declaration

    • (index: number, element: DatafieldGridLayoutElement): string
    • Parameters

      • index: number
      • element: DatafieldGridLayoutElement

      Returns string

trackBySubgridFn: ((index: number, subgrid: Subgrid) => string)

Type declaration

    • (index: number, subgrid: Subgrid): string
    • Parameters

      • index: number
      • subgrid: Subgrid

      Returns string

ɵcmp: unknown
ɵfac: unknown

Accessors

  • get dataSource(): Subgrid[]
  • Returns Subgrid[]

  • get taskId(): string
  • Returns string

Methods

  • cloneAndFilterHidden(dataGroups: DataGroup[]): DataGroup[]
  • Creates a duplicate of the provided data group array and filters away any fields and data groups that are marked as hidden. Because of the duplication the filtering doesn't affect the original instances and they remain unchanged.

    Parameters

    • dataGroups: DataGroup[]

      the data groups that should be filtered

    Returns DataGroup[]

    the filtered duplicated data groups

  • cloneDataGroups(dataGroups: DataGroup[]): DataGroup[]
  • Creates a duplicate of the provided data group array.

    Only the data groups are cloned, the fields are only copied as references.

    Parameters

    • dataGroups: DataGroup[]

      the data groups that should be cloned

    Returns DataGroup[]

    the duplicated data groups

  • collapseGridEmptySpace(grid: string[][], layout: DataGroupLayout, subgrid: Subgrid): void
  • Applies the empty row removal and field compacting rules based on the provided layout configuration.

    The input grid is modified in place.

    Parameters

    • grid: string[][]

      the state of the grid that should be modified

    • layout: DataGroupLayout

      configuration of the applied compacting rules

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns void

  • compactFieldsUp(grid: string[][], hideRows: DataGroupHideEmptyRows, subgrid: Subgrid): void
  • Moves any element as far UP as it can go. Elements that were originally declared in the same row might end up in different rows. Resulting trailing empty rows are removed.

    The input grid is modified in place.

    Parameters

    • grid: string[][]

      the state of the grid that should be modified

    • hideRows: DataGroupHideEmptyRows

      configuration for empty row removal during the compacting process

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns void

  • computeDefaultLayoutConfiguration(): void
  • Returns void

    the default alignment for the displayed task that can be overridden by fields individual property. If te task specifies no default value the [global default]{@link AbstractTaskContentComponent#DEFAULT_FIELD_ALIGNMENT} value is returned.

  • computeFlowLayout(dataGroup: DataGroup, subgrid: Subgrid): void
  • Computes the layout data for a single data group with flow layout. The resulting layout is saved into the input objects.

    Parameters

    • dataGroup: DataGroup

      the data group that should be laid out into a grid using the flow algorithm

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns void

  • computeGridLayout(dataGroup: DataGroup, subgrid: Subgrid): void
  • Computes the layout data for a single data group with grid layout. The resulting layout is saved into the input objects.

    Parameters

    • dataGroup: DataGroup

      the data group that should be laid out into a grid

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns void

  • computeLayoutData(dataGroups: DataGroup[]): void
  • Computes the layout data for the tasks grid layout and sets the result to the public properties of this class that are then bound to HTML.

    Parameters

    • dataGroups: DataGroup[]

      the data groups that should be laid out

    Returns void

  • computeLegacyLayout(dataGroup: DataGroup, subgrid: Subgrid): void
  • Computes the layout data for a single data group with legacy layout. The resulting layout is saved into the input objects.

    The legacy layout forces the number of columns to be 4 and logs a warning if this was not the case.

    Parameters

    • dataGroup: DataGroup

      the data group that should be laid out into a grid using the legacy algorithm used in NAE versions < 4.0.0

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns void

  • createComponentTaskRefDataGroup(originalDataGroup: DataGroup, taskRef: TaskRefField, title?: string): DataGroup
  • Creates a new data group that contains only the passed task ref. The information about nesting and parent task/case are preserved from the passed original data group.

    Parameters

    • originalDataGroup: DataGroup

      source of the information about parent task/case

    • taskRef: TaskRefField

      the task ref that will be added to the new data group

    • Optional title: string

      optional title for taskref

    Returns DataGroup

  • createSubgridId(dataGroup: DataGroup): string
  • Parameters

    • dataGroup: DataGroup

    Returns string

  • flowFields(dataGroup: DataGroup, subgrid: Subgrid, fieldWidth: number): void
  • Lays out the fields from left to right, from top to bottom. If the width is greater than 1 and the block of flowed fields doesn't fit neatly into the columns (if the width of a single field is not a divisor of column count), then the entire block of fields is left aligned. The last row of fields is aligned to the left, center or right based on the data groups property. If the last row cannot be aligned to the exact center it is offset one grid tile to the left.

    Parameters

    • dataGroup: DataGroup

      the data group that should be laid out into a grid

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    • fieldWidth: number

      the number of grid tiles, that should be occupied by each field

    Returns void

  • getElementDimensions(grid: string[][], x: number, y: number, subgrid: Subgrid): { height: number; width: number }
  • Determines the dimensions of the element in the grid with its top-left corner at the specified position

    Parameters

    • grid: string[][]

      the grid of elements

    • x: number

      the X coordinate of the desired elements top-left corner

    • y: number

      the Y coordinate of the desired elements top-left corner

    • subgrid: Subgrid

      the object that holds the context of the computed layouting unit

    Returns { height: number; width: number }

    the width and height of the specified element

    • height: number
    • width: number
  • getItemAlignment(item: DatafieldGridLayoutElement): string
  • Parameters

    • item: DatafieldGridLayoutElement

      an object containing grid element information

    Returns string

    the Angular flex layouts alignment property for individual data fields based on the layout configuration specified by the process

  • getNumberOfFormColumns(): number
  • Returns number

    the number of columns as specified by the tasks layout property, or 4 if no value is specified.

  • hasRequiredComponentProperty(component: Component, propertyName: string, propertyValue: string): boolean
  • Parameters

    • component: Component
    • propertyName: string
    • propertyValue: string

    Returns boolean

  • initializeLocalFieldLayout(dataGroups: DataGroup[]): void
  • Passes over all the fields in the provided data groups and if they are visible, initializes their local layout attribute.

    Parameters

    • dataGroups: DataGroup[]

      the containers of the fields that should have their local layout initialized

    Returns void

  • isAreaEmpty(grid: string[][], x: number, y: number, width: number, height: number): boolean
  • Determines whether the specified area in the grid contains no elements, or not

    Parameters

    • grid: string[][]

      the grid of elements

    • x: number

      the X coordinate of the tested areas top-left corner

    • y: number

      the Y coordinate of the tested areas top-left corner

    • width: number

      the width of the tested area

    • height: number

      the height of the tested area

    Returns boolean

  • isLastRow(index: number, dataGroup: DataGroup, fieldsPerRow: number): boolean
  • Parameters

    • index: number

      the index of the checked element within its data group

    • dataGroup: DataGroup

      the checked data group

    • fieldsPerRow: number

      the number of fields that is required to fill an entire row

    Returns boolean

    whether the field at the given index is within the last row of elements of the provided data group. Note that if the last row contains enough elements to be completely filled this method returns false.

  • isPaperView(): boolean
  • Returns boolean

  • isTaskRef(field: DataField<unknown>): boolean
  • Parameters

    • field: DataField<unknown>

    Returns boolean

  • newGridRow(width: number, content?: string): string[]
  • Parameters

    • width: number

      width of the row

    • Optional content: string

      the value that should be used to fill all elements in the row

    Returns string[]

  • ngOnDestroy(): void
  • Returns void

  • occupySpace(grid: string[][], y: number, x: number, width: number, value: string, height?: number, checkOccupants?: boolean): void
  • Fills the specified rectangular area with the specified value in the provided grid.

    If the specified area contains values other than the empty string an error will be thrown.

    Parameters

    • grid: string[][]

      the grid that should be modified

    • y: number

      the 0 based row index of the top-left corner of the filled area

    • x: number

      the 0 based column index of the top-left corner of the filled area

    • width: number

      the width of the filled area

    • value: string

      the value that is set into every cell of the grid inside the specified area

    • Optional height: number

      the height of the filled area

    • Optional checkOccupants: boolean

      whether the filled area should be checked for other elements. If a check is performed an error will be thrown if elements are found.

    Returns void

  • preprocessDashboardTaskRef(preprocessedDataGroups: DataGroup[], rawDataGroups: DataGroup[]): DataGroup[]
  • Identifies data groups that represent dashboard tiles, removes them from the data group array and passes them onto the task ref field instance.

    Parameters

    • preprocessedDataGroups: DataGroup[]
    • rawDataGroups: DataGroup[]

    Returns DataGroup[]

    an array of data group objects that does not contain dashboard tiles referenced by the dashboard task ref

  • preprocessDataGroups(dataGroups: DataGroup[]): DataGroup[]
  • Clones the content of the data groups to prevent unintentional memory accesses to source data. Rearranges the data groups to accommodate taskrefs. Filters out hidden and forbidden fields. Populates dashboard task ref fields with dashboard tile data.

    Parameters

    • dataGroups: DataGroup[]

    Returns DataGroup[]

    the preprocessed data groups

  • rearrangeDataGroups(dataGroups: DataGroup[]): PreprocessedDataGroups
  • Clones the content of the data groups to prevent unintentional memory accesses to source data. Rearranges the data groups to accommodate taskrefs. Determines if the data groups contain a dashboard task ref field.

    Parameters

    • dataGroups: DataGroup[]

    Returns PreprocessedDataGroups

    the preprocessed data groups with metadata

  • removeEmptyRows(grid: string[][], firstRow?: number, lastRow?: number): void
  • Removes rows from the grid that only contain empty elements (are empty). The grid is modified in place.

    Parameters

    • grid: string[][]

      the grid that should have it's empty rows removed

    • Optional firstRow: number

      the 0 based index of the first row that should be checked. Use 0 to start from the beginning of the grid.

      If no value is provided, the grid will be checked from the first row.

    • Optional lastRow: number

      the 0 based index of the row where the checking should end. The row with this index is not checked.

      If no value is provided the entire grid from the firstRow will be checked.

      If a value that is smaller or equal to the firstRow is provided no checks will be preformed.

    Returns void

  • renderContent(content?: Subgrid[]): void
  • Destroys the previous content and pushes the new content into the stream

    Parameters

    • Optional content: Subgrid[]

      the new content

    Returns void

  • renderFields(subgrids: Map<string, Subgrid>): void
  • Parameters

    • subgrids: Map<string, Subgrid>

    Returns void

  • resolveContentHeightCss(): string
  • Computes component height if the rows attribute of task layout is set.

    Returns string

  • scrollingNeeded(): boolean
  • Decides whether there is a fixed number of rows and it need-s scrolling

    Returns boolean

  • shouldResolveTaskRefData(dataRef: DataField<any>): boolean
  • Parameters

    • dataRef: DataField<any>

    Returns boolean

  • splitDataGroupOnTaskRef(dataGroup: DataGroup): SplitDataGroup
  • Sorts the input data group based on the Y coordinate of the fields and splits it into parts on the first task ref. If some fields appear before the first task ref they are extracted into a new [startGroup]{@link SplitDataGroup#startGroup}. If some fields appear after the first task ref they are extracted into a new [endGroup]{@link SplitDataGroup#endGroup}.

    Parameters

    • dataGroup: DataGroup

    Returns SplitDataGroup

  • spreadFieldRenderingOverTime(subgrids: Subgrid[], iteration?: number): void
  • Parameters

    • subgrids: Subgrid[]
    • Optional iteration: number

    Returns void

  • trackByDatafields(index: number, element: DatafieldGridLayoutElement): string
  • Parameters

    • index: number
    • element: DatafieldGridLayoutElement

    Returns string

Generated using TypeDoc