Actions
Cleanup #42907
openmgr/dashboard: make CdTableSelection generic
% Done:
0%
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Description
The CdTableSelection class of the dashboards frontend is a perfect candidate to become a generic class.
export class CdTableSelection<T> { selected: T[] = []; hasMultiSelection: boolean; hasSingleSelection: boolean; hasSelection: boolean; constructor() { this.update(); } /** * Recalculate the variables based on the current number * of selected rows. */ update() { this.hasSelection = this.selected.length > 0; this.hasSingleSelection = this.selected.length === 1; this.hasMultiSelection = this.selected.length > 1; } /** * Get the first selected row. * @return {T | null} */ first(): T { return this.hasSelection ? this.selected[0] : null; } }
Updated by Patrick Seidensal over 4 years ago
- Subject changed from mgr/dashboard: make CdTableColumn generic to mgr/dashboard: make CdTableSelection generic
- Description updated (diff)
Updated by Ernesto Puerta about 3 years ago
- Project changed from mgr to Dashboard
- Category changed from 132 to General
Actions