Skip to content

Commit

Permalink
moved plan components to its directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Dec 27, 2024
1 parent 1e457b3 commit 5a54e29
Show file tree
Hide file tree
Showing 60 changed files with 355 additions and 353 deletions.
2 changes: 1 addition & 1 deletion projects/planner/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@angular/router';
import { Location } from '@angular/common';
import { AppSettingsComponent } from './app-settings/app-settings.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { DashboardComponent } from './plan/dashboard/dashboard.component';
import { NgModule, inject } from '@angular/core';
import { KnownViews, ViewStates } from './shared/viewStates';
import { AboutComponent } from './about/about.component';
Expand Down
58 changes: 30 additions & 28 deletions projects/planner/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,41 @@ import {TankSizeComponent} from './controls/tank.size/tank.size.component';
import {GradientsComponent} from './controls/gradients/gradients.component';
import {PpO2Component} from './controls/pp-o2/pp-o2.component';

import {TanksSimpleComponent} from './tanks-simple/tanks-simple.component';
import {TanksComplexComponent} from './tanks-complex/tanks-complex.component';
import {DiverComponent} from './diver/diver.component';
import {DiveOptionsComponent} from './diveoptions/diveoptions.component';
import {DiveInfoComponent} from './diveinfo/diveinfo.component';
import {SurfaceIntervalComponent} from './plan/surface-interval/surface-interval.component';
import {PlanTabsComponent} from './plan/plan.tabs/plan.tabs.component';
import {TanksSimpleComponent} from './plan/tanks-simple/tanks-simple.component';
import {TanksComplexComponent} from './plan/tanks-complex/tanks-complex.component';
import {DiverComponent} from './plan/diver/diver.component';
import {DiveOptionsComponent} from './plan/diveoptions/diveoptions.component';
import {DiveInfoComponent} from './plan/diveinfo/diveinfo.component';
import {DashboardComponent} from './plan/dashboard/dashboard.component';
import {WayPointsComponent} from './plan/waypoints/waypoints.component';
import {ProfileChartComponent} from './plan/profilechart/profilechart.component';
import {DepthsSimpleComponent} from './plan/depths-simple/depths-simple.component';
import {DepthsComplexComponent} from './plan/depths-complex/depths-complex.component';
import {TankChartComponent} from './plan/tank-chart/tank-chart.component';
import {DepthComponent} from './plan/depth/depth.component';
import {DiveIssuesComponent} from './plan/dive-issues/dive-issues.component';

import {DiffComponent} from './diff/diff.component';
import {DiffTabsButtonComponent} from './diff/tabs/profile-button/diff-tabs-button.component';
import {DiffTabsComponent} from './diff/tabs/diff-tabs.component';
import {GasConsumedDifferenceComponent} from './diff/gasconsumed/diff-gas-consumed/diff-gas-consumed.component';
import {
GasConsumedDifferenceTankComponent
} from './diff/gasconsumed/diff-gas-consumed/tank-chart/diff-gas-consumed-tank-chart.component';
import {WaypointsDifferenceComponent} from './diff/waypoints/diff-waypoints.component';
import {DiveResultsDifferenceComponent} from './diff/diveresults/diff-diveresults.component';
import {ProfileDifferenceChartComponent} from './diff/profilechart/diff-profilechart.component';
import {DiveResultsTableDifferenceComponent} from './diff/diveresults/table/diff-diveresults-table.component';

import {MainMenuComponent} from './mainmenu/mainmenu.component';
import {DashboardComponent} from './dashboard/dashboard.component';
import {WayPointsComponent} from './waypoints/waypoints.component';
import {ProfileChartComponent} from './profilechart/profilechart.component';
import {AboutComponent} from './about/about.component';
import {AppFooterComponent} from './footer/footer.component';
import {DepthsSimpleComponent} from './depths-simple/depths-simple.component';
import {DepthsComplexComponent} from './depths-complex/depths-complex.component';
import {TankChartComponent} from './tank-chart/tank-chart.component';
import {AppSettingsComponent} from './app-settings/app-settings.component';
import {DepthComponent} from './depth/depth.component';
import {DurationPipe} from './pipes/duration.pipe';
import {AppinfoComponent} from './appinfo/appinfo.component';

import {PlannerService} from './shared/planner.service';
import {PreferencesStore} from './shared/preferencesStore';
import {UnitConversion} from './shared/UnitConversion';
Expand All @@ -62,8 +80,6 @@ import {WorkersFactoryCommon} from './shared/serial.workers.factory';
import {NdlService} from './shared/ndl.service';
import {OptionsService} from './shared/options.service';
import {DelayedScheduleService} from './shared/delayedSchedule.service';
import {AppinfoComponent} from './appinfo/appinfo.component';
import {DiveIssuesComponent} from './dive-issues/dive-issues.component';
import {InputControls} from './shared/inputcontrols';
import {ValidatorGroups} from './shared/ValidatorGroups';
import {DepthsService} from './shared/depths.service';
Expand All @@ -75,31 +91,17 @@ import {ViewSwitchService} from './shared/viewSwitchService';
import {Preferences} from './shared/preferences';
import {PlanUrlSerialization} from './shared/PlanUrlSerialization';
import {WayPointsService} from './shared/waypoints.service';
import {PlanTabsComponent} from './plan.tabs/plan.tabs.component';
import {StopsFilter} from './shared/stopsFilter.service';
import {ViewStates} from './shared/viewStates';
import {Urls} from './shared/navigation.service';
import {SubViewStorage} from './shared/subViewStorage';
import {DashboardStartUp} from './shared/startUp';
import {DiffComponent} from './diff/diff.component';
import {DiveResults} from './shared/diveresults';
import {DiveSchedules} from './shared/dive.schedules';
import {RedundanciesService} from './shared/redundancies.service';
import {ReloadDispatcher} from './shared/reloadDispatcher';
import {ManagedDiveSchedules} from './shared/managedDiveSchedules';
import {WaypointsDifferenceComponent} from './diff/waypoints/diff-waypoints.component';
import {DiveResultsDifferenceComponent} from './diff/diveresults/diff-diveresults.component';
import {ProfileDifferenceChartComponent} from './diff/profilechart/diff-profilechart.component';
import {SurfaceIntervalComponent} from './surface-interval/surface-interval.component';
import {DiveResultsTableDifferenceComponent} from './diff/diveresults/table/diff-diveresults-table.component';
import { GasBlenderService } from './shared/gas-blender.service';
import {DiffTabsButtonComponent} from './diff/tabs/profile-button/diff-tabs-button.component';
import {DiffTabsComponent} from './diff/tabs/diff-tabs.component';
import {GasConsumedDifferenceComponent} from './diff/gasconsumed/diff-gas-consumed/diff-gas-consumed.component';
import {
GasConsumedDifferenceTankComponent
} from './diff/gasconsumed/diff-gas-consumed/tank-chart/diff-gas-consumed-tank-chart.component';

import { ProfileComparatorService } from './shared/diff/profileComparatorService';
import { GasesComparisonService } from './shared/diff/gases-comparison.service';
import { ResultsComparison } from './shared/diff/results-comparison.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { Component, HostListener, OnInit } from '@angular/core';
import { FormGroup, NonNullableFormBuilder } from '@angular/forms';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { takeUntil } from 'rxjs';
import { Streamed } from '../shared/streamed';
import { ViewSwitchService } from '../shared/viewSwitchService';
import { UnitConversion } from '../shared/UnitConversion';
import { DashboardStartUp } from '../shared/startUp';
import { ReloadDispatcher } from '../shared/reloadDispatcher';
import { DiveSchedules } from '../shared/dive.schedules';
import { Streamed } from '../../shared/streamed';
import { ViewSwitchService } from '../../shared/viewSwitchService';
import { UnitConversion } from '../../shared/UnitConversion';
import { DashboardStartUp } from '../../shared/startUp';
import { ReloadDispatcher } from '../../shared/reloadDispatcher';
import { DiveSchedules } from '../../shared/dive.schedules';

@Component({
selector: 'app-dashboard',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
import { DecimalPipe } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { InputControls } from '../shared/inputcontrols';
import { UnitConversion } from '../shared/UnitConversion';
import { ValidatorGroups } from '../shared/ValidatorGroups';
import { DepthComponent } from './depth.component';

export class DepthPage {
constructor(private fixture: ComponentFixture<DepthComponent>) { }

public get depthInput(): HTMLInputElement {
return this.fixture.debugElement.query(By.css('#depthField')).nativeElement as HTMLInputElement;
}

public get applyMaxDepthButton(): HTMLButtonElement {
return this.fixture.debugElement.query(By.css('#applyMaxDepthBtn')).nativeElement as HTMLButtonElement;
}
}

describe('DepthComponent', () => {
let component: DepthComponent;
let fixture: ComponentFixture<DepthComponent>;
let page: DepthPage;
let changeFired: boolean;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DepthComponent],
imports: [ReactiveFormsModule],
providers: [
UnitConversion, ValidatorGroups,
InputControls, DecimalPipe
]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(DepthComponent);
page = new DepthPage(fixture);
component = fixture.componentInstance;
component.units.imperialUnits = true;
fixture.detectChanges();
});

it('Fires value changed', () => {
component.depthChange.subscribe(() => changeFired = true);
changeFired = false;
page.depthInput.value = '70';
page.depthInput.dispatchEvent(new Event('input'));
expect(changeFired).toBeTruthy();
});

it('Fires apply max depth', () => {
let eventFired = false;
component.assignMaxDepth.subscribe(() => eventFired = true);
page.applyMaxDepthButton.click();
expect(eventFired).toBeTruthy();
});
});
import { DecimalPipe } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { InputControls } from '../../shared/inputcontrols';
import { UnitConversion } from '../../shared/UnitConversion';
import { ValidatorGroups } from '../../shared/ValidatorGroups';
import { DepthComponent } from './depth.component';

export class DepthPage {
constructor(private fixture: ComponentFixture<DepthComponent>) { }

public get depthInput(): HTMLInputElement {
return this.fixture.debugElement.query(By.css('#depthField')).nativeElement as HTMLInputElement;
}

public get applyMaxDepthButton(): HTMLButtonElement {
return this.fixture.debugElement.query(By.css('#applyMaxDepthBtn')).nativeElement as HTMLButtonElement;
}
}

describe('DepthComponent', () => {
let component: DepthComponent;
let fixture: ComponentFixture<DepthComponent>;
let page: DepthPage;
let changeFired: boolean;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DepthComponent],
imports: [ReactiveFormsModule],
providers: [
UnitConversion, ValidatorGroups,
InputControls, DecimalPipe
]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(DepthComponent);
page = new DepthPage(fixture);
component = fixture.componentInstance;
component.units.imperialUnits = true;
fixture.detectChanges();
});

it('Fires value changed', () => {
component.depthChange.subscribe(() => changeFired = true);
changeFired = false;
page.depthInput.value = '70';
page.depthInput.dispatchEvent(new Event('input'));
expect(changeFired).toBeTruthy();
});

it('Fires apply max depth', () => {
let eventFired = false;
component.assignMaxDepth.subscribe(() => eventFired = true);
page.applyMaxDepthButton.click();
expect(eventFired).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { NonNullableFormBuilder, FormGroup } from '@angular/forms';
import { Precision } from 'scuba-physics';
import { InputControls } from '../shared/inputcontrols';
import { UnitConversion } from '../shared/UnitConversion';
import { ValidatorGroups } from '../shared/ValidatorGroups';
import { InputControls } from '../../shared/inputcontrols';
import { UnitConversion } from '../../shared/UnitConversion';
import { ValidatorGroups } from '../../shared/ValidatorGroups';

@Component({
selector: 'app-depth',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { DecimalPipe } from '@angular/common';
import { ComponentFixture, TestBed, inject } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { DepthsService } from '../shared/depths.service';
import { InputControls } from '../shared/inputcontrols';
import { PlannerService } from '../shared/planner.service';
import { WorkersFactoryCommon } from '../shared/serial.workers.factory';
import { UnitConversion } from '../shared/UnitConversion';
import { DepthsService } from '../../shared/depths.service';
import { InputControls } from '../../shared/inputcontrols';
import { PlannerService } from '../../shared/planner.service';
import { WorkersFactoryCommon } from '../../shared/serial.workers.factory';
import { UnitConversion } from '../../shared/UnitConversion';
import { DepthsComplexComponent } from './depths-complex.component';
import { ValidatorGroups } from '../shared/ValidatorGroups';
import { ViewSwitchService } from '../shared/viewSwitchService';
import { WayPointsService } from '../shared/waypoints.service';
import { SubViewStorage } from '../shared/subViewStorage';
import { ViewStates } from '../shared/viewStates';
import { PreferencesStore } from '../shared/preferencesStore';
import { Preferences } from '../shared/preferences';
import { DiveResults } from '../shared/diveresults';
import { ReloadDispatcher } from '../shared/reloadDispatcher';
import { DiveSchedules } from '../shared/dive.schedules';
import { ApplicationSettingsService } from '../shared/ApplicationSettings';
import { ValidatorGroups } from '../../shared/ValidatorGroups';
import { ViewSwitchService } from '../../shared/viewSwitchService';
import { WayPointsService } from '../../shared/waypoints.service';
import { SubViewStorage } from '../../shared/subViewStorage';
import { ViewStates } from '../../shared/viewStates';
import { PreferencesStore } from '../../shared/preferencesStore';
import { Preferences } from '../../shared/preferences';
import { DiveResults } from '../../shared/diveresults';
import { ReloadDispatcher } from '../../shared/reloadDispatcher';
import { DiveSchedules } from '../../shared/dive.schedules';
import { ApplicationSettingsService } from '../../shared/ApplicationSettings';

export class ComplexDepthsPage {
constructor(private fixture: ComponentFixture<DepthsComplexComponent>) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { FormArray, FormControl,
NonNullableFormBuilder, FormGroup
} from '@angular/forms';
import { takeUntil } from 'rxjs';
import { faLayerGroup, faPlus, faMinus } from '@fortawesome/free-solid-svg-icons';
import { InputControls } from '../shared/inputcontrols';
import { Level, TankBound } from '../shared/models';
import { Streamed } from '../shared/streamed';
import { RangeConstants, UnitConversion } from '../shared/UnitConversion';
import { ValidatorGroups } from '../shared/ValidatorGroups';
import { Precision } from 'scuba-physics';
import { DiveSchedules } from '../shared/dive.schedules';
import { ReloadDispatcher } from '../shared/reloadDispatcher';
import { DepthsService } from '../shared/depths.service';
import { faLayerGroup, faPlus, faMinus } from '@fortawesome/free-solid-svg-icons';
import { InputControls } from '../../shared/inputcontrols';
import { Level, TankBound } from '../../shared/models';
import { Streamed } from '../../shared/streamed';
import { RangeConstants, UnitConversion } from '../../shared/UnitConversion';
import { ValidatorGroups } from '../../shared/ValidatorGroups';
import { DiveSchedules } from '../../shared/dive.schedules';
import { ReloadDispatcher } from '../../shared/reloadDispatcher';
import { DepthsService } from '../../shared/depths.service';

interface LevelRow {
duration: FormControl<number>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { DecimalPipe } from '@angular/common';
import { ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { DepthsService } from '../shared/depths.service';
import { InputControls } from '../shared/inputcontrols';
import { OptionsService } from '../shared/options.service';
import { PlannerService } from '../shared/planner.service';
import { WorkersFactoryCommon } from '../shared/serial.workers.factory';
import { UnitConversion } from '../shared/UnitConversion';
import { DepthsSimpleComponent } from './depths-simple.component';
import { ValidatorGroups } from '../shared/ValidatorGroups';
import { ViewSwitchService } from '../shared/viewSwitchService';
import { WayPointsService } from '../shared/waypoints.service';
import { SubViewStorage } from '../shared/subViewStorage';
import { ViewStates } from '../shared/viewStates';
import { PreferencesStore } from '../shared/preferencesStore';
import { Preferences } from '../shared/preferences';
import { DiveSchedules } from '../shared/dive.schedules';
import { ReloadDispatcher } from '../shared/reloadDispatcher';
import { Time } from 'scuba-physics';
import { DepthsService } from '../../shared/depths.service';
import { InputControls } from '../../shared/inputcontrols';
import { OptionsService } from '../../shared/options.service';
import { PlannerService } from '../../shared/planner.service';
import { WorkersFactoryCommon } from '../../shared/serial.workers.factory';
import { UnitConversion } from '../../shared/UnitConversion';
import { DepthsSimpleComponent } from './depths-simple.component';
import { ValidatorGroups } from '../../shared/ValidatorGroups';
import { ViewSwitchService } from '../../shared/viewSwitchService';
import { WayPointsService } from '../../shared/waypoints.service';
import { SubViewStorage } from '../../shared/subViewStorage';
import { ViewStates } from '../../shared/viewStates';
import { PreferencesStore } from '../../shared/preferencesStore';
import { Preferences } from '../../shared/preferences';
import { DiveSchedules } from '../../shared/dive.schedules';
import { ReloadDispatcher } from '../../shared/reloadDispatcher';
import { SurfaceIntervalComponent } from '../surface-interval/surface-interval.component';
import { DepthComponent } from '../depth/depth.component';

Expand Down
Loading

0 comments on commit 5a54e29

Please sign in to comment.