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