diff --git a/src/app-theme.scss b/src/app-theme.scss index 5f5d058a..2a0888f9 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 34310644..4c3a937c 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 1e0ea7f4..524374f9 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 ebafd932..6cc2a519 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 c3684bcb..1c9a2f1b 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 1ff29d21..b477d502 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 ebd984f5..d7e03ad5 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 8fb6f1fd..9f37b635 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 23cff033..f54cc7e6 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 a433b36c..1a13ce16 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 2bf64d0a..26f24aab 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   -