diff --git a/pom.xml b/pom.xml index 20a2e13531..8301cb782f 100755 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,6 @@ tools application msa - ui @@ -307,6 +306,7 @@ **/*.proto.js docker/haproxy/** docker/tb-node/** + ui/** JAVADOC_STYLE diff --git a/ui-ngx/src/app/shared/components/contact.component.html b/ui-ngx/src/app/modules/home/components/contact.component.html similarity index 100% rename from ui-ngx/src/app/shared/components/contact.component.html rename to ui-ngx/src/app/modules/home/components/contact.component.html diff --git a/ui-ngx/src/app/shared/components/contact.component.ts b/ui-ngx/src/app/modules/home/components/contact.component.ts similarity index 93% rename from ui-ngx/src/app/shared/components/contact.component.ts rename to ui-ngx/src/app/modules/home/components/contact.component.ts index f16993bfbc..cce7d3f03b 100644 --- a/ui-ngx/src/app/shared/components/contact.component.ts +++ b/ui-ngx/src/app/modules/home/components/contact.component.ts @@ -16,7 +16,7 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { COUNTRIES } from '@shared/components/contact.models'; +import { COUNTRIES } from '@home/models/contact.models'; @Component({ selector: 'tb-contact', diff --git a/ui-ngx/src/app/shared/components/details-panel.component.html b/ui-ngx/src/app/modules/home/components/details-panel.component.html similarity index 100% rename from ui-ngx/src/app/shared/components/details-panel.component.html rename to ui-ngx/src/app/modules/home/components/details-panel.component.html diff --git a/ui-ngx/src/app/shared/components/details-panel.component.scss b/ui-ngx/src/app/modules/home/components/details-panel.component.scss similarity index 97% rename from ui-ngx/src/app/shared/components/details-panel.component.scss rename to ui-ngx/src/app/modules/home/components/details-panel.component.scss index bcbc36cbbd..bc7127b393 100644 --- a/ui-ngx/src/app/shared/components/details-panel.component.scss +++ b/ui-ngx/src/app/modules/home/components/details-panel.component.scss @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@import '../../../scss/constants'; +@import '../../../../scss/constants'; :host { width: 100%; diff --git a/ui-ngx/src/app/shared/components/details-panel.component.ts b/ui-ngx/src/app/modules/home/components/details-panel.component.ts similarity index 100% rename from ui-ngx/src/app/shared/components/details-panel.component.ts rename to ui-ngx/src/app/modules/home/components/details-panel.component.ts diff --git a/ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.html b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html similarity index 100% rename from ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.html rename to ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html diff --git a/ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.scss b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.scss similarity index 100% rename from ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.scss rename to ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.scss diff --git a/ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.ts b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.ts similarity index 76% rename from ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.ts rename to ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.ts index a4c0de7ec3..4364e5ff3a 100644 --- a/ui-ngx/src/app/shared/components/entity/add-entity-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.ts @@ -14,26 +14,19 @@ /// limitations under the License. /// -import { - Component, - ComponentFactoryResolver, - Inject, - OnInit, - SkipSelf, - ViewChild -} from '@angular/core'; -import { ErrorStateMatcher, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; -import { PageComponent } from '@shared/components/page.component'; -import { Store } from '@ngrx/store'; -import { AppState } from '@core/core.state'; -import { FormControl, FormGroupDirective, NgForm } from '@angular/forms'; -import { EntityTypeResource, EntityTypeTranslation } from '@shared/models/entity-type.models'; -import { EntityTableConfig } from '@shared/components/entity/entities-table-config.models'; -import { BaseData, HasId } from '@shared/models/base-data'; -import { EntityId } from '@shared/models/id/entity-id'; -import { AddEntityDialogData } from '@shared/components/entity/entity-component.models'; -import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; -import { EntityComponent } from '@shared/components/entity/entity.component'; +import {Component, ComponentFactoryResolver, Inject, OnInit, SkipSelf, ViewChild} from '@angular/core'; +import {ErrorStateMatcher, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; +import {PageComponent} from '@shared/components/page.component'; +import {Store} from '@ngrx/store'; +import {AppState} from '@core/core.state'; +import {FormControl, FormGroupDirective, NgForm} from '@angular/forms'; +import {EntityTypeResource, EntityTypeTranslation} from '@shared/models/entity-type.models'; +import {BaseData, HasId} from '@shared/models/base-data'; +import {EntityId} from '@shared/models/id/entity-id'; +import {TbAnchorComponent} from '@shared/components/tb-anchor.component'; +import {EntityComponent} from './entity.component'; +import {EntityTableConfig} from '@home/models/entity/entities-table-config.models'; +import {AddEntityDialogData} from '@home/models/entity/entity-component.models'; @Component({ selector: 'tb-add-entity-dialog', diff --git a/ui-ngx/src/app/shared/components/entity/contact-based.component.ts b/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts similarity index 95% rename from ui-ngx/src/app/shared/components/entity/contact-based.component.ts rename to ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts index 9f4a50a73f..845fe5741e 100644 --- a/ui-ngx/src/app/shared/components/entity/contact-based.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts @@ -16,12 +16,12 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityComponent } from '@shared/components/entity/entity.component'; import { FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { ContactBased } from '@shared/models/contact-based.model'; import { AfterViewInit } from '@angular/core'; -import { POSTAL_CODE_PATTERNS } from '@shared/components/contact.models'; +import { POSTAL_CODE_PATTERNS } from '@home/models/contact.models'; import { HasId } from '@shared/models/base-data'; +import {EntityComponent} from './entity.component'; export abstract class ContactBasedComponent> extends EntityComponent implements AfterViewInit { diff --git a/ui-ngx/src/app/shared/components/entity/entities-table.component.html b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html similarity index 100% rename from ui-ngx/src/app/shared/components/entity/entities-table.component.html rename to ui-ngx/src/app/modules/home/components/entity/entities-table.component.html diff --git a/ui-ngx/src/app/shared/components/entity/entities-table.component.scss b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.scss similarity index 100% rename from ui-ngx/src/app/shared/components/entity/entities-table.component.scss rename to ui-ngx/src/app/modules/home/components/entity/entities-table.component.scss diff --git a/ui-ngx/src/app/shared/components/entity/entities-table.component.ts b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts similarity index 97% rename from ui-ngx/src/app/shared/components/entity/entities-table.component.ts rename to ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts index e21b048541..9e08976d00 100644 --- a/ui-ngx/src/app/shared/components/entity/entities-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts @@ -29,7 +29,7 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { PageLink, TimePageLink } from '@shared/models/page/page-link'; import { MatDialog, MatPaginator, MatSort } from '@angular/material'; -import { EntitiesDataSource } from '@shared/models/datasource/entity-datasource'; +import { EntitiesDataSource } from '@home/models/datasource/entity-datasource'; import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'; import { Direction, SortOrder } from '@shared/models/page/sort-order'; import { forkJoin, fromEvent, merge, Observable } from 'rxjs'; @@ -43,14 +43,14 @@ import { EntityTableConfig, GroupActionDescriptor, HeaderActionDescriptor -} from '@shared/components/entity/entities-table-config.models'; +} from '@home/models/entity/entities-table-config.models'; import { EntityTypeTranslation } from '@shared/models/entity-type.models'; import { DialogService } from '@core/services/dialog.service'; -import { AddEntityDialogComponent } from '@shared/components/entity/add-entity-dialog.component'; +import { AddEntityDialogComponent } from './add-entity-dialog.component'; import { AddEntityDialogData, EntityAction -} from '@shared/components/entity/entity-component.models'; +} from '@home/models/entity/entity-component.models'; import { Timewindow } from '@shared/models/time/time.models'; import {DomSanitizer, SafeHtml} from '@angular/platform-browser'; import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; diff --git a/ui-ngx/src/app/shared/components/entity/entity-details-panel.component.html b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.html similarity index 69% rename from ui-ngx/src/app/shared/components/entity/entity-details-panel.component.html rename to ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.html index 23e4633fcf..839c8aac75 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-details-panel.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.html @@ -31,13 +31,6 @@ - + diff --git a/ui-ngx/src/app/shared/components/entity/entity-details-panel.component.scss b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.scss similarity index 100% rename from ui-ngx/src/app/shared/components/entity/entity-details-panel.component.scss rename to ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.scss diff --git a/ui-ngx/src/app/shared/components/entity/entity-details-panel.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts similarity index 68% rename from ui-ngx/src/app/shared/components/entity/entity-details-panel.component.ts rename to ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts index e61daaac2e..b791d0a8f5 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-details-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts @@ -23,12 +23,15 @@ import { OnDestroy, OnInit, Output, - ViewChild + ViewChild, + ViewChildren, + QueryList, + ContentChildren, AfterViewInit } from '@angular/core'; import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityTableConfig } from '@shared/components/entity/entities-table-config.models'; +import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; import { BaseData, HasId } from '@shared/models/base-data'; import { EntityType, @@ -36,11 +39,12 @@ import { EntityTypeTranslation } from '@shared/models/entity-type.models'; import { NgForm } from '@angular/forms'; -import { EntityComponent } from '@shared/components/entity/entity.component'; +import { EntityComponent } from './entity.component'; import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; -import { EntityAction } from '@shared/components/entity/entity-component.models'; +import { EntityAction } from '@home/models/entity/entity-component.models'; import { Subscription } from 'rxjs'; -// import { AuditLogMode } from '@shared/models/audit-log.models'; +import { MatTabGroup, MatTab } from '@angular/material'; +import { EntityTabsComponent } from '@home/components/entity/entity-tabs.component'; @Component({ selector: 'tb-entity-details-panel', @@ -48,7 +52,7 @@ import { Subscription } from 'rxjs'; styleUrls: ['./entity-details-panel.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class EntityDetailsPanelComponent extends PageComponent implements OnInit, OnDestroy { +export class EntityDetailsPanelComponent extends PageComponent implements OnInit, AfterViewInit, OnDestroy { @Input() entitiesTableConfig: EntityTableConfig>; @@ -62,6 +66,7 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit entityAction = new EventEmitter>>(); entityComponent: EntityComponent>; + entityTabsComponent: EntityTabsComponent>; detailsForm: NgForm; isEditValue = false; @@ -71,6 +76,12 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit @ViewChild('entityDetailsForm', {static: true}) entityDetailsFormAnchor: TbAnchorComponent; + @ViewChild('entityTabs', {static: true}) entityTabsAnchor: TbAnchorComponent; + + @ViewChild(MatTabGroup, {static: true}) matTabGroup: MatTabGroup; + + @ViewChildren(MatTab) inclusiveTabs: QueryList; + translations: EntityTypeTranslation; resources: EntityTypeResource; entity: BaseData; @@ -94,6 +105,9 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit set isEdit(val: boolean) { this.isEditValue = val; this.entityComponent.isEdit = val; + if (this.entityTabsComponent) { + this.entityTabsComponent.isEdit = val; + } } get isEdit() { @@ -125,6 +139,19 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit this.entityActionSubscription = this.entityComponent.entityAction.subscribe((action) => { this.entityAction.emit(action); }); + this.buildEntityTabsComponent(); + } + + buildEntityTabsComponent() { + if (this.entitiesTableConfig.entityTabsComponent) { + const componentTabsFactory = this.componentFactoryResolver.resolveComponentFactory(this.entitiesTableConfig.entityTabsComponent); + const viewContainerRef = this.entityTabsAnchor.viewContainerRef; + viewContainerRef.clear(); + const componentTabsRef = viewContainerRef.createComponent(componentTabsFactory); + this.entityTabsComponent = componentTabsRef.instance; + this.entityTabsComponent.isEdit = this.isEdit; + this.entityTabsComponent.entitiesTableConfig = this.entitiesTableConfig; + } } reload(): void { @@ -133,6 +160,9 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit (entity) => { this.entity = entity; this.entityComponent.entity = entity; + if (this.entityTabsComponent) { + this.entityTabsComponent.entity = entity; + } } ); } @@ -145,6 +175,9 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit this.isEdit = isEdit; if (!this.isEdit) { this.entityComponent.entity = this.entity; + if (this.entityTabsComponent) { + this.entityTabsComponent.entity = this.entity; + } } else { this.selectedTab = 0; } @@ -157,6 +190,9 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit (entity) => { this.entity = entity; this.entityComponent.entity = entity; + if (this.entityTabsComponent) { + this.entityTabsComponent.entity = entity; + } this.isEdit = false; this.entityUpdated.emit(this.entity); } @@ -164,4 +200,17 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit } } + ngAfterViewInit(): void { + if (this.entityTabsComponent) { + this.entityTabsComponent.entityTabsChanged.subscribe( + (entityTabs) => { + if (entityTabs) { + this.matTabGroup._tabs.reset([...this.inclusiveTabs.toArray(), ...entityTabs]); + this.matTabGroup._tabs.notifyOnChanges(); + } + } + ); + } + } + } diff --git a/ui-ngx/src/app/shared/components/entity/entity-table-header.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts similarity index 92% rename from ui-ngx/src/app/shared/components/entity/entity-table-header.component.ts rename to ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts index a398567e7f..966bd7d27b 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-table-header.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts @@ -19,7 +19,7 @@ import { PageComponent } from '@shared/components/page.component'; import { Input, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityTableConfig } from '@shared/components/entity/entities-table-config.models'; +import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; export abstract class EntityTableHeaderComponent> extends PageComponent implements OnInit { diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-tabs.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-tabs.component.ts new file mode 100644 index 0000000000..ddfe2cf845 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/entity/entity-tabs.component.ts @@ -0,0 +1,85 @@ +/// +/// Copyright © 2016-2019 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { BaseData, HasId } from '@shared/models/base-data'; +import { PageComponent } from '@shared/components/page.component'; +import { + AfterViewInit, + ContentChildren, + EventEmitter, + Input, + OnInit, + Output, + 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'; +import { EntityAction } from '@home/models/entity/entity-component.models'; +import { BehaviorSubject } from 'rxjs'; + +export abstract class EntityTabsComponent> extends PageComponent implements OnInit, AfterViewInit { + + entityValue: T; + + @ViewChildren(MatTab) entityTabs: QueryList; + + isEditValue: boolean; + + @Input() + set isEdit(isEdit: boolean) { + this.isEditValue = isEdit; + } + + get isEdit() { + return this.isEditValue; + } + + @Input() + set entity(entity: T) { + this.entityValue = entity; + } + + get entity(): T { + return this.entityValue; + } + + @Input() + entitiesTableConfig: EntityTableConfig; + + private entityTabsSubject = new BehaviorSubject>(null); + + entityTabsChanged = this.entityTabsSubject.asObservable(); + + protected constructor(protected store: Store) { + super(store); + } + + ngOnInit() { + } + + ngAfterViewInit(): void { + this.entityTabsSubject.next(this.entityTabs.toArray()); + this.entityTabs.changes.subscribe( + () => { + this.entityTabsSubject.next(this.entityTabs.toArray()); + } + ); + } + +} diff --git a/ui-ngx/src/app/shared/components/entity/entity.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts similarity index 94% rename from ui-ngx/src/app/shared/components/entity/entity.component.ts rename to ui-ngx/src/app/modules/home/components/entity/entity.component.ts index 63624a1dcd..0edf4a48d7 100644 --- a/ui-ngx/src/app/shared/components/entity/entity.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts @@ -20,8 +20,8 @@ import { PageComponent } from '@shared/components/page.component'; import { EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityAction } from '@shared/components/entity/entity-component.models'; -import { EntityTableConfig } from '@shared/components/entity/entities-table-config.models'; +import { EntityAction } from '@home/models/entity/entity-component.models'; +import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; export abstract class EntityComponent> extends PageComponent implements OnInit { diff --git a/ui-ngx/src/app/modules/home/components/home-components.module.ts b/ui-ngx/src/app/modules/home/components/home-components.module.ts new file mode 100644 index 0000000000..1f47f9ba6c --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/home-components.module.ts @@ -0,0 +1,50 @@ +/// +/// Copyright © 2016-2019 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {SharedModule} from '@app/shared/shared.module'; +import {AddEntityDialogComponent} from './entity/add-entity-dialog.component'; +import {EntitiesTableComponent} from './entity/entities-table.component'; +import {DetailsPanelComponent} from './details-panel.component'; +import {EntityDetailsPanelComponent} from './entity/entity-details-panel.component'; +import {ContactComponent} from './contact.component'; + +@NgModule({ + entryComponents: [ + AddEntityDialogComponent + ], + declarations: + [ + EntitiesTableComponent, + AddEntityDialogComponent, + DetailsPanelComponent, + EntityDetailsPanelComponent, + ContactComponent, + ], + imports: [ + CommonModule, + SharedModule + ], + exports: [ + EntitiesTableComponent, + AddEntityDialogComponent, + DetailsPanelComponent, + EntityDetailsPanelComponent, + ContactComponent + ] +}) +export class HomeComponentsModule { } diff --git a/ui-ngx/src/app/shared/components/contact.models.ts b/ui-ngx/src/app/modules/home/models/contact.models.ts similarity index 100% rename from ui-ngx/src/app/shared/components/contact.models.ts rename to ui-ngx/src/app/modules/home/models/contact.models.ts diff --git a/ui-ngx/src/app/shared/models/datasource/entity-datasource.ts b/ui-ngx/src/app/modules/home/models/datasource/entity-datasource.ts similarity index 97% rename from ui-ngx/src/app/shared/models/datasource/entity-datasource.ts rename to ui-ngx/src/app/modules/home/models/datasource/entity-datasource.ts index a61677f668..19ece9066d 100644 --- a/ui-ngx/src/app/shared/models/datasource/entity-datasource.ts +++ b/ui-ngx/src/app/modules/home/models/datasource/entity-datasource.ts @@ -22,7 +22,7 @@ import { BaseData, HasId } from '@shared/models/base-data'; import { CollectionViewer, DataSource } from '@angular/cdk/typings/collections'; import { catchError, map, take, tap } from 'rxjs/operators'; import { SelectionModel } from '@angular/cdk/collections'; -import {EntityBooleanFunction} from '@shared/components/entity/entities-table-config.models'; +import {EntityBooleanFunction} from '@home/models/entity/entities-table-config.models'; export type EntitiesFetchFunction, P extends PageLink> = (pageLink: P) => Observable>; diff --git a/ui-ngx/src/app/shared/components/entity/entities-table-config.models.ts b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts similarity index 82% rename from ui-ngx/src/app/shared/components/entity/entities-table-config.models.ts rename to ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts index 536b5289a1..2065941254 100644 --- a/ui-ngx/src/app/shared/components/entity/entities-table-config.models.ts +++ b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts @@ -14,26 +14,22 @@ /// limitations under the License. /// -import { BaseData, HasId } from '@shared/models/base-data'; -import { EntityId } from '@shared/models/id/entity-id'; -import { EntitiesFetchFunction } from '@shared/models/datasource/entity-datasource'; -import { Observable, of } from 'rxjs'; -import { emptyPageData } from '@shared/models/page/page-data'; -import { DatePipe } from '@angular/common'; -import { Direction, SortOrder } from '@shared/models/page/sort-order'; -import { - EntityType, - EntityTypeResource, - EntityTypeTranslation -} from '@shared/models/entity-type.models'; -import { EntityComponent } from '@shared/components/entity/entity.component'; -import { Type } from '@angular/core'; -import { EntityAction } from '@shared/components/entity/entity-component.models'; -import { HasUUID } from '@shared/models/id/has-uuid'; -import { PageLink } from '@shared/models/page/page-link'; -import { EntitiesTableComponent } from '@shared/components/entity/entities-table.component'; -import { EntityTableHeaderComponent } from '@shared/components/entity/entity-table-header.component'; -import { ActivatedRoute } from '@angular/router'; +import {BaseData, HasId} from '@shared/models/base-data'; +import {EntitiesFetchFunction} from '@home/models/datasource/entity-datasource'; +import {Observable, of} from 'rxjs'; +import {emptyPageData} from '@shared/models/page/page-data'; +import {DatePipe} from '@angular/common'; +import {Direction, SortOrder} from '@shared/models/page/sort-order'; +import {EntityType, EntityTypeResource, EntityTypeTranslation} from '@shared/models/entity-type.models'; +import {EntityComponent} from '@home/components/entity/entity.component'; +import {Type} from '@angular/core'; +import {EntityAction} from './entity-component.models'; +import {HasUUID} from '@shared/models/id/has-uuid'; +import {PageLink} from '@shared/models/page/page-link'; +import {EntitiesTableComponent} from '@home/components/entity/entities-table.component'; +import {EntityTableHeaderComponent} from '@home/components/entity/entity-table-header.component'; +import {ActivatedRoute} from '@angular/router'; +import { EntityTabsComponent } from '../../components/entity/entity-tabs.component'; export type EntityBooleanFunction> = (entity: T) => boolean; export type EntityStringFunction> = (entity: T) => string; @@ -117,6 +113,7 @@ export class EntityTableConfig, P extends PageLink = P entityTranslations: EntityTypeTranslation; entityResources: EntityTypeResource; entityComponent: Type>; + entityTabsComponent: Type>; addDialogStyle = {}; defaultSortOrder: SortOrder = {property: 'createdTime', direction: Direction.ASC}; columns: Array> = []; diff --git a/ui-ngx/src/app/shared/components/entity/entity-component.models.ts b/ui-ngx/src/app/modules/home/models/entity/entity-component.models.ts similarity index 84% rename from ui-ngx/src/app/shared/components/entity/entity-component.models.ts rename to ui-ngx/src/app/modules/home/models/entity/entity-component.models.ts index a65d44a96c..9c14b38953 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-component.models.ts +++ b/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 '@shared/components/entity/entities-table-config.models'; +import {BaseData, HasId} from '@shared/models/base-data'; +import {EntityTableConfig} from './entities-table-config.models'; export interface AddEntityDialogData> { entitiesTableConfig: EntityTableConfig; diff --git a/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts b/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts index 18dc45c68c..a270d0ccd9 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts @@ -20,8 +20,9 @@ import { CommonModule } from '@angular/common'; import { AdminRoutingModule } from './admin-routing.module'; import { SharedModule } from '@app/shared/shared.module'; import { MailServerComponent } from '@modules/home/pages/admin/mail-server.component'; -import {GeneralSettingsComponent} from "@modules/home/pages/admin/general-settings.component"; -import {SecuritySettingsComponent} from "@modules/home/pages/admin/security-settings.component"; +import {GeneralSettingsComponent} from '@modules/home/pages/admin/general-settings.component'; +import {SecuritySettingsComponent} from '@modules/home/pages/admin/security-settings.component'; +import {HomeComponentsModule} from '@modules/home/components/home-components.module'; @NgModule({ declarations: @@ -33,6 +34,7 @@ import {SecuritySettingsComponent} from "@modules/home/pages/admin/security-sett imports: [ CommonModule, SharedModule, + HomeComponentsModule, AdminRoutingModule ] }) diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset-routing.module.ts b/ui-ngx/src/app/modules/home/pages/asset/asset-routing.module.ts index 8ded96dc19..23914db1dd 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset-routing.module.ts @@ -17,7 +17,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {EntitiesTableComponent} from '@shared/components/entity/entities-table.component'; +import {EntitiesTableComponent} from '../../components/entity/entities-table.component'; import {Authority} from '@shared/models/authority.enum'; import {AssetsTableConfigResolver} from './assets-table-config.resolver'; diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts b/ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts index 20b638ef5a..29ccd643f4 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts @@ -17,7 +17,7 @@ import {Component} from '@angular/core'; import {Store} from '@ngrx/store'; import {AppState} from '@core/core.state'; -import {EntityTableHeaderComponent} from '@shared/components/entity/entity-table-header.component'; +import {EntityTableHeaderComponent} from '../../components/entity/entity-table-header.component'; import {EntityType} from '@shared/models/entity-type.models'; import {AssetInfo} from '@shared/models/asset.models'; diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts index 6265126dbf..b0365273e3 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts @@ -17,7 +17,7 @@ import {Component} from '@angular/core'; import {Store} from '@ngrx/store'; import {AppState} from '@core/core.state'; -import {EntityComponent} from '@shared/components/entity/entity.component'; +import {EntityComponent} from '../../components/entity/entity.component'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {EntityType} from '@shared/models/entity-type.models'; import {NULL_UUID} from '@shared/models/id/has-uuid'; diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.module.ts b/ui-ngx/src/app/modules/home/pages/asset/asset.module.ts index 04c401979e..cbdabf8aea 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.module.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.module.ts @@ -21,6 +21,7 @@ import {HomeDialogsModule} from '../../dialogs/home-dialogs.module'; import {AssetComponent} from './asset.component'; import {AssetTableHeaderComponent} from './asset-table-header.component'; import {AssetRoutingModule} from './asset-routing.module'; +import {HomeComponentsModule} from '@modules/home/components/home-components.module'; @NgModule({ entryComponents: [ @@ -34,6 +35,7 @@ import {AssetRoutingModule} from './asset-routing.module'; imports: [ CommonModule, SharedModule, + HomeComponentsModule, HomeDialogsModule, AssetRoutingModule ] diff --git a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts index 016004a493..40599b1d72 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts @@ -25,11 +25,11 @@ import { EntityTableConfig, GroupActionDescriptor, HeaderActionDescriptor -} from '@shared/components/entity/entities-table-config.models'; +} from '@home/models/entity/entities-table-config.models'; import {TranslateService} from '@ngx-translate/core'; import {DatePipe} from '@angular/common'; import {EntityType, entityTypeResources, entityTypeTranslations} from '@shared/models/entity-type.models'; -import {EntityAction} from '@shared/components/entity/entity-component.models'; +import {EntityAction} from '@home/models/entity/entity-component.models'; import {forkJoin, Observable, of} from 'rxjs'; import {select, Store} from '@ngrx/store'; import {selectAuthUser} from '@core/auth/auth.selectors'; diff --git a/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts b/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts index d405c8cf12..10a0e0f4eb 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts @@ -17,7 +17,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {EntitiesTableComponent} from '@shared/components/entity/entities-table.component'; +import {EntitiesTableComponent} from '../../components/entity/entities-table.component'; import {Authority} from '@shared/models/authority.enum'; import {UsersTableConfigResolver} from '../user/users-table-config.resolver'; import {CustomersTableConfigResolver} from './customers-table-config.resolver'; diff --git a/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts b/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts index 3a7d4b55cb..6ef3349c98 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts @@ -19,10 +19,10 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Customer } from '@shared/models/customer.model'; -import { ContactBasedComponent } from '@shared/components/entity/contact-based.component'; import {Tenant} from '@app/shared/models/tenant.model'; import {ActionNotificationShow} from '@app/core/notification/notification.actions'; import {TranslateService} from '@ngx-translate/core'; +import {ContactBasedComponent} from '../../components/entity/contact-based.component'; @Component({ selector: 'tb-customer', diff --git a/ui-ngx/src/app/modules/home/pages/customer/customer.module.ts b/ui-ngx/src/app/modules/home/pages/customer/customer.module.ts index c0b5ff743f..3b4b78244e 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customer.module.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customer.module.ts @@ -19,6 +19,7 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '@shared/shared.module'; import {CustomerComponent} from '@modules/home/pages/customer/customer.component'; import {CustomerRoutingModule} from './customer-routing.module'; +import {HomeComponentsModule} from '@modules/home/components/home-components.module'; @NgModule({ entryComponents: [ @@ -30,6 +31,7 @@ import {CustomerRoutingModule} from './customer-routing.module'; imports: [ CommonModule, SharedModule, + HomeComponentsModule, CustomerRoutingModule ] }) diff --git a/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts index 7f340b9afe..76477a2c4e 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts @@ -23,7 +23,7 @@ import { DateEntityTableColumn, EntityTableColumn, EntityTableConfig -} from '@shared/components/entity/entities-table-config.models'; +} from '@home/models/entity/entities-table-config.models'; import { TranslateService } from '@ngx-translate/core'; import { DatePipe } from '@angular/common'; import { @@ -31,7 +31,7 @@ import { entityTypeResources, entityTypeTranslations } from '@shared/models/entity-type.models'; -import { EntityAction } from '@shared/components/entity/entity-component.models'; +import { EntityAction } from '@home/models/entity/entity-component.models'; import {Customer} from '@app/shared/models/customer.model'; import {CustomerService} from '@app/core/http/customer.service'; import {CustomerComponent} from '@modules/home/pages/customer/customer.component'; diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts index 6914a4f0c0..95e1f2f620 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts @@ -17,7 +17,7 @@ import {Component} from '@angular/core'; import {Store} from '@ngrx/store'; import {AppState} from '@core/core.state'; -import {EntityComponent} from '@shared/components/entity/entity.component'; +import {EntityComponent} from '../../components/entity/entity.component'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {ActionNotificationShow} from '@core/notification/notification.actions'; import {TranslateService} from '@ngx-translate/core'; @@ -35,7 +35,7 @@ import {DashboardService} from '@core/http/dashboard.service'; templateUrl: './dashboard-form.component.html', styleUrls: ['./dashboard-form.component.scss'] }) -export class DashboardFormComponent extends EntityComponent { +export class DashboardFormComponent extends EntityComponent { dashboardScope: 'tenant' | 'customer' | 'customer_user'; customerId: string; diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-routing.module.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-routing.module.ts index bda080e3bd..ee52db4849 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-routing.module.ts @@ -17,7 +17,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {EntitiesTableComponent} from '@shared/components/entity/entities-table.component'; +import {EntitiesTableComponent} from '../../components/entity/entities-table.component'; import {Authority} from '@shared/models/authority.enum'; import {DashboardsTableConfigResolver} from './dashboards-table-config.resolver'; diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard.module.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard.module.ts index 77476a0087..9726fe8ec6 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard.module.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard.module.ts @@ -22,6 +22,7 @@ import {DashboardFormComponent} from '@modules/home/pages/dashboard/dashboard-fo import {ManageDashboardCustomersDialogComponent} from '@modules/home/pages/dashboard/manage-dashboard-customers-dialog.component'; import {DashboardRoutingModule} from './dashboard-routing.module'; import {MakeDashboardPublicDialogComponent} from '@modules/home/pages/dashboard/make-dashboard-public-dialog.component'; +import {HomeComponentsModule} from '@modules/home/components/home-components.module'; @NgModule({ entryComponents: [ @@ -37,6 +38,7 @@ import {MakeDashboardPublicDialogComponent} from '@modules/home/pages/dashboard/ imports: [ CommonModule, SharedModule, + HomeComponentsModule, HomeDialogsModule, DashboardRoutingModule ] diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts index 9cb38ff734..968a5a2563 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts @@ -25,11 +25,11 @@ import { EntityTableConfig, GroupActionDescriptor, HeaderActionDescriptor -} from '@shared/components/entity/entities-table-config.models'; +} from '@home/models/entity/entities-table-config.models'; import {TranslateService} from '@ngx-translate/core'; import {DatePipe} from '@angular/common'; import {EntityType, entityTypeResources, entityTypeTranslations} from '@shared/models/entity-type.models'; -import {EntityAction} from '@shared/components/entity/entity-component.models'; +import {EntityAction} from '@home/models/entity/entity-component.models'; import {forkJoin, Observable, of} from 'rxjs'; import {select, Store} from '@ngrx/store'; import {selectAuthUser} from '@core/auth/auth.selectors'; diff --git a/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts b/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts index 78ccb6370e..52e6a43dfd 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts @@ -17,7 +17,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {EntitiesTableComponent} from '@shared/components/entity/entities-table.component'; +import {EntitiesTableComponent} from '../../components/entity/entities-table.component'; import {Authority} from '@shared/models/authority.enum'; import {DevicesTableConfigResolver} from '@modules/home/pages/device/devices-table-config.resolver'; diff --git a/ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts b/ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts index 4a89ebc60c..4e7017c62c 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts @@ -17,7 +17,7 @@ import { Component } from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityTableHeaderComponent } from '@shared/components/entity/entity-table-header.component'; +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'; diff --git a/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.html b/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.html new file mode 100644 index 0000000000..bb8056d55b --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.html @@ -0,0 +1,29 @@ + + + Hobotok
{{ test }} + {{ entity | json }} +
+ + Hobotok 2
+ {{ entity | json }} +
+ + Hobotok 2
+ {{ entity | json }} +
diff --git a/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.ts b/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.ts new file mode 100644 index 0000000000..e335218800 --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/device/device-tabs.component.ts @@ -0,0 +1,41 @@ +/// +/// Copyright © 2016-2019 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { Component } from '@angular/core'; +import { Store } from '@ngrx/store'; +import { AppState } from '@core/core.state'; +import { DeviceInfo } from '@shared/models/device.models'; +import { EntityType } from '@shared/models/entity-type.models'; +import { EntityTabsComponent } from '../../components/entity/entity-tabs.component'; + +@Component({ + selector: 'tb-device-tabs', + templateUrl: './device-tabs.component.html', + styleUrls: [] +}) +export class DeviceTabsComponent extends EntityTabsComponent { + + entityType = EntityType; + + constructor(protected store: Store) { + super(store); + } + + ngOnInit() { + super.ngOnInit(); + } + +} diff --git a/ui-ngx/src/app/modules/home/pages/device/device.component.ts b/ui-ngx/src/app/modules/home/pages/device/device.component.ts index ca86fa33af..721b4bf875 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device.component.ts @@ -17,7 +17,7 @@ import { Component, OnInit } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { EntityComponent } from '@shared/components/entity/entity.component'; +import { EntityComponent } from '../../components/entity/entity.component'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { User } from '@shared/models/user.model'; import { selectAuth, selectUserDetails } from '@core/auth/auth.selectors'; diff --git a/ui-ngx/src/app/modules/home/pages/device/device.module.ts b/ui-ngx/src/app/modules/home/pages/device/device.module.ts index 2644e2b26a..2e3b659860 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device.module.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device.module.ts @@ -22,21 +22,26 @@ import {DeviceRoutingModule} from './device-routing.module'; import {DeviceTableHeaderComponent} from '@modules/home/pages/device/device-table-header.component'; import {DeviceCredentialsDialogComponent} from '@modules/home/pages/device/device-credentials-dialog.component'; import {HomeDialogsModule} from '../../dialogs/home-dialogs.module'; +import {HomeComponentsModule} from '@modules/home/components/home-components.module'; +import { DeviceTabsComponent } from '@home/pages/device/device-tabs.component'; @NgModule({ entryComponents: [ DeviceComponent, + DeviceTabsComponent, DeviceTableHeaderComponent, DeviceCredentialsDialogComponent ], declarations: [ DeviceComponent, + DeviceTabsComponent, DeviceTableHeaderComponent, DeviceCredentialsDialogComponent ], imports: [ CommonModule, SharedModule, + HomeComponentsModule, HomeDialogsModule, DeviceRoutingModule ] diff --git a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts index 95e6edc67b..b916313ce9 100644 --- a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts @@ -24,11 +24,11 @@ import { EntityTableColumn, EntityTableConfig, GroupActionDescriptor, HeaderActionDescriptor -} from '@shared/components/entity/entities-table-config.models'; +} from '@home/models/entity/entities-table-config.models'; import {TranslateService} from '@ngx-translate/core'; import {DatePipe} from '@angular/common'; import {EntityType, entityTypeResources, entityTypeTranslations} from '@shared/models/entity-type.models'; -import {EntityAction} from '@shared/components/entity/entity-component.models'; +import {EntityAction} from '@home/models/entity/entity-component.models'; import {Device, DeviceCredentials, DeviceInfo} from '@app/shared/models/device.models'; import {DeviceComponent} from '@modules/home/pages/device/device.component'; import {forkJoin, Observable, of} from 'rxjs'; @@ -58,6 +58,7 @@ import { AddEntitiesToCustomerDialogComponent, AddEntitiesToCustomerDialogData } from '../../dialogs/add-entities-to-customer-dialog.component'; +import { DeviceTabsComponent } from '@home/pages/device/device-tabs.component'; @Injectable() export class DevicesTableConfigResolver implements Resolve> { @@ -78,6 +79,7 @@ export class DevicesTableConfigResolver implements Resolve { }; diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index feab000ddc..653edf41ab 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -14,72 +14,67 @@ /// limitations under the License. /// -import { NgModule } from '@angular/core'; -import { CommonModule, DatePipe } from '@angular/common'; -import { FooterComponent } from './components/footer.component'; -import { LogoComponent } from './components/logo.component'; -import { ToastDirective, TbSnackBarComponent } from './components/toast.directive'; -import { BreadcrumbComponent } from '@app/shared/components/breadcrumb.component'; +import {NgModule} from '@angular/core'; +import {CommonModule, DatePipe} from '@angular/common'; +import {FooterComponent} from './components/footer.component'; +import {LogoComponent} from './components/logo.component'; +import {TbSnackBarComponent, ToastDirective} from './components/toast.directive'; +import {BreadcrumbComponent} from '@app/shared/components/breadcrumb.component'; import { - MatButtonModule, - MatCheckboxModule, - MatIconModule, - MatCardModule, - MatProgressBarModule, - MatInputModule, - MatSnackBarModule, - MatSidenavModule, - MatToolbarModule, - MatMenuModule, - MatGridListModule, - MatDialogModule, - MatSelectModule, - MatTooltipModule, - MatTableModule, - MatPaginatorModule, - MatSortModule, - MatProgressSpinnerModule, - MatDividerModule, - MatTabsModule, - MatRadioModule, - MatSlideToggleModule, - MatDatepickerModule, - MatSliderModule, - MatExpansionModule, - MatStepperModule, MatAutocompleteModule, - MatChipsModule + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatDatepickerModule, + MatDialogModule, + MatDividerModule, + MatExpansionModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatMenuModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatSelectModule, + MatSidenavModule, + MatSliderModule, + MatSlideToggleModule, + MatSnackBarModule, + MatSortModule, + MatStepperModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule } from '@angular/material'; -import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core'; -import { FlexLayoutModule } from '@angular/flex-layout'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { ShareModule as ShareButtonsModule } from '@ngx-share/core'; -import { UserMenuComponent } from '@shared/components/user-menu.component'; -import { NospacePipe } from './pipe/nospace.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { TbCheckboxComponent } from '@shared/components/tb-checkbox.component'; -import { HelpComponent } from '@shared/components/help.component'; -import { EntitiesTableComponent } from '@shared/components/entity/entities-table.component'; -import { AddEntityDialogComponent } from '@shared/components/entity/add-entity-dialog.component'; -import { DetailsPanelComponent } from '@shared/components/details-panel.component'; -import { EntityDetailsPanelComponent } from '@shared/components/entity/entity-details-panel.component'; -import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; -import { ContactComponent } from '@shared/components/contact.component'; +import {MatDatetimepickerModule, MatNativeDatetimeModule} from '@mat-datetimepicker/core'; +import {FlexLayoutModule} from '@angular/flex-layout'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; +import {ShareModule as ShareButtonsModule} from '@ngx-share/core'; +import {UserMenuComponent} from '@shared/components/user-menu.component'; +import {NospacePipe} from './pipe/nospace.pipe'; +import {TranslateModule} from '@ngx-translate/core'; +import {TbCheckboxComponent} from '@shared/components/tb-checkbox.component'; +import {HelpComponent} from '@shared/components/help.component'; +import {TbAnchorComponent} from '@shared/components/tb-anchor.component'; // import { AuditLogDetailsDialogComponent } from '@shared/components/audit-log/audit-log-details-dialog.component'; // import { AuditLogTableComponent } from '@shared/components/audit-log/audit-log-table.component'; -import { MillisecondsToTimeStringPipe } from '@shared/pipe/milliseconds-to-time-string.pipe'; -import { TimewindowComponent } from '@shared/components/time/timewindow.component'; -import { OverlayModule } from '@angular/cdk/overlay'; -import { TimewindowPanelComponent } from '@shared/components/time/timewindow-panel.component'; -import { TimeintervalComponent } from '@shared/components/time/timeinterval.component'; -import { DatetimePeriodComponent } from '@shared/components/time/datetime-period.component'; -import { EnumToArrayPipe } from '@shared/pipe/enum-to-array.pipe'; -import { ClipboardModule } from 'ngx-clipboard'; +import {MillisecondsToTimeStringPipe} from '@shared/pipe/milliseconds-to-time-string.pipe'; +import {TimewindowComponent} from '@shared/components/time/timewindow.component'; +import {OverlayModule} from '@angular/cdk/overlay'; +import {TimewindowPanelComponent} from '@shared/components/time/timewindow-panel.component'; +import {TimeintervalComponent} from '@shared/components/time/timeinterval.component'; +import {DatetimePeriodComponent} from '@shared/components/time/datetime-period.component'; +import {EnumToArrayPipe} from '@shared/pipe/enum-to-array.pipe'; +import {ClipboardModule} from 'ngx-clipboard'; // import { ValueInputComponent } from '@shared/components/value-input.component'; -import { FullscreenDirective } from '@shared/components/fullscreen.directive'; -import { HighlightPipe } from '@shared/pipe/highlight.pipe'; +import {FullscreenDirective} from '@shared/components/fullscreen.directive'; +import {HighlightPipe} from '@shared/pipe/highlight.pipe'; import {DashboardAutocompleteComponent} from '@shared/components/dashboard-autocomplete.component'; import {EntitySubTypeAutocompleteComponent} from '@shared/components/entity/entity-subtype-autocomplete.component'; import {EntitySubTypeSelectComponent} from './components/entity/entity-subtype-select.component'; @@ -102,7 +97,6 @@ import {SocialSharePanelComponent} from './components/socialshare-panel.componen entryComponents: [ TbSnackBarComponent, TbAnchorComponent, - AddEntityDialogComponent, // AuditLogDetailsDialogComponent, TimewindowPanelComponent, ], @@ -117,11 +111,6 @@ import {SocialSharePanelComponent} from './components/socialshare-panel.componen TbSnackBarComponent, BreadcrumbComponent, UserMenuComponent, - EntitiesTableComponent, - AddEntityDialogComponent, - DetailsPanelComponent, - EntityDetailsPanelComponent, - ContactComponent, // AuditLogTableComponent, // AuditLogDetailsDialogComponent, TimewindowComponent, @@ -195,11 +184,6 @@ import {SocialSharePanelComponent} from './components/socialshare-panel.componen TbCheckboxComponent, BreadcrumbComponent, UserMenuComponent, - EntitiesTableComponent, - AddEntityDialogComponent, - DetailsPanelComponent, - EntityDetailsPanelComponent, - ContactComponent, // AuditLogTableComponent, TimewindowComponent, TimewindowPanelComponent, diff --git a/ui-ngx/tsconfig.json b/ui-ngx/tsconfig.json index 0c3e7e411f..8f4576a7bf 100644 --- a/ui-ngx/tsconfig.json +++ b/ui-ngx/tsconfig.json @@ -21,7 +21,8 @@ ], "@core/*": ["src/app/core/*"], "@modules/*": ["src/app/modules/*"], - "@shared/*": ["src/app/shared/*"] + "@shared/*": ["src/app/shared/*"], + "@home/*": ["src/app/modules/home/*"] }, "lib": [ "es2018",