From 6b30469b933fe309949d7d910121e1b6e648a66c Mon Sep 17 00:00:00 2001 From: Andrii Shvaika Date: Fri, 10 Apr 2026 18:30:24 +0300 Subject: [PATCH] refactor(iot-hub): sync hardware types and use cases with IoT Hub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware Types: update to 15 values (was 19): Actuator, AI Accelerator, Analyzer, Camera, Controller, Data Logger, Development Board, Display, Gateway, Meter, PLC, Relay, Sensor, Single Board Computer, Tracker Use Cases: flatten to 22 values (was 27 grouped into 8 industries): Air Quality Monitoring, Asset Tracking, Cold Chain, Drones, ... No more group headers — simple flat checkbox list. --- .../iot-hub/iot-hub-browse.component.html | 13 ++++----- .../iot-hub/iot-hub-browse.component.ts | 4 +-- .../models/iot-hub/iot-hub-item.models.ts | 27 +++++++------------ 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html index 0641c14b25..02e4890b6e 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html @@ -136,14 +136,11 @@ {{ 'iot-hub.use-case' | translate }} - @for (group of useCaseGroups; track group.label) { -
{{ group.label }}
- @for (uc of group.values; track uc) { - - {{ uc }} - - } + @for (uc of useCaseValues; track uc) { + + {{ uc }} + } diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts index 66fae7a9dc..4ae8b7c0b6 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts @@ -23,7 +23,7 @@ import { PageData } from '@shared/models/page/page-data'; import { MpItemVersionQuery, MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; import { ItemType, - getCategoriesForType, useCaseTranslations, useCaseGroups, UseCaseGroup, + getCategoriesForType, useCaseTranslations, useCaseValues, connectivityGroups, ConnectivityGroup, hardwareTypes } from '@shared/models/iot-hub/iot-hub-item.models'; import { cfTypeTranslations, widgetTypeTranslations, ruleChainTypeTranslations } from '@shared/models/iot-hub/iot-hub-version.models'; @@ -108,7 +108,7 @@ export class TbIotHubBrowseComponent implements OnInit, OnDestroy { categories = new Map(); useCases: Map = useCaseTranslations as Map; - useCaseGroups: UseCaseGroup[] = useCaseGroups; + useCaseValues: string[] = useCaseValues; connectivityGroups: ConnectivityGroup[] = connectivityGroups; hardwareTypes: string[] = hardwareTypes; cfTypes: Map = cfTypeTranslations; diff --git a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts index e096ded646..1c9064c0bc 100644 --- a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts +++ b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts @@ -180,20 +180,13 @@ export const useCaseTranslations = new Map([ [UseCase.WATER_UTILITIES, 'iot-hub.use-case.water-utilities'] ]); -export interface UseCaseGroup { - label: string; - values: string[]; -} - -export const useCaseGroups: UseCaseGroup[] = [ - { label: 'Energy & Utilities', values: ['Smart Energy', 'Smart Grid', 'Tank Level Monitoring', 'Waste Management'] }, - { label: 'Buildings & Facilities', values: ['Smart Office', 'Smart Buildings', 'HVAC Monitoring', 'Access Control'] }, - { label: 'Environment & Agriculture', values: ['Smart Farming', 'Air Quality Monitoring', 'Environment Monitoring', 'Water Quality'] }, - { label: 'Manufacturing', values: ['Predictive Maintenance', 'Asset Tracking', 'Production Monitoring'] }, - { label: 'Transportation', values: ['Fleet Tracking', 'Cold Chain', 'Connected Vehicles'] }, - { label: 'Health & Safety', values: ['Health Care', 'Safety Monitoring'] }, - { label: 'Retail', values: ['Smart Retail', 'Inventory Tracking'] }, - { label: 'Smart Cities', values: ['Street Lighting', 'Parking', 'Traffic Management'] } +export const useCaseValues: string[] = [ + 'Air Quality Monitoring', 'Asset Tracking', 'Cold Chain', 'Drones', + 'Environment Monitoring', 'Fleet Tracking', 'Health Care', 'Industrial Automation', + 'Predictive Maintenance', 'Robotics', 'SCADA', 'Smart Building', + 'Smart City', 'Smart Energy', 'Smart Farming', 'Smart Home', + 'Smart Metering', 'Smart Office', 'Smart Retail', 'Solar Monitoring', + 'Tank Level Monitoring', 'Waste Management' ]; export interface ConnectivityGroup { @@ -208,9 +201,9 @@ export const connectivityGroups: ConnectivityGroup[] = [ ]; export const hardwareTypes: string[] = [ - 'Accelerometer', 'Actuator', 'Analyzer', 'Controller', 'Data Logger', 'Detector', - 'Energy Meter', 'Gateway', 'Microcontroller', 'Module', 'Monitor', 'Probe', 'Relay', - 'Sensor', 'Station', 'Switch', 'System', 'Tracker', 'Transmitter' + 'Actuator', 'AI Accelerator', 'Analyzer', 'Camera', 'Controller', 'Data Logger', + 'Development Board', 'Display', 'Gateway', 'Meter', 'PLC', 'Relay', + 'Sensor', 'Single Board Computer', 'Tracker' ]; export function getCategoriesForType(type: ItemType): Map {