Browse Source

refactor(iot-hub): sync hardware types and use cases with IoT Hub

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.
pull/15508/head
Andrii Shvaika 6 months ago
parent
commit
6b30469b93
  1. 13
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts
  3. 27
      ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts

13
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.html

@ -136,14 +136,11 @@
<mat-expansion-panel-header>
<mat-panel-title>{{ 'iot-hub.use-case' | translate }}</mat-panel-title>
</mat-expansion-panel-header>
@for (group of useCaseGroups; track group.label) {
<div class="tb-iot-hub-filter-group-label">{{ group.label }}</div>
@for (uc of group.values; track uc) {
<mat-checkbox [checked]="isUseCaseActive(uc)"
(change)="onUseCaseToggle(uc)">
{{ uc }}
</mat-checkbox>
}
@for (uc of useCaseValues; track uc) {
<mat-checkbox [checked]="isUseCaseActive(uc)"
(change)="onUseCaseToggle(uc)">
{{ uc }}
</mat-checkbox>
}
</mat-expansion-panel>
</div>

4
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<string, string>();
useCases: Map<string, string> = useCaseTranslations as Map<string, string>;
useCaseGroups: UseCaseGroup[] = useCaseGroups;
useCaseValues: string[] = useCaseValues;
connectivityGroups: ConnectivityGroup[] = connectivityGroups;
hardwareTypes: string[] = hardwareTypes;
cfTypes: Map<string, string> = cfTypeTranslations;

27
ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts

@ -180,20 +180,13 @@ export const useCaseTranslations = new Map<UseCase, string>([
[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<string, string> {

Loading…
Cancel
Save