Browse Source

[3.0] Improvement code style (#2670)

* Clear code and styles

* Clear import
pull/2677/head
Vladyslav 7 years ago
committed by GitHub
parent
commit
e3e860fe3f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/app-routing.module.ts
  2. 4
      ui-ngx/src/app/core/api/data-aggregator.ts
  3. 2
      ui-ngx/src/app/core/api/datasource-subcription.ts
  4. 2
      ui-ngx/src/app/core/api/widget-api.models.ts
  5. 3
      ui-ngx/src/app/core/core.module.ts
  6. 8
      ui-ngx/src/app/core/core.state.ts
  7. 7
      ui-ngx/src/app/core/guards/auth.guard.ts
  8. 6
      ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts
  9. 5
      ui-ngx/src/app/core/http/alarm.service.ts
  10. 3
      ui-ngx/src/app/core/http/component-descriptor.service.ts
  11. 3
      ui-ngx/src/app/core/http/device.service.ts
  12. 9
      ui-ngx/src/app/core/http/entity.service.ts
  13. 2
      ui-ngx/src/app/core/interceptors/load.selectors.ts
  14. 2
      ui-ngx/src/app/core/notification/notification.actions.ts
  15. 9
      ui-ngx/src/app/core/notification/notification.effects.ts
  16. 9
      ui-ngx/src/app/core/services/broadcast.service.ts
  17. 1
      ui-ngx/src/app/core/services/dashboard-utils.service.ts
  18. 2
      ui-ngx/src/app/core/services/item-buffer.service.ts
  19. 2
      ui-ngx/src/app/core/services/menu.service.ts
  20. 2
      ui-ngx/src/app/core/services/notification.service.ts
  21. 1
      ui-ngx/src/app/core/services/raf.service.ts
  22. 9
      ui-ngx/src/app/core/services/script/node-script-test.service.ts
  23. 9
      ui-ngx/src/app/core/services/time.service.ts
  24. 2
      ui-ngx/src/app/core/services/window.service.ts
  25. 19
      ui-ngx/src/app/core/settings/settings.effects.ts
  26. 2
      ui-ngx/src/app/core/translate/missing-translate-handler.ts
  27. 4
      ui-ngx/src/app/core/translate/translate-default-compiler.ts
  28. 4
      ui-ngx/src/app/core/utils.ts
  29. 10
      ui-ngx/src/app/modules/dashboard/dashboard-pages.routing.module.ts
  30. 2
      ui-ngx/src/app/modules/dashboard/dashboard-routing.module.ts
  31. 2
      ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.html
  32. 2
      ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts
  33. 12
      ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts
  34. 9
      ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts
  35. 4
      ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html
  36. 3
      ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts
  37. 6
      ui-ngx/src/app/modules/home/components/entity/entity-tabs.component.ts
  38. 19
      ui-ngx/src/app/modules/home/components/import-export/import-dialog.component.ts
  39. 2
      ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.scss
  40. 2
      ui-ngx/src/app/modules/home/components/widget/data-keys.component.scss
  41. 3
      ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts
  42. 3
      ui-ngx/src/app/modules/home/components/widget/legend-config-panel.component.ts
  43. 6
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  44. 3
      ui-ngx/src/app/modules/home/components/widget/lib/analogue-radial-gauge.ts
  45. 6
      ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.html
  46. 10
      ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.scss
  47. 2
      ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.ts
  48. 32
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
  49. 2
      ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts
  50. 13
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts
  51. 30
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts
  52. 6
      ui-ngx/src/app/modules/home/components/widget/lib/maps/maps-utils.ts
  53. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.scss
  54. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/google-map.ts
  55. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/here-map.ts
  56. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/image-map.ts
  57. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/openstreet-map.ts
  58. 4
      ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/tencent-map.ts
  59. 2
      ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts
  60. 6
      ui-ngx/src/app/modules/home/components/widget/lib/table-widget.scss
  61. 3
      ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts
  62. 8
      ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts
  63. 4
      ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts
  64. 4
      ui-ngx/src/app/modules/home/dialogs/add-entities-to-customer-dialog.component.ts
  65. 3
      ui-ngx/src/app/modules/home/dialogs/assign-to-customer-dialog.component.ts
  66. 2
      ui-ngx/src/app/modules/home/home-routing.module.ts
  67. 2
      ui-ngx/src/app/modules/home/menu/menu-link.component.ts
  68. 2
      ui-ngx/src/app/modules/home/menu/menu-toggle.component.ts
  69. 4
      ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
  70. 7
      ui-ngx/src/app/modules/home/models/datasource/attribute-datasource.ts
  71. 4
      ui-ngx/src/app/modules/home/models/entity/entity-component.models.ts
  72. 22
      ui-ngx/src/app/modules/home/models/widget-component.models.ts
  73. 6
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts
  74. 1
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.models.ts
  75. 15
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts
  76. 25
      ui-ngx/src/app/modules/home/pages/dashboard/edit-widget.component.ts
  77. 20
      ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts
  78. 18
      ui-ngx/src/app/modules/home/pages/dashboard/manage-dashboard-customers-dialog.component.ts
  79. 2
      ui-ngx/src/app/modules/home/pages/dashboard/states/state-controller.component.ts
  80. 4
      ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts
  81. 8
      ui-ngx/src/app/modules/home/pages/home-links/home-links-routing.module.ts
  82. 3
      ui-ngx/src/app/modules/home/pages/home-links/home-links.component.ts
  83. 2
      ui-ngx/src/app/modules/home/pages/home-links/home-links.module.ts
  84. 2
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.scss
  85. 8
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  86. 10
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-routing.module.ts
  87. 1
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-tabs.component.ts
  88. 2
      ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.html
  89. 2
      ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.ts
  90. 12
      ui-ngx/src/app/modules/home/pages/widget/widget-library.module.ts
  91. 10
      ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts
  92. 3
      ui-ngx/src/app/modules/login/pages/login/login.component.ts
  93. 11
      ui-ngx/src/app/shared/animations/speed-dial-fab.animations.ts
  94. 4
      ui-ngx/src/app/shared/components/circular-progress.directive.ts
  95. 2
      ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.scss
  96. 2
      ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.html
  97. 2
      ui-ngx/src/app/shared/components/dialog/todo-dialog.component.ts
  98. 10
      ui-ngx/src/app/shared/components/directives/tb-json-to-string.directive.ts
  99. 18
      ui-ngx/src/app/shared/components/entity/entity-list-select.component.ts
  100. 39
      ui-ngx/src/app/shared/components/entity/entity-list.component.ts

2
ui-ngx/src/app/app-routing.module.ts

@ -15,7 +15,7 @@
///
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{ path: '',

4
ui-ngx/src/app/core/api/data-aggregator.ts

@ -14,11 +14,11 @@
/// limitations under the License.
///
import { SubscriptionData, SubscriptionUpdateMsg, SubscriptionDataHolder } from '@app/shared/models/telemetry/telemetry.models';
import { SubscriptionData, SubscriptionDataHolder } from '@app/shared/models/telemetry/telemetry.models';
import { AggregationType } from '@shared/models/time/time.models';
import { UtilsService } from '@core/services/utils.service';
import Timeout = NodeJS.Timeout;
import { deepClone } from '@core/utils';
import Timeout = NodeJS.Timeout;
export declare type onAggregatedData = (data: SubscriptionData, detectChanges: boolean) => void;

2
ui-ngx/src/app/core/api/datasource-subcription.ts

@ -28,7 +28,7 @@ import {
} from '@shared/models/telemetry/telemetry.models';
import { DatasourceListener } from './datasource.service';
import { AggregationType, SubscriptionTimewindow, YEAR } from '@shared/models/time/time.models';
import { deepClone, isDefined, isObject, isDefinedAndNotNull } from '@core/utils';
import { deepClone, isDefinedAndNotNull, isObject } from '@core/utils';
import { UtilsService } from '@core/services/utils.service';
import { EntityType } from '@shared/models/entity-type.models';
import { DataAggregator } from '@core/api/data-aggregator';

2
ui-ngx/src/app/core/api/widget-api.models.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Observable, Subject } from 'rxjs';
import { Observable } from 'rxjs';
import { EntityId } from '@app/shared/models/id/entity-id';
import {
DataSet,

3
ui-ngx/src/app/core/core.module.ts

@ -28,7 +28,8 @@ import {
MissingTranslationHandler,
TranslateCompiler,
TranslateLoader,
TranslateModule, TranslateParser
TranslateModule,
TranslateParser
} from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { TbMissingTranslationHandler } from './translate/missing-translate-handler';

8
ui-ngx/src/app/core/core.state.ts

@ -14,13 +14,10 @@
/// limitations under the License.
///
import {
ActionReducerMap,
MetaReducer, Store
} from '@ngrx/store';
import { ActionReducerMap, MetaReducer } from '@ngrx/store';
import { storeFreeze } from 'ngrx-store-freeze';
import { environment as env} from '@env/environment';
import { environment as env } from '@env/environment';
import { initStateFromLocalStorage } from './meta-reducers/init-state-from-local-storage.reducer';
import { debug } from './meta-reducers/debug.reducer';
@ -35,7 +32,6 @@ import { SettingsEffects } from '@app/core/settings/settings.effects';
import { NotificationState } from '@app/core/notification/notification.models';
import { notificationReducer } from '@app/core/notification/notification.reducer';
import { NotificationEffects } from '@app/core/notification/notification.effects';
import { take } from 'rxjs/operators';
export const reducers: ActionReducerMap<AppState> = {
load: loadReducer,

7
ui-ngx/src/app/core/guards/auth.guard.ts

@ -15,12 +15,7 @@
///
import { Injectable, NgZone } from '@angular/core';
import {
ActivatedRouteSnapshot,
CanActivate,
CanActivateChild,
RouterStateSnapshot
} from '@angular/router';
import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router';
import { AuthService } from '../auth/auth.service';
import { select, Store } from '@ngrx/store';
import { AppState } from '../core.state';

6
ui-ngx/src/app/core/guards/confirm-on-exit.guard.ts

@ -15,11 +15,7 @@
///
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
CanDeactivate,
RouterStateSnapshot
} from '@angular/router';
import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router';
import { FormGroup } from '@angular/forms';
import { select, Store } from '@ngrx/store';
import { AppState } from '@core/core.state';

5
ui-ngx/src/app/core/http/alarm.service.ts

@ -16,7 +16,7 @@
import { Injectable } from '@angular/core';
import { defaultHttpOptionsFromConfig, RequestConfig } from './http-utils';
import { Observable } from 'rxjs';
import { EMPTY, Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { PageData } from '@shared/models/page/page-data';
import { EntityId } from '@shared/models/id/entity-id';
@ -36,9 +36,8 @@ import { UtilsService } from '@core/services/utils.service';
import { TimePageLink } from '@shared/models/page/page-link';
import { Direction, SortOrder } from '@shared/models/page/sort-order';
import { concatMap, expand, map, toArray } from 'rxjs/operators';
import { EMPTY } from 'rxjs';
import Timeout = NodeJS.Timeout;
import { isDefined } from '@core/utils';
import Timeout = NodeJS.Timeout;
interface AlarmSourceListenerQuery {
entityType: EntityType;

3
ui-ngx/src/app/core/http/component-descriptor.service.ts

@ -19,8 +19,7 @@ import { HttpClient } from '@angular/common/http';
import { ComponentDescriptor, ComponentType } from '@shared/models/component-descriptor.models';
import { defaultHttpOptionsFromConfig, RequestConfig } from '@core/http/http-utils';
import { Observable, of } from 'rxjs';
import { RuleChainMetaData } from '@shared/models/rule-chain.models';
import { tap, map } from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { RuleNodeType } from '@shared/models/rule-node.models';
@Injectable({

3
ui-ngx/src/app/core/http/device.service.ts

@ -21,7 +21,8 @@ import { HttpClient } from '@angular/common/http';
import { PageLink } from '@shared/models/page/page-link';
import { PageData } from '@shared/models/page/page-data';
import {
ClaimRequest, ClaimResult,
ClaimRequest,
ClaimResult,
Device,
DeviceCredentials,
DeviceInfo,

9
ui-ngx/src/app/core/http/entity.service.ts

@ -642,7 +642,6 @@ export class EntityService {
return result;
}
));
break;
case AliasFilterType.entityList:
return this.getEntities(filter.entityType, filter.entityList, {ignoreLoading: true, ignoreErrors: true}).pipe(
map((entities) => {
@ -654,7 +653,6 @@ export class EntityService {
}
}
));
break;
case AliasFilterType.entityName:
return this.getEntitiesByNameFilter(filter.entityType, filter.entityNameFilter, maxItems,
'', {ignoreLoading: true, ignoreErrors: true}).pipe(
@ -668,7 +666,6 @@ export class EntityService {
}
)
);
break;
case AliasFilterType.stateEntity:
result.stateEntity = true;
if (stateEntityId) {
@ -681,7 +678,6 @@ export class EntityService {
} else {
return of(result);
}
break;
case AliasFilterType.assetType:
return this.getEntitiesByNameFilter(EntityType.ASSET, filter.assetNameFilter, maxItems,
filter.assetType, {ignoreLoading: true, ignoreErrors: true}).pipe(
@ -695,7 +691,6 @@ export class EntityService {
}
)
);
break;
case AliasFilterType.deviceType:
return this.getEntitiesByNameFilter(EntityType.DEVICE, filter.deviceNameFilter, maxItems,
filter.deviceType, {ignoreLoading: true, ignoreErrors: true}).pipe(
@ -709,7 +704,6 @@ export class EntityService {
}
)
);
break;
case AliasFilterType.entityViewType:
return this.getEntitiesByNameFilter(EntityType.ENTITY_VIEW, filter.entityViewNameFilter, maxItems,
filter.entityViewType, {ignoreLoading: true, ignoreErrors: true}).pipe(
@ -723,7 +717,6 @@ export class EntityService {
}
)
);
break;
case AliasFilterType.relationsQuery:
result.stateEntity = filter.rootStateEntity;
let rootEntityType;
@ -768,7 +761,6 @@ export class EntityService {
} else {
return of(result);
}
break;
case AliasFilterType.assetSearchQuery:
case AliasFilterType.deviceSearchQuery:
case AliasFilterType.entityViewSearchQuery:
@ -823,7 +815,6 @@ export class EntityService {
} else {
return of(result);
}
break;
}
}

2
ui-ngx/src/app/core/interceptors/load.selectors.ts

@ -18,9 +18,7 @@ import { createFeatureSelector, createSelector, select, Store } from '@ngrx/stor
import { AppState } from '../core.state';
import { LoadState } from './load.models';
import { AuthUser } from '@shared/models/user.model';
import { take } from 'rxjs/operators';
import { selectAuthUser } from '@core/auth/auth.selectors';
export const selectLoadState = createFeatureSelector<AppState, LoadState>(
'load'

2
ui-ngx/src/app/core/notification/notification.actions.ts

@ -15,7 +15,7 @@
///
import { Action } from '@ngrx/store';
import { NotificationMessage, HideNotification } from '@app/core/notification/notification.models';
import { HideNotification, NotificationMessage } from '@app/core/notification/notification.models';
export enum NotificationActionTypes {
SHOW_NOTIFICATION = '[Notification] Show',

9
ui-ngx/src/app/core/notification/notification.effects.ts

@ -16,14 +16,9 @@
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import {
map,
} from 'rxjs/operators';
import { map } from 'rxjs/operators';
import {
NotificationActions,
NotificationActionTypes
} from '@app/core/notification/notification.actions';
import { NotificationActions, NotificationActionTypes } from '@app/core/notification/notification.actions';
import { NotificationService } from '@app/core/services/notification.service';
@Injectable()

9
ui-ngx/src/app/core/services/broadcast.service.ts

@ -14,11 +14,10 @@
/// limitations under the License.
///
import {Injectable} from '@angular/core';
import {Subject, Subscription} from 'rxjs';
import {NotificationMessage} from '@core/notification/notification.models';
import {BroadcastEvent, BroadcastListener, BroadcastMessage} from '@core/services/broadcast.models';
import {filter} from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { BroadcastEvent, BroadcastListener, BroadcastMessage } from '@core/services/broadcast.models';
import { filter } from 'rxjs/operators';
@Injectable({
providedIn: 'root'

1
ui-ngx/src/app/core/services/dashboard-utils.service.ts

@ -331,7 +331,6 @@ export class DashboardUtilsService {
const states = dashboardConfiguration.states;
const state = states[targetState];
if (state) {
const allWidgets = dashboardConfiguration.widgets;
const result: DashboardLayoutsInfo = {};
for (const l of Object.keys(state.layouts)) {
const layout: DashboardLayout = state.layouts[l];

2
ui-ngx/src/app/core/services/item-buffer.service.ts

@ -16,7 +16,7 @@
import { Injectable } from '@angular/core';
import { Dashboard, DashboardLayoutId } from '@app/shared/models/dashboard.models';
import { EntityAlias, EntityAliasFilter, EntityAliases, EntityAliasInfo, AliasesInfo } from '@shared/models/alias.models';
import { AliasesInfo, EntityAlias, EntityAliases, EntityAliasInfo } from '@shared/models/alias.models';
import { DatasourceType, Widget, WidgetPosition, WidgetSize } from '@shared/models/widget.models';
import { DashboardUtilsService } from '@core/services/dashboard-utils.service';
import { deepClone, isEqual } from '@core/utils';

2
ui-ngx/src/app/core/services/menu.service.ts

@ -23,7 +23,7 @@ import { take } from 'rxjs/operators';
import { HomeSection, MenuSection } from '@core/services/menu.models';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { Authority } from '@shared/models/authority.enum';
import {AuthUser} from '@shared/models/user.model';
import { AuthUser } from '@shared/models/user.model';
@Injectable({
providedIn: 'root'

2
ui-ngx/src/app/core/services/notification.service.ts

@ -16,7 +16,7 @@
import { Injectable } from '@angular/core';
import { HideNotification, NotificationMessage } from '@app/core/notification/notification.models';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { Observable, Subject } from 'rxjs';
@Injectable(

1
ui-ngx/src/app/core/services/raf.service.ts

@ -15,7 +15,6 @@
///
import { Inject, Injectable, NgZone } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { WINDOW } from '@core/services/window.service';
export type CancelAnimationFrame = () => void;

9
ui-ngx/src/app/core/services/script/node-script-test.service.ts

@ -15,11 +15,14 @@
///
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { Observable } from 'rxjs';
import { RuleChainService } from '@core/http/rule-chain.service';
import { map, switchMap } from 'rxjs/operators';
import { switchMap } from 'rxjs/operators';
import { MatDialog } from '@angular/material/dialog';
import { NodeScriptTestDialogComponent, NodeScriptTestDialogData } from '@shared/components/dialog/node-script-test-dialog.component';
import {
NodeScriptTestDialogComponent,
NodeScriptTestDialogData
} from '@shared/components/dialog/node-script-test-dialog.component';
@Injectable({
providedIn: 'root'

9
ui-ngx/src/app/core/services/time.service.ts

@ -15,7 +15,14 @@
///
import { Injectable } from '@angular/core';
import { AggregationType, DAY, defaultTimeIntervals, SECOND, Timewindow, defaultTimewindow } from '@shared/models/time/time.models';
import {
AggregationType,
DAY,
defaultTimeIntervals,
defaultTimewindow,
SECOND,
Timewindow
} from '@shared/models/time/time.models';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { defaultHttpOptions } from '@core/http/http-utils';

2
ui-ngx/src/app/core/services/window.service.ts

@ -16,7 +16,7 @@
import { isPlatformBrowser } from '@angular/common';
import { ClassProvider, FactoryProvider, InjectionToken, PLATFORM_ID, Injectable } from '@angular/core';
import { ClassProvider, FactoryProvider, Injectable, InjectionToken, PLATFORM_ID } from '@angular/core';
/* Create a new injection token for injecting the window into a component. */
export const WINDOW = new InjectionToken('WindowToken');

19
ui-ngx/src/app/core/settings/settings.effects.ts

@ -14,27 +14,16 @@
/// limitations under the License.
///
import { ActivationEnd, ActivationStart, Router } from '@angular/router';
import { ActivationEnd, Router } from '@angular/router';
import { Injectable } from '@angular/core';
import { select, Store } from '@ngrx/store';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { TranslateService } from '@ngx-translate/core';
import { merge } from 'rxjs';
import {
tap,
withLatestFrom,
map,
distinctUntilChanged,
filter
} from 'rxjs/operators';
import { distinctUntilChanged, filter, map, tap, withLatestFrom } from 'rxjs/operators';
import {
SettingsActionTypes,
SettingsActions,
} from './settings.actions';
import {
selectSettingsState
} from './settings.selectors';
import { SettingsActions, SettingsActionTypes, } from './settings.actions';
import { selectSettingsState } from './settings.selectors';
import { AppState } from '@app/core/core.state';
import { LocalStorageService } from '@app/core/local-storage/local-storage.service';
import { TitleService } from '@app/core/services/title.service';

2
ui-ngx/src/app/core/translate/missing-translate-handler.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import {MissingTranslationHandler, MissingTranslationHandlerParams} from '@ngx-translate/core';
import { MissingTranslationHandler, MissingTranslationHandlerParams } from '@ngx-translate/core';
import { customTranslationsPrefix } from '@app/shared/models/constants';
export class TbMissingTranslationHandler implements MissingTranslationHandler {

4
ui-ngx/src/app/core/translate/translate-default-compiler.ts

@ -15,10 +15,12 @@
///
import {
MESSAGE_FORMAT_CONFIG, MessageFormatConfig,
MESSAGE_FORMAT_CONFIG,
MessageFormatConfig,
TranslateMessageFormatCompiler
} from 'ngx-translate-messageformat-compiler';
import { Inject, Injectable, Optional } from '@angular/core';
const parse = require('messageformat-parser').parse;
@Injectable({ providedIn: 'root' })

4
ui-ngx/src/app/core/utils.ts

@ -15,8 +15,8 @@
///
import _ from 'lodash';
import { Observable, Subject, fromEvent, of } from 'rxjs';
import { finalize, share, map } from 'rxjs/operators';
import { fromEvent, Observable, of, Subject } from 'rxjs';
import { finalize, map, share } from 'rxjs/operators';
import base64js from 'base64-js';
export function onParentScrollOrWindowResize(el: Node): Observable<Event> {

10
ui-ngx/src/app/modules/dashboard/dashboard-pages.routing.module.ts

@ -17,18 +17,12 @@
import { Injectable, NgModule } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterModule, Routes } from '@angular/router';
import {Authority} from '@shared/models/authority.enum';
import { Authority } from '@shared/models/authority.enum';
import { DashboardPageComponent } from '@home/pages/dashboard/dashboard-page.component';
import { BreadCrumbConfig, BreadCrumbLabelFunction } from '@shared/components/breadcrumb';
import { widgetTypesBreadcumbLabelFunction } from '@home/pages/widget/widget-library-routing.module';
import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
import { WidgetService } from '@core/http/widget.service';
import { Observable } from 'rxjs';
import { Dashboard } from '@app/shared/models/dashboard.models';
import { DashboardService } from '@core/http/dashboard.service';
import { DashboardUtilsService } from '@core/services/dashboard-utils.service';
import { map } from 'rxjs/operators';
import { dashboardBreadcumbLabelFunction, DashboardResolver } from '@app/modules/home/pages/dashboard/dashboard-routing.module';
import { DashboardResolver } from '@app/modules/home/pages/dashboard/dashboard-routing.module';
import { UtilsService } from '@core/services/utils.service';
import { Widget } from '@app/shared/models/widget.models';

2
ui-ngx/src/app/modules/dashboard/dashboard-routing.module.ts

@ -15,7 +15,7 @@
///
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@core/guards/auth.guard';
import { StoreModule } from '@ngrx/store';

2
ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.html

@ -57,7 +57,7 @@
</div>
<div mat-dialog-actions fxLayoutAlign="end center">
<mat-checkbox formControlName="openDashboard"
style="margin-bottom: 0px; padding-right: 20px;">
style="margin-bottom: 0; padding-right: 20px;">
{{ 'dashboard.open-dashboard' | translate }}
</mat-checkbox>
<button mat-raised-button color="primary"

2
ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts

@ -21,7 +21,7 @@ import { ContactBased } from '@shared/models/contact-based.model';
import { AfterViewInit } from '@angular/core';
import { POSTAL_CODE_PATTERNS } from '@home/models/contact.models';
import { HasId } from '@shared/models/base-data';
import {EntityComponent} from './entity.component';
import { EntityComponent } from './entity.component';
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
export abstract class ContactBasedComponent<T extends ContactBased<HasId>> extends EntityComponent<T> implements AfterViewInit {

12
ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts

@ -16,12 +16,16 @@
import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectorRef,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
ElementRef, EventEmitter,
Input, OnChanges,
OnInit, SimpleChanges,
ElementRef,
EventEmitter,
Input,
OnChanges,
OnInit,
SimpleChanges,
ViewChild
} from '@angular/core';
import { PageComponent } from '@shared/components/page.component';

9
ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts

@ -16,10 +16,13 @@
import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectorRef,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver, ComponentRef,
EventEmitter, Injector,
ComponentFactoryResolver,
ComponentRef,
EventEmitter,
Injector,
Input,
OnDestroy,
OnInit,

4
ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html

@ -106,7 +106,7 @@
<ng-template [ngSwitchCase]="aliasFilterType.relationsQuery">
<section fxLayout="column" id="relationsQueryFilter">
<label class="tb-small">{{ 'alias.root-entity' | translate }}</label>
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0px;">
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0;">
<mat-slide-toggle class="root-state-entity-switch"
formControlName="rootStateEntity">
</mat-slide-toggle>
@ -134,7 +134,7 @@
</div>
</div>
<div fxFlex fxLayout="row">
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0px;">
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0;">
<mat-slide-toggle class="root-state-entity-switch"
formControlName="fetchLastLevelOnly">
</mat-slide-toggle>

3
ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts

@ -16,13 +16,14 @@
import { BaseData, HasId } from '@shared/models/base-data';
import { PageComponent } from '@shared/components/page.component';
import { Input, OnInit, Directive } from '@angular/core';
import { Directive, Input, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
import { PageLink } from '@shared/models/page/page-link';
@Directive()
// tslint:disable-next-line:directive-class-suffix
export abstract class EntityTableHeaderComponent<T extends BaseData<HasId>,
P extends PageLink = PageLink,
L extends BaseData<HasId> = T,

6
ui-ngx/src/app/modules/home/components/entity/entity-tabs.component.ts

@ -16,15 +16,14 @@
import { BaseData, HasId } from '@shared/models/base-data';
import { PageComponent } from '@shared/components/page.component';
import { AfterViewInit, ContentChildren, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren, Directive } from '@angular/core';
import { AfterViewInit, Directive, Input, OnInit, QueryList, ViewChildren } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
import { MatTab } from '@angular/material/tabs';
import { EntityAction } from '@home/models/entity/entity-component.models';
import { BehaviorSubject } from 'rxjs';
import { Authority } from '@app/shared/models/authority.enum';
import { selectAuthUser, getCurrentAuthUser } from '@core/auth/auth.selectors';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { AuthUser } from '@shared/models/user.model';
import { EntityType } from '@shared/models/entity-type.models';
import { AuditLogMode } from '@shared/models/audit-log.models';
@ -35,6 +34,7 @@ import { NgForm } from '@angular/forms';
import { PageLink } from '@shared/models/page/page-link';
@Directive()
// tslint:disable-next-line:directive-class-suffix
export abstract class EntityTabsComponent<T extends BaseData<HasId>,
P extends PageLink = PageLink,
L extends BaseData<HasId> = T,

19
ui-ngx/src/app/modules/home/components/import-export/import-dialog.component.ts

@ -19,27 +19,10 @@ import { ErrorStateMatcher } from '@angular/material/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import {
AbstractControl,
FormArray,
FormBuilder,
FormControl,
FormGroup,
FormGroupDirective,
NgForm, Validators, ValidatorFn
} from '@angular/forms';
import { FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { DialogComponent } from '@app/shared/components/dialog.component';
import { AttributeData } from '@shared/models/telemetry/telemetry.models';
import { EntityAlias, EntityAliases, EntityAliasFilter } from '@shared/models/alias.models';
import { DatasourceType, Widget, widgetType } from '@shared/models/widget.models';
import { AliasEntityType, EntityType } from '@shared/models/entity-type.models';
import { UtilsService } from '@core/services/utils.service';
import { TranslateService } from '@ngx-translate/core';
import { ActionNotificationShow } from '@core/notification/notification.actions';
import { DialogService } from '@core/services/dialog.service';
import { EntityService } from '@core/http/entity.service';
import { Observable, of } from 'rxjs';
export interface ImportDialogData {
importTitle: string;

2
ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.scss

@ -17,7 +17,7 @@
mat-form-field.resource-field {
max-height: 40px;
margin: 10px 0px 0px 0px;
margin: 10px 0 0;
.mat-form-field-wrapper {
padding-bottom: 0;
.mat-form-field-flex {

2
ui-ngx/src/app/modules/home/components/widget/data-keys.component.scss

@ -51,7 +51,7 @@
width: 24px;
height: 24px;
font-size: 24px;
margin-left: 0px;
margin-left: 0;
color: inherit;
opacity: inherit;
}

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

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Injectable, Injector, NgModule } from '@angular/core';
import { Injectable, NgModule } from '@angular/core';
import { Observable } from 'rxjs';
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
@ -36,7 +36,6 @@ export class CustomDialogService {
private translate: TranslateService,
private authService: AuthService,
private dynamicComponentFactoryService: DynamicComponentFactoryService,
private injector: Injector,
public dialog: MatDialog
) {
}

3
ui-ngx/src/app/modules/home/components/widget/legend-config-panel.component.ts

@ -15,7 +15,7 @@
///
import { Component, Inject, InjectionToken, OnInit, ViewContainerRef } from '@angular/core';
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
import { OverlayRef } from '@angular/cdk/overlay';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
@ -60,7 +60,6 @@ export class LegendConfigPanelComponent extends PageComponent implements OnInit
public overlayRef: OverlayRef,
protected store: Store<AppState>,
public fb: FormBuilder,
private overlay: Overlay,
public viewContainerRef: ViewContainerRef) {
super(store);
}

6
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -37,8 +37,7 @@ import { deepClone, isDefined, isNumber } from '@core/utils';
import cssjs from '@core/css/css';
import { PageLink } from '@shared/models/page/page-link';
import { Direction, SortOrder, sortOrderFromString } from '@shared/models/page/sort-order';
import { DataSource } from '@angular/cdk/collections';
import { CollectionViewer, SelectionModel } from '@angular/cdk/collections';
import { CollectionViewer, DataSource, SelectionModel } from '@angular/cdk/collections';
import { BehaviorSubject, forkJoin, fromEvent, merge, Observable, of } from 'rxjs';
import { emptyPageData, PageData } from '@shared/models/page/page-data';
import { entityTypeTranslations } from '@shared/models/entity-type.models';
@ -59,7 +58,8 @@ import {
getColumnWidth,
TableWidgetDataKeySettings,
TableWidgetSettings,
toAlarmColumnDef, widthStyle
toAlarmColumnDef,
widthStyle
} from '@home/components/widget/lib/table-widget.models';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';

3
ui-ngx/src/app/modules/home/components/widget/lib/analogue-radial-gauge.ts

@ -16,7 +16,8 @@
import * as CanvasGauges from 'canvas-gauges';
import {
AnalogueRadialGaugeSettings, getAnalogueRadialGaugeSettingsSchema
AnalogueRadialGaugeSettings,
getAnalogueRadialGaugeSettingsSchema
} from '@home/components/widget/lib/analogue-radial-gauge.models';
import { JsonSettingsSchema } from '@shared/models/widget.models';
import { WidgetContext } from '@home/models/widget-component.models';

6
ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.html

@ -19,7 +19,7 @@
[ngClass]="{'short-mode':ctx.width < 400, 'labels-hidden': settings.hideLabels, 'long-mode': ctx.width >= 400}">
<mat-form-field class="mat-block" [fxHide]="settings.hidePicker" (click)="openNavigatorPanel($event)">
<mat-label *ngIf="!settings.hideLabels" translate>widgets.date-range-navigator.localizationMap.Date picker</mat-label>
<mat-select #datePicker [ngModel]="advancedModel.chosenLabel" matInput>
<mat-select #datePicker [ngModel]="advancedModel.chosenLabel">
<mat-option [value]="advancedModel.chosenLabel">
{{advancedModel.chosenLabel}}
</mat-option>
@ -27,7 +27,7 @@
</mat-form-field>
<mat-form-field class="mat-block" [fxHide]="settings.hideInterval">
<mat-label translate *ngIf="!settings.hideLabels">widgets.date-range-navigator.localizationMap.Interval</mat-label>
<mat-select matInput [(ngModel)]="selectedDateInterval" (ngModelChange)="changeInterval()">
<mat-select [(ngModel)]="selectedDateInterval" (ngModelChange)="changeInterval()">
<mat-option *ngIf="customInterval" [value]="customInterval.ts">
{{'widgets.date-range-navigator.localizationMap.' + customInterval.label | translate}}
</mat-option>
@ -43,7 +43,7 @@
</button>
<mat-form-field class="mat-block" fxFlex.gt-sm>
<mat-label translate *ngIf="!settings.hideLabels">widgets.date-range-navigator.localizationMap.Step size</mat-label>
<mat-select matInput [(ngModel)]="selectedStepSize">
<mat-select [(ngModel)]="selectedStepSize">
<mat-option *ngFor="let date of datesMap | keyvalue: originalOrder" [value]="date.value.ts">
{{'widgets.date-range-navigator.localizationMap.' + date.value.label | translate}}
</mat-option>

10
ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.scss

@ -34,12 +34,6 @@
margin: 4px 0;
}
.navigation {
md-input-container {
margin: 0;
}
}
.picker {
.picker__wrapper {
position: relative;
@ -74,10 +68,6 @@
.drn__element {
width: 100%;
md-input-container {
flex: 1;
}
}
.picker {

2
ui-ngx/src/app/modules/home/components/widget/lib/date-range-navigator/date-range-navigator.component.ts

@ -38,7 +38,7 @@ import {
DateRangeNavigatorSettings,
getFormattedDate
} from '@home/components/widget/lib/date-range-navigator/date-range-navigator.models';
import { DatePipe, KeyValue } from '@angular/common';
import { KeyValue } from '@angular/common';
import * as _moment from 'moment';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';

32
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

@ -43,9 +43,8 @@ import { deepClone, isDefined, isNumber } from '@core/utils';
import cssjs from '@core/css/css';
import { PageLink } from '@shared/models/page/page-link';
import { Direction, SortOrder, sortOrderFromString } from '@shared/models/page/sort-order';
import { DataSource } from '@angular/cdk/collections';
import { CollectionViewer, DataSource } from '@angular/cdk/collections';
import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
import { CollectionViewer } from '@angular/cdk/collections';
import { BehaviorSubject, fromEvent, merge, Observable, of } from 'rxjs';
import { emptyPageData, PageData } from '@shared/models/page/page-data';
import { EntityId } from '@shared/models/id/entity-id';
@ -55,20 +54,21 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import {
CellContentInfo,
CellStyleInfo,
constructTableCssString,
DisplayColumn,
EntityColumn,
EntityData,
fromEntityColumnDef,
getCellContentInfo,
getCellStyleInfo,
getColumnWidth,
getEntityValue,
TableWidgetDataKeySettings,
TableWidgetSettings,
toEntityColumnDef, widthStyle
CellContentInfo,
CellStyleInfo,
constructTableCssString,
DisplayColumn,
EntityColumn,
EntityData,
fromEntityColumnDef,
getCellContentInfo,
getCellStyleInfo,
getColumnWidth,
getEntityValue,
TableWidgetDataKeySettings,
TableWidgetSettings,
toEntityColumnDef,
widthStyle
} from '@home/components/widget/lib/table-widget.models';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';

2
ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts

@ -17,7 +17,7 @@
// tslint:disable-next-line:no-reference
/// <reference path="../../../../../../../src/typings/jquery.flot.typings.d.ts" />
import { JsonSettingsSchema, DataKey, DatasourceData, Datasource } from '@shared/models/widget.models';
import { DataKey, Datasource, DatasourceData, JsonSettingsSchema } from '@shared/models/widget.models';
import * as moment_ from 'moment';
export declare type ChartType = 'line' | 'pie' | 'bar' | 'state' | 'graph';

13
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

@ -14,16 +14,23 @@
/// limitations under the License.
///
import L, { LatLngTuple, LatLngBounds, Point } from 'leaflet';
import L, { LatLngBounds, LatLngTuple } from 'leaflet';
import 'leaflet-providers';
import 'leaflet.markercluster/dist/MarkerCluster.css';
import 'leaflet.markercluster/dist/MarkerCluster.Default.css';
import LM from 'leaflet.markercluster/dist/leaflet.markercluster';
import { MapSettings, MarkerSettings, FormattedData, UnitedMapSettings, PolygonSettings, PolylineSettings } from './map-models';
import {
FormattedData,
MapSettings,
MarkerSettings,
PolygonSettings,
PolylineSettings,
UnitedMapSettings
} from './map-models';
import { Marker } from './markers';
import { Observable, BehaviorSubject } from 'rxjs';
import { BehaviorSubject, Observable } from 'rxjs';
import { filter } from 'rxjs/operators';
import { Polyline } from './polyline';
import { Polygon } from './polygon';

30
ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts

@ -17,22 +17,22 @@
import { MapProviders, UnitedMapSettings } from './map-models';
import LeafletMap from './leaflet-map';
import {
openstreetMapSettingsSchema,
googleMapSettingsSchema,
imageMapSettingsSchema,
tencentMapSettingsSchema,
commonMapSettingsSchema,
routeMapSettingsSchema,
markerClusteringSettingsSchema,
markerClusteringSettingsSchemaLeaflet,
hereMapSettingsSchema,
mapProviderSchema,
mapPolygonSchema
commonMapSettingsSchema,
googleMapSettingsSchema,
hereMapSettingsSchema,
imageMapSettingsSchema,
mapPolygonSchema,
mapProviderSchema,
markerClusteringSettingsSchema,
markerClusteringSettingsSchemaLeaflet,
openstreetMapSettingsSchema,
routeMapSettingsSchema,
tencentMapSettingsSchema
} from './schemes';
import { MapWidgetStaticInterface, MapWidgetInterface } from './map-widget.interface';
import { OpenStreetMap, TencentMap, GoogleMap, HEREMap, ImageMap } from './providers';
import { parseFunction, parseArray, parseData, safeExecute, parseWithTranslation } from '@core/utils';
import { initSchema, addToSchema, mergeSchemes, addCondition, addGroupInfo } from '@core/schema-utils';
import { MapWidgetInterface, MapWidgetStaticInterface } from './map-widget.interface';
import { GoogleMap, HEREMap, ImageMap, OpenStreetMap, TencentMap } from './providers';
import { parseArray, parseData, parseFunction, parseWithTranslation } from '@core/utils';
import { addCondition, addGroupInfo, addToSchema, initSchema, mergeSchemes } from '@core/schema-utils';
import { forkJoin } from 'rxjs';
import { WidgetContext } from '@app/modules/home/models/widget-component.models';
import { getDefCenterPosition } from './maps-utils';

6
ui-ngx/src/app/modules/home/components/widget/lib/maps/maps-utils.ts

@ -15,9 +15,7 @@
///
import L from 'leaflet';
import _ from 'lodash';
import { MarkerSettings, PolylineSettings, PolygonSettings } from './map-models';
import { parseWithTranslation } from '@app/core/utils';
import { MarkerSettings, PolygonSettings, PolylineSettings } from './map-models';
export function createTooltip(target: L.Layer,
settings: MarkerSettings | PolylineSettings | PolygonSettings,
@ -63,4 +61,4 @@ export function getDefCenterPosition(position) {
if (typeof (position) === 'object')
return position;
return [0, 0];
}
}

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.scss

@ -16,10 +16,8 @@
.arrow {
height: 30px;
width: 30px;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAMAAAANxBKoAAACAVBMVEUAAAAAqv9AgP8ggP8udP8qgP8ndv8kbf8kgP8eeP8rcf8mc/8jdP8hev8me/8kdv8jcv8pcP8ic/8neP8leP8ofP8mef8pev8nef8oe/8nef8pef8qfv8qgf8qe/8mev8off8oev8oef8oe/8pev8qe/8oe/8off8pfP8oev8pev8qe/8qfP8pev8pe/8qfP8pe/8oev8pe/8qe/8qfP8qfP8qff8qff8qfP8qff8pe/8qff8qfP8qfP8pev8pev8JYf8KYP8UY/8UZf8WY/8WZv8YZP8bZP8fZv8fZ/8gZv8gZ/8hZP8iZ/8jaf8jav8kaP8kav8ka/8kbP8kbf8kb/8lbP8lbf8lbv8lb/8lcP8mb/8mcP8mcf8ncf8ncv8nc/8ndP8ndf8ocv4odP8odf8odv8od/8oeP8peP8pef8pev8qev8qe/8qfP8rbP8rfP8rff8tc/4vcP4xbv4zcf42dP49df4+gP4/fv5Rif5biP1ul/14mvx4nvyMrfuMrvuWsfuctvuguPuww/vD0fnH1vrI1frK2PrL2fnV3vnb4vnc5fnd5fnd5vne5fnj6vnl6/jm7Pno7fXo7fbo7ffo7fjp7fnp7vjq7vjs8fnt8Pjt8fjw8fXw8fbw8fjy8/jz9fn5+fj7+/f++/j/+/X/+/b/+/f/+/j//Pj//vhoUaHMAAAAQHRSTlMAAwQICwwNDg4REhQWFxscHTI1QkRGSktOU1RdYWFscXJzhYWKqre6wMHDw8PHx8rN09TW1uLi7e/x8vLz9fj5hfwW0QAAAnVJREFUSMeV1fdb00AYB/BzoQjurSjuvQcuFLcgWqTVtLVpL0GS2GuDuLeouPeAiLOuwOFf6WU0ucvq4/d52v6Qz/M+18u97wHgyfh5m5vUYlHt2rV8BojOqGUqonNhVgTegfxZE2JXoMAUFgXYsSoKy3YfnoIiUqxm8UwUnSoaT0WVUuPi6lCUz+ft/+pqNYwqsiwrlm8s45XBVpE7BQgFyeZLbB1ihVwmefjpDSjbi7HwziArCdlU/MArjDHfaestBh4dZs9/JBb/4kVbo5FEr/JaWRL4VPvZ39jMVV4q63qiCx7bIfDJtst/LYt/JnLldaNuACbS9JwiQj4Zu/3HlDr5nEyJivMcgPn0Nogwfaq1Z9igQ7pO9AuqNEJzQINTV5ZghjvywLFG6dYMVRptAF3uPvBc8xPsWH0Q44ccpEqjvaBoa0lI7/ts2kHdCsbDJ5jSSC2/SEU8856x+hDGd+JZujQquvp6ieT7Nyel0o/jCSgzTefq0y81I30f7PRr2i1fbWrd+98yXtMGfOt29wTyiebHpu83dZ+m3U969qSBeje5DHeod8Dx5PeYZ7/rPO8y0XLvk+1J8UcJyLzLScw5kTsgz8Xu2vXJV0uaOSfsGcznZZGcwdi1L5qV13HmDILV3tY1z3fbxa8Wv+Se74VEj/H3jmz0TvuVN4Z+x/ZORF8efU64s/CtUT0vCbk0d/DZTSgxPQ/WhswTSYTZrDNPllaaVQo1q/Y4k63mv+YgmFZxxk6gR/LsCngcO+6nR9lCrfcqqQ2/dxqD7rT1IXhxyB24O8BuCr9eq9axU7F7wYjoy3ty3TZVLaCC2rRxru/hPwVgtEdFK5vOAAAAAElFTkSuQmCC");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAMAAAANxBKoAAACAVBMVEUAAAAAqv9AgP8ggP8udP8qgP8ndv8kbf8kgP8eeP8rcf8mc/8jdP8hev8me/8kdv8jcv8pcP8ic/8neP8leP8ofP8mef8pev8nef8oe/8nef8pef8qfv8qgf8qe/8mev8off8oev8oef8oe/8pev8qe/8oe/8off8pfP8oev8pev8qe/8qfP8pev8pe/8qfP8pe/8oev8pe/8qe/8qfP8qfP8qff8qff8qfP8qff8pe/8qff8qfP8qfP8pev8pev8JYf8KYP8UY/8UZf8WY/8WZv8YZP8bZP8fZv8fZ/8gZv8gZ/8hZP8iZ/8jaf8jav8kaP8kav8ka/8kbP8kbf8kb/8lbP8lbf8lbv8lb/8lcP8mb/8mcP8mcf8ncf8ncv8nc/8ndP8ndf8ocv4odP8odf8odv8od/8oeP8peP8pef8pev8qev8qe/8qfP8rbP8rfP8rff8tc/4vcP4xbv4zcf42dP49df4+gP4/fv5Rif5biP1ul/14mvx4nvyMrfuMrvuWsfuctvuguPuww/vD0fnH1vrI1frK2PrL2fnV3vnb4vnc5fnd5fnd5vne5fnj6vnl6/jm7Pno7fXo7fbo7ffo7fjp7fnp7vjq7vjs8fnt8Pjt8fjw8fXw8fbw8fjy8/jz9fn5+fj7+/f++/j/+/X/+/b/+/f/+/j//Pj//vhoUaHMAAAAQHRSTlMAAwQICwwNDg4REhQWFxscHTI1QkRGSktOU1RdYWFscXJzhYWKqre6wMHDw8PHx8rN09TW1uLi7e/x8vLz9fj5hfwW0QAAAnVJREFUSMeV1fdb00AYB/BzoQjurSjuvQcuFLcgWqTVtLVpL0GS2GuDuLeouPeAiLOuwOFf6WU0ucvq4/d52v6Qz/M+18u97wHgyfh5m5vUYlHt2rV8BojOqGUqonNhVgTegfxZE2JXoMAUFgXYsSoKy3YfnoIiUqxm8UwUnSoaT0WVUuPi6lCUz+ft/+pqNYwqsiwrlm8s45XBVpE7BQgFyeZLbB1ihVwmefjpDSjbi7HwziArCdlU/MArjDHfaestBh4dZs9/JBb/4kVbo5FEr/JaWRL4VPvZ39jMVV4q63qiCx7bIfDJtst/LYt/JnLldaNuACbS9JwiQj4Zu/3HlDr5nEyJivMcgPn0Nogwfaq1Z9igQ7pO9AuqNEJzQINTV5ZghjvywLFG6dYMVRptAF3uPvBc8xPsWH0Q44ccpEqjvaBoa0lI7/ts2kHdCsbDJ5jSSC2/SEU8856x+hDGd+JZujQquvp6ieT7Nyel0o/jCSgzTefq0y81I30f7PRr2i1fbWrd+98yXtMGfOt29wTyiebHpu83dZ+m3U969qSBeje5DHeod8Dx5PeYZ7/rPO8y0XLvk+1J8UcJyLzLScw5kTsgz8Xu2vXJV0uaOSfsGcznZZGcwdi1L5qV13HmDILV3tY1z3fbxa8Wv+Se74VEj/H3jmz0TvuVN4Z+x/ZORF8efU64s/CtUT0vCbk0d/DZTSgxPQ/WhswTSYTZrDNPllaaVQo1q/Y4k63mv+YgmFZxxk6gR/LsCngcO+6nR9lCrfcqqQ2/dxqD7rT1IXhxyB24O8BuCr9eq9axU7F7wYjoy3ty3TZVLaCC2rRxru/hPwVgtEdFK5vOAAAAAElFTkSuQmCC") no-repeat center center;
}
.leaflet-div-icon,

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/google-map.ts

@ -17,7 +17,7 @@
import L from 'leaflet';
import LeafletMap from '../leaflet-map';
import { MapSettings, UnitedMapSettings } from '../map-models';
import { UnitedMapSettings } from '../map-models';
import 'leaflet.gridlayer.googlemutant';
let googleLoaded = false;
@ -54,4 +54,4 @@ export class GoogleMap extends LeafletMap {
document.getElementsByTagName('head')[0].appendChild(script);
}
}
}
}

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/here-map.ts

@ -16,7 +16,7 @@
import L from 'leaflet';
import LeafletMap from '../leaflet-map';
import { MapSettings, UnitedMapSettings } from '../map-models';
import { UnitedMapSettings } from '../map-models';
export class HEREMap extends LeafletMap {
constructor($container, options: UnitedMapSettings) {
@ -27,4 +27,4 @@ export class HEREMap extends LeafletMap {
super.setMap(map);
super.initSettings(options);
}
}
}

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/image-map.ts

@ -16,7 +16,7 @@
import L, { LatLngLiteral } from 'leaflet';
import LeafletMap from '../leaflet-map';
import { MapSettings, UnitedMapSettings } from '../map-models';
import { UnitedMapSettings } from '../map-models';
import { aspectCache } from '@app/core/utils';
const maxZoom = 4;// ?
@ -135,4 +135,4 @@ export class ImageMap extends LeafletMap {
[this.options.yPosKeyName]: (position.lat + 180) / 360
}
}*/
}
}

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/openstreet-map.ts

@ -16,7 +16,7 @@
import L from 'leaflet';
import LeafletMap from '../leaflet-map';
import { MapSettings, UnitedMapSettings } from '../map-models';
import { UnitedMapSettings } from '../map-models';
export class OpenStreetMap extends LeafletMap {
constructor($container, options: UnitedMapSettings) {
@ -27,4 +27,4 @@ export class OpenStreetMap extends LeafletMap {
super.setMap(map);
super.initSettings(options);
}
}
}

4
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/tencent-map.ts

@ -17,7 +17,7 @@
import L from 'leaflet';
import LeafletMap from '../leaflet-map';
import { MapSettings, UnitedMapSettings } from '../map-models';
import { UnitedMapSettings } from '../map-models';
export class TencentMap extends LeafletMap {
constructor($container, options: UnitedMapSettings) {
@ -29,4 +29,4 @@ export class TencentMap extends LeafletMap {
super.setMap(map);
super.initSettings(options);
}
}
}

2
ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts

@ -23,8 +23,8 @@ import { AppState } from '@core/core.state';
import { isDefined, isNumber } from '@core/utils';
import { CanvasDigitalGauge, CanvasDigitalGaugeOptions } from '@home/components/widget/lib/canvas-digital-gauge';
import * as tinycolor_ from 'tinycolor2';
import GenericOptions = CanvasGauges.GenericOptions;
import { ResizeObserver } from '@juggle/resize-observer';
import GenericOptions = CanvasGauges.GenericOptions;
const tinycolor = tinycolor_;

6
ui-ngx/src/app/modules/home/components/widget/lib/table-widget.scss

@ -32,16 +32,16 @@
.mat-row:not(.mat-row-select), .mat-header-row:not(.mat-row-select) {
mat-cell:nth-child(n+2):nth-last-child(n+2), mat-footer-cell:nth-child(n+2):nth-last-child(n+2), mat-header-cell:nth-child(n+2):nth-last-child(n+2) {
padding: 0px 5px;
padding: 0 5px;
}
}
.mat-row.mat-row-select, .mat-header-row.mat-row-select {
mat-cell:nth-child(2), mat-footer-cell:nth-child(2), mat-header-cell:nth-child(2) {
padding: 0px 5px;
padding: 0 5px;
}
mat-cell:nth-child(n+3):nth-last-child(n+2), mat-footer-cell:nth-child(n+3):nth-last-child(n+2), mat-header-cell:nth-child(n+3):nth-last-child(n+2) {
padding: 0px 5px;
padding: 0 5px;
}
}
}

3
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts

@ -44,8 +44,7 @@ import { isDefined, isNumber } from '@core/utils';
import cssjs from '@core/css/css';
import { PageLink } from '@shared/models/page/page-link';
import { Direction, SortOrder, sortOrderFromString } from '@shared/models/page/sort-order';
import { DataSource } from '@angular/cdk/collections';
import { CollectionViewer } from '@angular/cdk/collections';
import { CollectionViewer, DataSource } from '@angular/cdk/collections';
import { BehaviorSubject, fromEvent, merge, Observable, of } from 'rxjs';
import { emptyPageData, PageData } from '@shared/models/page/page-data';
import { catchError, debounceTime, distinctUntilChanged, map, tap } from 'rxjs/operators';

8
ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts

@ -19,15 +19,15 @@ import _ from 'lodash';
import tinycolor from 'tinycolor2';
import { interpolateOnPointSegment } from 'leaflet-geometryutil';
import { Component, OnInit, Input, ViewChild, AfterViewInit, ChangeDetectorRef, SecurityContext } from '@angular/core';
import { AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, SecurityContext, ViewChild } from '@angular/core';
import { MapWidgetController, TbMapWidgetV2 } from '../lib/maps/map-widget2';
import { MapProviders } from '../lib/maps/map-models';
import { parseArray, parseWithTranslation, safeExecute, parseTemplate } from '@app/core/utils';
import { initSchema, addToSchema, addGroupInfo } from '@app/core/schema-utils';
import { parseArray, parseWithTranslation, safeExecute } from '@app/core/utils';
import { addGroupInfo, addToSchema, initSchema } from '@app/core/schema-utils';
import { tripAnimationSchema } from '../lib/maps/schemes';
import { DomSanitizer } from '@angular/platform-browser';
import { WidgetContext } from '@app/modules/home/models/widget-component.models';
import { getRatio, findAngle } from '../lib/maps/maps-utils';
import { findAngle, getRatio } from '../lib/maps/maps-utils';
import { JsonSettingsSchema, WidgetConfig } from '@shared/models/widget.models';
import moment from 'moment';

4
ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts

@ -23,7 +23,9 @@ import {
Datasource,
DatasourceType,
datasourceTypeTranslationMap,
defaultLegendConfig, GroupInfo, JsonSchema,
defaultLegendConfig,
GroupInfo,
JsonSchema,
widgetType
} from '@shared/models/widget.models';
import {

4
ui-ngx/src/app/modules/home/dialogs/add-entities-to-customer-dialog.component.ts

@ -120,16 +120,12 @@ export class AddEntitiesToCustomerDialogComponent extends
switch (this.data.entityType) {
case EntityType.DEVICE:
return this.deviceService.assignDeviceToCustomer(customerId, entityId);
break;
case EntityType.ASSET:
return this.assetService.assignAssetToCustomer(customerId, entityId);
break;
case EntityType.ENTITY_VIEW:
return this.entityViewService.assignEntityViewToCustomer(customerId, entityId);
break;
case EntityType.DASHBOARD:
return this.dashboardService.assignDashboardToCustomer(customerId, entityId);
break;
}
}

3
ui-ngx/src/app/modules/home/dialogs/assign-to-customer-dialog.component.ts

@ -114,13 +114,10 @@ export class AssignToCustomerDialogComponent extends
switch (this.data.entityType) {
case EntityType.DEVICE:
return this.deviceService.assignDeviceToCustomer(customerId, entityId);
break;
case EntityType.ASSET:
return this.assetService.assignAssetToCustomer(customerId, entityId);
break;
case EntityType.ENTITY_VIEW:
return this.entityViewService.assignEntityViewToCustomer(customerId, entityId);
break;
}
}

2
ui-ngx/src/app/modules/home/home-routing.module.ts

@ -15,7 +15,7 @@
///
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home.component';
import { AuthGuard } from '@core/guards/auth.guard';

2
ui-ngx/src/app/modules/home/menu/menu-link.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { MenuSection } from '@core/services/menu.models';
@Component({

2
ui-ngx/src/app/modules/home/menu/menu-toggle.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { MenuSection } from '@core/services/menu.models';
import { Router } from '@angular/router';

4
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

@ -15,13 +15,13 @@
///
import { GridsterComponent, GridsterConfig, GridsterItem, GridsterItemComponentInterface } from 'angular-gridster2';
import { Widget, widgetType, WidgetPosition } from '@app/shared/models/widget.models';
import { Widget, WidgetPosition, widgetType } from '@app/shared/models/widget.models';
import { WidgetLayout, WidgetLayouts } from '@app/shared/models/dashboard.models';
import { IDashboardWidget, WidgetAction, WidgetContext, WidgetHeaderAction } from './widget-component.models';
import { Timewindow } from '@shared/models/time/time.models';
import { Observable, of, Subject } from 'rxjs';
import { guid, isDefined, isEqual, isUndefined } from '@app/core/utils';
import { IterableDiffer, KeyValueDiffer, NgZone } from '@angular/core';
import { IterableDiffer, KeyValueDiffer } from '@angular/core';
import { IAliasController, IStateController } from '@app/core/api/widget-api.models';
export interface WidgetsData {

7
ui-ngx/src/app/modules/home/models/datasource/attribute-datasource.ts

@ -14,10 +14,9 @@
/// limitations under the License.
///
import { CollectionViewer, DataSource } from '@angular/cdk/collections';
import { CollectionViewer, DataSource, SelectionModel } from '@angular/cdk/collections';
import { BehaviorSubject, Observable, of, ReplaySubject } from 'rxjs';
import { emptyPageData, PageData } from '@shared/models/page/page-data';
import { SelectionModel } from '@angular/cdk/collections';
import { PageLink } from '@shared/models/page/page-link';
import { catchError, map, publishReplay, refCount, take, tap } from 'rxjs/operators';
import { EntityId } from '@app/shared/models/id/entity-id';
@ -26,8 +25,8 @@ import {
AttributeData,
AttributeScope,
isClientSideTelemetryType,
TelemetryType,
TelemetrySubscriber
TelemetrySubscriber,
TelemetryType
} from '@shared/models/telemetry/telemetry.models';
import { AttributeService } from '@core/http/attribute.service';
import { TelemetryWebsocketService } from '@core/ws/telemetry-websocket.service';

4
ui-ngx/src/app/modules/home/models/entity/entity-component.models.ts

@ -14,8 +14,8 @@
/// limitations under the License.
///
import {BaseData, HasId} from '@shared/models/base-data';
import {EntityTableConfig} from './entities-table-config.models';
import { BaseData, HasId } from '@shared/models/base-data';
import { EntityTableConfig } from './entities-table-config.models';
export interface AddEntityDialogData<T extends BaseData<HasId>> {
entitiesTableConfig: EntityTableConfig<T>;

22
ui-ngx/src/app/modules/home/models/widget-component.models.ts

@ -17,7 +17,10 @@
import { IDashboardComponent } from '@home/models/dashboard-component.models';
import {
DataSet,
Datasource, DatasourceData,
Datasource,
DatasourceData,
JsonSettingsSchema,
Widget,
WidgetActionDescriptor,
WidgetActionSource,
WidgetConfig,
@ -25,8 +28,7 @@ import {
WidgetType,
widgetType,
WidgetTypeDescriptor,
WidgetTypeParameters,
Widget, JsonSettingsSchema
WidgetTypeParameters
} from '@shared/models/widget.models';
import { Timewindow, WidgetTimewindow } from '@shared/models/time/time.models';
import {
@ -34,10 +36,11 @@ import {
IStateController,
IWidgetSubscription,
IWidgetUtils,
RpcApi, SubscriptionEntityInfo, SubscriptionInfo,
RpcApi,
SubscriptionEntityInfo,
TimewindowFunctions,
WidgetActionsApi,
WidgetSubscriptionApi, WidgetSubscriptionContext, WidgetSubscriptionOptions
WidgetSubscriptionApi
} from '@core/api/widget-api.models';
import { ChangeDetectorRef, ComponentFactory, Injector, NgZone, Type } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
@ -45,13 +48,8 @@ import { RafService } from '@core/services/raf.service';
import { WidgetTypeId } from '@shared/models/id/widget-type-id';
import { TenantId } from '@shared/models/id/tenant-id';
import { WidgetLayout } from '@shared/models/dashboard.models';
import { DeviceService } from '@core/http/device.service';
import { AssetService } from '@app/core/http/asset.service';
import { DialogService } from '@core/services/dialog.service';
import { CustomDialogService } from '@home/components/widget/dialog/custom-dialog.service';
import { isDefined, formatValue } from '@core/utils';
import { forkJoin, Observable, of, ReplaySubject } from 'rxjs';
import { WidgetSubscription } from '@core/api/widget-subscription';
import { formatValue, isDefined } from '@core/utils';
import { forkJoin, of } from 'rxjs';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import {

6
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts

@ -26,8 +26,10 @@ import {
DashboardConfiguration,
DashboardLayoutId,
DashboardLayoutInfo,
DashboardLayoutsInfo, DashboardState,
DashboardStateLayouts, GridSettings,
DashboardLayoutsInfo,
DashboardState,
DashboardStateLayouts,
GridSettings,
WidgetLayout
} from '@app/shared/models/dashboard.models';
import { WINDOW } from '@core/services/window.service';

1
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.models.ts

@ -70,7 +70,6 @@ export declare type DashboardPageLayouts = {[key in DashboardLayoutId]: Dashboar
export class LayoutWidgetsArray implements Iterable<Widget> {
private widgetIds: string[] = [];
private pointer = 0;
private loaded = false;

15
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts

@ -14,23 +14,12 @@
/// limitations under the License.
///
import {
Component,
OnDestroy,
OnInit,
ViewEncapsulation,
Input,
Output,
EventEmitter,
OnChanges,
SimpleChanges
} from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
import { IAliasController } from '@core/api/widget-api.models';
import { NULL_UUID } from '@shared/models/id/has-uuid';
import { WidgetService } from '@core/http/widget.service';
import { widgetType, Widget } from '@shared/models/widget.models';
import { Widget, widgetType } from '@shared/models/widget.models';
import { toWidgetInfo } from '@home/models/widget-component.models';
import { DashboardCallbacks } from '../../models/dashboard-component.models';

25
ui-ngx/src/app/modules/home/pages/dashboard/edit-widget.component.ts

@ -14,35 +14,18 @@
/// limitations under the License.
///
import { Component, OnInit, Input, OnChanges, SimpleChanges, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { ActivatedRoute, Router } from '@angular/router';
import { WidgetService } from '@core/http/widget.service';
import { DialogService } from '@core/services/dialog.service';
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { Dashboard, WidgetLayout } from '@shared/models/dashboard.models';
import { IAliasController } from '@core/api/widget-api.models';
import { Widget, WidgetActionSource, WidgetTypeParameters } from '@shared/models/widget.models';
import { Widget } from '@shared/models/widget.models';
import { WidgetComponentService } from '@home/components/widget/widget-component.service';
import { WidgetConfigComponentData } from '../../models/widget-component.models';
import { deepClone, isDefined, isString } from '@core/utils';
import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
import { EntityType } from '@shared/models/entity-type.models';
import { Observable, of } from 'rxjs';
import { EntityAlias, EntityAliases } from '@shared/models/alias.models';
import { WidgetConfigCallbacks } from '@home/components/widget/widget-config.component.models';
import {
EntityAliasesDialogComponent,
EntityAliasesDialogData
} from '@home/components/alias/entity-aliases-dialog.component';
import {
EntityAliasDialogComponent,
EntityAliasDialogData
} from '@home/components/alias/entity-alias-dialog.component';
import { tap } from 'rxjs/operators';
import { isDefined, isString } from '@core/utils';
import { FormBuilder, FormGroup, NgForm } from '@angular/forms';
@Component({
selector: 'tb-edit-widget',

20
ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts

@ -14,19 +14,15 @@
/// limitations under the License.
///
import {Component, Inject, OnInit, SkipSelf} from '@angular/core';
import { ErrorStateMatcher } from '@angular/material/core';
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import {PageComponent} from '@shared/components/page.component';
import {Store} from '@ngrx/store';
import {AppState} from '@core/core.state';
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm} from '@angular/forms';
import {EntityType} from '@shared/models/entity-type.models';
import {DashboardService} from '@core/http/dashboard.service';
import {forkJoin, Observable} from 'rxjs';
import {DashboardInfo} from '@app/shared/models/dashboard.models';
import {ActionNotificationShow} from '@core/notification/notification.actions';
import {TranslateService} from '@ngx-translate/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { FormBuilder } from '@angular/forms';
import { DashboardService } from '@core/http/dashboard.service';
import { DashboardInfo } from '@app/shared/models/dashboard.models';
import { ActionNotificationShow } from '@core/notification/notification.actions';
import { TranslateService } from '@ngx-translate/core';
import { DialogComponent } from '@shared/components/dialog.component';
import { Router } from '@angular/router';

18
ui-ngx/src/app/modules/home/pages/dashboard/manage-dashboard-customers-dialog.component.ts

@ -14,16 +14,15 @@
/// limitations under the License.
///
import {Component, Inject, OnInit, SkipSelf} from '@angular/core';
import { Component, Inject, OnInit, SkipSelf } from '@angular/core';
import { ErrorStateMatcher } from '@angular/material/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import {PageComponent} from '@shared/components/page.component';
import {Store} from '@ngrx/store';
import {AppState} from '@core/core.state';
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm} from '@angular/forms';
import {EntityType} from '@shared/models/entity-type.models';
import {DashboardService} from '@core/http/dashboard.service';
import {forkJoin, Observable} from 'rxjs';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm } from '@angular/forms';
import { EntityType } from '@shared/models/entity-type.models';
import { DashboardService } from '@core/http/dashboard.service';
import { forkJoin, Observable } from 'rxjs';
import { DialogComponent } from '@shared/components/dialog.component';
import { Router } from '@angular/router';
@ -122,13 +121,10 @@ export class ManageDashboardCustomersDialogComponent extends
switch (this.data.actionType) {
case 'assign':
return this.dashboardService.addDashboardCustomers(dashboardId, customerIds);
break;
case 'manage':
return this.dashboardService.updateDashboardCustomers(dashboardId, customerIds);
break;
case 'unassign':
return this.dashboardService.removeDashboardCustomers(dashboardId, customerIds);
break;
}
}
}

2
ui-ngx/src/app/modules/home/pages/dashboard/states/state-controller.component.ts

@ -19,7 +19,7 @@ import { IDashboardController } from '../dashboard-page.models';
import { DashboardState } from '@app/shared/models/dashboard.models';
import { Subscription } from 'rxjs';
import { NgZone, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router, Params } from '@angular/router';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { StatesControllerService } from '@home/pages/dashboard/states/states-controller.service';
import { EntityId } from '@app/shared/models/id/entity-id';
import { StateParams } from '@app/core/api/widget-api.models';

4
ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts

@ -18,8 +18,8 @@ import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableHeaderComponent } from '../../components/entity/entity-table-header.component';
import {DeviceInfo} from '@app/shared/models/device.models';
import {EntityType} from '@shared/models/entity-type.models';
import { DeviceInfo } from '@app/shared/models/device.models';
import { EntityType } from '@shared/models/entity-type.models';
@Component({
selector: 'tb-device-table-header',

8
ui-ngx/src/app/modules/home/pages/home-links/home-links-routing.module.ts

@ -14,11 +14,11 @@
/// limitations under the License.
///
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {HomeLinksComponent} from './home-links.component';
import {Authority} from '@shared/models/authority.enum';
import { HomeLinksComponent } from './home-links.component';
import { Authority } from '@shared/models/authority.enum';
const routes: Routes = [
{

3
ui-ngx/src/app/modules/home/pages/home-links/home-links.component.ts

@ -15,9 +15,6 @@
///
import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { PageComponent } from '@shared/components/page.component';
import { MenuService } from '@core/services/menu.service';
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
import { MediaBreakpoints } from '@shared/models/constants';

2
ui-ngx/src/app/modules/home/pages/home-links/home-links.module.ts

@ -18,7 +18,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeLinksRoutingModule } from './home-links-routing.module';
import { HomeLinksComponent} from './home-links.component';
import { HomeLinksComponent } from './home-links.component';
import { SharedModule } from '@app/shared/shared.module';
@NgModule({

2
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.scss

@ -114,7 +114,7 @@
overflow-x: hidden;
overflow-y: auto;
.mat-expansion-panel {
border-radius: 0px;
border-radius: 0;
&:last-child {
margin-bottom: 5px;
}

8
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -40,10 +40,12 @@ import { DialogService } from '@core/services/dialog.service';
import { AuthService } from '@core/auth/auth.service';
import { ActivatedRoute, Router } from '@angular/router';
import {
inputNodeComponent, NodeConnectionInfo,
inputNodeComponent,
NodeConnectionInfo,
ResolvedRuleChainMetaData,
RuleChain,
RuleChainConnectionInfo, RuleChainImport,
RuleChainConnectionInfo,
RuleChainImport,
RuleChainMetaData,
ruleChainNodeComponent
} from '@shared/models/rule-chain.models';
@ -73,8 +75,8 @@ import { MatMenuTrigger } from '@angular/material/menu';
import { ItemBufferService, RuleNodeConnection } from '@core/services/item-buffer.service';
import { Hotkey } from 'angular2-hotkeys';
import { EntityType } from '@shared/models/entity-type.models';
import Timeout = NodeJS.Timeout;
import { DebugEventType, EventType } from '@shared/models/event.models';
import Timeout = NodeJS.Timeout;
@Component({
selector: 'tb-rulechain-page',

10
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-routing.module.ts

@ -16,13 +16,16 @@
import * as AngularCore from '@angular/core';
import { Injectable, NgModule } from '@angular/core';
import * as AngularRouter from '@angular/router';
import {
ActivatedRouteSnapshot,
CanActivate,
Resolve, Router,
Resolve,
Router,
RouterModule,
RouterStateSnapshot,
Routes, UrlTree
Routes,
UrlTree
} from '@angular/router';
import { EntitiesTableComponent } from '../../components/entity/entities-table.component';
@ -40,7 +43,6 @@ import { ConfirmOnExitGuard } from '@core/guards/confirm-on-exit.guard';
import * as AngularCommon from '@angular/common';
import * as AngularForms from '@angular/forms';
import * as AngularRouter from '@angular/router';
import * as AngularCdkCoercion from '@angular/cdk/coercion';
import * as AngularCdkKeycodes from '@angular/cdk/keycodes';
import * as AngularMaterialChips from '@angular/material/chips';
@ -49,10 +51,10 @@ import * as AngularMaterialDialog from '@angular/material/dialog';
import * as NgrxStore from '@ngrx/store';
import * as TranslateCore from '@ngx-translate/core';
import * as TbCore from '@core/public-api';
import { ItemBufferService } from '@core/public-api';
import * as TbShared from '@shared/public-api';
import * as TbHomeComponents from '@home/components/public-api';
import * as _moment from 'moment';
import { ItemBufferService } from '@core/public-api';
declare const SystemJS;

1
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-tabs.component.ts

@ -18,7 +18,6 @@ import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component';
import { AssetInfo } from '@app/shared/models/asset.models';
import { RuleChain } from '@shared/models/rule-chain.models';
@Component({

2
ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.html

@ -124,7 +124,7 @@
fxLayoutAlign="start center"
*ngFor="let resource of widget.resources; let i = index" >
<mat-form-field fxFlex class="mat-block resource-field" floatLabel="never"
style="margin: 10px 0px 0px 0px; max-height: 40px;">
style="margin: 10px 0 0 0; max-height: 40px;">
<input required matInput [(ngModel)]="resource.url"
(ngModelChange)="isDirty = true"
placeholder="{{ 'widget.resource-url' | translate }}"/>

2
ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.ts

@ -45,8 +45,8 @@ import {
SaveWidgetTypeAsDialogResult
} from '@home/pages/widget/save-widget-type-as-dialog.component';
import { Subscription } from 'rxjs';
import Timeout = NodeJS.Timeout;
import { ResizeObserver } from '@juggle/resize-observer';
import Timeout = NodeJS.Timeout;
// @dynamic
@Component({

12
ui-ngx/src/app/modules/home/pages/widget/widget-library.module.ts

@ -14,12 +14,12 @@
/// limitations under the License.
///
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SharedModule} from '@shared/shared.module';
import {WidgetsBundleComponent} from '@modules/home/pages/widget/widgets-bundle.component';
import {WidgetLibraryRoutingModule} from '@modules/home/pages/widget/widget-library-routing.module';
import {HomeComponentsModule} from '@modules/home/components/home-components.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@shared/shared.module';
import { WidgetsBundleComponent } from '@modules/home/pages/widget/widgets-bundle.component';
import { WidgetLibraryRoutingModule } from '@modules/home/pages/widget/widget-library-routing.module';
import { HomeComponentsModule } from '@modules/home/components/home-components.module';
import { WidgetLibraryComponent } from './widget-library.component';
import { WidgetEditorComponent } from '@home/pages/widget/widget-editor.component';
import { SelectWidgetTypeDialogComponent } from '@home/pages/widget/select-widget-type-dialog.component';

10
ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts

@ -15,11 +15,11 @@
///
import { Component, Inject } from '@angular/core';
import {Store} from '@ngrx/store';
import {AppState} from '@core/core.state';
import {EntityComponent} from '../../components/entity/entity.component';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {WidgetsBundle} from '@shared/models/widgets-bundle.model';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityComponent } from '../../components/entity/entity.component';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
@Component({

3
ui-ngx/src/app/modules/login/pages/login/login.component.ts

@ -22,8 +22,7 @@ import { PageComponent } from '@shared/components/page.component';
import { FormBuilder } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http';
import { Constants } from '@shared/models/constants';
import { Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
@Component({
selector: 'tb-login',

11
ui-ngx/src/app/shared/animations/speed-dial-fab.animations.ts

@ -14,16 +14,7 @@
/// limitations under the License.
///
import {
animate,
keyframes,
query,
stagger,
state,
style,
transition,
trigger
} from '@angular/animations';
import { animate, keyframes, query, stagger, state, style, transition, trigger } from '@angular/animations';
export const speedDialFabAnimations = [
trigger('fabToggler', [

4
ui-ngx/src/app/shared/components/circular-progress.directive.ts

@ -14,9 +14,7 @@
/// limitations under the License.
///
import { Directive, ElementRef, ViewContainerRef, ComponentFactoryResolver, ComponentRef, Input } from '@angular/core';
import { Overlay } from '@angular/cdk/overlay';
import { MatProgressBar } from '@angular/material/progress-bar';
import { ComponentFactoryResolver, ComponentRef, Directive, ElementRef, Input, ViewContainerRef } from '@angular/core';
import { MatSpinner } from '@angular/material/progress-spinner';
@Directive({

2
ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.scss

@ -32,7 +32,7 @@
padding: 16px;
margin: 10px;
border: solid 1px #ffa500;
border-radius: 0%;
border-radius: 0;
line-height: 0;
}
}

2
ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.html

@ -37,7 +37,7 @@
<div formGroupName="payload" fxLayout="column" style="height: 100%;">
<div fxLayout="row">
<tb-message-type-autocomplete
style="margin-bottom: 0px; min-width: 300px;"
style="margin-bottom: 0; min-width: 300px;"
formControlName="msgType"
required>
</tb-message-type-autocomplete>

2
ui-ngx/src/app/shared/components/dialog/todo-dialog.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
@Component({

10
ui-ngx/src/app/shared/components/directives/tb-json-to-string.directive.ts

@ -14,16 +14,18 @@
/// limitations under the License.
///
import {Directive, ElementRef, forwardRef, HostListener, Renderer2, SkipSelf} from '@angular/core';
import { Directive, ElementRef, forwardRef, HostListener, Renderer2, SkipSelf } from '@angular/core';
import {
ControlValueAccessor,
FormControl, FormGroupDirective,
FormControl,
FormGroupDirective,
NG_VALIDATORS,
NG_VALUE_ACCESSOR, NgForm,
NG_VALUE_ACCESSOR,
NgForm,
ValidationErrors,
Validator
} from '@angular/forms';
import {ErrorStateMatcher} from '@angular/material/core';
import { ErrorStateMatcher } from '@angular/material/core';
@Directive({
selector: '[tb-json-to-string]',

18
ui-ngx/src/app/shared/components/entity/entity-list-select.component.ts

@ -14,15 +14,15 @@
/// limitations under the License.
///
import {AfterViewInit, Component, forwardRef, Input, OnInit} from '@angular/core';
import {ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR} from '@angular/forms';
import {Store} from '@ngrx/store';
import {AppState} from '@core/core.state';
import {TranslateService} from '@ngx-translate/core';
import {AliasEntityType, EntityType, entityTypeTranslations} from '@shared/models/entity-type.models';
import {EntityService} from '@core/http/entity.service';
import {EntityId} from '@shared/models/id/entity-id';
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import { AfterViewInit, Component, forwardRef, Input, OnInit } from '@angular/core';
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { TranslateService } from '@ngx-translate/core';
import { AliasEntityType, EntityType } from '@shared/models/entity-type.models';
import { EntityService } from '@core/http/entity.service';
import { EntityId } from '@shared/models/id/entity-id';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
interface EntityListSelectModel {
entityType: EntityType | AliasEntityType;

39
ui-ngx/src/app/shared/components/entity/entity-list.component.ts

@ -15,38 +15,29 @@
///
import {
AfterContentInit,
AfterViewInit,
Component,
ElementRef,
forwardRef,
Input, OnChanges,
OnInit, SimpleChanges,
SkipSelf,
Input,
OnChanges,
OnInit,
SimpleChanges,
ViewChild
} from '@angular/core';
import {
ControlValueAccessor,
FormBuilder,
FormControl,
FormGroup,
FormGroupDirective,
NG_VALUE_ACCESSOR, NgForm, Validators
} from '@angular/forms';
import {Observable, of} from 'rxjs';
import {map, mergeMap, startWith, tap, share, pairwise, filter} from 'rxjs/operators';
import {Store} from '@ngrx/store';
import {AppState} from '@app/core/core.state';
import {TranslateService} from '@ngx-translate/core';
import {AliasEntityType, EntityType} from '@shared/models/entity-type.models';
import {BaseData} from '@shared/models/base-data';
import {EntityId} from '@shared/models/id/entity-id';
import {EntityService} from '@core/http/entity.service';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import { Observable } from 'rxjs';
import { filter, map, mergeMap, share, tap } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { AppState } from '@app/core/core.state';
import { TranslateService } from '@ngx-translate/core';
import { EntityType } from '@shared/models/entity-type.models';
import { BaseData } from '@shared/models/base-data';
import { EntityId } from '@shared/models/id/entity-id';
import { EntityService } from '@core/http/entity.service';
import { MatAutocomplete } from '@angular/material/autocomplete';
import { MatChipList } from '@angular/material/chips';
import { ErrorStateMatcher } from '@angular/material/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { emptyPageData } from '@shared/models/page/page-data';
@Component({
selector: 'tb-entity-list',

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save