From ceafe49ebd13bdbb0aa56aa9d1b7aa0ce5a19f04 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Tue, 4 Jun 2019 06:24:46 -0700 Subject: [PATCH] Fixes after review --- src/app/app.module.ts | 4 ++-- .../drawings-editors/style-editor/style-editor.component.ts | 5 +++-- .../drawings-editors/text-editor/text-editor.component.ts | 2 +- .../{NonNegativeValidator.ts => non-negative-validator.ts} | 0 .../{RotationValidator.ts => rotation-validator.ts} | 0 5 files changed, 6 insertions(+), 5 deletions(-) rename src/app/validators/{NonNegativeValidator.ts => non-negative-validator.ts} (100%) rename src/app/validators/{RotationValidator.ts => rotation-validator.ts} (100%) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 32679dd3..be596dd9 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -184,8 +184,8 @@ import { AdbutlerComponent } from './components/adbutler/adbutler.component'; import { ConsoleService } from './services/settings/console.service'; import { DefaultConsoleService } from './services/settings/default-console.service'; import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer'; -import { NonNegativeValidator } from './validators/NonNegativeValidator'; -import { RotationValidator } from './validators/RotationValidator'; +import { NonNegativeValidator } from './validators/non-negative-validator'; +import { RotationValidator } from './validators/rotation-validator'; if (environment.production) { Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', { diff --git a/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts b/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts index 978f4663..6a553f70 100644 --- a/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts +++ b/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts @@ -12,8 +12,8 @@ import { LineElement } from '../../../../cartography/models/drawings/line-elemen import { RectElement } from '../../../../cartography/models/drawings/rect-element'; import { FormGroup, FormBuilder, FormControl, Validators } from '@angular/forms'; import { ToasterService } from '../../../../services/toaster.service'; -import { NonNegativeValidator } from '../../../../validators/NonNegativeValidator'; -import { RotationValidator } from '../../../../validators/RotationValidator'; +import { NonNegativeValidator } from '../../../../validators/non-negative-validator'; +import { RotationValidator } from '../../../../validators/rotation-validator'; @Component({ selector: 'app-style-editor', @@ -58,6 +58,7 @@ export class StyleEditorDialogComponent implements OnInit { this.element.stroke_width = this.drawing.element.stroke_width; } + if (this.element.stroke_width === undefined) this.element.stroke_width = 0; this.formGroup.controls['borderWidth'].setValue(this.element.stroke_width); this.formGroup.controls['rotation'].setValue(this.drawing.rotation); } diff --git a/src/app/components/project-map/drawings-editors/text-editor/text-editor.component.ts b/src/app/components/project-map/drawings-editors/text-editor/text-editor.component.ts index 474036a8..721cec36 100644 --- a/src/app/components/project-map/drawings-editors/text-editor/text-editor.component.ts +++ b/src/app/components/project-map/drawings-editors/text-editor/text-editor.component.ts @@ -10,7 +10,7 @@ import { DrawingsDataSource } from '../../../../cartography/datasources/drawings import { TextElement } from '../../../../cartography/models/drawings/text-element'; import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; import { ToasterService } from '../../../../services/toaster.service'; -import { RotationValidator } from '../../../../validators/RotationValidator'; +import { RotationValidator } from '../../../../validators/rotation-validator'; @Component({ selector: 'app-text-editor', diff --git a/src/app/validators/NonNegativeValidator.ts b/src/app/validators/non-negative-validator.ts similarity index 100% rename from src/app/validators/NonNegativeValidator.ts rename to src/app/validators/non-negative-validator.ts diff --git a/src/app/validators/RotationValidator.ts b/src/app/validators/rotation-validator.ts similarity index 100% rename from src/app/validators/RotationValidator.ts rename to src/app/validators/rotation-validator.ts