Commit 38617625c1cae70c19b356f241c51a28b37a2dd9
Committed by
GitHub
1 parent
2a1fa76c
fix error create dialog new dashboard (#2606)
Showing
2 changed files
with
4 additions
and
3 deletions
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | import { BaseData, HasId } from '@shared/models/base-data'; | 17 | import { BaseData, HasId } from '@shared/models/base-data'; |
18 | import { FormBuilder, FormGroup, NgForm } from '@angular/forms'; | 18 | import { FormBuilder, FormGroup, NgForm } from '@angular/forms'; |
19 | import { PageComponent } from '@shared/components/page.component'; | 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 | import { Store } from '@ngrx/store'; | 21 | import { Store } from '@ngrx/store'; |
22 | import { AppState } from '@core/core.state'; | 22 | import { AppState } from '@core/core.state'; |
23 | import { EntityAction } from '@home/models/entity/entity-component.models'; | 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,7 +25,7 @@ import { EntityTableConfig } from '@home/models/entity/entities-table-config.mod | ||
25 | import { PageLink } from '@shared/models/page/page-link'; | 25 | import { PageLink } from '@shared/models/page/page-link'; |
26 | 26 | ||
27 | // @dynamic | 27 | // @dynamic |
28 | -@Directive() | 28 | +@Component({}) |
29 | export abstract class EntityComponent<T extends BaseData<HasId>, | 29 | export abstract class EntityComponent<T extends BaseData<HasId>, |
30 | P extends PageLink = PageLink, | 30 | P extends PageLink = PageLink, |
31 | L extends BaseData<HasId> = T, | 31 | L extends BaseData<HasId> = T, |
@@ -29,6 +29,7 @@ import { | @@ -29,6 +29,7 @@ import { | ||
29 | } from '@shared/models/dashboard.models'; | 29 | } from '@shared/models/dashboard.models'; |
30 | import { DashboardService } from '@core/http/dashboard.service'; | 30 | import { DashboardService } from '@core/http/dashboard.service'; |
31 | import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; | 31 | import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; |
32 | +import { isEqual } from '@core/utils'; | ||
32 | 33 | ||
33 | @Component({ | 34 | @Component({ |
34 | selector: 'tb-dashboard-form', | 35 | selector: 'tb-dashboard-form', |
@@ -106,7 +107,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> { | @@ -106,7 +107,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> { | ||
106 | } | 107 | } |
107 | 108 | ||
108 | private updateFields(entity: Dashboard): void { | 109 | private updateFields(entity: Dashboard): void { |
109 | - if (entity) { | 110 | + if (entity && !isEqual(entity, {})) { |
110 | this.assignedCustomersText = getDashboardAssignedCustomersText(entity); | 111 | this.assignedCustomersText = getDashboardAssignedCustomersText(entity); |
111 | this.publicLink = this.dashboardService.getPublicDashboardLink(entity); | 112 | this.publicLink = this.dashboardService.getPublicDashboardLink(entity); |
112 | } | 113 | } |