diff --git a/src/app/cartography/widgets/links/ethernet-link.ts b/src/app/cartography/widgets/links/ethernet-link.ts index 77fda0be..77625fee 100644 --- a/src/app/cartography/widgets/links/ethernet-link.ts +++ b/src/app/cartography/widgets/links/ethernet-link.ts @@ -26,7 +26,7 @@ export class EthernetLinkWidget implements Widget { return new EthernetLinkPath( [link.source.x + link.source.width / 2, link.source.y + link.source.height / 2], [link.target.x + link.target.width / 2, link.target.y + link.target.height / 2], - link.link_style ? link.link_style : this.defaultEthernetLinkStyle + link.link_style.color ? link.link_style : this.defaultEthernetLinkStyle ); } diff --git a/src/app/cartography/widgets/links/serial-link.ts b/src/app/cartography/widgets/links/serial-link.ts index 05ff94f2..49e8c509 100644 --- a/src/app/cartography/widgets/links/serial-link.ts +++ b/src/app/cartography/widgets/links/serial-link.ts @@ -60,7 +60,7 @@ export class SerialLinkWidget implements Widget { angle_source, angle_target, [target.x, target.y], - link.link_style ? link.link_style : this.defaultSerialLinkStyle); + link.link_style.color ? link.link_style : this.defaultSerialLinkStyle); } public draw(view: SVGSelection) { diff --git a/src/app/components/project-map/drawings-editors/link-style-editor/link-style-editor.component.ts b/src/app/components/project-map/drawings-editors/link-style-editor/link-style-editor.component.ts index 25134039..5a4a6721 100644 --- a/src/app/components/project-map/drawings-editors/link-style-editor/link-style-editor.component.ts +++ b/src/app/components/project-map/drawings-editors/link-style-editor/link-style-editor.component.ts @@ -7,6 +7,7 @@ import { Server } from '../../../../models/server'; import { ToasterService } from '../../../../services/toaster.service'; import { NonNegativeValidator } from '../../../../validators/non-negative-validator'; import { LinkService } from '../../../../services/link.service'; +import { LinksDataSource } from '../../../../cartography/datasources/links-datasource'; @Component({ selector: 'app-link-style-editor', @@ -25,6 +26,7 @@ export class LinkStyleEditorDialogComponent implements OnInit { private formBuilder: FormBuilder, private toasterService: ToasterService, private linkService: LinkService, + private linksDataSource: LinksDataSource, private nonNegativeValidator: NonNegativeValidator ) { this.formGroup = this.formBuilder.group({ @@ -63,6 +65,7 @@ export class LinkStyleEditorDialogComponent implements OnInit { this.link.link_style.type = type; this.linkService.updateLinkStyle(this.server, this.link).subscribe((link) => { + this.linksDataSource.update(link); this.toasterService.success("Link updated"); this.dialogRef.close(); });