Refactored formatting
This commit is contained in:
		
							parent
							
								
									6f91d8dd1c
								
							
						
					
					
						commit
						2fa1d234b3
					
				@ -31,7 +31,7 @@ import { DashboardService } from '@core/http/dashboard.service';
 | 
				
			|||||||
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
 | 
					import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
 | 
				
			||||||
import { isEqual } from '@core/utils';
 | 
					import { isEqual } from '@core/utils';
 | 
				
			||||||
import { EntityType } from '@shared/models/entity-type.models';
 | 
					import { EntityType } from '@shared/models/entity-type.models';
 | 
				
			||||||
import {PageLink} from "@shared/models/page/page-link";
 | 
					import { PageLink } from "@shared/models/page/page-link";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'tb-dashboard-form',
 | 
					  selector: 'tb-dashboard-form',
 | 
				
			||||||
@ -118,7 +118,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard, PageLink,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  onPublicLinkCopied($event) {
 | 
					  onPublicLinkCopied($event) {
 | 
				
			||||||
    this.store.dispatch(new ActionNotificationShow(
 | 
					    this.store.dispatch(new ActionNotificationShow(
 | 
				
			||||||
     {
 | 
					      {
 | 
				
			||||||
        message: this.translate.instant('dashboard.public-link-copied-message'),
 | 
					        message: this.translate.instant('dashboard.public-link-copied-message'),
 | 
				
			||||||
        type: 'success',
 | 
					        type: 'success',
 | 
				
			||||||
        duration: 750,
 | 
					        duration: 750,
 | 
				
			||||||
 | 
				
			|||||||
@ -14,9 +14,9 @@
 | 
				
			|||||||
/// limitations under the License.
 | 
					/// limitations under the License.
 | 
				
			||||||
///
 | 
					///
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {Injectable} from '@angular/core';
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {ActivatedRouteSnapshot, Router} from '@angular/router';
 | 
					import { ActivatedRouteSnapshot, Router } from '@angular/router';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  CellActionDescriptor,
 | 
					  CellActionDescriptor,
 | 
				
			||||||
  checkBoxCell,
 | 
					  checkBoxCell,
 | 
				
			||||||
@ -26,20 +26,20 @@ import {
 | 
				
			|||||||
  GroupActionDescriptor,
 | 
					  GroupActionDescriptor,
 | 
				
			||||||
  HeaderActionDescriptor
 | 
					  HeaderActionDescriptor
 | 
				
			||||||
} from '@home/models/entity/entities-table-config.models';
 | 
					} from '@home/models/entity/entities-table-config.models';
 | 
				
			||||||
import {TranslateService} from '@ngx-translate/core';
 | 
					import { TranslateService } from '@ngx-translate/core';
 | 
				
			||||||
import {DatePipe} from '@angular/common';
 | 
					import { DatePipe } from '@angular/common';
 | 
				
			||||||
import {EntityType, entityTypeResources, entityTypeTranslations} from '@shared/models/entity-type.models';
 | 
					import { EntityType, entityTypeResources, entityTypeTranslations } from '@shared/models/entity-type.models';
 | 
				
			||||||
import {EntityAction} from '@home/models/entity/entity-component.models';
 | 
					import { EntityAction } from '@home/models/entity/entity-component.models';
 | 
				
			||||||
import {forkJoin, Observable, of} from 'rxjs';
 | 
					import { forkJoin, Observable, of } from 'rxjs';
 | 
				
			||||||
import {select, Store} from '@ngrx/store';
 | 
					import { select, Store } from '@ngrx/store';
 | 
				
			||||||
import {selectAuthUser} from '@core/auth/auth.selectors';
 | 
					import { selectAuthUser } from '@core/auth/auth.selectors';
 | 
				
			||||||
import {map, mergeMap, take, tap} from 'rxjs/operators';
 | 
					import { map, mergeMap, take, tap } from 'rxjs/operators';
 | 
				
			||||||
import {AppState} from '@core/core.state';
 | 
					import { AppState } from '@core/core.state';
 | 
				
			||||||
import {Authority} from '@app/shared/models/authority.enum';
 | 
					import { Authority } from '@app/shared/models/authority.enum';
 | 
				
			||||||
import {CustomerService} from '@core/http/customer.service';
 | 
					import { CustomerService } from '@core/http/customer.service';
 | 
				
			||||||
import {Customer} from '@app/shared/models/customer.model';
 | 
					import { Customer } from '@app/shared/models/customer.model';
 | 
				
			||||||
import {MatDialog} from '@angular/material/dialog';
 | 
					import { MatDialog } from '@angular/material/dialog';
 | 
				
			||||||
import {DialogService} from '@core/services/dialog.service';
 | 
					import { DialogService } from '@core/services/dialog.service';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  AddEntitiesToCustomerDialogComponent,
 | 
					  AddEntitiesToCustomerDialogComponent,
 | 
				
			||||||
  AddEntitiesToCustomerDialogData
 | 
					  AddEntitiesToCustomerDialogData
 | 
				
			||||||
@ -52,8 +52,8 @@ import {
 | 
				
			|||||||
  isCurrentPublicDashboardCustomer,
 | 
					  isCurrentPublicDashboardCustomer,
 | 
				
			||||||
  isPublicDashboard
 | 
					  isPublicDashboard
 | 
				
			||||||
} from '@app/shared/models/dashboard.models';
 | 
					} from '@app/shared/models/dashboard.models';
 | 
				
			||||||
import {DashboardService} from '@app/core/http/dashboard.service';
 | 
					import { DashboardService } from '@app/core/http/dashboard.service';
 | 
				
			||||||
import {DashboardFormComponent} from '@modules/home/pages/dashboard/dashboard-form.component';
 | 
					import { DashboardFormComponent } from '@modules/home/pages/dashboard/dashboard-form.component';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  ManageDashboardCustomersActionType,
 | 
					  ManageDashboardCustomersActionType,
 | 
				
			||||||
  ManageDashboardCustomersDialogComponent,
 | 
					  ManageDashboardCustomersDialogComponent,
 | 
				
			||||||
@ -63,16 +63,16 @@ import {
 | 
				
			|||||||
  MakeDashboardPublicDialogComponent,
 | 
					  MakeDashboardPublicDialogComponent,
 | 
				
			||||||
  MakeDashboardPublicDialogData
 | 
					  MakeDashboardPublicDialogData
 | 
				
			||||||
} from '@modules/home/pages/dashboard/make-dashboard-public-dialog.component';
 | 
					} from '@modules/home/pages/dashboard/make-dashboard-public-dialog.component';
 | 
				
			||||||
import {DashboardTabsComponent} from '@home/pages/dashboard/dashboard-tabs.component';
 | 
					import { DashboardTabsComponent } from '@home/pages/dashboard/dashboard-tabs.component';
 | 
				
			||||||
import {ImportExportService} from '@shared/import-export/import-export.service';
 | 
					import { ImportExportService } from '@shared/import-export/import-export.service';
 | 
				
			||||||
import {EdgeService} from '@core/http/edge.service';
 | 
					import { EdgeService } from '@core/http/edge.service';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  AddEntitiesToEdgeDialogComponent,
 | 
					  AddEntitiesToEdgeDialogComponent,
 | 
				
			||||||
  AddEntitiesToEdgeDialogData
 | 
					  AddEntitiesToEdgeDialogData
 | 
				
			||||||
} from '@home/dialogs/add-entities-to-edge-dialog.component';
 | 
					} from '@home/dialogs/add-entities-to-edge-dialog.component';
 | 
				
			||||||
import {HomeDialogsService} from '@home/dialogs/home-dialogs.service';
 | 
					import { HomeDialogsService } from '@home/dialogs/home-dialogs.service';
 | 
				
			||||||
import {Widget} from '@shared/models/widget.models';
 | 
					import { Widget } from '@shared/models/widget.models';
 | 
				
			||||||
import {EntityAliases} from '@shared/models/alias.models';
 | 
					import { EntityAliases } from '@shared/models/alias.models';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  EntityAliasesDialogComponent,
 | 
					  EntityAliasesDialogComponent,
 | 
				
			||||||
  EntityAliasesDialogData
 | 
					  EntityAliasesDialogData
 | 
				
			||||||
@ -81,7 +81,7 @@ import {
 | 
				
			|||||||
  DashboardInfoDialogData,
 | 
					  DashboardInfoDialogData,
 | 
				
			||||||
  ImportDashboardFileDialogComponent
 | 
					  ImportDashboardFileDialogComponent
 | 
				
			||||||
} from "@home/pages/dashboard/import-dashboard-file-dialog.component";
 | 
					} from "@home/pages/dashboard/import-dashboard-file-dialog.component";
 | 
				
			||||||
import {PageLink} from "@shared/models/page/page-link";
 | 
					import { PageLink } from "@shared/models/page/page-link";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable()
 | 
					@Injectable()
 | 
				
			||||||
export class DashboardsTableConfigResolver {
 | 
					export class DashboardsTableConfigResolver {
 | 
				
			||||||
 | 
				
			|||||||
@ -14,17 +14,16 @@
 | 
				
			|||||||
/// limitations under the License.
 | 
					/// limitations under the License.
 | 
				
			||||||
///
 | 
					///
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {Component, Inject, OnInit} from '@angular/core';
 | 
					import { Component, Inject, OnInit } from '@angular/core';
 | 
				
			||||||
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
 | 
					import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
 | 
				
			||||||
import {Store} from '@ngrx/store';
 | 
					import { Store } from '@ngrx/store';
 | 
				
			||||||
import {AppState} from '@core/core.state';
 | 
					import { AppState } from '@core/core.state';
 | 
				
			||||||
import {UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
 | 
					import { FormBuilder, FormGroup } from '@angular/forms';
 | 
				
			||||||
import {DashboardService} from '@core/http/dashboard.service';
 | 
					import { DashboardService } from '@core/http/dashboard.service';
 | 
				
			||||||
import {Dashboard, DashboardInfo} from '@app/shared/models/dashboard.models';
 | 
					import { Dashboard } from '@app/shared/models/dashboard.models';
 | 
				
			||||||
import {ActionNotificationShow} from '@core/notification/notification.actions';
 | 
					import { ActionNotificationShow } from '@core/notification/notification.actions';
 | 
				
			||||||
import {TranslateService} from '@ngx-translate/core';
 | 
					import { DialogComponent } from '@shared/components/dialog.component';
 | 
				
			||||||
import {DialogComponent} from '@shared/components/dialog.component';
 | 
					import { Router } from '@angular/router';
 | 
				
			||||||
import {Router} from '@angular/router';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface DashboardInfoDialogData {
 | 
					export interface DashboardInfoDialogData {
 | 
				
			||||||
  dashboard: Dashboard;
 | 
					  dashboard: Dashboard;
 | 
				
			||||||
@ -37,17 +36,16 @@ export interface DashboardInfoDialogData {
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
export class ImportDashboardFileDialogComponent extends DialogComponent<ImportDashboardFileDialogComponent> implements OnInit {
 | 
					export class ImportDashboardFileDialogComponent extends DialogComponent<ImportDashboardFileDialogComponent> implements OnInit {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  dashboard: Dashboard;
 | 
					  private dashboard: Dashboard;
 | 
				
			||||||
  currentFileName: string = '';
 | 
					  currentFileName: string = '';
 | 
				
			||||||
  uploadFileFormGroup: UntypedFormGroup;
 | 
					  uploadFileFormGroup: FormGroup;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(protected store: Store<AppState>,
 | 
					  constructor(protected store: Store<AppState>,
 | 
				
			||||||
              protected router: Router,
 | 
					              protected router: Router,
 | 
				
			||||||
              @Inject(MAT_DIALOG_DATA) public data: DashboardInfoDialogData,
 | 
					              @Inject(MAT_DIALOG_DATA) public data: DashboardInfoDialogData,
 | 
				
			||||||
              public translate: TranslateService,
 | 
					 | 
				
			||||||
              private dashboardService: DashboardService,
 | 
					              private dashboardService: DashboardService,
 | 
				
			||||||
              public dialogRef: MatDialogRef<ImportDashboardFileDialogComponent>,
 | 
					              protected dialogRef: MatDialogRef<ImportDashboardFileDialogComponent>,
 | 
				
			||||||
              public fb: UntypedFormBuilder) {
 | 
					              public fb: FormBuilder) {
 | 
				
			||||||
    super(store, router, dialogRef);
 | 
					    super(store, router, dialogRef);
 | 
				
			||||||
    this.dashboard = data.dashboard;
 | 
					    this.dashboard = data.dashboard;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -62,9 +60,9 @@ export class ImportDashboardFileDialogComponent extends DialogComponent<ImportDa
 | 
				
			|||||||
    this.dialogRef.close();
 | 
					    this.dialogRef.close();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  save(){
 | 
					  save() {
 | 
				
			||||||
    const fileControl = this.uploadFileFormGroup.get('file');
 | 
					    const fileControl = this.uploadFileFormGroup.get('file');
 | 
				
			||||||
    if(!fileControl || !fileControl.value){
 | 
					    if (!fileControl || !fileControl.value) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -74,7 +72,7 @@ export class ImportDashboardFileDialogComponent extends DialogComponent<ImportDa
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
    this.dashboard.configuration = dashboardContent;
 | 
					    this.dashboard.configuration = dashboardContent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.dashboardService.saveDashboard(this.dashboard).subscribe(()=>{
 | 
					    this.dashboardService.saveDashboard(this.dashboard).subscribe(() => {
 | 
				
			||||||
      this.dialogRef.close(true);
 | 
					      this.dialogRef.close(true);
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -195,7 +195,6 @@ export interface Dashboard extends DashboardInfo {
 | 
				
			|||||||
  configuration?: DashboardConfiguration;
 | 
					  configuration?: DashboardConfiguration;
 | 
				
			||||||
  dialogRef?: MatDialogRef<any>;
 | 
					  dialogRef?: MatDialogRef<any>;
 | 
				
			||||||
  resources?: Array<any>;
 | 
					  resources?: Array<any>;
 | 
				
			||||||
  fileContent?: DashboardConfiguration;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface HomeDashboard extends Dashboard {
 | 
					export interface HomeDashboard extends Dashboard {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user