Skip to content

feat: add tabs, product type column, and discovered field#3417

Draft
ShradhaGupta31 wants to merge 1 commit into
mainfrom
device-discovery-UI-changes
Draft

feat: add tabs, product type column, and discovered field#3417
ShradhaGupta31 wants to merge 1 commit into
mainfrom
device-discovery-UI-changes

Conversation

@ShradhaGupta31

Copy link
Copy Markdown
Contributor
  • Add three tabs to the devices page: All, Activated and Discovered with live counts in each tab label
  • Add 'Product Type' column (ISM / vPro) derived from fwSku bitmask

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Anything the reviewer should know when reviewing this PR?

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

@ShradhaGupta31 ShradhaGupta31 force-pushed the device-discovery-UI-changes branch 6 times, most recently from 2daa143 to a98454e Compare July 13, 2026 14:57
- Add three tabs to the devices page: All, Activated and Discovered with live counts in each tab label
- Add 'Product Type' column (ISM / vPro) derived from fwSku bitmask

Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds UI affordances on the Devices page to segment devices by status and expose additional device metadata, extending the device model to support a “discovered” flag and deriving a “Product Type” column from fwSku.

Changes:

  • Adds discovered?: boolean to DeviceInfo.
  • Introduces a mat-tab-group with All / Activated / Discovered tabs and client-side tab filtering with per-tab counts.
  • Adds a “Product Type” table column computed from the firmware SKU bitmask.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/models/models.ts Extends DeviceInfo with an optional discovered flag used by the new UI filtering.
src/app/devices/devices.component.ts Adds tab state + filtering, stores server total count, and introduces getProductType() for the new column.
src/app/devices/devices.component.html Adds the tabs UI and renders the new Product Type column in the device table.
Comments suppressed due to low confidence (1)

src/app/devices/devices.component.ts:193

  • The Product Type column is marked sortable (mat-sort-header), but MatTableDataSource will sort by a 'productType' property that doesn't exist on Device. As a result, sorting by this column will not work unless a sortingDataAccessor is provided.
  constructor() {
    this.selectedDevices = new SelectionModel<Device>(true, [])
    this.powerStates = this.devicesService.PowerStates
    if (!this.isCloudMode) {
      this.displayedColumns = [
        'select',
        'hostname',
        'productType',
        'tags',
        'actions',
        'notification'
      ]
    }
  }

Comment on lines +133 to +152
private applyTabFilter(): void {
let filtered: Device[]
switch (this.activeTab()) {
case 1:
filtered = this.allDevicesData.filter(
(d) => d.deviceInfo?.currentMode != null && d.deviceInfo.currentMode !== 'not activated'
)
this.totalCount.set(filtered.length)
break
case 2:
filtered = this.allDevicesData.filter((d) => d.deviceInfo?.discovered === true)
this.totalCount.set(filtered.length)
break
default:
filtered = this.allDevicesData
this.totalCount.set(this.serverTotalCount)
break
}
this.devices.data = filtered
}
Comment on lines +49 to +51
<mat-tab-group (selectedTabChange)="onTabChange($event.index)">
<mat-tab [label]="'All (' + allDevicesData.length + ')'"></mat-tab>
<mat-tab [label]="'Activated (' + activatedCount + ')'"></mat-tab>
Comment on lines +49 to +53
<mat-tab-group (selectedTabChange)="onTabChange($event.index)">
<mat-tab [label]="'All (' + allDevicesData.length + ')'"></mat-tab>
<mat-tab [label]="'Activated (' + activatedCount + ')'"></mat-tab>
<mat-tab [label]="'Discovered (' + discoveredCount + ')'"></mat-tab>
</mat-tab-group>
Comment on lines +129 to +131
<ng-container matColumnDef="productType">
<mat-header-cell *matHeaderCellDef mat-sort-header>Product Type</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="navigateTo(element.guid)">
Comment on lines +392 to +400
getProductType(device: Device): string {
const skuNum = parseInt(device.deviceInfo?.fwSku ?? '', 10)
if (isNaN(skuNum)) return ''
const isISM = (skuNum & 0x10) > 0
const isVPro = (skuNum & 0x08) > 0
if (isISM) return 'ISM'
if (isVPro) return 'vPro'
return ''
}
Comment on lines 128 to 136
<!-- tags Column -->
<ng-container matColumnDef="productType">
<mat-header-cell *matHeaderCellDef mat-sort-header>Product Type</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="navigateTo(element.guid)">
{{ getProductType(element) }}
</mat-cell>
</ng-container>
<!-- tags Column -->
<ng-container matColumnDef="tags">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tabs for devices include product type column, and discovered field

2 participants