Skip to content

Commit

Permalink
style and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
panaaj committed Sep 1, 2023
1 parent 4c481d7 commit 12e7d1e
Show file tree
Hide file tree
Showing 27 changed files with 48 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/app-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 10 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/app/app.info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/components/dialogs/geojson-dialog.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SKWaypoint,
SKRegion,
SKTrack
} from 'src/app/modules/skresources/';
} from 'src/app/modules';
import {
LineStringFeature,
MultiLineStringFeature,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down
4 changes: 1 addition & 3 deletions src/app/lib/components/dialogs/trail2route-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 **********
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/components/file-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/alarms/alarms.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

interface OutputMessage {
radius: number | null;
raised: boolean
raised: boolean;
}

@Component({
Expand Down
5 changes: 3 additions & 2 deletions src/app/modules/alarms/components/timer-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import { MatIconModule } from '@angular/material/icon';
{{ label }} {{ timeLeft }} secs
</button>
&nbsp;
<button *ngSwitchCase="true"
mat-raised-button
<button
*ngSwitchCase="true"
mat-raised-button
color="accent"
(click)="action()"
>
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/app/modules/experiments/experiments.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MatMenuModule } from '@angular/material/menu';
import { CommonDialogs } from 'src/app/lib/components/dialogs';

// ** components **
import { ExperimentsComponent } from './experiments';
import { ExperimentsComponent } from './experiments.component';

@NgModule({
imports: [
Expand All @@ -28,4 +28,5 @@ import { ExperimentsComponent } from './experiments';
})
export class ExperimentsModule {}

export * from './experiments';
export * from './experiments.component';
export * from './weather/weather.module';
1 change: 0 additions & 1 deletion src/app/modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ export * from './map/map.module';
export * from './skstream/skstream.module';

export * from './experiments/experiments.module';
export * from './experiments/weather/weather.module';
5 changes: 1 addition & 4 deletions src/app/modules/map/components/popover/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import {
ChangeDetectionStrategy
} from '@angular/core';
import { AppInfo } from 'src/app/app.info';
import {
SKAtoN,
SKAircraft
} from 'src/app/modules/skresources/resource-classes';
import { SKAtoN, SKAircraft } from 'src/app/modules';

/*********** Popover ***************
title: string - title text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import {
} from '@angular/core';
import { AppInfo } from 'src/app/app.info';
import { Convert } from 'src/app/lib/convert';
import {
SKRoute,
SKWaypoint,
SKNote,
SKRegion
} from 'src/app/modules/skresources/resource-classes';
import { SKRoute, SKWaypoint, SKNote, SKRegion } from 'src/app/modules';

/*********** Resource Popover ***************
title: string - title text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SimpleChanges
} from '@angular/core';
import { AppInfo } from 'src/app/app.info';
import { SKVessel } from 'src/app/modules/skresources/resource-classes';
import { SKVessel } from 'src/app/modules';
import { Convert } from 'src/app/lib/convert';
import { GeoUtils, Position } from 'src/app/lib/geoutils';

Expand Down
20 changes: 9 additions & 11 deletions src/app/modules/map/fb-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ import { GeoUtils, Position } from 'src/app/lib/geoutils';

import { AppInfo } from 'src/app/app.info';
import { SettingsMessage } from 'src/app/lib/services';
import { SKResources } from '../skresources/resources.service';
import { SKOtherResources } from '../skresources/sets/resource-sets.service';
import {
SKResources,
SKOtherResources,
SKChart,
SKRoute,
SKWaypoint,
SKNote,
SKRegion,
SKVessel,
SKAtoN,
SKAircraft,
SKSaR
} from '../skresources/resource-classes';
import { SKStreamFacade } from '../skstream/skstream.facade';
SKSaR,
SKStreamFacade
} from 'src/app/modules';
import {
mapInteractions,
mapControls,
Expand All @@ -46,12 +50,6 @@ import {
import { ModifyEvent } from 'ol/interaction/Modify';
import { DrawEvent } from 'ol/interaction/Draw';
import { Coordinate } from 'ol/coordinate';
import {
SKRoute,
SKWaypoint,
SKNote,
SKRegion
} from 'src/app/modules/skresources/resource-classes';
import { ResourceSets } from 'src/app/types';

interface IResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { MapComponent } from '../map.component';
import { Extent } from '../models';
import { fromLonLatArray } from '../util';
import { AsyncSubject } from 'rxjs';
import { SKResourceSet } from 'src/app/modules/skresources/sets/resource-set';
import { SKResourceSet } from 'src/app/modules';

// ** Signal K resource collection format **
@Component({
Expand Down
1 change: 0 additions & 1 deletion src/app/modules/skresources/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/modules/skresources/lists/aislist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ChangeDetectionStrategy
} from '@angular/core';
import { AppInfo } from 'src/app/app.info';
import { SKVessel } from 'src/app/modules/skresources/resource-classes';
import { SKVessel } from 'src/app/modules';
import { Position } from 'src/app/lib/geoutils';

//** AIS Dialog **
Expand Down
1 change: 0 additions & 1 deletion src/app/modules/skresources/notes/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/modules/skresources/notes/notes.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule, Injectable } from '@angular/core';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { FormsModule } from '@angular/forms';
Expand Down
9 changes: 5 additions & 4 deletions src/app/modules/skresources/resources.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import {
SignalKDetailsComponent,
FileInputComponent
} from 'src/app/lib/components';
import { CommonDialogs } from 'src/app/lib/components/dialogs';
import { PipesModule } from 'src/app/lib/pipes';

import {
ResourceDialog,
Expand All @@ -44,9 +46,7 @@ import {
} from './resource-dialogs';
import { ResourceImportDialog } from './sets/resource-upload-dialog';

import { SKNotesModule } from './notes';
import { CommonDialogs } from 'src/app/lib/components/dialogs';
import { PipesModule } from 'src/app/lib/pipes';
import { SKNotesModule } from './notes/notes.module';

@NgModule({
imports: [
Expand Down Expand Up @@ -116,6 +116,7 @@ export class SignalKResourcesModule {}
export * from './resources.service';
export * from './resource-dialogs';
export * from './resource-classes';
export * from './notes';
export * from './notes/notes.module';
export * from './sets/resource-set';
export * from './sets/resource-sets.service';
export * from './sets/resource-upload-dialog';
2 changes: 1 addition & 1 deletion src/app/modules/skresources/resources.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { GeoUtils, Position } from 'src/app/lib/geoutils';
import { Convert } from 'src/app/lib/convert';

import { LoginDialog } from 'src/app/lib/components/dialogs';
import { NoteDialog, RelatedNotesDialog } from './notes';
import { NoteDialog, RelatedNotesDialog } from './notes/notes.module';
import { ResourceDialog } from './resource-dialogs';
import {
SKChart,
Expand Down
4 changes: 1 addition & 3 deletions src/app/modules/skstream/skstream.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import { AppInfo } from 'src/app/app.info';
import { SettingsMessage } from 'src/app/lib/services';
import { SignalKClient } from 'signalk-client-angular';
import { SKStreamProvider } from './skstream.service';
import { SKRoute, SKVessel } from '../skresources/resource-classes';
import { AlarmsFacade } from '../alarms/alarms.facade';
import { Convert } from 'src/app/lib/convert';
import { SKResources } from '../skresources';
import { SKResources, SKRoute, SKVessel, AlarmsFacade } from 'src/app/modules';
import {
NotificationMessage,
UpdateMessage,
Expand Down
2 changes: 1 addition & 1 deletion src/app/types/resources/freeboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
SKWaypoint,
SKNote,
SKChart
} from '../../modules/skresources/resource-classes';
} from 'src/app/modules/skresources/resource-classes';

export type FBRoutes = Array<FBRoute>;
export type FBRoute = [string, SKRoute, boolean?];
Expand Down

0 comments on commit 12e7d1e

Please sign in to comment.