File

platform-components-ng/projects/platform-components-lib/src/lib/components/authoring/qpp-bulk-actions/qpp-bulk-actions.component.ts

Description

QPP Bulk Action Component Purpose: Workflow status change across multiple selected assets.

Implements

OnInit OnChanges OnDestroy

Metadata

changeDetection ChangeDetectionStrategy.OnPush
providers QppBulkActionsService
selector qpp-bulk-actions
templateUrl qpp-bulk-actions.component.html

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(assetService: AssetService, callbackService: CallbackService, dialogService: QppDialogService, qppErrorMessageService: QppErrorMessageService, applicationConfigService: ApplicationConfigService, cdr: ChangeDetectorRef, elementRef: ElementRef)
Parameters :
Name Type Optional
assetService AssetService No
callbackService CallbackService No
dialogService QppDialogService No
qppErrorMessageService QppErrorMessageService No
applicationConfigService ApplicationConfigService No
cdr ChangeDetectorRef No
elementRef ElementRef No

Inputs

assets
Type : QppBulkActionAssets[]
Default value : []
closeBtnInTitleBar
Default value : true
title
Default value : "Bulk Workflow Status Change"

Outputs

afterSubmit
Type : EventEmitter
close
Type : EventEmitter
submit
Type : EventEmitter

Methods

clearAllContentTypeFilters
clearAllContentTypeFilters()

Clears all selected content type filters and resets option selection state.

Returns : void

void

clearFilters
clearFilters()

Clear all filter inputs (status, content type, search term) and rebuild groups.

Returns : void

void

Async confirmSubmit
confirmSubmit()

Handles the confirmation and execution of a bulk submit action.

This method performs the following steps:

  1. Checks if a bulk action is already being applied and exits early if so.
  2. Retrieves the actionable selected items.
  3. Builds the payload for the bulk action.
  4. Executes a pre-submit callback, allowing for payload modification or cancellation.
  5. Emits the submit event with the target items.
  6. Processes the results, handling successes and errors accordingly.
Returns : Promise<void>

Promise Resolves when the bulk action process is complete.

emitCloseEvent
emitCloseEvent()

Emit close output event for parent consumers.

Returns : void

void

fetchAssetDetails
fetchAssetDetails()

Fetches detailed information for the currently selected assets.

  • Resets any previous load errors and clears enriched asset data if no assets are selected.
  • Constructs asset detail requests for each selected asset.
  • Initiates an asynchronous request to retrieve asset details via the asset service.
  • On success:
    • Maps the received asset details to enriched asset objects.
    • Updates the component's enriched assets, workflow groups, workflow list, and content type filter options.
    • Initializes collapsible UI elements and marks the component as initialized.
  • On error:
    • Sets the load error message and clears enriched assets and workflow groups.
  • On completion:
    • Marks loading as complete and triggers change detection.
Returns : void
getConfirmationMessage
getConfirmationMessage()

Build confirmation message shown before executing bulk operation.

Returns : string

string message text

isAssetSelected
isAssetSelected(asset: EnrichedAsset)

Is asset selected

Parameters :
Name Type Optional Description
asset EnrichedAsset No

asset

Returns : boolean

boolean

isTypeSelected
isTypeSelected(option: FilterOption)

Determines whether a given content type option is currently selected.

Parameters :
Name Type Optional Description
option FilterOption No

The filter option to test.

Returns : boolean

boolean True if selected, false otherwise.

ngOnChanges
ngOnChanges(changes: SimpleChanges)

Lifecycle changes hook. Re-fetches asset details when input list of assets changes.

Parameters :
Name Type Optional Description
changes SimpleChanges No

SimpleChanges object

Returns : void

void

ngOnDestroy
ngOnDestroy()

Lifecycle destroy hook. Clears pending debounce timer to avoid post-destroy execution.

Returns : void

void

Async ngOnInit
ngOnInit()

Lifecycle init hook. Loads asset details and determines if property changes should create a revision.

Returns : Promise<void>

Promise

onAssigneeChange
onAssigneeChange(assignees: any[], row?: EnrichedAsset, group?: any)

Updates the target assignees for a specific asset row when the assignee selection changes.

Parameters :
Name Type Optional Description
assignees any[] No

Array of selected user summaries (raw structure depends on routing component).

row EnrichedAsset Yes

Optional reference to the asset row whose assignees changed.

group any Yes
Returns : void

void

onCTDropdownClose
onCTDropdownClose()

On dropdown close event on content type filter

Returns : void

void

onCTDropdownOpen
onCTDropdownOpen()

On dropdown open event on content type filter

Returns : void

void

onFilterLevelWorkflowStatusChange
onFilterLevelWorkflowStatusChange(selectedItems: CollectionWorkflow[])

Handles changes to the filter level workflow status selection.

Parameters :
Name Type Optional Description
selectedItems CollectionWorkflow[] No
  • An array of CollectionWorkflow objects representing the currently selected workflow statuses.
Returns : void
onItemWorkflowStatusChange
onItemWorkflowStatusChange(selectedWorkflow: CollectionWorkflow, asset: EnrichedAsset)

Handles changes to the workflow status selection for a given asset.

This method processes the selected workflow(s) and status(es) from a dropdown, determines the target workflow and status to apply to the asset, and updates the asset's targetWorkflow and targetStatus properties accordingly. It supports both single and multi-select dropdowns by normalizing the input to an array. After updating the asset, it triggers Angular change detection to ensure UI updates.

Parameters :
Name Type Optional Description
selectedWorkflow CollectionWorkflow No
  • The selected workflow(s) from the dropdown. Can be a single CollectionWorkflow or an array of them.
asset EnrichedAsset No
  • The EnrichedAsset object to update with the selected workflow and status.
Returns : void
onRowSelectionChange
onRowSelectionChange(rows: EnrichedAsset[], groupAssets: EnrichedAsset[], group: any)

Handles changes to the selection of rows within a specific group.

Parameters :
Name Type Optional Description
rows EnrichedAsset[] No
  • The full set of assets currently selected in this group.
groupAssets EnrichedAsset[] No
  • The full set of assets that belong to this group.
group any No
Returns : void
onSearchChange
onSearchChange(value: string)

Handles changes to the search input by debouncing the execution of search-related logic.

Parameters :
Name Type Optional
value string No
Returns : void
onTypeFilterApply
onTypeFilterApply()

Applies the selected content type filters. Closes the dropdown UI then rebuilds workflow groups. (Separate from onTypeFilterChange to allow explicit user apply action.)

Returns : void

void

onTypeFilterChange
onTypeFilterChange(contentTypes: FilterOption[])

Handler for content type multi-select changes. Stores a shallow copy of the selected options so change detection triggers and subsequent filtering logic can operate on a stable reference.

Parameters :
Name Type Optional Description
contentTypes FilterOption[] No

Array of selected content type filter options.

Returns : void
setWorkflowDropdownData
setWorkflowDropdownData(group: any)

Set collection workflow data for group

Parameters :
Name Type Optional Description
group any No

group

Returns : void

void

sortTableData
sortTableData(event: any, group: any)

Sorts the assets within a given group based on the specified event parameters.

Parameters :
Name Type Optional Description
event any No
  • The sorting event containing the column id and sort direction.
group any No
  • The group object whose assets array will be sorted.

The method uses Utility.sortByString to sort the assets array in the group by the property specified in event.id. The sort direction is determined by whether event.sort equals "ascending".

Returns : void
statusStyle
statusStyle(statusInfo: Status | null)

Status style

Parameters :
Name Type Optional
statusInfo Status | null No
Returns : literal type

void

submitSelected
submitSelected()

Displays a confirmation dialog with a warning message before submitting the selected items. Handles user actions for confirmation or cancellation:

  • On confirmation, closes the dialog and proceeds with the submission.
  • On cancellation, closes the dialog and aborts the submission.

The confirmation message is generated using getConfirmationMessage(). The dialog uses QppConfirmationTemplateDialogComponent for rendering.

Returns : void

Properties

assetDisplayColumns
Type : DisplayColumn[]
Default value : ASSET_DISPLAY_COLUMNS
collapsibleElem
Type : ElementRef
Decorators :
@ViewChild('collapsible')
confirmationMessage
Type : string
Default value : ""
contentTypeDropdown
Type : ElementRef
Decorators :
@ViewChild('qwcTypeDropdown', {read: ElementRef})
contentTypeFilterDropDownConfig
Type : QwcSelectConfig
Default value : { idKey: "name", searchable: false, popoverClass: "qba-content-type-filter-dropdown", multiSelect: true, closeOnSelect: false, showSelectedItem: false, dropdownAlignCenter: true, placeHolder: "Select Type", }
DROPDOWN_MAX_WIDTH
Type : number
Default value : 200
enrichedAssets
Type : EnrichedAsset[]
Default value : []
errorInfo
Type : Array<literal type>
Default value : []
filterContentType
Type : string | null
Default value : null
filterSearch
Type : string
Default value : ""
filterTypeOptions
Type : FilterOption[]
Default value : []
initialized
Default value : false
initialSelectedTypeOptions
Type : FilterOption[]
Default value : []
isCTDropdownOpen
Default value : false
loadError
Type : string | null
Default value : null
loadingDetails
Default value : false
qwcTypeDropdown
Type : QWCSimpleSelect
Decorators :
@ViewChild('qwcTypeDropdown')
selectedAssets
Type : EnrichedAsset[]
Default value : []
selectedTypeOptions
Type : FilterOption[]
Default value : []
selectedWorkflowOptions
Type : CollectionWorkflow[]
Default value : []
showErrorView
Default value : false
showFilterIcon
Default value : false
statusOptions
Type : Status[]
Default value : []
workflowGroups
Type : literal type[]
Default value : []
workflowsList
Type : CollectionWorkflow[]
Default value : []

result-matching ""

    No results matching ""