From 1e3271ce71878373a321afd7aa8a1407da0833b7 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 23 Apr 2021 12:26:09 +0300 Subject: [PATCH] UI: move firmware-autocomplete to shared module; Add service map: DeviceProfileService, FirmwareService --- .../app/modules/home/components/home-components.module.ts | 7 ++----- ui-ngx/src/app/modules/home/models/services.map.ts | 6 +++++- .../firmware/firmware-autocomplete.component.html | 0 .../components/firmware/firmware-autocomplete.component.ts | 0 ui-ngx/src/app/shared/shared.module.ts | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) rename ui-ngx/src/app/{modules/home => shared}/components/firmware/firmware-autocomplete.component.html (100%) rename ui-ngx/src/app/{modules/home => shared}/components/firmware/firmware-autocomplete.component.ts (100%) diff --git a/ui-ngx/src/app/modules/home/components/home-components.module.ts b/ui-ngx/src/app/modules/home/components/home-components.module.ts index e9d8fb7aa0..14ec1fdc4e 100644 --- a/ui-ngx/src/app/modules/home/components/home-components.module.ts +++ b/ui-ngx/src/app/modules/home/components/home-components.module.ts @@ -137,7 +137,6 @@ import { EMBED_DASHBOARD_DIALOG_TOKEN } from '@home/components/widget/dialog/emb import { EdgeDownlinkTableComponent } from '@home/components/edge/edge-downlink-table.component'; import { EdgeDownlinkTableHeaderComponent } from '@home/components/edge/edge-downlink-table-header.component'; import { DisplayWidgetTypesPanelComponent } from '@home/components/dashboard-page/widget-types-panel.component'; -import { FirmwareAutocompleteComponent } from '@home/components/firmware/firmware-autocomplete.component'; @NgModule({ declarations: @@ -254,8 +253,7 @@ import { FirmwareAutocompleteComponent } from '@home/components/firmware/firmwar ManageDashboardStatesDialogComponent, DashboardStateDialogComponent, EmbedDashboardDialogComponent, - DisplayWidgetTypesPanelComponent, - FirmwareAutocompleteComponent + DisplayWidgetTypesPanelComponent ], imports: [ CommonModule, @@ -361,8 +359,7 @@ import { FirmwareAutocompleteComponent } from '@home/components/firmware/firmwar ManageDashboardStatesDialogComponent, DashboardStateDialogComponent, EmbedDashboardDialogComponent, - DisplayWidgetTypesPanelComponent, - FirmwareAutocompleteComponent + DisplayWidgetTypesPanelComponent ], providers: [ WidgetComponentService, diff --git a/ui-ngx/src/app/modules/home/models/services.map.ts b/ui-ngx/src/app/modules/home/models/services.map.ts index 64e94f24df..c518249b77 100644 --- a/ui-ngx/src/app/modules/home/models/services.map.ts +++ b/ui-ngx/src/app/modules/home/models/services.map.ts @@ -34,6 +34,8 @@ import { AlarmService } from '@core/http/alarm.service'; import { Router } from '@angular/router'; import { BroadcastService } from '@core/services/broadcast.service'; import { ImportExportService } from '@home/components/import-export/import-export.service'; +import { DeviceProfileService } from '@core/http/device-profile.service'; +import { FirmwareService } from '@core/http/firmware.service'; export const ServicesMap = new Map>( [ @@ -55,6 +57,8 @@ export const ServicesMap = new Map>( ['translate', TranslateService], ['http', HttpClient], ['router', Router], - ['importExport', ImportExportService] + ['importExport', ImportExportService], + ['deviceProfileService', DeviceProfileService], + ['firmwareService', FirmwareService] ] ); diff --git a/ui-ngx/src/app/modules/home/components/firmware/firmware-autocomplete.component.html b/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.html similarity index 100% rename from ui-ngx/src/app/modules/home/components/firmware/firmware-autocomplete.component.html rename to ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.html diff --git a/ui-ngx/src/app/modules/home/components/firmware/firmware-autocomplete.component.ts b/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts similarity index 100% rename from ui-ngx/src/app/modules/home/components/firmware/firmware-autocomplete.component.ts rename to ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index 15d36d6753..925b297e77 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -141,6 +141,7 @@ import { FileSizePipe } from '@shared/pipe/file-size.pipe'; import { WidgetsBundleSearchComponent } from '@shared/components/widgets-bundle-search.component'; import { SelectableColumnsPipe } from '@shared/pipe/selectable-columns.pipe'; import { QuickTimeIntervalComponent } from '@shared/components/time/quick-time-interval.component'; +import { FirmwareAutocompleteComponent } from '@shared/components/firmware/firmware-autocomplete.component'; import { MAT_DATE_LOCALE } from '@angular/material/core'; @NgModule({ @@ -238,6 +239,7 @@ import { MAT_DATE_LOCALE } from '@angular/material/core'; HistorySelectorComponent, EntityGatewaySelectComponent, ContactComponent, + FirmwareAutocompleteComponent, WidgetsBundleSearchComponent ], imports: [ @@ -409,6 +411,7 @@ import { MAT_DATE_LOCALE } from '@angular/material/core'; HistorySelectorComponent, EntityGatewaySelectComponent, ContactComponent, + FirmwareAutocompleteComponent, WidgetsBundleSearchComponent ] })