From 12e7d1e2851c1784199c79b4f028208133d0b2bf Mon Sep 17 00:00:00 2001 From: panaaj <38519157+panaaj@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:02:41 +0930 Subject: [PATCH] style and formatting --- src/app-theme.scss | 2 +- src/app/app.component.ts | 14 +++++++++---- src/app/app.info.ts | 3 +-- .../dialogs/geojson-dialog.facade.ts | 2 +- .../gpx/gpxload/gpxload-dialog.facade.ts | 2 +- .../gpx/gpxsave/gpxsave-dialog.facade.ts | 2 +- .../components/dialogs/trail2route-dialog.ts | 4 +--- .../lib/components/file-input.component.ts | 2 +- src/app/modules/alarms/alarms.facade.ts | 2 +- .../components/anchor-watch.component.ts | 2 +- .../components/timer-button.component.ts | 5 +++-- ...xperiments.ts => experiments.component.ts} | 0 .../modules/experiments/experiments.module.ts | 5 +++-- src/app/modules/index.ts | 1 - .../components/popover/popover.component.ts | 5 +---- .../popover/resource-popover.component.ts | 7 +------ .../default/vessel-popover.component.ts | 2 +- src/app/modules/map/fb-map.component.ts | 20 +++++++++---------- .../resources/layer-resourceset.component.ts | 2 +- src/app/modules/skresources/index.ts | 1 - src/app/modules/skresources/lists/aislist.ts | 2 +- src/app/modules/skresources/notes/index.ts | 1 - .../modules/skresources/notes/notes.module.ts | 2 +- .../modules/skresources/resources.module.ts | 9 +++++---- .../modules/skresources/resources.service.ts | 2 +- src/app/modules/skstream/skstream.facade.ts | 4 +--- src/app/types/resources/freeboard.ts | 2 +- 27 files changed, 48 insertions(+), 57 deletions(-) rename src/app/modules/experiments/{experiments.ts => experiments.component.ts} (100%) delete mode 100644 src/app/modules/skresources/index.ts delete mode 100644 src/app/modules/skresources/notes/index.ts diff --git a/src/app-theme.scss b/src/app-theme.scss index 5f5d058a3..2a0888f9a 100644 --- a/src/app-theme.scss +++ b/src/app-theme.scss @@ -39,7 +39,7 @@ $my-dark-theme: mat.define-dark-theme(( @include mat.all-component-themes($my-theme); .dark-theme { - @include mat.all-component-themes($my-dark-theme); + @include mat.all-component-colors($my-dark-theme); .about-row .item a { color: mat-color($my-dark-accent); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 34310644f..4c3a937c4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -17,9 +17,7 @@ import { GPXImportDialog, GPXExportDialog } from 'src/app/lib/components/dialogs'; -import { - CourseSettingsModal -} from 'src/app/lib/components'; +import { CourseSettingsModal } from 'src/app/lib/components'; import { SettingsDialog, SKStreamFacade, @@ -859,7 +857,15 @@ export class AppComponent { if (!res) { return; } // cancelled - this.skres.createResource(res.path, res.data); + try { + const d = JSON.parse(res.data); + this.skres.createResource(res.path, d); + } catch (err) { + this.app.showAlert( + 'Load Resource', + 'Resources were not loaded!\nInvalid JSON.' + ); + } this.focusMap(); }); } diff --git a/src/app/app.info.ts b/src/app/app.info.ts index 1e0ea7f4e..524374f97 100644 --- a/src/app/app.info.ts +++ b/src/app/app.info.ts @@ -21,8 +21,7 @@ import { import { Convert } from './lib/convert'; import { SignalKClient } from 'signalk-client-angular'; -import { SKVessel, SKChart } from './modules/skresources/resource-classes'; -import { SKStreamProvider } from './modules/skstream/skstream.service'; +import { SKVessel, SKChart, SKStreamProvider } from './modules'; export interface PluginSettings { version: string; diff --git a/src/app/lib/components/dialogs/geojson-dialog.facade.ts b/src/app/lib/components/dialogs/geojson-dialog.facade.ts index ebafd932c..6cc2a5195 100644 --- a/src/app/lib/components/dialogs/geojson-dialog.facade.ts +++ b/src/app/lib/components/dialogs/geojson-dialog.facade.ts @@ -11,7 +11,7 @@ import { SKWaypoint, SKRegion, SKTrack -} from 'src/app/modules/skresources/'; +} from 'src/app/modules'; import { LineStringFeature, MultiLineStringFeature, diff --git a/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts index c3684bcbb..1c9a2f1b6 100644 --- a/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts +++ b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts @@ -5,7 +5,7 @@ import { Subject, Observable } from 'rxjs'; import { AppInfo } from 'src/app/app.info'; import { SignalKClient } from 'signalk-client-angular'; -import { SKResources } from '../../../../../modules/skresources'; +import { SKResources } from 'src/app/modules'; import { GPX, GPXRoute, diff --git a/src/app/lib/components/dialogs/gpx/gpxsave/gpxsave-dialog.facade.ts b/src/app/lib/components/dialogs/gpx/gpxsave/gpxsave-dialog.facade.ts index 1ff29d21c..b477d502a 100644 --- a/src/app/lib/components/dialogs/gpx/gpxsave/gpxsave-dialog.facade.ts +++ b/src/app/lib/components/dialogs/gpx/gpxsave/gpxsave-dialog.facade.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { Subject, Observable } from 'rxjs'; import { SK2GPX } from './sk2gpx'; -import { SKTrack } from 'src/app/modules/skresources/resource-classes'; +import { SKTrack } from 'src/app/modules'; import { SignalKClient } from 'signalk-client-angular'; @Injectable({ providedIn: 'root' }) diff --git a/src/app/lib/components/dialogs/trail2route-dialog.ts b/src/app/lib/components/dialogs/trail2route-dialog.ts index ebd984f5a..d7e03ad5d 100644 --- a/src/app/lib/components/dialogs/trail2route-dialog.ts +++ b/src/app/lib/components/dialogs/trail2route-dialog.ts @@ -18,9 +18,7 @@ import { MatToolbarModule } from '@angular/material/toolbar'; import { CommonDialogs } from 'src/app/lib/components/dialogs'; import { FreeboardOpenlayersModule } from 'src/app/modules/map/ol'; import { SimplifyAP } from 'simplify-ts'; -import { SKRoute } from 'src/app/modules/skresources/resource-classes'; -import { SKResources } from 'src/app/modules/skresources//resources.service'; -import { SKStreamFacade } from 'src/app/modules/skstream/skstream.facade'; +import { SKRoute, SKResources, SKStreamFacade } from 'src/app/modules'; import { AppInfo } from 'src/app/app.info'; /********* Trail2RouteDialog ********** diff --git a/src/app/lib/components/file-input.component.ts b/src/app/lib/components/file-input.component.ts index 8fb6f1fd8..9f37b635b 100644 --- a/src/app/lib/components/file-input.component.ts +++ b/src/app/lib/components/file-input.component.ts @@ -15,7 +15,7 @@ import { @Component({ standalone: true, selector: 'ap-file-input', - imports: [ CommonModule ], + imports: [CommonModule], templateUrl: './file-input.component.html', styleUrls: ['./file-input.component.css'] }) diff --git a/src/app/modules/alarms/alarms.facade.ts b/src/app/modules/alarms/alarms.facade.ts index 23cff033c..f54cc7e66 100644 --- a/src/app/modules/alarms/alarms.facade.ts +++ b/src/app/modules/alarms/alarms.facade.ts @@ -5,7 +5,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Subject, forkJoin, Observable } from 'rxjs'; import { AppInfo } from 'src/app/app.info'; -import { SKResources } from '../skresources'; +import { SKResources } from 'src/app/modules'; import { SignalKClient } from 'signalk-client-angular'; import { SKStreamProvider } from '../skstream/skstream.service'; import { NotificationMessage } from 'src/app/types'; diff --git a/src/app/modules/alarms/components/anchor-watch.component.ts b/src/app/modules/alarms/components/anchor-watch.component.ts index a433b36c5..1a13ce16d 100644 --- a/src/app/modules/alarms/components/anchor-watch.component.ts +++ b/src/app/modules/alarms/components/anchor-watch.component.ts @@ -9,7 +9,7 @@ import { interface OutputMessage { radius: number | null; - raised: boolean + raised: boolean; } @Component({ diff --git a/src/app/modules/alarms/components/timer-button.component.ts b/src/app/modules/alarms/components/timer-button.component.ts index 2bf64d0aa..26f24aab8 100644 --- a/src/app/modules/alarms/components/timer-button.component.ts +++ b/src/app/modules/alarms/components/timer-button.component.ts @@ -32,8 +32,9 @@ import { MatIconModule } from '@angular/material/icon'; {{ label }} {{ timeLeft }} secs   -