Browse Source

move components from shared to widget lib

pull/8337/head
Maksym Dudnik 3 years ago
parent
commit
b767098c01
  1. 12
      ui-ngx/src/app/modules/common/modules-map.ts
  2. 5
      ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts
  3. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/device-gateway-command.component.html
  4. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/device-gateway-command.component.ts
  5. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.html
  6. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.scss
  7. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.ts
  8. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.html
  9. 2
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.scss
  10. 4
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.ts
  11. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.html
  12. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.scss
  13. 4
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.ts
  14. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.html
  15. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.scss
  16. 2
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.ts
  17. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.html
  18. 0
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.scss
  19. 2
      ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.ts
  20. 22
      ui-ngx/src/app/modules/home/components/widget/widget-components.module.ts
  21. 11
      ui-ngx/src/app/modules/home/pages/device/device.component.html
  22. 18
      ui-ngx/src/app/shared/shared.module.ts

12
ui-ngx/src/app/modules/common/modules-map.ts

@ -300,13 +300,7 @@ import * as QueueFormComponent from '@home/components/queue/queue-form.component
import * as AssetProfileComponent from '@home/components/profile/asset-profile.component';
import * as AssetProfileDialogComponent from '@home/components/profile/asset-profile-dialog.component';
import * as AssetProfileAutocompleteComponent from '@home/components/profile/asset-profile-autocomplete.component';
import * as DeviceGatewayCommandComponent from '@shared/components/device/device-gateway-command.component';
import * as GatewayRemoteConfigurationDialogComponent from '@shared/components/dialog/gateway-remote-configuration-dialog';
import * as GatewayConfigurationComponent from '@shared/components/device/gateway-configuration.component';
import * as GatewayConnectorComponent from '@shared/components/device/gateway-connectors.component';
import * as GatewayLogsComponent from '@shared/components/device/gateway-logs.component';
import * as GatewayStatisticsComponent from '@shared/components/device/gateway-statistics.component';
import * as GatewayServiceRPCComponent from '@shared/components/device/gateway-service-rpc.component';
import * as RuleChainSelectComponent from '@shared/components/rule-chain/rule-chain-select.component';
import { IModulesMap } from '@modules/common/modules-map.models';
@ -414,12 +408,6 @@ class ModulesMap implements IModulesMap {
'@shared/components/help.component': HelpComponent,
'@shared/components/help-markdown.component': HelpMarkdownComponent,
'@shared/components/help-popup.component': HelpPopupComponent,
'@shared/components/device/device-gateway-command.component': DeviceGatewayCommandComponent,
'@shared/components/device/gateway-configuration.component': GatewayConfigurationComponent,
'@shared/components/device/gateway-connectors.component': GatewayConnectorComponent,
'@shared/components/device/gateway-logs.component': GatewayLogsComponent,
'@shared/components/device/gateway-statistics.component': GatewayStatisticsComponent,
'@shared/components/device/gateway-service-rpc.component': GatewayServiceRPCComponent,
'@shared/components/device/gateway-remote-configuration-dialog': GatewayRemoteConfigurationDialogComponent,
'@shared/components/tb-checkbox.component': TbCheckboxComponent,
'@shared/components/toast.directive': TbToast,

5
ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts

@ -28,7 +28,7 @@ import {
CustomDialogContainerData
} from '@home/components/widget/dialog/custom-dialog-container.component';
import { SHARED_MODULE_TOKEN } from '@shared/components/tokens';
import { HOME_COMPONENTS_MODULE_TOKEN, SHARED_HOME_COMPONENTS_MODULE_TOKEN } from '@home/components/tokens';
import { HOME_COMPONENTS_MODULE_TOKEN, SHARED_HOME_COMPONENTS_MODULE_TOKEN, WIDGET_COMPONENTS_MODULE_TOKEN } from '@home/components/tokens';
@Injectable()
export class CustomDialogService {
@ -42,6 +42,7 @@ export class CustomDialogService {
@Inject(SHARED_MODULE_TOKEN) private sharedModule: Type<any>,
@Inject(SHARED_HOME_COMPONENTS_MODULE_TOKEN) private sharedHomeComponentsModule: Type<any>,
@Inject(HOME_COMPONENTS_MODULE_TOKEN) private homeComponentsModule: Type<any>,
@Inject(WIDGET_COMPONENTS_MODULE_TOKEN) private widgetComponentsModule: Type<any>,
public dialog: MatDialog
) {
}
@ -52,7 +53,7 @@ export class CustomDialogService {
customDialog(template: string, controller: (instance: CustomDialogComponent) => void, data?: any,
config?: MatDialogConfig): Observable<any> {
const modules = [this.sharedModule, CommonModule, this.sharedHomeComponentsModule, this.homeComponentsModule];
const modules = [this.sharedModule, CommonModule, this.sharedHomeComponentsModule, this.homeComponentsModule, this.widgetComponentsModule];
if (Array.isArray(this.customModules)) {
modules.push(...this.customModules);
}

0
ui-ngx/src/app/shared/components/device/device-gateway-command.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/device-gateway-command.component.html

0
ui-ngx/src/app/shared/components/device/device-gateway-command.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/device-gateway-command.component.ts

0
ui-ngx/src/app/shared/components/device/gateway-configuration.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.html

0
ui-ngx/src/app/shared/components/device/gateway-configuration.component.scss → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.scss

0
ui-ngx/src/app/shared/components/device/gateway-configuration.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-configuration.component.ts

0
ui-ngx/src/app/shared/components/device/gateway-connectors.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.html

2
ui-ngx/src/app/shared/components/device/gateway-connectors.component.scss → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.scss

@ -24,7 +24,7 @@
width: 100%;
&>mat-card, &>div {
min-width: 50%;
min-width: calc(50% - 15px);
}
mat-card {

4
ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-connectors.component.ts

@ -34,9 +34,9 @@ import { MatSort } from '@angular/material/sort';
import { tap } from 'rxjs/operators';
import { TelemetryWebsocketService } from '@core/ws/telemetry-websocket.service';
import { MatTableDataSource } from '@angular/material/table';
import { GatewayLogLevel } from '@shared/components/device/gateway-configuration.component';
import { GatewayLogLevel } from '@home/components/widget/lib/device/gateway-configuration.component';
import { ActionNotificationShow } from '@core/notification/notification.actions';
import { DialogService } from '@app/core/services/dialog.service';
import { DialogService } from '@core/services/dialog.service';
import { WidgetContext } from '@home/models/widget-component.models';
import { deepClone } from '@core/utils';
import { NULL_UUID } from '@shared/models/id/has-uuid';

0
ui-ngx/src/app/shared/components/device/gateway-logs.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.html

0
ui-ngx/src/app/shared/components/device/gateway-logs.component.scss → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.scss

4
ui-ngx/src/app/shared/components/device/gateway-logs.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-logs.component.ts

@ -30,8 +30,8 @@ import { AttributeDatasource } from "@home/models/datasource/attribute-datasourc
import { Direction, SortOrder } from "@shared/models/page/sort-order";
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { GatewayLogLevel } from '@shared/components/device/gateway-configuration.component';
import { DialogService } from '@app/core/services/dialog.service';
import { GatewayLogLevel } from '@home/components/widget/lib/device/gateway-configuration.component';
import { DialogService } from '@core/services/dialog.service';
import { WidgetContext } from '@home/models/widget-component.models';

0
ui-ngx/src/app/shared/components/device/gateway-service-rpc.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.html

0
ui-ngx/src/app/shared/components/device/gateway-service-rpc.component.scss → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.scss

2
ui-ngx/src/app/shared/components/device/gateway-service-rpc.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-service-rpc.component.ts

@ -24,7 +24,7 @@ import { AttributeService } from '@core/http/attribute.service';
import { DeviceService } from '@core/http/device.service';
import { TranslateService } from '@ngx-translate/core';
import { PageComponent } from "@shared/components/page.component";
import { DialogService } from '@app/core/services/dialog.service';
import { DialogService } from '@core/services/dialog.service';
import { WidgetContext } from '@home/models/widget-component.models';
import { ContentType } from '@shared/models/constants';
import {

0
ui-ngx/src/app/shared/components/device/gateway-statistics.component.html → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.html

0
ui-ngx/src/app/shared/components/device/gateway-statistics.component.scss → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.scss

2
ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts → ui-ngx/src/app/modules/home/components/widget/lib/device/gateway-statistics.component.ts

@ -25,7 +25,7 @@ import { DeviceService } from '@core/http/device.service';
import { TranslateService } from '@ngx-translate/core';
import { AttributeData, AttributeScope } from '@shared/models/telemetry/telemetry.models';
import { PageComponent } from '@shared/components/page.component';
import { DialogService } from '@app/core/services/dialog.service';
import { DialogService } from '@core/services/dialog.service';
import { WidgetContext } from '@home/models/widget-component.models';
import { TbFlot } from '@home/components/widget/lib/flot-widget';
import { ResizeObserver } from '@juggle/resize-observer';

22
ui-ngx/src/app/modules/home/components/widget/widget-components.module.ts

@ -43,6 +43,12 @@ import { HomePageWidgetsModule } from '@home/components/widget/lib/home-page/hom
import { WIDGET_COMPONENTS_MODULE_TOKEN } from '@home/components/tokens';
import { FlotWidgetComponent } from '@home/components/widget/lib/flot-widget.component';
import { LegendComponent } from '@home/components/widget/lib/legend.component';
import { GatewayConnectorComponent } from '@home/components/widget/lib/device/gateway-connectors.component';
import { GatewayLogsComponent } from '@home/components/widget/lib/device/gateway-logs.component';
import { GatewayStatisticsComponent } from '@home/components/widget/lib/device/gateway-statistics.component';
import { GatewayServiceRPCComponent } from '@home/components/widget/lib/device/gateway-service-rpc.component';
import { DeviceGatewayCommandComponent } from '@home/components/widget/lib/device/device-gateway-command.component';
import { GatewayConfigurationComponent } from '@home/components/widget/lib/device/gateway-configuration.component';
@NgModule({
declarations:
@ -66,7 +72,13 @@ import { LegendComponent } from '@home/components/widget/lib/legend.component';
MarkdownWidgetComponent,
SelectEntityDialogComponent,
LegendComponent,
FlotWidgetComponent
FlotWidgetComponent,
GatewayConnectorComponent,
GatewayLogsComponent,
GatewayStatisticsComponent,
GatewayServiceRPCComponent,
DeviceGatewayCommandComponent,
GatewayConfigurationComponent
],
imports: [
CommonModule,
@ -94,7 +106,13 @@ import { LegendComponent } from '@home/components/widget/lib/legend.component';
QrCodeWidgetComponent,
MarkdownWidgetComponent,
LegendComponent,
FlotWidgetComponent
FlotWidgetComponent,
GatewayConnectorComponent,
GatewayLogsComponent,
GatewayStatisticsComponent,
GatewayServiceRPCComponent,
DeviceGatewayCommandComponent,
GatewayConfigurationComponent
],
providers: [
{provide: WIDGET_COMPONENTS_MODULE_TOKEN, useValue: WidgetComponentsModule }

11
ui-ngx/src/app/modules/home/pages/device/device.component.html

@ -142,14 +142,11 @@
{{ 'device.overwrite-activity-time' | translate }}
</mat-checkbox>
</div>
<mat-form-field class="mat-block">
<mat-label translate>device.description</mat-label>
<textarea matInput formControlName="description" rows="2"></textarea>
</mat-form-field>
</div>
</fieldset>
<tb-gateway-command *ngIf="entity?.id?.id && entityForm.get('additionalInfo.gateway').value && !isEdit" [deviceId]="entity?.id?.id"></tb-gateway-command>
<div formGroupName="additionalInfo" fxLayout="column">
<mat-form-field class="mat-block" >
<mat-label translate>device.description</mat-label>
<textarea matInput formControlName="description" rows="2"></textarea>
</mat-form-field>
</div>
</form>
</div>

18
ui-ngx/src/app/shared/shared.module.ts

@ -177,13 +177,7 @@ import { NotificationComponent } from '@shared/components/notification/notificat
import { TemplateAutocompleteComponent } from '@shared/components/notification/template-autocomplete.component';
import { SlackConversationAutocompleteComponent } from '@shared/components/slack-conversation-autocomplete.component';
import { DateAgoPipe } from '@shared/pipe/date-ago.pipe';
import { DeviceGatewayCommandComponent } from '@shared/components/device/device-gateway-command.component';
import { GatewayConfigurationComponent } from '@shared/components/device/gateway-configuration.component';
import { GatewayRemoteConfigurationDialogComponent } from '@shared/components/dialog/gateway-remote-configuration-dialog';
import { GatewayConnectorComponent } from '@shared/components/device/gateway-connectors.component';
import { GatewayLogsComponent } from '@shared/components/device/gateway-logs.component';
import { GatewayStatisticsComponent } from '@shared/components/device/gateway-statistics.component';
import { GatewayServiceRPCComponent } from '@shared/components/device/gateway-service-rpc.component';
import {
TbBreakPointsProvider,
MdLgLayoutDirective,
@ -270,12 +264,6 @@ export const MarkedOptionsFactory = (markedOptionsService: MarkedOptionsService)
HelpComponent,
HelpMarkdownComponent,
HelpPopupComponent,
DeviceGatewayCommandComponent,
GatewayConfigurationComponent,
GatewayConnectorComponent,
GatewayLogsComponent,
GatewayStatisticsComponent,
GatewayServiceRPCComponent,
GatewayRemoteConfigurationDialogComponent,
TbCheckboxComponent,
TbSnackBarComponent,
@ -455,12 +443,6 @@ export const MarkedOptionsFactory = (markedOptionsService: MarkedOptionsService)
HelpComponent,
HelpMarkdownComponent,
HelpPopupComponent,
DeviceGatewayCommandComponent,
GatewayConfigurationComponent,
GatewayConnectorComponent,
GatewayLogsComponent,
GatewayStatisticsComponent,
GatewayServiceRPCComponent,
GatewayRemoteConfigurationDialogComponent,
TbCheckboxComponent,
TbErrorComponent,

Loading…
Cancel
Save