|
|
|
@ -30,6 +30,7 @@ import { |
|
|
|
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'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-dashboard-form', |
|
|
|
@ -43,6 +44,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> { |
|
|
|
|
|
|
|
publicLink: string; |
|
|
|
assignedCustomersText: string; |
|
|
|
entityType = EntityType; |
|
|
|
|
|
|
|
constructor(protected store: Store<AppState>, |
|
|
|
protected translate: TranslateService, |
|
|
|
@ -78,7 +80,7 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> { |
|
|
|
|
|
|
|
buildForm(entity: Dashboard): UntypedFormGroup { |
|
|
|
this.updateFields(entity); |
|
|
|
return this.fb.group( |
|
|
|
const form = this.fb.group( |
|
|
|
{ |
|
|
|
title: [entity ? entity.title : '', [Validators.required, Validators.maxLength(255)]], |
|
|
|
image: [entity ? entity.image : null], |
|
|
|
@ -91,6 +93,11 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> { |
|
|
|
) |
|
|
|
} |
|
|
|
); |
|
|
|
if (this.isAdd) { |
|
|
|
form.addControl('assignedCustomerIds', this.fb.control([])); |
|
|
|
} |
|
|
|
|
|
|
|
return form; |
|
|
|
} |
|
|
|
|
|
|
|
updateForm(entity: Dashboard) { |
|
|
|
|