Commit 38617625c1cae70c19b356f241c51a28b37a2dd9

Authored by Vladyslav
Committed by GitHub
1 parent 2a1fa76c

fix error create dialog new dashboard (#2606)

... ... @@ -17,7 +17,7 @@
17 17 import { BaseData, HasId } from '@shared/models/base-data';
18 18 import { FormBuilder, FormGroup, NgForm } from '@angular/forms';
19 19 import { PageComponent } from '@shared/components/page.component';
20   -import { EventEmitter, Input, OnInit, Output, ViewChild, Directive } from '@angular/core';
  20 +import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
21 21 import { Store } from '@ngrx/store';
22 22 import { AppState } from '@core/core.state';
23 23 import { EntityAction } from '@home/models/entity/entity-component.models';
... ... @@ -25,7 +25,7 @@ import { EntityTableConfig } from '@home/models/entity/entities-table-config.mod
25 25 import { PageLink } from '@shared/models/page/page-link';
26 26
27 27 // @dynamic
28   -@Directive()
  28 +@Component({})
29 29 export abstract class EntityComponent<T extends BaseData<HasId>,
30 30 P extends PageLink = PageLink,
31 31 L extends BaseData<HasId> = T,
... ...
... ... @@ -29,6 +29,7 @@ import {
29 29 } from '@shared/models/dashboard.models';
30 30 import { DashboardService } from '@core/http/dashboard.service';
31 31 import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
  32 +import { isEqual } from '@core/utils';
32 33
33 34 @Component({
34 35 selector: 'tb-dashboard-form',
... ... @@ -106,7 +107,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> {
106 107 }
107 108
108 109 private updateFields(entity: Dashboard): void {
109   - if (entity) {
  110 + if (entity && !isEqual(entity, {})) {
110 111 this.assignedCustomersText = getDashboardAssignedCustomersText(entity);
111 112 this.publicLink = this.dashboardService.getPublicDashboardLink(entity);
112 113 }
... ...