From 6a071ed93ce25642647670fe7354968ffeb12f24 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Tue, 2 Dec 2025 11:18:35 -0500 Subject: [PATCH 01/34] Add aliases to run tests locally --- web/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/package.json b/web/package.json index bee430cb6..cfdda13f6 100644 --- a/web/package.json +++ b/web/package.json @@ -8,8 +8,9 @@ "build-local-deps": "npm run build --workspace=../proto --workspace=../lib", "build": "npm run --prefix scripts copy-keys && ng build -c $npm_config_config", "build-all": "npm run build-local-deps && npm run build", - "build-and-test": "npm run build && npm run test", - "build-all-and-test": "npm run build-all && npm run test", + "build-and-test": "npm run build --config=local && npm run test", + "build-all-and-test": "npm run build-all --config=local && npm run test", + "build-all-and-test-headless": "npm run build-all --config=local && npm run test-headless", "watch": "npm run build -- --watch", "start": "npm run build && ng serve -c $npm_config_config", "build-and-start": "npm run build && npm run start", From d4a816ed6413700726517bb425448637c3197bd9 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Tue, 2 Dec 2025 11:41:52 -0500 Subject: [PATCH 02/34] Update assetLinks warning --- web/scripts/copy-asset-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/scripts/copy-asset-links.js b/web/scripts/copy-asset-links.js index 61e93c2ed..7b113076c 100644 --- a/web/scripts/copy-asset-links.js +++ b/web/scripts/copy-asset-links.js @@ -38,5 +38,5 @@ if (existsSync(assertLinksFilepath)) { writeFileSync(`${wellKnownDir}/assetLinks.json`, assertLinks); } else { - console.warn('Missing asserLinks.json file'); + console.warn('Warning: Missing assetLinks.json file'); } From bb610f3c5fdd588cbfd9221b4f9d46a2b39d7c9c Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Tue, 2 Dec 2025 11:41:52 -0500 Subject: [PATCH 03/34] Update assetLinks warning --- .../main-page-container.component.html | 10 +- .../main-page-container.component.ts | 28 ++--- .../drawing-tools.component.html | 4 +- .../drawing-tools.component.spec.ts | 22 ++-- .../drawing-tools/drawing-tools.component.ts | 40 ++++--- .../main-page/main-page.component.html | 11 +- .../main-page/main-page.component.ts | 8 +- .../main-page/map/map.component.spec.ts | 12 +- .../main-page/map/map.component.ts | 13 +- .../loi-panel/loi-panel.component.spec.ts | 112 ++++++++++++++++++ .../loi-panel/loi-panel.component.ts | 39 +++--- .../secondary-side-panel.component.html | 4 +- .../secondary-side-panel.component.spec.ts | 78 ++++++++++++ .../secondary-side-panel.component.ts | 4 +- .../submission-panel.component.spec.ts | 111 +++++++++++++++++ .../submission-panel.component.ts | 18 ++- .../job-list/job-list.component.html | 3 +- .../job-list/job-list.component.spec.ts | 13 +- .../side-panel/job-list/job-list.component.ts | 33 +++--- .../side-panel/side-panel.component.html | 2 +- .../side-panel/side-panel.component.ts | 4 +- .../survey-header.component.html | 4 +- .../survey-header.component.spec.ts | 2 + .../survey-header/survey-header.component.ts | 31 ++--- web/src/app/routing.module.ts | 2 +- web/src/app/services/survey/survey.service.ts | 4 + 26 files changed, 446 insertions(+), 166 deletions(-) create mode 100644 web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts create mode 100644 web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts create mode 100644 web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page-container.component.html b/web/src/app/pages/main-page-container/main-page-container.component.html index f3ca683f4..106617312 100644 --- a/web/src/app/pages/main-page-container/main-page-container.component.html +++ b/web/src/app/pages/main-page-container/main-page-container.component.html @@ -14,10 +14,8 @@ limitations under the License. --> - + - -
- -
-
+
+ +
diff --git a/web/src/app/pages/main-page-container/main-page-container.component.ts b/web/src/app/pages/main-page-container/main-page-container.component.ts index 4c5c0b025..56f6dc7ae 100644 --- a/web/src/app/pages/main-page-container/main-page-container.component.ts +++ b/web/src/app/pages/main-page-container/main-page-container.component.ts @@ -14,11 +14,10 @@ * limitations under the License. */ -import {Component, effect} from '@angular/core'; -import {Observable} from 'rxjs'; +import { Component, effect, input } from '@angular/core'; +import { toObservable, toSignal } from '@angular/core/rxjs-interop'; +import { switchMap } from 'rxjs/operators'; -import {Survey} from 'app/models/survey.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; @Component({ @@ -27,20 +26,17 @@ import {SurveyService} from 'app/services/survey/survey.service'; styleUrls: ['./main-page-container.component.css'], }) export class MainPageContainerComponent { - private surveyIdSignal = this.navigationService.getSurveyId(); - - protected activeSurvey$: Observable; - - constructor( - private navigationService: NavigationService, - private surveyService: SurveyService - ) { - this.activeSurvey$ = surveyService.getActiveSurvey$(); + surveyId = input(); + survey = toSignal( + toObservable(this.surveyId).pipe( + switchMap(id => (id ? this.surveyService.loadSurvey$(id) : [])) + ) + ); + constructor(private surveyService: SurveyService) { effect(() => { - const surveyId = this.surveyIdSignal(); - - if (surveyId) this.surveyService.activateSurvey(surveyId); + const id = this.surveyId(); + if (id) this.surveyService.activateSurvey(id); }); } } diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html index 9af015ad2..647530096 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html @@ -21,7 +21,7 @@ [(value)]="selectedValue" > diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index 3b956cf62..9e4e60f6b 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -35,8 +35,7 @@ import { EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; import {DrawingToolsComponent} from './drawing-tools.component'; import {DrawingToolsModule} from './drawing-tools.module'; @@ -50,7 +49,6 @@ describe('DrawingToolsComponent', () => { let drawingToolsServiceSpy: jasmine.SpyObj; let mockSubmissionId$: BehaviorSubject; let navigationServiceSpy: jasmine.SpyObj; - let surveyServiceSpy: jasmine.SpyObj; const jobId1 = 'job001'; const jobId2 = 'job002'; @@ -105,25 +103,23 @@ describe('DrawingToolsComponent', () => { mockSubmissionId$ = new BehaviorSubject(null); navigationServiceSpy.getSubmissionId$.and.returnValue(mockSubmissionId$); - surveyServiceSpy = jasmine.createSpyObj('SurveyService', [ - 'getActiveSurvey$', - ]); - surveyServiceSpy.getActiveSurvey$.and.returnValue(of(mockSurvey)); - TestBed.configureTestingModule({ imports: [DrawingToolsModule, BrowserAnimationsModule], declarations: [DrawingToolsComponent], providers: [ {provide: AuthService, useValue: authServiceSpy}, {provide: DrawingToolsService, useValue: drawingToolsServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: SurveyService, useValue: surveyServiceSpy}, + { provide: NavigationService, useValue: navigationServiceSpy }, ], }).compileComponents(); })); function resetFixture() { + if (fixture) { + fixture.destroy(); + } fixture = TestBed.createComponent(DrawingToolsComponent); + fixture.componentRef.setInput('survey', mockSurvey); fixture.detectChanges(); } @@ -136,6 +132,9 @@ describe('DrawingToolsComponent', () => { } beforeEach(() => { + // resetFixture(); // Don't reset automatically, let tests do it or stick to standard. + // Actually standard is to do it in beforeEach. + // I will call resetFixture() here, but ensure resetFixture destroys previous. resetFixture(); }); @@ -188,6 +187,9 @@ describe('DrawingToolsComponent', () => { authServiceSpy.canUserAddPointsToJob.and.returnValue(false); resetFixture(); + // Verify spy behavior + // expect(authServiceSpy.canUserAddPointsToJob(mockSurvey, mockSurvey.jobs.first())).toBe(false); + const addPointButton = fixture.debugElement.query( By.css('#add-point-button') ); diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts index d9100465c..88644c7ee 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts @@ -20,12 +20,14 @@ import { Component, OnDestroy, OnInit, + computed, + effect, + input, } from '@angular/core'; import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; import {List} from 'immutable'; import {Observable, Subscription} from 'rxjs'; -import {map} from 'rxjs/internal/operators/map'; -import {tap} from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import {Job} from 'app/models/job.model'; import {Survey} from 'app/models/survey.model'; @@ -35,8 +37,7 @@ import { EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-drawing-tools', @@ -46,13 +47,21 @@ import {SurveyService} from 'app/services/survey/survey.service'; }) export class DrawingToolsComponent implements OnInit, OnDestroy { private subscription: Subscription = new Subscription(); + survey = input(); pointValue = 'point'; polygonValue = 'polygon'; selectedValue = ''; private lastSelectedValue = ''; selectedJobId = ''; - private activeSurvey!: Survey; - readonly jobs$: Observable>; + + readonly jobs = computed(() => { + const survey = this.survey(); + if (!survey) return List(); + return List(survey.jobs.valueSeq().toArray()) + .sortBy(l => l.index) + .filter(l => this.authService.canUserAddPointsToJob(survey, l)); + }); + readonly black = '#202225'; readonly addPointIconBlack = this.sanitizer.bypassSecurityTrustUrl( this.groundPinService.getPinImageSource(this.black) @@ -71,25 +80,20 @@ export class DrawingToolsComponent implements OnInit, OnDestroy { private sanitizer: DomSanitizer, private navigationService: NavigationService, private groundPinService: GroundPinService, - surveyService: SurveyService, - authService: AuthService + private authService: AuthService ) { this.isSubmissionSelected$ = this.navigationService .getSubmissionId$() .pipe(map(obs => !!obs)); this.disabled$ = drawingToolsService.getDisabled$(); - this.jobs$ = surveyService.getActiveSurvey$().pipe( - tap(survey => { - this.activeSurvey = survey; + + effect(() => { + const survey = this.survey(); + if (survey) { this.selectedJobId = survey.jobs.keySeq().first(); this.drawingToolsService.setSelectedJobId(this.selectedJobId); - }), - map(survey => - List(survey.jobs.valueSeq().toArray()) - .sortBy(l => l.index) - .filter(l => authService.canUserAddPointsToJob(this.activeSurvey, l)) - ) - ); + } + }); } ngOnInit() { diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.html b/web/src/app/pages/main-page-container/main-page/main-page.component.html index 8deff3a2d..8fca1efa9 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.html +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.html @@ -15,13 +15,14 @@ -->
- +
- - + +
- +
- +
diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.ts index 42a49c53d..b198c1a6a 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Component, OnInit, effect} from '@angular/core'; +import {Component, OnInit, effect, input} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; -import {Observable, Subscription} from 'rxjs'; +import {Subscription} from 'rxjs'; import {Survey} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; @@ -39,9 +39,9 @@ import {TitleDialogComponent} from './title-dialog/title-dialog.component'; styleUrls: ['./main-page.component.scss'], }) export class MainPageComponent implements OnInit { + activeSurvey = input.required(); private urlParamsSignal = this.navigationService.getUrlParams(); - activeSurvey$: Observable; subscription: Subscription = new Subscription(); shouldEnableDrawingTools = false; showSubmissionPanel: Boolean = false; @@ -54,8 +54,6 @@ export class MainPageComponent implements OnInit { private authService: AuthService, private dialog: MatDialog ) { - this.activeSurvey$ = this.surveyService.getActiveSurvey$(); - effect(() => { const {loiId, submissionId} = this.urlParamsSignal(); if (loiId) this.loiService.selectLocationOfInterest(loiId); diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts index 699b9ab2c..5f1a9917b 100644 --- a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts @@ -40,8 +40,7 @@ import { } from 'app/services/drawing-tools/drawing-tools.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; import {polygonShellCoordsToPolygon} from 'testing/helpers'; import {MapComponent} from './map.component'; @@ -49,7 +48,6 @@ import {MapComponent} from './map.component'; describe('MapComponent', () => { let component: MapComponent; let fixture: ComponentFixture; - let surveyServiceSpy: jasmine.SpyObj; let mockLois$: BehaviorSubject>; let loiServiceSpy: jasmine.SpyObj; let mockLocationOfInterestId$: BehaviorSubject; @@ -160,11 +158,6 @@ describe('MapComponent', () => { ); beforeEach(waitForAsync(() => { - surveyServiceSpy = jasmine.createSpyObj('SurveyService', [ - 'getActiveSurvey$', - ]); - surveyServiceSpy.getActiveSurvey$.and.returnValue(of(mockSurvey)); - loiServiceSpy = jasmine.createSpyObj( 'LocationOfInterestService', ['getLocationsOfInterest$', 'updatePoint', 'addPoint'] @@ -212,7 +205,6 @@ describe('MapComponent', () => { imports: [GoogleMapsModule], declarations: [MapComponent], providers: [ - {provide: SurveyService, useValue: surveyServiceSpy}, { provide: LocationOfInterestService, useValue: loiServiceSpy, @@ -238,6 +230,7 @@ describe('MapComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(MapComponent); + fixture.componentRef.setInput('activeSurvey', mockSurvey); component = fixture.componentInstance; component.shouldEnableDrawingTools = true; fixture.detectChanges(); @@ -315,6 +308,7 @@ describe('MapComponent', () => { describe('when selected job id is given', () => { beforeEach(() => { fixture = TestBed.createComponent(MapComponent); + fixture.componentRef.setInput('activeSurvey', mockSurvey); component = fixture.componentInstance; component.selectedJob = job1; fixture.detectChanges(); diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.ts b/web/src/app/pages/main-page-container/main-page/map/map.component.ts index 2b00060df..797264664 100644 --- a/web/src/app/pages/main-page-container/main-page/map/map.component.ts +++ b/web/src/app/pages/main-page-container/main-page/map/map.component.ts @@ -23,10 +23,13 @@ import { OnChanges, OnDestroy, ViewChild, + input, } from '@angular/core'; +import { toObservable } from '@angular/core/rxjs-interop'; import {GoogleMap} from '@angular/google-maps'; import {Map as ImmutableMap, List} from 'immutable'; import {BehaviorSubject, Observable, Subscription, combineLatest} from 'rxjs'; +import { filter, map } from 'rxjs/operators'; import {Coordinate} from 'app/models/geometry/coordinate'; import {Geometry, GeometryType} from 'app/models/geometry/geometry'; @@ -45,8 +48,7 @@ import { import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; // To make ESLint happy: /*global google*/ @@ -63,6 +65,7 @@ const enlargedPolygonStrokeWeight = 6; }) export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { private subscription: Subscription = new Subscription(); + activeSurvey = input(); private selectedJob$: BehaviorSubject = new BehaviorSubject< Job | undefined >(undefined); @@ -116,7 +119,6 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { constructor( private drawingToolsService: DrawingToolsService, - private surveyService: SurveyService, private loiService: LocationOfInterestService, private navigationService: NavigationService, private groundPinService: GroundPinService, @@ -125,7 +127,10 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { private changeDetectorRef: ChangeDetectorRef ) { this.lois$ = this.loiService.getLocationsOfInterest$(); - this.activeSurvey$ = this.surveyService.getActiveSurvey$(); + this.activeSurvey$ = toObservable(this.activeSurvey).pipe( + filter(s => !!s), + map(s => s as Survey) + ); } ngOnChanges() { diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts new file mode 100644 index 000000000..cd3df8219 --- /dev/null +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts @@ -0,0 +1,112 @@ +/** + * Copyright 2023 The Ground Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialog } from '@angular/material/dialog'; +import { List, Map } from 'immutable'; +import { of } from 'rxjs'; + +import { LocationOfInterest } from 'app/models/loi.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; + +import { LocationOfInterestPanelComponent } from './loi-panel.component'; + +describe('LocationOfInterestPanelComponent', () => { + let component: LocationOfInterestPanelComponent; + let fixture: ComponentFixture; + let loiServiceSpy: jasmine.SpyObj; + let submissionServiceSpy: jasmine.SpyObj; + let navigationServiceSpy: jasmine.SpyObj; + let dialogSpy: jasmine.SpyObj; + + const mockSurvey = new Survey( + 'survey1', + 'Survey Title', + 'Description', + Map(), + Map(), + 'owner1', + { type: DataSharingType.PRIVATE } + ); + + const mockLoi = new LocationOfInterest( + 'loi1', + 'job1', + { chainId: 'point1' } as any, + Map() + ); + + beforeEach(waitForAsync(() => { + loiServiceSpy = jasmine.createSpyObj('LocationOfInterestService', [ + 'getSelectedLocationOfInterest$', + ]); + submissionServiceSpy = jasmine.createSpyObj('SubmissionService', [ + 'getSubmissions$', + ]); + navigationServiceSpy = jasmine.createSpyObj('NavigationService', [ + 'showSubmissionDetail', + 'clearLocationOfInterestId', + ]); + dialogSpy = jasmine.createSpyObj('MatDialog', ['open']); + + loiServiceSpy.getSelectedLocationOfInterest$.and.returnValue(of(mockLoi)); + submissionServiceSpy.getSubmissions$.and.returnValue( + of(List()) + ); + + TestBed.configureTestingModule({ + declarations: [LocationOfInterestPanelComponent], + providers: [ + { provide: LocationOfInterestService, useValue: loiServiceSpy }, + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: MatDialog, useValue: dialogSpy }, + ], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LocationOfInterestPanelComponent); + component = fixture.componentInstance; + fixture.componentRef.setInput('activeSurvey', mockSurvey); + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should navigate to submission detail on selection', () => { + component.loi = mockLoi; + const submissionId = 'sub1'; + component.onSelectSubmission(submissionId); + + expect(navigationServiceSpy.showSubmissionDetail).toHaveBeenCalledWith( + mockSurvey.id, + mockLoi.id, + submissionId + ); + }); + + it('should clear LOI on close', () => { + component.onClosePanel(); + expect(navigationServiceSpy.clearLocationOfInterestId).toHaveBeenCalled(); + }); +}); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index cf3db4d2c..f28cda901 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -14,18 +14,19 @@ * limitations under the License. */ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import { Component, OnDestroy, OnInit, input } from '@angular/core'; +import { toObservable } from '@angular/core/rxjs-interop'; import {MatDialog} from '@angular/material/dialog'; import {List} from 'immutable'; -import {Subscription, switchMap} from 'rxjs'; +import { Subscription, combineLatest, switchMap } from 'rxjs'; import {LoiPropertiesDialogComponent} from 'app/components/loi-properties-dialog/loi-properties-dialog.component'; import {LocationOfInterest} from 'app/models/loi.model'; import {Submission} from 'app/models/submission/submission.model'; +import { Survey } from 'app/models/survey.model'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; import {getLoiIcon} from 'app/utils/utils'; @Component({ @@ -35,40 +36,38 @@ import {getLoiIcon} from 'app/utils/utils'; }) export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { subscription: Subscription = new Subscription(); + activeSurvey = input(); loi!: LocationOfInterest; name!: string | null; icon!: string; iconColor!: string; - surveyId!: string; submissions!: List; isLoading = true; constructor( private dialog: MatDialog, private loiService: LocationOfInterestService, - private surveyService: SurveyService, private submissionService: SubmissionService, private navigationService: NavigationService ) {} ngOnInit() { this.subscription.add( - this.surveyService - .getActiveSurvey$() + combineLatest([ + toObservable(this.activeSurvey), + this.loiService.getSelectedLocationOfInterest$(), + ]) .pipe( - switchMap(survey => { - this.surveyId = survey.id; - return this.loiService.getSelectedLocationOfInterest$().pipe( - switchMap(loi => { - this.iconColor = survey.getJob(loi.jobId)!.color!; - this.loi = loi; - this.name = LocationOfInterestService.getDisplayName(loi); - this.icon = getLoiIcon(loi); + switchMap(([survey, loi]) => { + if (survey) { + this.iconColor = survey.getJob(loi.jobId)!.color!; + } + this.loi = loi; + this.name = LocationOfInterestService.getDisplayName(loi); + this.icon = getLoiIcon(loi); - return this.submissionService.getSubmissions$(); - }) - ); + return this.submissionService.getSubmissions$(); }) ) .subscribe(submissions => { @@ -80,7 +79,7 @@ export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { onSelectSubmission(submissionId: string) { this.navigationService.showSubmissionDetail( - this.surveyId, + this.activeSurvey()?.id || '', this.loi.id, submissionId ); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html index 2e6d14d47..8e087603a 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html @@ -17,11 +17,11 @@
- + - +
diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts new file mode 100644 index 000000000..40e50b055 --- /dev/null +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts @@ -0,0 +1,78 @@ +/** + * Copyright 2023 The Ground Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; + +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { + NavigationService, + SideNavMode, +} from 'app/services/navigation/navigation.service'; + +import { SecondarySidePanelComponent } from './secondary-side-panel.component'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; + +describe('SecondarySidePanelComponent', () => { + let component: SecondarySidePanelComponent; + let fixture: ComponentFixture; + let navigationServiceSpy: jasmine.SpyObj; + + const mockSurvey = new Survey( + 'survey1', + 'Survey Title', + 'Description', + Map(), + Map(), + 'owner1', + { type: DataSharingType.PRIVATE } + ); + + beforeEach(waitForAsync(() => { + navigationServiceSpy = jasmine.createSpyObj('NavigationService', [ + 'getSideNavMode$', + 'getLoiId', + 'getSubmissionId', + ]); + + navigationServiceSpy.getSideNavMode$.and.returnValue( + of(SideNavMode.JOB_LIST) + ); + // Mock signal functions + (navigationServiceSpy.getLoiId as jasmine.Spy).and.returnValue(() => null); + (navigationServiceSpy.getSubmissionId as jasmine.Spy).and.returnValue( + () => null + ); + + TestBed.configureTestingModule({ + declarations: [SecondarySidePanelComponent], + providers: [{ provide: NavigationService, useValue: navigationServiceSpy }], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SecondarySidePanelComponent); + component = fixture.componentInstance; + fixture.componentRef.setInput('activeSurvey', mockSurvey); + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts index d9be9ca4c..a6254a75d 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import {Component, effect} from '@angular/core'; +import { Component, effect, input } from '@angular/core'; import {Observable} from 'rxjs'; +import { Survey } from 'app/models/survey.model'; import { NavigationService, SideNavMode, @@ -28,6 +29,7 @@ import { styleUrls: ['./secondary-side-panel.component.css'], }) export class SecondarySidePanelComponent { + activeSurvey = input(); private loiIdSignal = this.navigationService.getLoiId(); private submissionIdSignal = this.navigationService.getSubmissionId(); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts new file mode 100644 index 000000000..c1a225ae8 --- /dev/null +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts @@ -0,0 +1,111 @@ +/** + * Copyright 2023 The Ground Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { AngularFireStorage } from '@angular/fire/compat/storage'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; + +import { AuditInfo } from 'app/models/audit-info.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; + +import { SubmissionPanelComponent } from './submission-panel.component'; + +describe('SubmissionPanelComponent', () => { + let component: SubmissionPanelComponent; + let fixture: ComponentFixture; + let submissionServiceSpy: jasmine.SpyObj; + let navigationServiceSpy: jasmine.SpyObj; + let storageSpy: jasmine.SpyObj; + + const mockSurvey = new Survey( + 'survey1', + 'Survey Title', + 'Description', + Map(), + Map(), + 'owner1', + { type: DataSharingType.PRIVATE } + ); + + const mockUser = { + id: 'user001', + email: 'email@gmail.com', + displayName: 'User 1', + isAuthenticated: true, + }; + + const mockAuditInfo = new AuditInfo(mockUser, new Date(), new Date()); + + const mockSubmission = new Submission( + 'sub1', + 'loi1', + { id: 'job1' } as any, + mockAuditInfo, + mockAuditInfo, + Map() + ); + + beforeEach(waitForAsync(() => { + submissionServiceSpy = jasmine.createSpyObj('SubmissionService', [ + 'getSelectedSubmission$', + ]); + navigationServiceSpy = jasmine.createSpyObj('NavigationService', [ + 'getTaskId$', + 'selectLocationOfInterest', + 'showSubmissionDetailWithHighlightedTask', + ]); + storageSpy = jasmine.createSpyObj('AngularFireStorage', ['ref']); + + submissionServiceSpy.getSelectedSubmission$.and.returnValue( + of(mockSubmission) + ); + navigationServiceSpy.getTaskId$.and.returnValue(of(null)); + + TestBed.configureTestingModule({ + declarations: [SubmissionPanelComponent], + providers: [ + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: AngularFireStorage, useValue: storageSpy }, + ], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubmissionPanelComponent); + component = fixture.componentInstance; + fixture.componentRef.setInput('activeSurvey', mockSurvey); + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should navigate back to submission list', () => { + component.submission = mockSubmission; + component.navigateToSubmissionList(); + + expect(navigationServiceSpy.selectLocationOfInterest).toHaveBeenCalledWith( + mockSurvey.id, + mockSubmission.loiId + ); + }); +}); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index db441d307..27291a327 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -14,10 +14,12 @@ * limitations under the License. */ -import {Component, Input, OnDestroy, OnInit} from '@angular/core'; +import { Component, Input, OnDestroy, OnInit, input } from '@angular/core'; import {AngularFireStorage} from '@angular/fire/compat/storage'; import {List} from 'immutable'; -import {Subscription, firstValueFrom} from 'rxjs'; +import { firstValueFrom, Subscription } from 'rxjs'; + +// ... import {Point} from 'app/models/geometry/point'; import {MultipleSelection} from 'app/models/submission/multiple-selection'; @@ -25,6 +27,7 @@ import {Result} from 'app/models/submission/result.model'; import {Submission} from 'app/models/submission/submission.model'; import {Option} from 'app/models/task/option.model'; import {Task, TaskType} from 'app/models/task/task.model'; +import { Survey } from 'app/models/survey.model'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SubmissionService} from 'app/services/submission/submission.service'; @@ -37,10 +40,10 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { subscription: Subscription = new Subscription(); @Input() submissionId!: string; + activeSurvey = input(); submission: Submission | null = null; tasks?: List; selectedTaskId: string | null = null; - surveyId: string | null = null; firebaseURLs = new Map(); isLoading = true; @@ -53,11 +56,6 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { ) {} ngOnInit() { - this.subscription.add( - this.navigationService.getSurveyId$().subscribe(surveyId => { - this.surveyId = surveyId; - }) - ); this.subscription.add( this.submissionService.getSelectedSubmission$().subscribe(submission => { if (submission instanceof Submission) { @@ -99,7 +97,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { navigateToSubmissionList() { this.navigationService.selectLocationOfInterest( - this.surveyId!, + this.activeSurvey()?.id!, this.submission!.loiId ); } @@ -157,7 +155,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { selectGeometry(task: Task): void { this.navigationService.showSubmissionDetailWithHighlightedTask( - this.surveyId!, + this.activeSurvey()?.id!, this.submission!.loiId!, this.submission!.id!, task.id diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html index ffa7df906..9d692d209 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html +++ b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html @@ -15,13 +15,12 @@ --> diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts index f43fe4667..5464d6431 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts @@ -59,17 +59,6 @@ const mockAngularFireAuth = { authState: of(authState), }; -class MockSurveyService { - getActiveSurvey$() { - return of(mockSurvey); - } - getCurrentSurvey() {} - getCurrentSurveyAcl() {} - canManageSurvey() {} -} - -const surveyService = new MockSurveyService(); - describe('JobListComponent', () => { let component: JobListComponent; let fixture: ComponentFixture; @@ -85,7 +74,6 @@ describe('JobListComponent', () => { declarations: [JobListComponent], imports: [MatListModule], providers: [ - {provide: SurveyService, useValue: surveyService}, { provide: Router, useValue: routerSpy, @@ -104,6 +92,7 @@ describe('JobListComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(JobListComponent); + fixture.componentRef.setInput('activeSurvey', mockSurvey); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts index 13a59a5c8..a59390d70 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts @@ -14,14 +14,12 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {List} from 'immutable'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/internal/operators/map'; +import { Component, computed, input } from '@angular/core'; +import { List } from 'immutable'; import {Job} from 'app/models/job.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { Survey } from 'app/models/survey.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-job-list', @@ -29,19 +27,18 @@ import {SurveyService} from 'app/services/survey/survey.service'; styleUrls: ['./job-list.component.scss'], }) export class JobListComponent { - readonly jobs$: Observable>; + activeSurvey = input(); + readonly jobs = computed(() => { + const survey = this.activeSurvey(); + return survey + ? List(survey.jobs.valueSeq().toArray()).sortBy(l => l.index) + : List(); + }); - constructor( - readonly surveyService: SurveyService, - readonly navigationService: NavigationService - ) { - this.jobs$ = surveyService - .getActiveSurvey$() - .pipe( - map(survey => - List(survey.jobs.valueSeq().toArray()).sortBy(l => l.index) - ) - ); + constructor(readonly navigationService: NavigationService) { } + + trackById(index: number, job: Job): string { + return job.id; } isSidePanelExpanded() { diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html index de4ec9062..74c2cdeed 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html +++ b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html @@ -16,6 +16,6 @@
- +
diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts index a7e226356..eedfa0a8a 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import {Component} from '@angular/core'; +import { Component, input } from '@angular/core'; import {Observable} from 'rxjs'; +import { Survey } from 'app/models/survey.model'; import { NavigationService, SideNavMode, @@ -28,6 +29,7 @@ import { styleUrls: ['./side-panel.component.css'], }) export class SidePanelComponent { + activeSurvey = input(); readonly sideNavMode = SideNavMode; readonly sideNavMode$: Observable; diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html index 9e0bfca69..4d04dc5cf 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html @@ -26,6 +26,8 @@
-
{{ title ?? 'Untitled survey' }}
+
+ {{ activeSurvey()?.title ?? 'Untitled survey' }} +
diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts index 8a3f340e2..c95322661 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; @@ -54,6 +55,7 @@ describe('SurveyHeaderComponent', () => { }, }, ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts index a2d3170d5..3caaf1ed3 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts @@ -14,11 +14,12 @@ * limitations under the License. */ -import {Component, OnDestroy} from '@angular/core'; +import { Component, input } from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {Subscription} from 'rxjs'; import {ShareDialogComponent} from 'app/components/share-dialog/share-dialog.component'; +import { Survey } from 'app/models/survey.model'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; @@ -27,25 +28,14 @@ import {SurveyService} from 'app/services/survey/survey.service'; templateUrl: './survey-header.component.html', styleUrls: ['./survey-header.component.scss'], }) -export class SurveyHeaderComponent implements OnDestroy { - title: string; - surveyId!: string; +export class SurveyHeaderComponent { + activeSurvey = input(); - subscription: Subscription = new Subscription(); constructor( public navigationService: NavigationService, public surveyService: SurveyService, private dialog: MatDialog - ) { - this.title = ''; - const activeSurvey$ = this.surveyService.getActiveSurvey$(); - this.subscription.add( - activeSurvey$.subscribe(survey => { - this.title = survey.title || ''; - this.surveyId = survey.id; - }) - ); - } + ) { } /** * Updates the survey title with input element value. @@ -53,8 +43,9 @@ export class SurveyHeaderComponent implements OnDestroy { * @param evt the event emitted from the input element on blur. */ updateSurveyTitle(value: string): Promise { - if (value === this.title) return Promise.resolve(); - return this.surveyService.updateTitle(this.surveyId, value); + const survey = this.activeSurvey(); + if (!survey || value === survey.title) return Promise.resolve(); + return this.surveyService.updateTitle(survey.id, value); } onSurveysButtonClick(): void { @@ -68,15 +59,11 @@ export class SurveyHeaderComponent implements OnDestroy { }); } - ngOnDestroy() { - this.subscription.unsubscribe(); - } - onClickSidePanelButtonEvent() { this.navigationService.onClickSidePanelButton(); } isEditSurveyPage() { - return this.navigationService.isEditSurveyPage(this.surveyId); + return this.navigationService.isEditSurveyPage(this.activeSurvey()?.id || ''); } } diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index 7f2e13f0b..49efca6cf 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -135,7 +135,7 @@ const routes: Routes = [ canActivate: [AuthGuard], }, ]; -const config = RouterModule.forRoot(routes, {}); +const config = RouterModule.forRoot(routes, { bindToComponentInputs: true }); @NgModule({ imports: [config], diff --git a/web/src/app/services/survey/survey.service.ts b/web/src/app/services/survey/survey.service.ts index 9d28517ad..31f119b28 100644 --- a/web/src/app/services/survey/survey.service.ts +++ b/web/src/app/services/survey/survey.service.ts @@ -71,6 +71,10 @@ export class SurveyService { return this.activeSurvey$; } + loadSurvey$(id: string): Observable { + return this.dataStore.loadSurvey$(id); + } + getAccessibleSurveys$(): Observable> { const user = this.authService.getCurrentUser(); if (!user) { From 21577c44878aa76957de2a0b56a2b1c249517b26 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 11:40:42 -0500 Subject: [PATCH 04/34] Fix tests --- .../header/header.component.spec.ts | 2 + .../job-list-item.component.spec.ts | 4 +- .../job-list-item/job-list-item.component.ts | 1 + .../loi-editor/loi-editor.component.spec.ts | 6 +- .../loi-selection.component.spec.ts | 6 +- .../share-list/share-list.component.spec.ts | 25 +++--- .../share-survey.component.spec.ts | 5 +- .../sign-in-page.component.spec.ts | 2 + .../survey-list/survey-list.component.spec.ts | 2 + .../add-task-button.component.spec.ts | 2 + .../create-survey.component.spec.ts | 5 +- .../data-sharing-terms.component.spec.ts | 12 ++- .../survey-details.component.spec.ts | 16 ++++ .../task-details.component.spec.ts | 2 + .../edit-details.component.spec.ts | 6 +- .../edit-job/edit-job.component.spec.ts | 28 ++++++- .../edit-survey/edit-survey.component.spec.ts | 77 ++++++++++++++----- .../main-page/main-page.component.spec.ts | 17 +++- .../main-page/main-page.component.ts | 3 + .../main-page/map/map.component.spec.ts | 3 + .../loi-panel/loi-panel.component.ts | 4 +- .../secondary-side-panel.component.spec.ts | 4 + .../secondary-side-panel.component.ts | 3 +- .../submission-panel.component.spec.ts | 4 + .../submission-form.component.spec.ts | 3 +- 25 files changed, 195 insertions(+), 47 deletions(-) diff --git a/web/src/app/components/header/header.component.spec.ts b/web/src/app/components/header/header.component.spec.ts index 8179f1285..97594bf04 100644 --- a/web/src/app/components/header/header.component.spec.ts +++ b/web/src/app/components/header/header.component.spec.ts @@ -15,6 +15,7 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {MatMenuModule} from '@angular/material/menu'; import {Router} from '@angular/router'; @@ -46,6 +47,7 @@ describe('HeaderComponent', () => { {provide: Router, useValue: {events: of()}}, {provide: SurveyService, useValue: {canManageSurvey: () => false}}, ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); }); diff --git a/web/src/app/components/job-list-item/job-list-item.component.spec.ts b/web/src/app/components/job-list-item/job-list-item.component.spec.ts index 7e7028c58..ba7d3072b 100644 --- a/web/src/app/components/job-list-item/job-list-item.component.spec.ts +++ b/web/src/app/components/job-list-item/job-list-item.component.spec.ts @@ -16,7 +16,7 @@ import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; -import {CdkTreeModule} from '@angular/cdk/tree'; +import { CdkTreeModule } from '@angular/cdk/tree'; import {Signal, WritableSignal, signal} from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {AngularFireAuth} from '@angular/fire/compat/auth'; @@ -29,7 +29,7 @@ import {MatTreeModule} from '@angular/material/tree'; import {MatTreeHarness} from '@angular/material/tree/testing'; import {Router} from '@angular/router'; import {List, Map} from 'immutable'; -import {Subject, of} from 'rxjs'; +import { Subject, of } from 'rxjs'; import {AuditInfo} from 'app/models/audit-info.model'; import {Coordinate} from 'app/models/geometry/coordinate'; diff --git a/web/src/app/components/job-list-item/job-list-item.component.ts b/web/src/app/components/job-list-item/job-list-item.component.ts index f10694d17..e6963dbb2 100644 --- a/web/src/app/components/job-list-item/job-list-item.component.ts +++ b/web/src/app/components/job-list-item/job-list-item.component.ts @@ -61,6 +61,7 @@ export class JobListItemComponent implements OnInit, OnDestroy { private groundPinService: GroundPinService, private authService: AuthService ) { + console.log('JobListItemComponent urlParamsSignal:', this.urlParamsSignal); this.jobPinUrl = sanitizer.bypassSecurityTrustUrl( groundPinService.getPinImageSource() ); diff --git a/web/src/app/components/loi-editor/loi-editor.component.spec.ts b/web/src/app/components/loi-editor/loi-editor.component.spec.ts index 96d1c335c..623105860 100644 --- a/web/src/app/components/loi-editor/loi-editor.component.spec.ts +++ b/web/src/app/components/loi-editor/loi-editor.component.spec.ts @@ -17,6 +17,9 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {GoogleMapsModule} from '@angular/google-maps'; import {MatDialog} from '@angular/material/dialog'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatIconModule } from '@angular/material/icon'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {List, Map} from 'immutable'; import {ImportDialogComponent} from 'app/components/import-dialog/import-dialog.component'; @@ -79,8 +82,9 @@ describe('LoiEditorComponent', () => { matDialogSpy = jasmine.createSpyObj('MatDialog', ['open']); TestBed.configureTestingModule({ - imports: [GoogleMapsModule], + imports: [GoogleMapsModule, MatSlideToggleModule, MatIconModule], declarations: [LoiEditorComponent], + schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: DataStoreService, diff --git a/web/src/app/components/loi-selection/loi-selection.component.spec.ts b/web/src/app/components/loi-selection/loi-selection.component.spec.ts index fd777a614..305ccce24 100644 --- a/web/src/app/components/loi-selection/loi-selection.component.spec.ts +++ b/web/src/app/components/loi-selection/loi-selection.component.spec.ts @@ -14,9 +14,12 @@ * limitations under the License. */ +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {GoogleMapsModule} from '@angular/google-maps'; import {MatDialog} from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; import {List, Map} from 'immutable'; import {Coordinate} from 'app/models/geometry/coordinate'; @@ -75,7 +78,7 @@ describe('LoiSelectionComponent', () => { matDialogSpy = jasmine.createSpyObj('MatDialog', ['open']); TestBed.configureTestingModule({ - imports: [GoogleMapsModule, GroundIconModule], + imports: [GoogleMapsModule, GroundIconModule, MatListModule, MatIconModule], declarations: [LoiSelectionComponent], providers: [ { @@ -87,6 +90,7 @@ describe('LoiSelectionComponent', () => { useValue: matDialogSpy, }, ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(LoiSelectionComponent); diff --git a/web/src/app/components/share-list/share-list.component.spec.ts b/web/src/app/components/share-list/share-list.component.spec.ts index a482bd8fd..1d12dec6e 100644 --- a/web/src/app/components/share-list/share-list.component.spec.ts +++ b/web/src/app/components/share-list/share-list.component.spec.ts @@ -19,6 +19,7 @@ import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {MatListModule} from '@angular/material/list'; import {MatListHarness} from '@angular/material/list/testing'; +import { MatSelectModule } from '@angular/material/select'; import {Map} from 'immutable'; import {Subject, firstValueFrom, of} from 'rxjs'; @@ -55,7 +56,7 @@ describe('ShareListComponent', () => { {type: DataSharingType.PRIVATE} ); - const user = new User('', '', true); + const user = new User('user1', 'user1@gmail.com', true); beforeEach(waitForAsync(() => { draftSurveyServiceSpy = jasmine.createSpyObj( @@ -74,7 +75,7 @@ describe('ShareListComponent', () => { TestBed.configureTestingModule({ declarations: [ShareListComponent], - imports: [MatListModule], + imports: [MatListModule, MatSelectModule], providers: [ {provide: DraftSurveyService, useValue: draftSurveyServiceSpy}, {provide: AuthService, useValue: authServiceSpy}, @@ -95,10 +96,10 @@ describe('ShareListComponent', () => { it('updates itself when acl changes', async () => { activeSurvey$.next(survey); + fixture.detectChanges(); + await fixture.whenStable(); - fixture.whenStable().then(async () => { - expect(component.acl?.length).toBe(0); - }); + expect(component.acl?.length).toBe(0); activeSurvey$.next( new Survey( @@ -107,18 +108,18 @@ describe('ShareListComponent', () => { surveyDescription, /* jobs= */ Map(), /* acl= */ Map({a: Role.OWNER, b: Role.OWNER}), - /* ownerId= */ '', + /* ownerId= */ 'user1', {type: DataSharingType.PRIVATE} ) ); + fixture.detectChanges(); + await fixture.whenStable(); - fixture.whenStable().then(async () => { - expect(component.acl?.length).toBe(2); + expect(component.acl?.length).toBe(2); - const aclList = await loader.getHarness(MatListHarness); - const aclListItems = await aclList.getItems(); + const aclList = await loader.getHarness(MatListHarness); + const aclListItems = await aclList.getItems(); - expect(aclListItems.length).toBe(2); - }); + expect(aclListItems.length).toBe(3); }); }); diff --git a/web/src/app/components/share-survey/share-survey.component.spec.ts b/web/src/app/components/share-survey/share-survey.component.spec.ts index 14037f6a7..8c0a58bea 100644 --- a/web/src/app/components/share-survey/share-survey.component.spec.ts +++ b/web/src/app/components/share-survey/share-survey.component.spec.ts @@ -1,6 +1,8 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; +import { MatCardModule } from '@angular/material/card'; import {ShareSurveyComponent} from './share-survey.component'; @@ -10,8 +12,9 @@ describe('ShareSurveyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatIconModule, MatDialogModule], + imports: [MatIconModule, MatDialogModule, MatCardModule], declarations: [ShareSurveyComponent], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(ShareSurveyComponent); diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts b/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts index 9b3b4c50c..9f7281452 100644 --- a/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts +++ b/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {NavigationEnd, Router} from '@angular/router'; import {BehaviorSubject, NEVER, of} from 'rxjs'; @@ -41,6 +42,7 @@ describe('SignInPageComponent', () => { useValue: {getUser$: () => NEVER, isAuthenticated$: () => NEVER}, }, ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); }); diff --git a/web/src/app/components/survey-list/survey-list.component.spec.ts b/web/src/app/components/survey-list/survey-list.component.spec.ts index d9c3f25bd..f429a087d 100644 --- a/web/src/app/components/survey-list/survey-list.component.spec.ts +++ b/web/src/app/components/survey-list/survey-list.component.spec.ts @@ -29,6 +29,7 @@ import {MatCardModule} from '@angular/material/card'; import {MatDialog, MatDialogRef} from '@angular/material/dialog'; import {MatGridListModule} from '@angular/material/grid-list'; import {MatIconModule} from '@angular/material/icon'; +import { MatChipsModule } from '@angular/material/chips'; import {By} from '@angular/platform-browser'; import {List, Map} from 'immutable'; import {of} from 'rxjs'; @@ -176,6 +177,7 @@ describe('SurveyListComponent', () => { MatCardModule, MatGridListModule, MatIconModule, + MatChipsModule, ], declarations: [SurveyListComponent, HeaderComponent], providers: [ diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts b/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts index d65b48054..b88a8a22e 100644 --- a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts +++ b/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts @@ -15,6 +15,7 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { MatIconModule } from '@angular/material/icon'; import {AddTaskButtonComponent} from './add-task-button.component'; @@ -24,6 +25,7 @@ describe('TaskButtonComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ + imports: [MatIconModule], declarations: [AddTaskButtonComponent], }).compileComponents(); diff --git a/web/src/app/pages/create-survey/create-survey.component.spec.ts b/web/src/app/pages/create-survey/create-survey.component.spec.ts index fcb3b896f..4840ab1ed 100644 --- a/web/src/app/pages/create-survey/create-survey.component.spec.ts +++ b/web/src/app/pages/create-survey/create-survey.component.spec.ts @@ -22,7 +22,9 @@ import { tick, waitForAsync, } from '@angular/core/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {MatDialogModule} from '@angular/material/dialog'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import {By} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; import {List, Map} from 'immutable'; @@ -198,7 +200,7 @@ describe('CreateSurveyComponent', () => { ]); TestBed.configureTestingModule({ - imports: [MatDialogModule], + imports: [MatDialogModule, MatProgressSpinnerModule], declarations: [ CreateSurveyComponent, SurveyDetailsComponent, @@ -206,6 +208,7 @@ describe('CreateSurveyComponent', () => { DataSharingTermsComponent, ShareSurveyComponent, ], + schemas: [NO_ERRORS_SCHEMA], providers: [ {provide: NavigationService, useValue: navigationServiceSpy}, {provide: SurveyService, useValue: surveyServiceSpy}, diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts b/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts index 3e22ca1b4..6bc2360ff 100644 --- a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts +++ b/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts @@ -16,6 +16,10 @@ import {CommonModule} from '@angular/common'; import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { MatCardModule } from '@angular/material/card'; +import { MatRadioModule } from '@angular/material/radio'; +import { ReactiveFormsModule } from '@angular/forms'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { DATA_SHARING_TYPE_DESCRIPTION, @@ -30,7 +34,13 @@ describe('DataSharingTermsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [DataSharingTermsComponent], - imports: [CommonModule], + imports: [ + CommonModule, + MatCardModule, + MatRadioModule, + ReactiveFormsModule, + ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(DataSharingTermsComponent); diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts b/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts index 90192fe42..a93b14767 100644 --- a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts +++ b/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts @@ -15,6 +15,11 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; @@ -26,6 +31,17 @@ describe('SurveyDetailsComponent', () => { const description = 'description'; beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [SurveyDetailsComponent], + imports: [ + MatFormFieldModule, + MatInputModule, + ReactiveFormsModule, + NoopAnimationsModule, + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); + fixture = TestBed.createComponent(SurveyDetailsComponent); component = fixture.componentInstance; component.title = title; diff --git a/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts b/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts index 9777ee345..248c43b7d 100644 --- a/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts +++ b/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatDialogModule} from '@angular/material/dialog'; import {Map} from 'immutable'; @@ -55,6 +56,7 @@ describe('TaskDetailsComponent', () => { }, }, ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(TaskDetailsComponent); diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts b/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts index 03292bd47..df0a9040a 100644 --- a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts @@ -26,6 +26,9 @@ import { MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import {By} from '@angular/platform-browser'; import {Map} from 'immutable'; import {of} from 'rxjs'; @@ -82,7 +85,8 @@ describe('EditDetailsComponent', () => { await TestBed.configureTestingModule({ declarations: [EditDetailsComponent], - imports: [CommonModule, MatDialogModule], + imports: [CommonModule, MatDialogModule, MatCardModule, MatIconModule], + schemas: [NO_ERRORS_SCHEMA], providers: [ {provide: MatDialog, useValue: dialogSpy}, { diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts b/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts index 39bff6d61..e1b33676f 100644 --- a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts @@ -14,20 +14,24 @@ * limitations under the License. */ +import { Component, Input } from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import { MatButtonToggle, MatButtonToggleGroup, } from '@angular/material/button-toggle'; import {MatDialogModule} from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; import {By} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; import {User} from 'firebase/auth'; -import {Map} from 'immutable'; +import { List, Map } from 'immutable'; import {Subject, from, of} from 'rxjs'; import {TasksEditorModule} from 'app/components/tasks-editor/tasks-editor.module'; -import {Job} from 'app/models/job.model'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LoiEditorComponent } from 'app/components/loi-editor/loi-editor.component'; +import { LocationOfInterest } from 'app/models/loi.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; import {EditJobComponent} from 'app/pages/edit-survey/edit-job/edit-job.component'; @@ -38,6 +42,23 @@ import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; +@Component({ + selector: 'loi-editor', + template: '', + providers: [ + { + provide: LoiEditorComponent, + useExisting: MockLoiEditorComponent, + }, + ], +}) +class MockLoiEditorComponent { + @Input() canImport!: boolean; + @Input() survey!: Survey; + @Input() job!: Job; + @Input() lois!: List; +} + describe('EditJobComponent', () => { let component: EditJobComponent; let fixture: ComponentFixture; @@ -55,11 +76,12 @@ describe('EditJobComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditJobComponent], + declarations: [EditJobComponent, MockLoiEditorComponent], imports: [ MatButtonToggleGroup, MatButtonToggle, MatDialogModule, + MatIconModule, TasksEditorModule, ], providers: [ diff --git a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts b/web/src/app/pages/edit-survey/edit-survey.component.spec.ts index 63d97713d..cc5a84b8f 100644 --- a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-survey.component.spec.ts @@ -20,9 +20,16 @@ import { TestBed, fakeAsync, tick, + flush, waitForAsync, + discardPeriodicTasks, } from '@angular/core/testing'; import {MatDialog, MatDialogRef} from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import {By} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; import {RouterTestingModule} from '@angular/router/testing'; @@ -106,10 +113,13 @@ describe('EditSurveyComponent', () => { 'getEditSurveyPageSignal', 'getSurveyId$', 'getSurveyId', + 'navigateToEditJob', + 'navigateToEditSurvey', ] ); navigationServiceSpy.getSurveyId$.and.returnValue(surveyId$); navigationServiceSpy.getSurveyId.and.returnValue(surveyIdSignal); + navigationServiceSpy.getEditSurveyPageSignal.and.returnValue(signal('')); route = new ActivatedRouteStub(); surveyServiceSpy = jasmine.createSpyObj('SurveyService', [ @@ -121,11 +131,12 @@ describe('EditSurveyComponent', () => { draftSurveyServiceSpy = jasmine.createSpyObj( 'DraftSurveyService', - ['init', 'getSurvey$', 'addOrUpdateJob', 'deleteJob'] + ['init', 'getSurvey$', 'addOrUpdateJob', 'deleteJob', 'getSurvey'] ); draftSurveyServiceSpy.getSurvey$.and.returnValue( new BehaviorSubject(survey) ); + draftSurveyServiceSpy.getSurvey.and.returnValue(survey); jobServiceSpy = jasmine.createSpyObj('JobService', [ 'createNewJob', @@ -133,6 +144,7 @@ describe('EditSurveyComponent', () => { 'getNextColor', ]); jobServiceSpy.createNewJob.and.returnValue(newJob); + jobServiceSpy.duplicateJob.and.returnValue(newJob); jobServiceSpy.getNextColor.and.returnValue(undefined); dataStoreServiceSpy = jasmine.createSpyObj( @@ -148,8 +160,15 @@ describe('EditSurveyComponent', () => { dialogSpy.open.and.returnValue(dialogRefSpy); TestBed.configureTestingModule({ - imports: [RouterTestingModule], + imports: [ + RouterTestingModule, + MatDividerModule, + MatMenuModule, + MatProgressSpinnerModule, + NoopAnimationsModule, + ], declarations: [EditSurveyComponent], + schemas: [NO_ERRORS_SCHEMA], providers: [ {provide: NavigationService, useValue: navigationServiceSpy}, {provide: SurveyService, useValue: surveyServiceSpy}, @@ -193,6 +212,9 @@ describe('EditSurveyComponent', () => { surveyIdSignal.set(surveyId); surveyId$.next(surveyId); activeSurvey$.next(survey); + // Manually set survey to ensure it's available for template rendering + // bypassing potential async effect timing issues in tests. + fixture.componentInstance.survey = survey; tick(); fixture.detectChanges(); })); @@ -233,7 +255,7 @@ describe('EditSurveyComponent', () => { }); describe('add/rename/duplicate/delete a job', () => { - it('add a job', () => { + it('add a job', fakeAsync(() => { const addButton = fixture.debugElement.query(By.css('#add-button')) .nativeElement as HTMLElement; const newJobName = 'new job name'; @@ -246,35 +268,45 @@ describe('EditSurveyComponent', () => { expect(draftSurveyServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( newJob.copyWith({name: newJobName}) ); - }); + flush(); + discardPeriodicTasks(); + })); - it('rename a job', () => { + it('rename a job', fakeAsync(() => { const menuButton = fixture.debugElement.query(By.css('#menu-button-0')) .nativeElement as HTMLElement; - const renameButton = fixture.debugElement.query( - By.css('#rename-button-0') - ).nativeElement as HTMLElement; const newJobName = 'new job name'; dialogRefSpy.afterClosed.and.returnValue( of({dialogType: DialogType.RenameJob, jobName: newJobName}) ); menuButton.click(); + fixture.detectChanges(); + tick(); + + const renameButton = document.querySelector( + '#rename-button-0' + ) as HTMLElement; renameButton.click(); expect(draftSurveyServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( job1.copyWith({name: newJobName}) ); - }); + flush(); + discardPeriodicTasks(); + })); - it('duplicate a job', () => { + it('duplicate a job', fakeAsync(() => { const menuButton = fixture.debugElement.query(By.css('#menu-button-0')) .nativeElement as HTMLElement; - const duplicateButton = fixture.debugElement.query( - By.css('#duplicate-button-0') - ).nativeElement as HTMLElement; menuButton.click(); + fixture.detectChanges(); + tick(); + + const duplicateButton = document.querySelector( + '#duplicate-button-0' + ) as HTMLElement; duplicateButton.click(); expect(draftSurveyServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( @@ -284,23 +316,30 @@ describe('EditSurveyComponent', () => { ), true ); - }); + flush(); + discardPeriodicTasks(); + })); - it('delete a job', () => { + it('delete a job', fakeAsync(() => { const menuButton = fixture.debugElement.query(By.css('#menu-button-0')) .nativeElement as HTMLElement; - const deleteButton = fixture.debugElement.query( - By.css('#delete-button-0') - ).nativeElement as HTMLElement; dialogRefSpy.afterClosed.and.returnValue( of({dialogType: DialogType.DeleteJob, jobName: ''}) ); menuButton.click(); + fixture.detectChanges(); + tick(); + + const deleteButton = document.querySelector( + '#delete-button-0' + ) as HTMLElement; deleteButton.click(); expect(draftSurveyServiceSpy.deleteJob).toHaveBeenCalledOnceWith(job1); - }); + flush(); + discardPeriodicTasks(); + })); }); }); }); diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts index c21dec11f..05de44f0d 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Component, NO_ERRORS_SCHEMA} from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA, signal } from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {AngularFireAuth} from '@angular/fire/compat/auth'; import {AngularFirestore} from '@angular/fire/compat/firestore'; @@ -66,7 +66,7 @@ describe('MainPageComponent', () => { getSurveyId$: () => NEVER, getLocationOfInterestId$: () => NEVER, getSubmissionId$: () => NEVER, - getUrlParams: () => NEVER, + getUrlParams: () => signal({}), }; TestBed.configureTestingModule({ @@ -93,6 +93,19 @@ describe('MainPageComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(MainPageComponent); + + // Create a minimal mock survey for the input + const mockSurvey = { + id: 'survey1', + title: 'Survey Title', + description: 'Description', + jobs: {}, + acl: {}, + ownerId: 'owner1', + dataSharingTerms: {} + } as any; + + fixture.componentRef.setInput('activeSurvey', mockSurvey); component = fixture.componentInstance; fixture.detectChanges(); })); diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.ts index b198c1a6a..23da3c846 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.ts @@ -45,6 +45,9 @@ export class MainPageComponent implements OnInit { subscription: Subscription = new Subscription(); shouldEnableDrawingTools = false; showSubmissionPanel: Boolean = false; + shouldShowMap = true; + selectedJob = null; + showPredefinedLoisOnly = false; constructor( private navigationService: NavigationService, diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts index 5f1a9917b..d895a31d0 100644 --- a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts @@ -315,6 +315,7 @@ describe('MapComponent', () => { }); it('should render only lois under the job', fakeAsync(() => { + tick(); component.ngOnChanges(); expect(component.markers.size).toEqual(1); @@ -325,9 +326,11 @@ describe('MapComponent', () => { })); it('should fit the map when survey changed', fakeAsync(() => { + tick(); spyOn(component.map, 'fitBounds'); component.selectedJob = job2; component.ngOnChanges(); + tick(); expect(component.map.fitBounds).toHaveBeenCalledOnceWith( new google.maps.LatLngBounds(new google.maps.LatLng(45.6, 12.3)) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index f28cda901..ebe7ba67c 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -38,6 +38,8 @@ export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { subscription: Subscription = new Subscription(); activeSurvey = input(); + activeSurvey$ = toObservable(this.activeSurvey); + loi!: LocationOfInterest; name!: string | null; icon!: string; @@ -55,7 +57,7 @@ export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { ngOnInit() { this.subscription.add( combineLatest([ - toObservable(this.activeSurvey), + this.activeSurvey$, this.loiService.getSelectedLocationOfInterest$(), ]) .pipe( diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts index 40e50b055..3fa84e197 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts @@ -47,6 +47,7 @@ describe('SecondarySidePanelComponent', () => { 'getSideNavMode$', 'getLoiId', 'getSubmissionId', + 'getSideNavMode', ]); navigationServiceSpy.getSideNavMode$.and.returnValue( @@ -57,6 +58,9 @@ describe('SecondarySidePanelComponent', () => { (navigationServiceSpy.getSubmissionId as jasmine.Spy).and.returnValue( () => null ); + (navigationServiceSpy.getSideNavMode as jasmine.Spy).and.returnValue( + () => SideNavMode.JOB_LIST + ); TestBed.configureTestingModule({ declarations: [SecondarySidePanelComponent], diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts index c563c740e..9eb8f86ef 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts @@ -35,5 +35,6 @@ export class SecondarySidePanelComponent { SideNavMode = SideNavMode; - constructor(private navigationService: NavigationService) { } + constructor(private navigationService: NavigationService) { + } } diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts index c1a225ae8..47e4d4d1e 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts @@ -14,8 +14,10 @@ * limitations under the License. */ +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { AngularFireStorage } from '@angular/fire/compat/storage'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { Map } from 'immutable'; import { of } from 'rxjs'; @@ -80,11 +82,13 @@ describe('SubmissionPanelComponent', () => { TestBed.configureTestingModule({ declarations: [SubmissionPanelComponent], + imports: [MatProgressSpinnerModule], providers: [ { provide: SubmissionService, useValue: submissionServiceSpy }, { provide: NavigationService, useValue: navigationServiceSpy }, { provide: AngularFireStorage, useValue: storageSpy }, ], + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts b/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts index 94daab063..62ce59447 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts @@ -50,6 +50,7 @@ import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import { UrlParams } from 'app/services/navigation/url-params'; import {SubmissionService} from 'app/services/submission/submission.service'; import {SurveyService} from 'app/services/survey/survey.service'; @@ -172,7 +173,7 @@ describe('SubmissionFormComponent', () => { beforeEach(waitForAsync(() => { const navigationService = { getSurveyId$: () => of(''), - getUrlParams: () => NEVER, + getUrlParams: () => signal(new UrlParams(null, null, null, null)), getLocationOfInterestId$: () => NEVER, getSidePanelExpanded: () => false, }; From 77960b1f1214febfc2322dcd1de292f46ff4275b Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 11:42:42 -0500 Subject: [PATCH 05/34] Lint fix --- .../header/header.component.spec.ts | 2 +- .../job-list-item.component.spec.ts | 4 +-- .../loi-editor/loi-editor.component.spec.ts | 6 ++-- .../loi-selection.component.spec.ts | 13 ++++--- .../share-list/share-list.component.spec.ts | 2 +- .../share-survey.component.spec.ts | 4 +-- .../sign-in-page.component.spec.ts | 2 +- .../survey-list/survey-list.component.spec.ts | 2 +- .../add-task-button.component.spec.ts | 2 +- .../create-survey.component.spec.ts | 4 +-- .../data-sharing-terms.component.spec.ts | 8 ++--- .../survey-details.component.spec.ts | 10 +++--- .../task-details.component.spec.ts | 2 +- .../edit-details.component.spec.ts | 6 ++-- .../edit-job/edit-job.component.spec.ts | 12 +++---- .../edit-survey/edit-survey.component.spec.ts | 15 ++++---- .../main-page-container.component.ts | 6 ++-- .../drawing-tools.component.spec.ts | 4 +-- .../drawing-tools/drawing-tools.component.ts | 4 +-- .../main-page/main-page.component.spec.ts | 4 +-- .../main-page/map/map.component.spec.ts | 2 +- .../main-page/map/map.component.ts | 6 ++-- .../loi-panel/loi-panel.component.spec.ts | 34 +++++++++---------- .../loi-panel/loi-panel.component.ts | 10 +++--- .../secondary-side-panel.component.spec.ts | 16 ++++----- .../secondary-side-panel.component.ts | 7 ++-- .../submission-panel.component.spec.ts | 34 +++++++++---------- .../submission-panel.component.ts | 6 ++-- .../side-panel/job-list/job-list.component.ts | 10 +++--- .../side-panel/side-panel.component.ts | 4 +-- .../submission-form.component.spec.ts | 2 +- .../survey-header.component.spec.ts | 2 +- .../survey-header/survey-header.component.ts | 10 +++--- web/src/app/routing.module.ts | 2 +- web/src/environments/environment.dev.ts | 1 + web/src/environments/environment.prod.ts | 1 + 36 files changed, 133 insertions(+), 126 deletions(-) diff --git a/web/src/app/components/header/header.component.spec.ts b/web/src/app/components/header/header.component.spec.ts index 97594bf04..9701842cc 100644 --- a/web/src/app/components/header/header.component.spec.ts +++ b/web/src/app/components/header/header.component.spec.ts @@ -14,8 +14,8 @@ * limitations under the License. */ +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {MatMenuModule} from '@angular/material/menu'; import {Router} from '@angular/router'; diff --git a/web/src/app/components/job-list-item/job-list-item.component.spec.ts b/web/src/app/components/job-list-item/job-list-item.component.spec.ts index ba7d3072b..7e7028c58 100644 --- a/web/src/app/components/job-list-item/job-list-item.component.spec.ts +++ b/web/src/app/components/job-list-item/job-list-item.component.spec.ts @@ -16,7 +16,7 @@ import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; -import { CdkTreeModule } from '@angular/cdk/tree'; +import {CdkTreeModule} from '@angular/cdk/tree'; import {Signal, WritableSignal, signal} from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {AngularFireAuth} from '@angular/fire/compat/auth'; @@ -29,7 +29,7 @@ import {MatTreeModule} from '@angular/material/tree'; import {MatTreeHarness} from '@angular/material/tree/testing'; import {Router} from '@angular/router'; import {List, Map} from 'immutable'; -import { Subject, of } from 'rxjs'; +import {Subject, of} from 'rxjs'; import {AuditInfo} from 'app/models/audit-info.model'; import {Coordinate} from 'app/models/geometry/coordinate'; diff --git a/web/src/app/components/loi-editor/loi-editor.component.spec.ts b/web/src/app/components/loi-editor/loi-editor.component.spec.ts index 623105860..b60ac801c 100644 --- a/web/src/app/components/loi-editor/loi-editor.component.spec.ts +++ b/web/src/app/components/loi-editor/loi-editor.component.spec.ts @@ -14,12 +14,12 @@ * limitations under the License. */ +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {GoogleMapsModule} from '@angular/google-maps'; import {MatDialog} from '@angular/material/dialog'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatIconModule } from '@angular/material/icon'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {MatIconModule} from '@angular/material/icon'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {List, Map} from 'immutable'; import {ImportDialogComponent} from 'app/components/import-dialog/import-dialog.component'; diff --git a/web/src/app/components/loi-selection/loi-selection.component.spec.ts b/web/src/app/components/loi-selection/loi-selection.component.spec.ts index 305ccce24..00b4679ea 100644 --- a/web/src/app/components/loi-selection/loi-selection.component.spec.ts +++ b/web/src/app/components/loi-selection/loi-selection.component.spec.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {GoogleMapsModule} from '@angular/google-maps'; import {MatDialog} from '@angular/material/dialog'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; +import {MatIconModule} from '@angular/material/icon'; +import {MatListModule} from '@angular/material/list'; import {List, Map} from 'immutable'; import {Coordinate} from 'app/models/geometry/coordinate'; @@ -78,7 +78,12 @@ describe('LoiSelectionComponent', () => { matDialogSpy = jasmine.createSpyObj('MatDialog', ['open']); TestBed.configureTestingModule({ - imports: [GoogleMapsModule, GroundIconModule, MatListModule, MatIconModule], + imports: [ + GoogleMapsModule, + GroundIconModule, + MatListModule, + MatIconModule, + ], declarations: [LoiSelectionComponent], providers: [ { diff --git a/web/src/app/components/share-list/share-list.component.spec.ts b/web/src/app/components/share-list/share-list.component.spec.ts index 1d12dec6e..7fcd021f8 100644 --- a/web/src/app/components/share-list/share-list.component.spec.ts +++ b/web/src/app/components/share-list/share-list.component.spec.ts @@ -19,7 +19,7 @@ import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {MatListModule} from '@angular/material/list'; import {MatListHarness} from '@angular/material/list/testing'; -import { MatSelectModule } from '@angular/material/select'; +import {MatSelectModule} from '@angular/material/select'; import {Map} from 'immutable'; import {Subject, firstValueFrom, of} from 'rxjs'; diff --git a/web/src/app/components/share-survey/share-survey.component.spec.ts b/web/src/app/components/share-survey/share-survey.component.spec.ts index 8c0a58bea..e45cefcda 100644 --- a/web/src/app/components/share-survey/share-survey.component.spec.ts +++ b/web/src/app/components/share-survey/share-survey.component.spec.ts @@ -1,8 +1,8 @@ +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {MatCardModule} from '@angular/material/card'; import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; -import { MatCardModule } from '@angular/material/card'; import {ShareSurveyComponent} from './share-survey.component'; diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts b/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts index 9f7281452..521fc5220 100644 --- a/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts +++ b/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {NavigationEnd, Router} from '@angular/router'; import {BehaviorSubject, NEVER, of} from 'rxjs'; diff --git a/web/src/app/components/survey-list/survey-list.component.spec.ts b/web/src/app/components/survey-list/survey-list.component.spec.ts index f429a087d..0a561122d 100644 --- a/web/src/app/components/survey-list/survey-list.component.spec.ts +++ b/web/src/app/components/survey-list/survey-list.component.spec.ts @@ -26,10 +26,10 @@ import {AngularFireAuth} from '@angular/fire/compat/auth'; import {AngularFirestore} from '@angular/fire/compat/firestore'; import {MatButtonModule} from '@angular/material/button'; import {MatCardModule} from '@angular/material/card'; +import {MatChipsModule} from '@angular/material/chips'; import {MatDialog, MatDialogRef} from '@angular/material/dialog'; import {MatGridListModule} from '@angular/material/grid-list'; import {MatIconModule} from '@angular/material/icon'; -import { MatChipsModule } from '@angular/material/chips'; import {By} from '@angular/platform-browser'; import {List, Map} from 'immutable'; import {of} from 'rxjs'; diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts b/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts index b88a8a22e..8a4869160 100644 --- a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts +++ b/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts @@ -15,7 +15,7 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { MatIconModule } from '@angular/material/icon'; +import {MatIconModule} from '@angular/material/icon'; import {AddTaskButtonComponent} from './add-task-button.component'; diff --git a/web/src/app/pages/create-survey/create-survey.component.spec.ts b/web/src/app/pages/create-survey/create-survey.component.spec.ts index 4840ab1ed..46adc28d9 100644 --- a/web/src/app/pages/create-survey/create-survey.component.spec.ts +++ b/web/src/app/pages/create-survey/create-survey.component.spec.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import {NO_ERRORS_SCHEMA} from '@angular/core'; import { ComponentFixture, TestBed, @@ -22,9 +23,8 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import {MatDialogModule} from '@angular/material/dialog'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {By} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; import {List, Map} from 'immutable'; diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts b/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts index 6bc2360ff..53baddf19 100644 --- a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts +++ b/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts @@ -15,11 +15,11 @@ */ import {CommonModule} from '@angular/common'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { MatCardModule } from '@angular/material/card'; -import { MatRadioModule } from '@angular/material/radio'; -import { ReactiveFormsModule } from '@angular/forms'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {ReactiveFormsModule} from '@angular/forms'; +import {MatCardModule} from '@angular/material/card'; +import {MatRadioModule} from '@angular/material/radio'; import { DATA_SHARING_TYPE_DESCRIPTION, diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts b/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts index a93b14767..37ee05b04 100644 --- a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts +++ b/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts @@ -14,12 +14,12 @@ * limitations under the License. */ +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import {ReactiveFormsModule} from '@angular/forms'; +import {MatFormFieldModule} from '@angular/material/form-field'; +import {MatInputModule} from '@angular/material/input'; +import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; diff --git a/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts b/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts index 248c43b7d..d42f4f5b0 100644 --- a/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts +++ b/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatDialogModule} from '@angular/material/dialog'; import {Map} from 'immutable'; diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts b/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts index df0a9040a..85d99f4e2 100644 --- a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts @@ -15,20 +15,20 @@ */ import {CommonModule} from '@angular/common'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; import { ComponentFixture, TestBed, fakeAsync, flushMicrotasks, } from '@angular/core/testing'; +import {MatCardModule} from '@angular/material/card'; import { MatDialog, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import { MatCardModule } from '@angular/material/card'; -import { MatIconModule } from '@angular/material/icon'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import {MatIconModule} from '@angular/material/icon'; import {By} from '@angular/platform-browser'; import {Map} from 'immutable'; import {of} from 'rxjs'; diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts b/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts index e1b33676f..b96d31af8 100644 --- a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts @@ -14,24 +14,24 @@ * limitations under the License. */ -import { Component, Input } from '@angular/core'; +import {Component, Input} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import { MatButtonToggle, MatButtonToggleGroup, } from '@angular/material/button-toggle'; import {MatDialogModule} from '@angular/material/dialog'; -import { MatIconModule } from '@angular/material/icon'; +import {MatIconModule} from '@angular/material/icon'; import {By} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; import {User} from 'firebase/auth'; -import { List, Map } from 'immutable'; +import {List, Map} from 'immutable'; import {Subject, from, of} from 'rxjs'; +import {LoiEditorComponent} from 'app/components/loi-editor/loi-editor.component'; import {TasksEditorModule} from 'app/components/tasks-editor/tasks-editor.module'; -import { DataCollectionStrategy, Job } from 'app/models/job.model'; -import { LoiEditorComponent } from 'app/components/loi-editor/loi-editor.component'; -import { LocationOfInterest } from 'app/models/loi.model'; +import {DataCollectionStrategy, Job} from 'app/models/job.model'; +import {LocationOfInterest} from 'app/models/loi.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; import {EditJobComponent} from 'app/pages/edit-survey/edit-job/edit-job.component'; diff --git a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts b/web/src/app/pages/edit-survey/edit-survey.component.spec.ts index cc5a84b8f..f469b612a 100644 --- a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts +++ b/web/src/app/pages/edit-survey/edit-survey.component.spec.ts @@ -14,23 +14,22 @@ * limitations under the License. */ -import {WritableSignal, signal} from '@angular/core'; +import {NO_ERRORS_SCHEMA, WritableSignal, signal} from '@angular/core'; import { ComponentFixture, TestBed, + discardPeriodicTasks, fakeAsync, - tick, flush, + tick, waitForAsync, - discardPeriodicTasks, } from '@angular/core/testing'; import {MatDialog, MatDialogRef} from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import {MatDividerModule} from '@angular/material/divider'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {By} from '@angular/platform-browser'; +import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {ActivatedRoute} from '@angular/router'; import {RouterTestingModule} from '@angular/router/testing'; import {Map} from 'immutable'; diff --git a/web/src/app/pages/main-page-container/main-page-container.component.ts b/web/src/app/pages/main-page-container/main-page-container.component.ts index 56f6dc7ae..b65156a1b 100644 --- a/web/src/app/pages/main-page-container/main-page-container.component.ts +++ b/web/src/app/pages/main-page-container/main-page-container.component.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { Component, effect, input } from '@angular/core'; -import { toObservable, toSignal } from '@angular/core/rxjs-interop'; -import { switchMap } from 'rxjs/operators'; +import {Component, effect, input} from '@angular/core'; +import {toObservable, toSignal} from '@angular/core/rxjs-interop'; +import {switchMap} from 'rxjs/operators'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index 9e4e60f6b..663275bd7 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -35,7 +35,7 @@ import { EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import { NavigationService } from 'app/services/navigation/navigation.service'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {DrawingToolsComponent} from './drawing-tools.component'; import {DrawingToolsModule} from './drawing-tools.module'; @@ -109,7 +109,7 @@ describe('DrawingToolsComponent', () => { providers: [ {provide: AuthService, useValue: authServiceSpy}, {provide: DrawingToolsService, useValue: drawingToolsServiceSpy}, - { provide: NavigationService, useValue: navigationServiceSpy }, + {provide: NavigationService, useValue: navigationServiceSpy}, ], }).compileComponents(); })); diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts index 88644c7ee..cfab9c26a 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts @@ -27,7 +27,7 @@ import { import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; import {List} from 'immutable'; import {Observable, Subscription} from 'rxjs'; -import { map } from 'rxjs/operators'; +import {map} from 'rxjs/operators'; import {Job} from 'app/models/job.model'; import {Survey} from 'app/models/survey.model'; @@ -37,7 +37,7 @@ import { EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import { NavigationService } from 'app/services/navigation/navigation.service'; +import {NavigationService} from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-drawing-tools', diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts index 05de44f0d..413fb0bc2 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Component, NO_ERRORS_SCHEMA, signal } from '@angular/core'; +import {Component, NO_ERRORS_SCHEMA, signal} from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {AngularFireAuth} from '@angular/fire/compat/auth'; import {AngularFirestore} from '@angular/fire/compat/firestore'; @@ -102,7 +102,7 @@ describe('MainPageComponent', () => { jobs: {}, acl: {}, ownerId: 'owner1', - dataSharingTerms: {} + dataSharingTerms: {}, } as any; fixture.componentRef.setInput('activeSurvey', mockSurvey); diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts index d895a31d0..1f54bc2fe 100644 --- a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts @@ -40,7 +40,7 @@ import { } from 'app/services/drawing-tools/drawing-tools.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; import {polygonShellCoordsToPolygon} from 'testing/helpers'; import {MapComponent} from './map.component'; diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.ts b/web/src/app/pages/main-page-container/main-page/map/map.component.ts index 797264664..f8d0ecd9b 100644 --- a/web/src/app/pages/main-page-container/main-page/map/map.component.ts +++ b/web/src/app/pages/main-page-container/main-page/map/map.component.ts @@ -25,11 +25,11 @@ import { ViewChild, input, } from '@angular/core'; -import { toObservable } from '@angular/core/rxjs-interop'; +import {toObservable} from '@angular/core/rxjs-interop'; import {GoogleMap} from '@angular/google-maps'; import {Map as ImmutableMap, List} from 'immutable'; import {BehaviorSubject, Observable, Subscription, combineLatest} from 'rxjs'; -import { filter, map } from 'rxjs/operators'; +import {filter, map} from 'rxjs/operators'; import {Coordinate} from 'app/models/geometry/coordinate'; import {Geometry, GeometryType} from 'app/models/geometry/geometry'; @@ -48,7 +48,7 @@ import { import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; // To make ESLint happy: /*global google*/ diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts index cd3df8219..5f1539600 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { MatDialog } from '@angular/material/dialog'; -import { List, Map } from 'immutable'; -import { of } from 'rxjs'; +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; +import {MatDialog} from '@angular/material/dialog'; +import {List, Map} from 'immutable'; +import {of} from 'rxjs'; -import { LocationOfInterest } from 'app/models/loi.model'; -import { Submission } from 'app/models/submission/submission.model'; -import { DataSharingType, Survey } from 'app/models/survey.model'; -import { LocationOfInterestService } from 'app/services/loi/loi.service'; -import { NavigationService } from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {LocationOfInterest} from 'app/models/loi.model'; +import {Submission} from 'app/models/submission/submission.model'; +import {DataSharingType, Survey} from 'app/models/survey.model'; +import {LocationOfInterestService} from 'app/services/loi/loi.service'; +import {NavigationService} from 'app/services/navigation/navigation.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; -import { LocationOfInterestPanelComponent } from './loi-panel.component'; +import {LocationOfInterestPanelComponent} from './loi-panel.component'; describe('LocationOfInterestPanelComponent', () => { let component: LocationOfInterestPanelComponent; @@ -43,13 +43,13 @@ describe('LocationOfInterestPanelComponent', () => { Map(), Map(), 'owner1', - { type: DataSharingType.PRIVATE } + {type: DataSharingType.PRIVATE} ); const mockLoi = new LocationOfInterest( 'loi1', 'job1', - { chainId: 'point1' } as any, + {chainId: 'point1'} as any, Map() ); @@ -74,10 +74,10 @@ describe('LocationOfInterestPanelComponent', () => { TestBed.configureTestingModule({ declarations: [LocationOfInterestPanelComponent], providers: [ - { provide: LocationOfInterestService, useValue: loiServiceSpy }, - { provide: SubmissionService, useValue: submissionServiceSpy }, - { provide: NavigationService, useValue: navigationServiceSpy }, - { provide: MatDialog, useValue: dialogSpy }, + {provide: LocationOfInterestService, useValue: loiServiceSpy}, + {provide: SubmissionService, useValue: submissionServiceSpy}, + {provide: NavigationService, useValue: navigationServiceSpy}, + {provide: MatDialog, useValue: dialogSpy}, ], }).compileComponents(); })); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index ebe7ba67c..4e734b887 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import { Component, OnDestroy, OnInit, input } from '@angular/core'; -import { toObservable } from '@angular/core/rxjs-interop'; +import {Component, OnDestroy, OnInit, input} from '@angular/core'; +import {toObservable} from '@angular/core/rxjs-interop'; import {MatDialog} from '@angular/material/dialog'; import {List} from 'immutable'; -import { Subscription, combineLatest, switchMap } from 'rxjs'; +import {Subscription, combineLatest, switchMap} from 'rxjs'; import {LoiPropertiesDialogComponent} from 'app/components/loi-properties-dialog/loi-properties-dialog.component'; import {LocationOfInterest} from 'app/models/loi.model'; import {Submission} from 'app/models/submission/submission.model'; -import { Survey } from 'app/models/survey.model'; +import {Survey} from 'app/models/survey.model'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; import {getLoiIcon} from 'app/utils/utils'; @Component({ diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts index 3fa84e197..cd3b20b02 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { Map } from 'immutable'; -import { of } from 'rxjs'; +import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; +import {Map} from 'immutable'; +import {of} from 'rxjs'; -import { DataSharingType, Survey } from 'app/models/survey.model'; +import {DataSharingType, Survey} from 'app/models/survey.model'; import { NavigationService, SideNavMode, } from 'app/services/navigation/navigation.service'; -import { SecondarySidePanelComponent } from './secondary-side-panel.component'; -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import {SecondarySidePanelComponent} from './secondary-side-panel.component'; describe('SecondarySidePanelComponent', () => { let component: SecondarySidePanelComponent; @@ -39,7 +39,7 @@ describe('SecondarySidePanelComponent', () => { Map(), Map(), 'owner1', - { type: DataSharingType.PRIVATE } + {type: DataSharingType.PRIVATE} ); beforeEach(waitForAsync(() => { @@ -64,7 +64,7 @@ describe('SecondarySidePanelComponent', () => { TestBed.configureTestingModule({ declarations: [SecondarySidePanelComponent], - providers: [{ provide: NavigationService, useValue: navigationServiceSpy }], + providers: [{provide: NavigationService, useValue: navigationServiceSpy}], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts index 9eb8f86ef..391673bb0 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { Component, input } from '@angular/core'; +import {Component, input} from '@angular/core'; -import { Survey } from 'app/models/survey.model'; +import {Survey} from 'app/models/survey.model'; import { NavigationService, SideNavMode, @@ -35,6 +35,5 @@ export class SecondarySidePanelComponent { SideNavMode = SideNavMode; - constructor(private navigationService: NavigationService) { - } + constructor(private navigationService: NavigationService) {} } diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts index 47e4d4d1e..da1930656 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { AngularFireStorage } from '@angular/fire/compat/storage'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { Map } from 'immutable'; -import { of } from 'rxjs'; +import {NO_ERRORS_SCHEMA} from '@angular/core'; +import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; +import {AngularFireStorage} from '@angular/fire/compat/storage'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import {Map} from 'immutable'; +import {of} from 'rxjs'; -import { AuditInfo } from 'app/models/audit-info.model'; -import { Submission } from 'app/models/submission/submission.model'; -import { DataSharingType, Survey } from 'app/models/survey.model'; -import { NavigationService } from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {AuditInfo} from 'app/models/audit-info.model'; +import {Submission} from 'app/models/submission/submission.model'; +import {DataSharingType, Survey} from 'app/models/survey.model'; +import {NavigationService} from 'app/services/navigation/navigation.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; -import { SubmissionPanelComponent } from './submission-panel.component'; +import {SubmissionPanelComponent} from './submission-panel.component'; describe('SubmissionPanelComponent', () => { let component: SubmissionPanelComponent; @@ -43,7 +43,7 @@ describe('SubmissionPanelComponent', () => { Map(), Map(), 'owner1', - { type: DataSharingType.PRIVATE } + {type: DataSharingType.PRIVATE} ); const mockUser = { @@ -58,7 +58,7 @@ describe('SubmissionPanelComponent', () => { const mockSubmission = new Submission( 'sub1', 'loi1', - { id: 'job1' } as any, + {id: 'job1'} as any, mockAuditInfo, mockAuditInfo, Map() @@ -84,9 +84,9 @@ describe('SubmissionPanelComponent', () => { declarations: [SubmissionPanelComponent], imports: [MatProgressSpinnerModule], providers: [ - { provide: SubmissionService, useValue: submissionServiceSpy }, - { provide: NavigationService, useValue: navigationServiceSpy }, - { provide: AngularFireStorage, useValue: storageSpy }, + {provide: SubmissionService, useValue: submissionServiceSpy}, + {provide: NavigationService, useValue: navigationServiceSpy}, + {provide: AngularFireStorage, useValue: storageSpy}, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index 27291a327..5e669dcf1 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { Component, Input, OnDestroy, OnInit, input } from '@angular/core'; +import {Component, Input, OnDestroy, OnInit, input} from '@angular/core'; import {AngularFireStorage} from '@angular/fire/compat/storage'; import {List} from 'immutable'; -import { firstValueFrom, Subscription } from 'rxjs'; +import {Subscription, firstValueFrom} from 'rxjs'; // ... @@ -25,9 +25,9 @@ import {Point} from 'app/models/geometry/point'; import {MultipleSelection} from 'app/models/submission/multiple-selection'; import {Result} from 'app/models/submission/result.model'; import {Submission} from 'app/models/submission/submission.model'; +import {Survey} from 'app/models/survey.model'; import {Option} from 'app/models/task/option.model'; import {Task, TaskType} from 'app/models/task/task.model'; -import { Survey } from 'app/models/survey.model'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SubmissionService} from 'app/services/submission/submission.service'; diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts index a59390d70..c165cfd55 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { Component, computed, input } from '@angular/core'; -import { List } from 'immutable'; +import {Component, computed, input} from '@angular/core'; +import {List} from 'immutable'; import {Job} from 'app/models/job.model'; -import { Survey } from 'app/models/survey.model'; -import { NavigationService } from 'app/services/navigation/navigation.service'; +import {Survey} from 'app/models/survey.model'; +import {NavigationService} from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-job-list', @@ -35,7 +35,7 @@ export class JobListComponent { : List(); }); - constructor(readonly navigationService: NavigationService) { } + constructor(readonly navigationService: NavigationService) {} trackById(index: number, job: Job): string { return job.id; diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts index 0b745adae..44943b021 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { Component, input } from '@angular/core'; +import {Component, input} from '@angular/core'; import {Observable} from 'rxjs'; -import { Survey } from 'app/models/survey.model'; +import {Survey} from 'app/models/survey.model'; import { NavigationService, SideNavMode, diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts b/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts index 62ce59447..753759c51 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts @@ -50,7 +50,7 @@ import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import { UrlParams } from 'app/services/navigation/url-params'; +import {UrlParams} from 'app/services/navigation/url-params'; import {SubmissionService} from 'app/services/submission/submission.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts index c95322661..83c52a6ac 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts index 3caaf1ed3..67163dcee 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { Component, input } from '@angular/core'; +import {Component, input} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {Subscription} from 'rxjs'; import {ShareDialogComponent} from 'app/components/share-dialog/share-dialog.component'; -import { Survey } from 'app/models/survey.model'; +import {Survey} from 'app/models/survey.model'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; @@ -35,7 +35,7 @@ export class SurveyHeaderComponent { public navigationService: NavigationService, public surveyService: SurveyService, private dialog: MatDialog - ) { } + ) {} /** * Updates the survey title with input element value. @@ -64,6 +64,8 @@ export class SurveyHeaderComponent { } isEditSurveyPage() { - return this.navigationService.isEditSurveyPage(this.activeSurvey()?.id || ''); + return this.navigationService.isEditSurveyPage( + this.activeSurvey()?.id || '' + ); } } diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index 49efca6cf..d013f012b 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -135,7 +135,7 @@ const routes: Routes = [ canActivate: [AuthGuard], }, ]; -const config = RouterModule.forRoot(routes, { bindToComponentInputs: true }); +const config = RouterModule.forRoot(routes, {bindToComponentInputs: true}); @NgModule({ imports: [config], diff --git a/web/src/environments/environment.dev.ts b/web/src/environments/environment.dev.ts index 94265ebd3..00ed1392f 100644 --- a/web/src/environments/environment.dev.ts +++ b/web/src/environments/environment.dev.ts @@ -15,6 +15,7 @@ */ import {firebaseConfig} from 'environments/.firebase-config'; + import {Env} from 'environments/environment-enums'; export const environment = { diff --git a/web/src/environments/environment.prod.ts b/web/src/environments/environment.prod.ts index 59b67dd40..2f3513f17 100644 --- a/web/src/environments/environment.prod.ts +++ b/web/src/environments/environment.prod.ts @@ -15,6 +15,7 @@ */ import {firebaseConfig} from 'environments/.firebase-config'; + import {Env} from 'environments/environment-enums'; export const environment = { From 2845684aa5e3ebbf555b9a6b16c641fae3a1a4de Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 13:52:01 -0500 Subject: [PATCH 06/34] Remove debug log statement --- web/src/app/components/job-list-item/job-list-item.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/web/src/app/components/job-list-item/job-list-item.component.ts b/web/src/app/components/job-list-item/job-list-item.component.ts index e6963dbb2..f10694d17 100644 --- a/web/src/app/components/job-list-item/job-list-item.component.ts +++ b/web/src/app/components/job-list-item/job-list-item.component.ts @@ -61,7 +61,6 @@ export class JobListItemComponent implements OnInit, OnDestroy { private groundPinService: GroundPinService, private authService: AuthService ) { - console.log('JobListItemComponent urlParamsSignal:', this.urlParamsSignal); this.jobPinUrl = sanitizer.bypassSecurityTrustUrl( groundPinService.getPinImageSource() ); From 10688c7dbb7ebfaf2942ce123c55e8fb06d28307 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 13:57:05 -0500 Subject: [PATCH 07/34] Uncomment disabled post-condition --- .../main-page/drawing-tools/drawing-tools.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index 663275bd7..a87554983 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -188,7 +188,7 @@ describe('DrawingToolsComponent', () => { resetFixture(); // Verify spy behavior - // expect(authServiceSpy.canUserAddPointsToJob(mockSurvey, mockSurvey.jobs.first())).toBe(false); + expect(authServiceSpy.canUserAddPointsToJob(mockSurvey, mockSurvey.jobs.first())).toBe(false); const addPointButton = fixture.debugElement.query( By.css('#add-point-button') From 729d267a0de2db65daadee944a0745bd91b8a728 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 13:57:22 -0500 Subject: [PATCH 08/34] Update copyright year --- .../secondary-side-panel/loi-panel/loi-panel.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts index 5f1539600..6ee296248 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2023 The Ground Authors. + * Copyright 2025 The Ground Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 7cc1bd36ae17143f930c167576f0f47d58c26208 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 13:58:38 -0500 Subject: [PATCH 09/34] Remove thinking comments --- .../main-page/drawing-tools/drawing-tools.component.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index a87554983..0b8324e57 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -132,9 +132,6 @@ describe('DrawingToolsComponent', () => { } beforeEach(() => { - // resetFixture(); // Don't reset automatically, let tests do it or stick to standard. - // Actually standard is to do it in beforeEach. - // I will call resetFixture() here, but ensure resetFixture destroys previous. resetFixture(); }); From c8f08ba8884983681a1bb903926c20fa8fb6514d Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 13:59:41 -0500 Subject: [PATCH 10/34] Update copyright year --- .../submission-panel/submission-panel.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts index da1930656..1557f9450 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2023 The Ground Authors. + * Copyright 2025 The Ground Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From ca0ebef5f41cf81f0a6f69d7ccf55995f29c4fa9 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:00:45 -0500 Subject: [PATCH 11/34] Reformat --- .../drawing-tools/drawing-tools.component.spec.ts | 7 ++++++- .../submission-panel/submission-panel.component.ts | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index 0b8324e57..d1d634b3f 100644 --- a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -185,7 +185,12 @@ describe('DrawingToolsComponent', () => { resetFixture(); // Verify spy behavior - expect(authServiceSpy.canUserAddPointsToJob(mockSurvey, mockSurvey.jobs.first())).toBe(false); + expect( + authServiceSpy.canUserAddPointsToJob( + mockSurvey, + mockSurvey.jobs.first() + ) + ).toBe(false); const addPointButton = fixture.debugElement.query( By.css('#add-point-button') diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index 5e669dcf1..3919730af 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -19,8 +19,6 @@ import {AngularFireStorage} from '@angular/fire/compat/storage'; import {List} from 'immutable'; import {Subscription, firstValueFrom} from 'rxjs'; -// ... - import {Point} from 'app/models/geometry/point'; import {MultipleSelection} from 'app/models/submission/multiple-selection'; import {Result} from 'app/models/submission/result.model'; From b36299f26d9638a240e1ca7b548f60e0dc0e36a8 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:02:30 -0500 Subject: [PATCH 12/34] Handle error state properly --- .../submission-panel.component.ts | 69 ++++++++++++------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index 3919730af..37f7ee458 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {Component, Input, OnDestroy, OnInit, input} from '@angular/core'; -import {AngularFireStorage} from '@angular/fire/compat/storage'; -import {List} from 'immutable'; -import {Subscription, firstValueFrom} from 'rxjs'; - -import {Point} from 'app/models/geometry/point'; -import {MultipleSelection} from 'app/models/submission/multiple-selection'; -import {Result} from 'app/models/submission/result.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {Survey} from 'app/models/survey.model'; -import {Option} from 'app/models/task/option.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; +import { Component, Input, OnDestroy, OnInit, input } from '@angular/core'; +import { AngularFireStorage } from '@angular/fire/compat/storage'; +import { List } from 'immutable'; +import { Subscription, firstValueFrom } from 'rxjs'; + +import { Point } from 'app/models/geometry/point'; +import { MultipleSelection } from 'app/models/submission/multiple-selection'; +import { Result } from 'app/models/submission/result.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { Survey } from 'app/models/survey.model'; +import { Option } from 'app/models/task/option.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; @Component({ selector: 'submission-panel', @@ -51,7 +51,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { private submissionService: SubmissionService, private navigationService: NavigationService, private storage: AngularFireStorage - ) {} + ) { } ngOnInit() { this.subscription.add( @@ -94,18 +94,27 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { } navigateToSubmissionList() { + const survey = this.activeSurvey(); + if (!survey) { + console.error("No active survey - can't navigate to submission list"); + return; + } + if (!this.submission) { + console.error("No submission - can't navigate to submission list"); + return; + } this.navigationService.selectLocationOfInterest( - this.activeSurvey()?.id!, - this.submission!.loiId + survey.id, + this.submission.loiId ); } - getTaskSubmissionResult({id: taskId}: Task): Result | undefined { + getTaskSubmissionResult({ id: taskId }: Task): Result | undefined { return this.submission?.data.get(taskId); } getMultipleChoiceOption(task: Task, optionId: string) { - return task.multipleChoice?.options.find(({id}: Option) => id === optionId); + return task.multipleChoice?.options.find(({ id }: Option) => id === optionId); } getTaskMultipleChoiceSelections(task: Task): MultipleSelection { @@ -128,9 +137,9 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getCaptureLocationCoord(task: Task): string { // x represents longitude, y represents latitude - const {coord, accuracy, altitude} = this.getTaskSubmissionResult(task)! + const { coord, accuracy, altitude } = this.getTaskSubmissionResult(task)! .value as Point; - const {x, y} = coord; + const { x, y } = coord; const lng = Math.abs(x).toString() + (x > 0 ? '° E' : '° W'); const lat = Math.abs(y).toString() + (y > 0 ? '° N' : '° S'); const result = [`${lat}, ${lng}`]; @@ -148,14 +157,24 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getTime(task: Task): string { return ( this.getTaskSubmissionResult(task)?.value as Date - ).toLocaleTimeString([], {hour: 'numeric', minute: 'numeric'}); + ).toLocaleTimeString([], { hour: 'numeric', minute: 'numeric' }); } selectGeometry(task: Task): void { + const survey = this.activeSurvey(); + if (!survey) { + console.error("No active survey - can't select geometry"); + return; + } + if (!this.submission) { + console.error("No submission - can't select geometry"); + return; + } + this.navigationService.showSubmissionDetailWithHighlightedTask( - this.activeSurvey()?.id!, - this.submission!.loiId!, - this.submission!.id!, + survey.id, + this.submission.loiId, + this.submission.id, task.id ); } From 73464ff1aa66aec6dcb14880e7d3d116d07d215c Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:03:47 -0500 Subject: [PATCH 13/34] Add CR --- .../secondary-side-panel/secondary-side-panel.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html index c413ae86e..bcd6f9f93 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html @@ -24,4 +24,4 @@ - \ No newline at end of file + From b32ca0a815205d26e7240d9c616110b0e607bbf9 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:03:57 -0500 Subject: [PATCH 14/34] Update copyright --- .../secondary-side-panel/secondary-side-panel.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts index cd3b20b02..061302c24 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2023 The Ground Authors. + * Copyright 2025 The Ground Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From ff0ab6e2ca88b84fdcf452e9b53a159cc1aea9f5 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:08:30 -0500 Subject: [PATCH 15/34] Remove drawing tools logic and other unnecessary flags --- .../main-page/main-page.component.html | 6 +-- .../main-page/main-page.component.ts | 4 -- .../submission-panel.component.ts | 40 +++++++++---------- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.html b/web/src/app/pages/main-page-container/main-page/main-page.component.html index 8fca1efa9..dc43361ea 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.html +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.html @@ -19,10 +19,6 @@
-
- -
- +
diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.ts index 23da3c846..9c36ddc89 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.ts @@ -43,11 +43,7 @@ export class MainPageComponent implements OnInit { private urlParamsSignal = this.navigationService.getUrlParams(); subscription: Subscription = new Subscription(); - shouldEnableDrawingTools = false; showSubmissionPanel: Boolean = false; - shouldShowMap = true; - selectedJob = null; - showPredefinedLoisOnly = false; constructor( private navigationService: NavigationService, diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index 37f7ee458..576eba4a1 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import { Component, Input, OnDestroy, OnInit, input } from '@angular/core'; -import { AngularFireStorage } from '@angular/fire/compat/storage'; -import { List } from 'immutable'; -import { Subscription, firstValueFrom } from 'rxjs'; - -import { Point } from 'app/models/geometry/point'; -import { MultipleSelection } from 'app/models/submission/multiple-selection'; -import { Result } from 'app/models/submission/result.model'; -import { Submission } from 'app/models/submission/submission.model'; -import { Survey } from 'app/models/survey.model'; -import { Option } from 'app/models/task/option.model'; -import { Task, TaskType } from 'app/models/task/task.model'; -import { NavigationService } from 'app/services/navigation/navigation.service'; -import { SubmissionService } from 'app/services/submission/submission.service'; +import {Component, Input, OnDestroy, OnInit, input} from '@angular/core'; +import {AngularFireStorage} from '@angular/fire/compat/storage'; +import {List} from 'immutable'; +import {Subscription, firstValueFrom} from 'rxjs'; + +import {Point} from 'app/models/geometry/point'; +import {MultipleSelection} from 'app/models/submission/multiple-selection'; +import {Result} from 'app/models/submission/result.model'; +import {Submission} from 'app/models/submission/submission.model'; +import {Survey} from 'app/models/survey.model'; +import {Option} from 'app/models/task/option.model'; +import {Task, TaskType} from 'app/models/task/task.model'; +import {NavigationService} from 'app/services/navigation/navigation.service'; +import {SubmissionService} from 'app/services/submission/submission.service'; @Component({ selector: 'submission-panel', @@ -51,7 +51,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { private submissionService: SubmissionService, private navigationService: NavigationService, private storage: AngularFireStorage - ) { } + ) {} ngOnInit() { this.subscription.add( @@ -109,12 +109,12 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { ); } - getTaskSubmissionResult({ id: taskId }: Task): Result | undefined { + getTaskSubmissionResult({id: taskId}: Task): Result | undefined { return this.submission?.data.get(taskId); } getMultipleChoiceOption(task: Task, optionId: string) { - return task.multipleChoice?.options.find(({ id }: Option) => id === optionId); + return task.multipleChoice?.options.find(({id}: Option) => id === optionId); } getTaskMultipleChoiceSelections(task: Task): MultipleSelection { @@ -137,9 +137,9 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getCaptureLocationCoord(task: Task): string { // x represents longitude, y represents latitude - const { coord, accuracy, altitude } = this.getTaskSubmissionResult(task)! + const {coord, accuracy, altitude} = this.getTaskSubmissionResult(task)! .value as Point; - const { x, y } = coord; + const {x, y} = coord; const lng = Math.abs(x).toString() + (x > 0 ? '° E' : '° W'); const lat = Math.abs(y).toString() + (y > 0 ? '° N' : '° S'); const result = [`${lat}, ${lng}`]; @@ -157,7 +157,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getTime(task: Task): string { return ( this.getTaskSubmissionResult(task)?.value as Date - ).toLocaleTimeString([], { hour: 'numeric', minute: 'numeric' }); + ).toLocaleTimeString([], {hour: 'numeric', minute: 'numeric'}); } selectGeometry(task: Task): void { From 46aaa82ee4867dde23a8110d1f218ca4104144d0 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:09:19 -0500 Subject: [PATCH 16/34] Fix formatting --- web/src/environments/environment.dev.ts | 3 +-- web/src/environments/environment.prod.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/environments/environment.dev.ts b/web/src/environments/environment.dev.ts index 00ed1392f..d13ff88c8 100644 --- a/web/src/environments/environment.dev.ts +++ b/web/src/environments/environment.dev.ts @@ -14,8 +14,7 @@ * limitations under the License. */ -import {firebaseConfig} from 'environments/.firebase-config'; - +import { firebaseConfig } from 'environments/.firebase-config'; import {Env} from 'environments/environment-enums'; export const environment = { diff --git a/web/src/environments/environment.prod.ts b/web/src/environments/environment.prod.ts index 2f3513f17..fc75f79fb 100644 --- a/web/src/environments/environment.prod.ts +++ b/web/src/environments/environment.prod.ts @@ -14,8 +14,7 @@ * limitations under the License. */ -import {firebaseConfig} from 'environments/.firebase-config'; - +import { firebaseConfig } from 'environments/.firebase-config'; import {Env} from 'environments/environment-enums'; export const environment = { From 89e371a9df9b0222a527b2b33f382118bacc84c5 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 14:11:24 -0500 Subject: [PATCH 17/34] Formatting --- web/src/environments/environment.dev.ts | 3 ++- web/src/environments/environment.prod.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/environments/environment.dev.ts b/web/src/environments/environment.dev.ts index d13ff88c8..00ed1392f 100644 --- a/web/src/environments/environment.dev.ts +++ b/web/src/environments/environment.dev.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { firebaseConfig } from 'environments/.firebase-config'; +import {firebaseConfig} from 'environments/.firebase-config'; + import {Env} from 'environments/environment-enums'; export const environment = { diff --git a/web/src/environments/environment.prod.ts b/web/src/environments/environment.prod.ts index fc75f79fb..2f3513f17 100644 --- a/web/src/environments/environment.prod.ts +++ b/web/src/environments/environment.prod.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { firebaseConfig } from 'environments/.firebase-config'; +import {firebaseConfig} from 'environments/.firebase-config'; + import {Env} from 'environments/environment-enums'; export const environment = { From 721c5a6f3cb904bf731b8b4d749335eab2423147 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Thu, 11 Dec 2025 16:01:05 -0500 Subject: [PATCH 18/34] Remove blank lines between imports --- web/src/environments/environment.dev.ts | 1 - web/src/environments/environment.prod.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/web/src/environments/environment.dev.ts b/web/src/environments/environment.dev.ts index 00ed1392f..94265ebd3 100644 --- a/web/src/environments/environment.dev.ts +++ b/web/src/environments/environment.dev.ts @@ -15,7 +15,6 @@ */ import {firebaseConfig} from 'environments/.firebase-config'; - import {Env} from 'environments/environment-enums'; export const environment = { diff --git a/web/src/environments/environment.prod.ts b/web/src/environments/environment.prod.ts index 2f3513f17..59b67dd40 100644 --- a/web/src/environments/environment.prod.ts +++ b/web/src/environments/environment.prod.ts @@ -15,7 +15,6 @@ */ import {firebaseConfig} from 'environments/.firebase-config'; - import {Env} from 'environments/environment-enums'; export const environment = { From 50389234c70da3ea68a28c6237cca8c6570cbcf8 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 07:16:28 -0500 Subject: [PATCH 19/34] Refactor WIP --- .../create-survey/create-survey.component.ts | 7 +- .../edit-survey/edit-survey.component.ts | 8 +- .../main-page/main-page.component.ts | 3 +- web/src/app/routing.module.ts | 45 ++++++----- web/src/app/services/auth/auth.guard.ts | 8 +- .../navigation/navigation.constants.ts | 42 +++++++++++ .../services/navigation/navigation.service.ts | 74 +++++++------------ web/src/app/services/navigation/url-params.ts | 2 +- web/src/app/services/survey/survey.service.ts | 3 +- 9 files changed, 116 insertions(+), 76 deletions(-) create mode 100644 web/src/app/services/navigation/navigation.constants.ts diff --git a/web/src/app/pages/create-survey/create-survey.component.ts b/web/src/app/pages/create-survey/create-survey.component.ts index 2b6fcf34f..1741c8cb7 100644 --- a/web/src/app/pages/create-survey/create-survey.component.ts +++ b/web/src/app/pages/create-survey/create-survey.component.ts @@ -32,6 +32,7 @@ import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; import {SurveyService} from 'app/services/survey/survey.service'; import {TaskService} from 'app/services/task/task.service'; @@ -155,7 +156,7 @@ export class CreateSurveyComponent implements OnInit { ngOnInit(): void { this.subscription.add( this.navigationService.getSurveyId$().subscribe(async surveyId => { - this.surveyId = surveyId ? surveyId : NavigationService.SURVEY_ID_NEW; + this.surveyId = surveyId ? surveyId : SURVEY_ID_NEW; this.surveyService.activateSurvey(this.surveyId); await this.draftSurveyService.init(this.surveyId); this.draftSurveyService @@ -172,7 +173,7 @@ export class CreateSurveyComponent implements OnInit { .pipe( filter( ([survey]) => - this.surveyId === NavigationService.SURVEY_ID_NEW || + this.surveyId === SURVEY_ID_NEW || survey.id === this.surveyId ) ) @@ -332,7 +333,7 @@ export class CreateSurveyComponent implements OnInit { private async saveSurveyTitleAndDescription(): Promise { const [name, description] = this.surveyDetails!.toTitleAndDescription(); - if (this.surveyId === NavigationService.SURVEY_ID_NEW) { + if (this.surveyId === SURVEY_ID_NEW) { return await this.surveyService.createSurvey(name, description); } diff --git a/web/src/app/pages/edit-survey/edit-survey.component.ts b/web/src/app/pages/edit-survey/edit-survey.component.ts index b5bc2c819..ae456ceaf 100644 --- a/web/src/app/pages/edit-survey/edit-survey.component.ts +++ b/web/src/app/pages/edit-survey/edit-survey.component.ts @@ -25,6 +25,10 @@ import {Survey} from 'app/models/survey.model'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import { + SURVEY_SEGMENT, + SURVEYS_SHARE, +} from 'app/services/navigation/navigation.constants'; import {SurveyService} from 'app/services/survey/survey.service'; import {environment} from 'environments/environment'; @@ -74,10 +78,10 @@ export class EditSurveyComponent { const section = this.editSurveyPageSignal(); switch (section) { - case NavigationService.SURVEY_SEGMENT: + case SURVEY_SEGMENT: this.sectionTitle = $localize`:@@app.editSurvey.surveyDetails.title:Survey details`; break; - case NavigationService.SURVEYS_SHARE: + case SURVEYS_SHARE: this.sectionTitle = $localize`:@@app.editSurvey.sharing.title:Sharing`; break; default: diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.ts index 9c36ddc89..09cd1c340 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.ts @@ -22,6 +22,7 @@ import {Survey} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import {JOB_ID_NEW} from 'app/services/navigation/navigation.constants'; import {SubmissionService} from 'app/services/submission/submission.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {environment} from 'environments/environment'; @@ -66,7 +67,7 @@ export class MainPageComponent implements OnInit { this.navigationService .getSurveyId$() .subscribe( - id => id === NavigationService.JOB_ID_NEW && this.showTitleDialog() + id => id === JOB_ID_NEW && this.showTitleDialog() ) ); // Redirect to sign in page if user is not authenticated. diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index d013f012b..c9a209451 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -29,31 +29,36 @@ import {AuthGuard} from 'app/services/auth/auth.guard'; import {passlistGuard} from 'app/services/auth/passlist.guard'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {ShareSurveyComponent} from './components/share-survey/share-survey.component'; -import {AboutComponent} from './pages/about/about.component'; -import {AndroidIntentLandingPageComponent} from './pages/android-intent-landing-page/android-intent-landing-page.component'; -import {EditDetailsComponent} from './pages/edit-survey/edit-details/edit-details.component'; -import {EditJobComponent} from './pages/edit-survey/edit-job/edit-job.component'; -import {EditSurveyComponent} from './pages/edit-survey/edit-survey.component'; -import {EditSurveyModule} from './pages/edit-survey/edit-survey.module'; -import {SurveyJsonComponent} from './pages/edit-survey/survey-json/survey-json.component'; -import {ErrorComponent} from './pages/error/error.component'; -import {ErrorModule} from './pages/error/error.module'; -import {TermsComponent} from './pages/terms/terms.component'; - -const { +import { + ABOUT, + ANDROID_SEGMENT, + ERROR, LOI_ID, LOI_SEGMENT, SIGN_IN_SEGMENT, SUBMISSION_ID, SUBMISSION_SEGMENT, SURVEY_ID, + SURVEY_SEGMENT, SURVEYS_CREATE, SURVEYS_EDIT, SURVEYS_SEGMENT, TASK_ID, TASK_SEGMENT, -} = NavigationService; + TERMS, +} from 'app/services/navigation/navigation.constants'; + +import {ShareSurveyComponent} from './components/share-survey/share-survey.component'; +import {AboutComponent} from './pages/about/about.component'; +import {AndroidIntentLandingPageComponent} from './pages/android-intent-landing-page/android-intent-landing-page.component'; +import {EditDetailsComponent} from './pages/edit-survey/edit-details/edit-details.component'; +import {EditJobComponent} from './pages/edit-survey/edit-job/edit-job.component'; +import {EditSurveyComponent} from './pages/edit-survey/edit-survey.component'; +import {EditSurveyModule} from './pages/edit-survey/edit-survey.module'; +import {SurveyJsonComponent} from './pages/edit-survey/survey-json/survey-json.component'; +import {ErrorComponent} from './pages/error/error.component'; +import {ErrorModule} from './pages/error/error.module'; +import {TermsComponent} from './pages/terms/terms.component'; const routes: Routes = [ { @@ -82,7 +87,7 @@ const routes: Routes = [ canActivate: [AuthGuard, passlistGuard], }, { - path: `${NavigationService.SURVEY_SEGMENT}/:${SURVEY_ID}/${SURVEYS_EDIT}`, + path: `${SURVEY_SEGMENT}/:${SURVEY_ID}/${SURVEYS_EDIT}`, component: EditSurveyComponent, canActivate: [AuthGuard], children: [ @@ -93,7 +98,7 @@ const routes: Routes = [ ], }, { - path: `${NavigationService.SURVEY_SEGMENT}/:${SURVEY_ID}`, + path: `${SURVEY_SEGMENT}/:${SURVEY_ID}`, component: MainPageContainerComponent, canActivate: [AuthGuard], children: [ @@ -116,21 +121,21 @@ const routes: Routes = [ ], }, { - path: NavigationService.ERROR, + path: ERROR, component: ErrorComponent, canActivate: [AuthGuard], }, { - path: NavigationService.ABOUT, + path: ABOUT, component: AboutComponent, }, { - path: `${NavigationService.ANDROID_SEGMENT}`, + path: `${ANDROID_SEGMENT}`, component: AndroidIntentLandingPageComponent, children: [{path: '**', component: AndroidIntentLandingPageComponent}], }, { - path: NavigationService.TERMS, + path: TERMS, component: TermsComponent, canActivate: [AuthGuard], }, diff --git a/web/src/app/services/auth/auth.guard.ts b/web/src/app/services/auth/auth.guard.ts index 0339f77e6..ea532ce83 100644 --- a/web/src/app/services/auth/auth.guard.ts +++ b/web/src/app/services/auth/auth.guard.ts @@ -21,6 +21,10 @@ import {catchError, map} from 'rxjs/operators'; import {User} from 'app/models/user.model'; import {AuthService} from 'app/services/auth/auth.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import { + SIGN_IN_SEGMENT, + TERMS, +} from 'app/services/navigation/navigation.constants'; import {environment} from 'environments/environment'; @Injectable({ @@ -49,7 +53,7 @@ export class AuthGuard { if (environment.useEmulators) { return true; } - if (url.includes(NavigationService.SIGN_IN_SEGMENT)) { + if (url.includes(SIGN_IN_SEGMENT)) { if (!user.isAuthenticated) { return true; } @@ -57,7 +61,7 @@ export class AuthGuard { return false; } - if (url.includes(NavigationService.TERMS)) { + if (url.includes(TERMS)) { if (user.isAuthenticated) { return true; } diff --git a/web/src/app/services/navigation/navigation.constants.ts b/web/src/app/services/navigation/navigation.constants.ts new file mode 100644 index 000000000..2eb540915 --- /dev/null +++ b/web/src/app/services/navigation/navigation.constants.ts @@ -0,0 +1,42 @@ +/** + * Copyright 2025 The Ground Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export enum SideNavMode { + JOB_LIST = 1, + SUBMISSION = 2, +} + +export const LOI_SEGMENT = 'site'; +export const LOI_ID = 'siteId'; +export const JOB_ID_NEW = 'new'; +export const SUBMISSION_SEGMENT = 'submission'; +export const SUBMISSION_ID = 'submissionId'; +export const SUBMISSION_ID_NEW = 'new'; +export const SURVEY_ID_NEW = 'new'; +export const SURVEY_ID = 'surveyId'; +export const SURVEY_SEGMENT = 'survey'; +export const SIGN_IN_SEGMENT = 'signin'; +export const SURVEYS_SEGMENT = 'surveys'; +export const SURVEYS_CREATE = 'create'; +export const SURVEYS_EDIT = 'edit'; +export const SURVEYS_SHARE = 'share'; +export const TASK_SEGMENT = 'task'; +export const TASK_ID = 'taskId'; +export const JOB_SEGMENT = 'job'; +export const ERROR = 'error'; +export const ABOUT = 'about'; +export const TERMS = 'terms'; +export const ANDROID_SEGMENT = 'android'; diff --git a/web/src/app/services/navigation/navigation.service.ts b/web/src/app/services/navigation/navigation.service.ts index 93d340ec1..272feb798 100644 --- a/web/src/app/services/navigation/navigation.service.ts +++ b/web/src/app/services/navigation/navigation.service.ts @@ -35,6 +35,32 @@ import {filter} from 'rxjs/operators'; import {UrlParams} from './url-params'; import {DataStoreService} from '../data-store/data-store.service'; +import { + ABOUT, + ANDROID_SEGMENT, + ERROR, + JOB_ID_NEW, + JOB_SEGMENT, + LOI_ID, + LOI_SEGMENT, + SIGN_IN_SEGMENT, + SUBMISSION_ID, + SUBMISSION_ID_NEW, + SUBMISSION_SEGMENT, + SURVEY_ID, + SURVEY_ID_NEW, + SURVEY_SEGMENT, + SURVEYS_CREATE, + SURVEYS_EDIT, + SURVEYS_SEGMENT, + SURVEYS_SHARE, + TASK_ID, + TASK_SEGMENT, + TERMS, +} from './navigation.constants'; +import {SideNavMode} from './navigation.constants'; + +export {SideNavMode} from './navigation.constants'; /** * Exposes application state in the URL as streams to other services @@ -44,27 +70,6 @@ import {DataStoreService} from '../data-store/data-store.service'; providedIn: 'root', }) export class NavigationService implements OnDestroy { - static readonly LOI_SEGMENT = 'site'; - static readonly LOI_ID = 'siteId'; - static readonly JOB_ID_NEW = 'new'; - static readonly SUBMISSION_SEGMENT = 'submission'; - static readonly SUBMISSION_ID = 'submissionId'; - static readonly SUBMISSION_ID_NEW = 'new'; - static readonly SURVEY_ID_NEW = 'new'; - static readonly SURVEY_ID = 'surveyId'; - static readonly SURVEY_SEGMENT = 'survey'; - static readonly SIGN_IN_SEGMENT = 'signin'; - static readonly SURVEYS_SEGMENT = 'surveys'; - static readonly SURVEYS_CREATE = 'create'; - static readonly SURVEYS_EDIT = 'edit'; - static readonly SURVEYS_SHARE = 'share'; - static readonly TASK_SEGMENT = 'task'; - static readonly TASK_ID = 'taskId'; - static readonly JOB_SEGMENT = 'job'; - static readonly ERROR = 'error'; - static readonly ABOUT = 'about'; - static readonly TERMS = 'terms'; - static readonly ANDROID_SEGMENT = 'android'; private sidePanelExpanded = true; @@ -372,29 +377,6 @@ export class NavigationService implements OnDestroy { } } -export enum SideNavMode { - JOB_LIST = 1, - SUBMISSION = 2, -} -const { - ABOUT, - ERROR, - LOI_ID, - LOI_SEGMENT, - JOB_SEGMENT, - SIGN_IN_SEGMENT, - SUBMISSION_ID, - SUBMISSION_SEGMENT, - SURVEY_ID, - SURVEY_ID_NEW, - SURVEY_SEGMENT, - SURVEYS_CREATE, - SURVEYS_EDIT, - SURVEYS_SHARE, - SURVEYS_SEGMENT, - TASK_ID, - TASK_SEGMENT, - TERMS, - ANDROID_SEGMENT, -} = NavigationService; + + diff --git a/web/src/app/services/navigation/url-params.ts b/web/src/app/services/navigation/url-params.ts index acb157661..30710d73d 100644 --- a/web/src/app/services/navigation/url-params.ts +++ b/web/src/app/services/navigation/url-params.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {SideNavMode} from './navigation.service'; +import {SideNavMode} from './navigation.constants'; export class UrlParams { public sideNavMode: SideNavMode | null; diff --git a/web/src/app/services/survey/survey.service.ts b/web/src/app/services/survey/survey.service.ts index 31f119b28..f9847d4cd 100644 --- a/web/src/app/services/survey/survey.service.ts +++ b/web/src/app/services/survey/survey.service.ts @@ -24,6 +24,7 @@ import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; +import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; @Injectable({ providedIn: 'root', @@ -45,7 +46,7 @@ export class SurveyService { // Asynchronously load survey. switchMap() internally disposes // of previous subscription if present. switchMap(id => { - if (id === NavigationService.SURVEY_ID_NEW) { + if (id === SURVEY_ID_NEW) { return of(Survey.UNSAVED_NEW); } return this.dataStore.loadSurvey$(id); From de8ba582ce44a73200ca2675abd1ad1d6bc26e0e Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 11:16:14 -0500 Subject: [PATCH 20/34] Fix runtime errors --- .../secondary-side-panel/loi-panel/loi-panel.component.ts | 6 +++++- .../secondary-side-panel.component.html | 7 ++++--- .../main-page/survey-header/survey-header.component.ts | 6 +++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index 4e734b887..ad1b274b0 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -80,8 +80,12 @@ export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { } onSelectSubmission(submissionId: string) { + if (!this.activeSurvey()) { + console.error('No active survey'); + return; + } this.navigationService.showSubmissionDetail( - this.activeSurvey()?.id || '', + this.activeSurvey()?.id!, this.loi.id, submissionId ); diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html index bcd6f9f93..0f833f1b3 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html @@ -17,11 +17,12 @@
- + - +
-
+ \ No newline at end of file diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts index 67163dcee..4453851aa 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts @@ -64,8 +64,12 @@ export class SurveyHeaderComponent { } isEditSurveyPage() { + if (!this.activeSurvey()) { + console.error('No active survey'); + return; + } return this.navigationService.isEditSurveyPage( - this.activeSurvey()?.id || '' + this.activeSurvey()?.id! ); } } From 795bbd09fdd1334bf652be7dacea727a1f71b684 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 11:34:30 -0500 Subject: [PATCH 21/34] Fix broken test --- .../app/pages/create-survey/create-survey.component.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/app/pages/create-survey/create-survey.component.spec.ts b/web/src/app/pages/create-survey/create-survey.component.spec.ts index 46adc28d9..66e78c038 100644 --- a/web/src/app/pages/create-survey/create-survey.component.spec.ts +++ b/web/src/app/pages/create-survey/create-survey.component.spec.ts @@ -49,6 +49,7 @@ import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {TaskService} from 'app/services/task/task.service'; import {ActivatedRouteStub} from 'testing/activated-route-stub'; +import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; describe('CreateSurveyComponent', () => { let component: CreateSurveyComponent; @@ -249,7 +250,7 @@ describe('CreateSurveyComponent', () => { describe('when no survey', () => { beforeEach(fakeAsync(() => { - surveyId$.next(NavigationService.SURVEY_ID_NEW); + surveyId$.next(SURVEY_ID_NEW); activeSurvey$.next(Survey.UNSAVED_NEW); tick(); fixture.detectChanges(); @@ -317,7 +318,7 @@ describe('CreateSurveyComponent', () => { describe('Survey Details', () => { describe('when no survey', () => { beforeEach(fakeAsync(() => { - surveyId$.next(NavigationService.SURVEY_ID_NEW); + surveyId$.next(SURVEY_ID_NEW); activeSurvey$.next(Survey.UNSAVED_NEW); tick(); fixture.detectChanges(); From 77eac007eaa79dd2a941ec15090c1145c112d33c Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 13:02:22 -0500 Subject: [PATCH 22/34] Lint fix --- .../create-survey.component.spec.ts | 2 +- .../create-survey/create-survey.component.ts | 5 ++--- .../edit-survey/edit-survey.component.ts | 4 ++-- .../main-page/main-page.component.ts | 6 ++---- .../loi-panel/loi-panel.component.ts | 2 +- .../survey-header/survey-header.component.ts | 4 +--- web/src/app/routing.module.ts | 7 +++---- web/src/app/services/auth/auth.guard.ts | 2 +- .../services/navigation/navigation.service.ts | 19 +++++++------------ web/src/app/services/survey/survey.service.ts | 2 +- 10 files changed, 21 insertions(+), 32 deletions(-) diff --git a/web/src/app/pages/create-survey/create-survey.component.spec.ts b/web/src/app/pages/create-survey/create-survey.component.spec.ts index 66e78c038..87ca040b5 100644 --- a/web/src/app/pages/create-survey/create-survey.component.spec.ts +++ b/web/src/app/pages/create-survey/create-survey.component.spec.ts @@ -45,11 +45,11 @@ import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/sur import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; +import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {TaskService} from 'app/services/task/task.service'; import {ActivatedRouteStub} from 'testing/activated-route-stub'; -import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; describe('CreateSurveyComponent', () => { let component: CreateSurveyComponent; diff --git a/web/src/app/pages/create-survey/create-survey.component.ts b/web/src/app/pages/create-survey/create-survey.component.ts index 1741c8cb7..052c4789c 100644 --- a/web/src/app/pages/create-survey/create-survey.component.ts +++ b/web/src/app/pages/create-survey/create-survey.component.ts @@ -31,8 +31,8 @@ import {TaskDetailsComponent} from 'app/pages/create-survey/task-details/task-de import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {TaskService} from 'app/services/task/task.service'; @@ -173,8 +173,7 @@ export class CreateSurveyComponent implements OnInit { .pipe( filter( ([survey]) => - this.surveyId === SURVEY_ID_NEW || - survey.id === this.surveyId + this.surveyId === SURVEY_ID_NEW || survey.id === this.surveyId ) ) .subscribe(([survey, lois]) => { diff --git a/web/src/app/pages/edit-survey/edit-survey.component.ts b/web/src/app/pages/edit-survey/edit-survey.component.ts index ae456ceaf..0266c951e 100644 --- a/web/src/app/pages/edit-survey/edit-survey.component.ts +++ b/web/src/app/pages/edit-survey/edit-survey.component.ts @@ -24,11 +24,11 @@ import {Job} from 'app/models/job.model'; import {Survey} from 'app/models/survey.model'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import { - SURVEY_SEGMENT, SURVEYS_SHARE, + SURVEY_SEGMENT, } from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {environment} from 'environments/environment'; diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/pages/main-page-container/main-page/main-page.component.ts index 09cd1c340..3facbe06c 100644 --- a/web/src/app/pages/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/pages/main-page-container/main-page/main-page.component.ts @@ -21,8 +21,8 @@ import {Subscription} from 'rxjs'; import {Survey} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import {JOB_ID_NEW} from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {SubmissionService} from 'app/services/submission/submission.service'; import {SurveyService} from 'app/services/survey/survey.service'; import {environment} from 'environments/environment'; @@ -66,9 +66,7 @@ export class MainPageComponent implements OnInit { this.subscription.add( this.navigationService .getSurveyId$() - .subscribe( - id => id === JOB_ID_NEW && this.showTitleDialog() - ) + .subscribe(id => id === JOB_ID_NEW && this.showTitleDialog()) ); // Redirect to sign in page if user is not authenticated. this.subscription.add( diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index ad1b274b0..38503b8e9 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -85,7 +85,7 @@ export class LocationOfInterestPanelComponent implements OnInit, OnDestroy { return; } this.navigationService.showSubmissionDetail( - this.activeSurvey()?.id!, + this.activeSurvey()!.id, this.loi.id, submissionId ); diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts index 4453851aa..96f601263 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts @@ -68,8 +68,6 @@ export class SurveyHeaderComponent { console.error('No active survey'); return; } - return this.navigationService.isEditSurveyPage( - this.activeSurvey()?.id! - ); + return this.navigationService.isEditSurveyPage(this.activeSurvey()!.id); } } diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index c9a209451..f421073b5 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -27,8 +27,6 @@ import {MainPageContainerComponent} from 'app/pages/main-page-container/main-pag import {MainPageContainerModule} from 'app/pages/main-page-container/main-page-container.module'; import {AuthGuard} from 'app/services/auth/auth.guard'; import {passlistGuard} from 'app/services/auth/passlist.guard'; -import {NavigationService} from 'app/services/navigation/navigation.service'; - import { ABOUT, ANDROID_SEGMENT, @@ -38,15 +36,16 @@ import { SIGN_IN_SEGMENT, SUBMISSION_ID, SUBMISSION_SEGMENT, - SURVEY_ID, - SURVEY_SEGMENT, SURVEYS_CREATE, SURVEYS_EDIT, SURVEYS_SEGMENT, + SURVEY_ID, + SURVEY_SEGMENT, TASK_ID, TASK_SEGMENT, TERMS, } from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {ShareSurveyComponent} from './components/share-survey/share-survey.component'; import {AboutComponent} from './pages/about/about.component'; diff --git a/web/src/app/services/auth/auth.guard.ts b/web/src/app/services/auth/auth.guard.ts index ea532ce83..e6efed373 100644 --- a/web/src/app/services/auth/auth.guard.ts +++ b/web/src/app/services/auth/auth.guard.ts @@ -20,11 +20,11 @@ import {catchError, map} from 'rxjs/operators'; import {User} from 'app/models/user.model'; import {AuthService} from 'app/services/auth/auth.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import { SIGN_IN_SEGMENT, TERMS, } from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; import {environment} from 'environments/environment'; @Injectable({ diff --git a/web/src/app/services/navigation/navigation.service.ts b/web/src/app/services/navigation/navigation.service.ts index 272feb798..16081e9ba 100644 --- a/web/src/app/services/navigation/navigation.service.ts +++ b/web/src/app/services/navigation/navigation.service.ts @@ -33,8 +33,6 @@ import { import {BehaviorSubject, Observable, Subscription} from 'rxjs'; import {filter} from 'rxjs/operators'; -import {UrlParams} from './url-params'; -import {DataStoreService} from '../data-store/data-store.service'; import { ABOUT, ANDROID_SEGMENT, @@ -47,20 +45,22 @@ import { SUBMISSION_ID, SUBMISSION_ID_NEW, SUBMISSION_SEGMENT, - SURVEY_ID, - SURVEY_ID_NEW, - SURVEY_SEGMENT, SURVEYS_CREATE, SURVEYS_EDIT, SURVEYS_SEGMENT, SURVEYS_SHARE, + SURVEY_ID, + SURVEY_ID_NEW, + SURVEY_SEGMENT, + SideNavMode, TASK_ID, TASK_SEGMENT, TERMS, } from './navigation.constants'; -import {SideNavMode} from './navigation.constants'; +import {UrlParams} from './url-params'; +import {DataStoreService} from '../data-store/data-store.service'; -export {SideNavMode} from './navigation.constants'; +export {SideNavMode} from './navigation.constants'; /** * Exposes application state in the URL as streams to other services @@ -70,7 +70,6 @@ export {SideNavMode} from './navigation.constants'; providedIn: 'root', }) export class NavigationService implements OnDestroy { - private sidePanelExpanded = true; private urlSignal = signal(''); @@ -376,7 +375,3 @@ export class NavigationService implements OnDestroy { this.subscription.unsubscribe(); } } - - - - diff --git a/web/src/app/services/survey/survey.service.ts b/web/src/app/services/survey/survey.service.ts index f9847d4cd..307b680f7 100644 --- a/web/src/app/services/survey/survey.service.ts +++ b/web/src/app/services/survey/survey.service.ts @@ -23,8 +23,8 @@ import {Role} from 'app/models/role.model'; import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; +import {NavigationService} from 'app/services/navigation/navigation.service'; @Injectable({ providedIn: 'root', From a069b748ce6d4fe61432efaa6c008a49b776e1d4 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 16:01:30 -0500 Subject: [PATCH 23/34] Reorganize components --- web/src/app/app.module.ts | 2 +- .../about/about.component.html | 0 .../about/about.component.scss | 0 .../about/about.component.ts | 0 .../about/about.module.ts | 4 +- ...android-intent-landing-page.component.html | 0 ...android-intent-landing-page.component.scss | 0 .../android-intent-landing-page.component.ts | 0 .../android-intent-landing-page.module.ts | 0 .../_create-survey.component-theme.scss | 0 .../create-survey.component.html | 0 .../create-survey.component.scss | 0 .../create-survey.component.spec.ts | 10 +-- .../create-survey/create-survey.component.ts | 8 +-- .../create-survey/create-survey.module.ts | 12 ++-- .../data-sharing-terms.component.html | 0 .../data-sharing-terms.component.scss | 0 .../data-sharing-terms.component.spec.ts | 2 +- .../data-sharing-terms.component.ts | 0 .../data-sharing-terms.module.ts | 2 +- .../job-details/job-details.component.html | 0 .../job-details/job-details.component.scss | 0 .../job-details/job-details.component.spec.ts | 2 +- .../job-details/job-details.component.ts | 0 .../job-details/job-details.module.ts | 2 +- .../step-card/_step-card.component-theme.scss | 0 .../step-card/step-card.component.html | 0 .../step-card/step-card.component.scss | 0 .../step-card/step-card.component.spec.ts | 0 .../step-card/step-card.component.ts | 0 .../step-card/step-card.module.ts | 2 +- .../survey-details.component.html | 0 .../survey-details.component.scss | 0 .../survey-details.component.spec.ts | 2 +- .../survey-details.component.ts | 0 .../survey-details/survey-details.module.ts | 2 +- .../survey-loi/survey-loi.component.html | 0 .../survey-loi/survey-loi.component.scss | 0 .../survey-loi/survey-loi.component.spec.ts | 2 +- .../survey-loi/survey-loi.component.ts | 0 .../survey-loi/survey-loi.module.ts | 2 +- .../task-details/task-details.component.html | 0 .../task-details.component.spec.ts | 0 .../task-details/task-details.component.ts | 2 +- .../task-details/task-details.module.ts | 2 +- .../_edit-survey.component-theme.scss | 0 .../edit-details/edit-details.component.html | 0 .../edit-details/edit-details.component.scss | 0 .../edit-details.component.spec.ts | 2 +- .../edit-details/edit-details.component.ts | 2 +- .../edit-details/edit-details.module.ts | 4 +- .../edit-job/_edit-job.component-theme.scss | 0 .../edit-job/edit-job.component.html | 0 .../edit-job/edit-job.component.scss | 0 .../edit-job/edit-job.component.spec.ts | 6 +- .../edit-job/edit-job.component.ts | 4 +- .../edit-survey/edit-job/edit-job.module.ts | 6 +- .../edit-survey/edit-survey.component.html | 0 .../edit-survey/edit-survey.component.scss | 0 .../edit-survey/edit-survey.component.spec.ts | 2 +- .../edit-survey/edit-survey.component.ts | 0 .../edit-survey/edit-survey.module.ts | 4 +- .../job-dialog/job-dialog.component.html | 0 .../job-dialog/job-dialog.component.scss | 0 .../job-dialog/job-dialog.component.spec.ts | 0 .../job-dialog/job-dialog.component.ts | 0 .../job-dialog/job-dialog.module.ts | 2 +- .../survey-json/survey-json.component.html | 0 .../survey-json/survey-json.component.scss | 0 .../survey-json/survey-json.component.ts | 0 .../survey-json/survey-json.module.ts | 0 .../error/error.component.html | 0 .../error/error.component.scss | 0 .../error/error.component.ts | 0 .../error/error.module.ts | 4 +- .../main-page-container.component.css | 0 .../main-page-container.component.html | 0 .../main-page-container.component.spec.ts | 0 .../main-page-container.component.ts | 0 .../main-page-container.module.ts | 0 .../_drawing-tools.component-theme.scss | 0 .../drawing-tools.component.html | 0 .../drawing-tools.component.scss | 0 .../drawing-tools.component.spec.ts | 0 .../drawing-tools/drawing-tools.component.ts | 0 .../drawing-tools/drawing-tools.module.ts | 0 .../_job-dialog.component-theme.scss | 0 .../color-picker/color-picker.component.html | 0 .../color-picker/color-picker.component.scss | 0 .../color-picker.component.spec.ts | 0 .../color-picker/color-picker.component.ts | 0 .../color-picker/color-picker.module.ts | 0 .../edit-style-button.component.html | 0 .../edit-style-button.component.spec.ts | 0 .../edit-style-button.component.ts | 0 .../edit-style-button.module.ts | 0 .../job-dialog/job-dialog.component.html | 0 .../job-dialog/job-dialog.component.scss | 0 .../job-dialog/job-dialog.component.spec.ts | 2 +- .../job-dialog/job-dialog.component.ts | 0 .../main-page/job-dialog/job-dialog.module.ts | 2 +- .../_task-editor.component-theme.scss | 0 .../option-editor.component.html | 0 .../option-editor.component.scss | 0 .../option-editor.component.spec.ts | 0 .../option-editor/option-editor.component.ts | 0 .../option-editor/option-editor.module.ts | 0 .../task-editor/task-editor.component.html | 0 .../task-editor/task-editor.component.scss | 0 .../task-editor/task-editor.component.spec.ts | 0 .../task-editor/task-editor.component.ts | 0 .../task-editor/task-editor.module.ts | 0 .../main-page/main-page.component.html | 0 .../main-page/main-page.component.scss | 0 .../main-page/main-page.component.spec.ts | 0 .../main-page/main-page.component.ts | 0 .../main-page/main-page.module.ts | 0 .../main-page/map/_map.component-theme.scss | 0 .../main-page/map/map.component.html | 0 .../main-page/map/map.component.scss | 0 .../main-page/map/map.component.spec.ts | 0 .../main-page/map/map.component.ts | 0 .../main-page/map/map.module.ts | 0 ..._secondary-side-panel.component-theme.scss | 0 .../loi-panel/loi-panel.component.html | 0 .../loi-panel/loi-panel.component.scss | 0 .../loi-panel/loi-panel.component.spec.ts | 0 .../loi-panel/loi-panel.component.ts | 2 +- .../loi-panel/loi-panel.module.ts | 0 .../secondary-side-panel.component.css | 0 .../secondary-side-panel.component.html | 0 .../secondary-side-panel.component.spec.ts | 0 .../secondary-side-panel.component.ts | 0 .../secondary-side-panel.module.ts | 0 .../submission-panel.component.html | 0 .../submission-panel.component.scss | 0 .../submission-panel.component.spec.ts | 0 .../submission-panel.component.ts | 0 .../submission-panel.module.ts | 0 .../job-list/job-list.component.html | 0 .../job-list/job-list.component.scss | 0 .../job-list/job-list.component.spec.ts | 0 .../side-panel/job-list/job-list.component.ts | 0 .../side-panel/job-list/job-list.module.ts | 2 +- .../side-panel/side-panel.component.css | 0 .../side-panel/side-panel.component.html | 0 .../side-panel/side-panel.component.ts | 0 .../main-page/side-panel/side-panel.module.ts | 0 .../_submission-form.component-theme.scss | 0 .../submission-form.component.html | 0 .../submission-form.component.scss | 0 .../submission-form.component.spec.ts | 2 +- .../submission-form.component.ts | 2 +- .../submission-form/submission-form.module.ts | 2 +- .../_survey-header.component-theme.scss | 0 .../survey-header.component.html | 0 .../survey-header.component.scss | 0 .../survey-header.component.spec.ts | 0 .../survey-header/survey-header.component.ts | 2 +- .../survey-header/survey-header.module.ts | 4 +- .../_title-dialog.component-theme.scss | 0 .../title-dialog/title-dialog.component.html | 0 .../title-dialog/title-dialog.component.scss | 0 .../title-dialog.component.spec.ts | 0 .../title-dialog/title-dialog.component.ts | 0 .../title-dialog/title-dialog.module.ts | 0 .../copy-survey-controls.component.html | 0 .../copy-survey-controls.component.scss | 0 .../copy-survey-controls.component.spec.ts | 0 .../copy-survey-controls.component.ts | 0 .../copy-survey-controls.module.ts | 0 .../data-visibility-control.component.html | 0 .../data-visibility-control.component.ts | 0 .../data-visibility-control.module.ts | 0 ...eneral-access-control.component-theme.scss | 0 .../general-access-control.component.html | 0 .../general-access-control.component.scss | 0 .../general-access-control.component.ts | 0 .../general-access-control.module.ts | 0 .../header/_header.component-theme.scss | 0 .../_account-popup.component-theme.scss | 0 .../account-popup.component.html | 0 .../account-popup.component.scss | 0 .../account-popup.component.spec.ts | 2 +- .../account-popup/account-popup.component.ts | 0 .../account-popup/account-popup.module.ts | 4 +- .../current-user-widget.component.html | 0 .../current-user-widget.component.scss | 0 .../current-user-widget.component.spec.ts | 2 +- .../current-user-widget.component.ts | 2 +- .../current-user-widget.module.ts | 4 +- .../{ => shared}/header/header.component.html | 0 .../{ => shared}/header/header.component.scss | 0 .../header/header.component.spec.ts | 0 .../{ => shared}/header/header.component.ts | 2 +- .../{ => shared}/header/header.module.ts | 0 .../_import-dialog.component-theme.scss | 0 .../import-dialog.component.html | 0 .../import-dialog.component.scss | 0 .../import-dialog.component.spec.ts | 2 +- .../import-dialog/import-dialog.component.ts | 0 .../import-dialog/import-dialog.module.ts | 0 .../_inline-editor.component-theme.scss | 0 .../inline-editor.component.html | 0 .../inline-editor.component.scss | 0 .../inline-editor/inline-editor.component.ts | 0 .../inline-editor/inline-editor.module.ts | 0 .../_job-list-item.component-theme.scss | 0 .../job-list-item.component.html | 0 .../job-list-item.component.scss | 0 .../job-list-item.component.spec.ts | 0 .../job-list-item/job-list-item.component.ts | 0 .../job-list-item/job-list-item.module.ts | 0 .../job-list-item/tree-data-source.ts | 0 .../_loi-editor.component-theme.scss | 0 .../loi-editor/loi-editor.component.html | 0 .../loi-editor/loi-editor.component.scss | 0 .../loi-editor/loi-editor.component.spec.ts | 2 +- .../loi-editor/loi-editor.component.ts | 2 +- .../loi-editor/loi-editor.module.ts | 0 ...loi-properties-dialog.component-theme.scss | 0 .../loi-properties-dialog.component.html | 0 .../loi-properties-dialog.component.scss | 0 .../loi-properties-dialog.component.ts | 0 .../loi-properties-dialog.module.ts | 0 .../_loi-selection.component-theme.scss | 0 .../loi-selection.component.html | 0 .../loi-selection.component.scss | 0 .../loi-selection.component.spec.ts | 0 .../loi-selection/loi-selection.component.ts | 0 .../loi-selection/loi-selection.module.ts | 2 +- .../_share-dialog.component-theme.scss | 0 .../share-dialog/share-dialog.component.html | 0 .../share-dialog/share-dialog.component.scss | 0 .../share-dialog.component.spec.ts | 0 .../share-dialog/share-dialog.component.ts | 0 .../share-dialog/share-dialog.module.ts | 0 .../_share-list.component-theme.scss | 0 .../share-list/share-list.component.html | 0 .../share-list/share-list.component.scss | 0 .../share-list/share-list.component.spec.ts | 0 .../share-list/share-list.component.ts | 0 .../share-list/share-list.module.ts | 0 .../_share-survey.component-theme.scss | 0 .../share-survey/share-survey.component.html | 0 .../share-survey/share-survey.component.scss | 0 .../share-survey.component.spec.ts | 0 .../share-survey/share-survey.component.ts | 2 +- .../share-survey/share-survey.module.ts | 4 +- .../_sign-in-page.component-theme.scss | 0 .../sign-in-page/sign-in-page.component.html | 0 .../sign-in-page/sign-in-page.component.scss | 0 .../sign-in-page.component.spec.ts | 0 .../sign-in-page/sign-in-page.component.ts | 0 .../sign-in-page/sign-in-page.module.ts | 2 +- .../_survey-list.component-theme.scss | 0 .../survey-list/survey-list.component.html | 0 .../survey-list/survey-list.component.scss | 0 .../survey-list/survey-list.component.spec.ts | 2 +- .../survey-list/survey-list.component.ts | 2 +- .../survey-list/survey-list.module.ts | 2 +- .../_tasks-editor.component-theme.scss | 0 .../add-task-button.component.html | 0 .../add-task-button.component.scss | 0 .../add-task-button.component.spec.ts | 0 .../add-task-button.component.ts | 0 .../add-task-button/add-task-button.module.ts | 0 .../_task-condition-form-theme.scss | 0 .../task-condition-form.component.html | 0 .../task-condition-form.component.scss | 0 .../task-condition-form.component.ts | 0 .../task-condition-form.module.ts | 0 .../_edit-option.component-theme.scss | 0 .../edit-option/edit-option.component.html | 0 .../edit-option/edit-option.component.scss | 0 .../edit-option/edit-option.component.spec.ts | 0 .../edit-option/edit-option.component.ts | 0 .../edit-option/edit-option.module.ts | 0 .../task-form/task-form.component.html | 0 .../task-form/task-form.component.scss | 0 .../task-form/task-form.component.ts | 2 +- .../task-form/task-form.module.ts | 0 .../tasks-editor/tasks-editor.component.html | 0 .../tasks-editor/tasks-editor.component.scss | 0 .../tasks-editor/tasks-editor.component.ts | 0 .../tasks-editor/tasks-editor.module.ts | 0 .../_user-avatar.component-theme.scss | 0 .../user-avatar/user-avatar.component.html | 0 .../user-avatar/user-avatar.component.scss | 0 .../user-avatar/user-avatar.component.spec.ts | 0 .../user-avatar/user-avatar.component.ts | 0 .../user-avatar/user-avatar.module.ts | 0 .../terms/_terms.component-theme.scss | 0 .../terms/terms.component.html | 0 .../terms/terms.component.scss | 0 .../terms/terms.component.ts | 0 .../terms/terms.module.ts | 4 +- web/src/app/routing.module.ts | 38 ++++++------ web/src/ground-theme.scss | 62 +++++++++---------- 299 files changed, 129 insertions(+), 129 deletions(-) rename web/src/app/{pages => components}/about/about.component.html (100%) rename web/src/app/{pages => components}/about/about.component.scss (100%) rename web/src/app/{pages => components}/about/about.component.ts (100%) rename web/src/app/{pages => components}/about/about.module.ts (87%) rename web/src/app/{pages => components}/android-intent-landing-page/android-intent-landing-page.component.html (100%) rename web/src/app/{pages => components}/android-intent-landing-page/android-intent-landing-page.component.scss (100%) rename web/src/app/{pages => components}/android-intent-landing-page/android-intent-landing-page.component.ts (100%) rename web/src/app/{pages => components}/android-intent-landing-page/android-intent-landing-page.module.ts (100%) rename web/src/app/{pages => components}/create-survey/_create-survey.component-theme.scss (100%) rename web/src/app/{pages => components}/create-survey/create-survey.component.html (100%) rename web/src/app/{pages => components}/create-survey/create-survey.component.scss (100%) rename web/src/app/{pages => components}/create-survey/create-survey.component.spec.ts (97%) rename web/src/app/{pages => components}/create-survey/create-survey.component.ts (96%) rename web/src/app/{pages => components}/create-survey/create-survey.module.ts (74%) rename web/src/app/{pages => components}/create-survey/data-sharing-terms/data-sharing-terms.component.html (100%) rename web/src/app/{pages => components}/create-survey/data-sharing-terms/data-sharing-terms.component.scss (100%) rename web/src/app/{pages => components}/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts (95%) rename web/src/app/{pages => components}/create-survey/data-sharing-terms/data-sharing-terms.component.ts (100%) rename web/src/app/{pages => components}/create-survey/data-sharing-terms/data-sharing-terms.module.ts (91%) rename web/src/app/{pages => components}/create-survey/job-details/job-details.component.html (100%) rename web/src/app/{pages => components}/create-survey/job-details/job-details.component.scss (100%) rename web/src/app/{pages => components}/create-survey/job-details/job-details.component.spec.ts (93%) rename web/src/app/{pages => components}/create-survey/job-details/job-details.component.ts (100%) rename web/src/app/{pages => components}/create-survey/job-details/job-details.module.ts (91%) rename web/src/app/{pages => components}/create-survey/step-card/_step-card.component-theme.scss (100%) rename web/src/app/{pages => components}/create-survey/step-card/step-card.component.html (100%) rename web/src/app/{pages => components}/create-survey/step-card/step-card.component.scss (100%) rename web/src/app/{pages => components}/create-survey/step-card/step-card.component.spec.ts (100%) rename web/src/app/{pages => components}/create-survey/step-card/step-card.component.ts (100%) rename web/src/app/{pages => components}/create-survey/step-card/step-card.module.ts (89%) rename web/src/app/{pages => components}/create-survey/survey-details/survey-details.component.html (100%) rename web/src/app/{pages => components}/create-survey/survey-details/survey-details.component.scss (100%) rename web/src/app/{pages => components}/create-survey/survey-details/survey-details.component.spec.ts (95%) rename web/src/app/{pages => components}/create-survey/survey-details/survey-details.component.ts (100%) rename web/src/app/{pages => components}/create-survey/survey-details/survey-details.module.ts (91%) rename web/src/app/{pages => components}/create-survey/survey-loi/survey-loi.component.html (100%) rename web/src/app/{pages => components}/create-survey/survey-loi/survey-loi.component.scss (100%) rename web/src/app/{pages => components}/create-survey/survey-loi/survey-loi.component.spec.ts (97%) rename web/src/app/{pages => components}/create-survey/survey-loi/survey-loi.component.ts (100%) rename web/src/app/{pages => components}/create-survey/survey-loi/survey-loi.module.ts (91%) rename web/src/app/{pages => components}/create-survey/task-details/task-details.component.html (100%) rename web/src/app/{pages => components}/create-survey/task-details/task-details.component.spec.ts (100%) rename web/src/app/{pages => components}/create-survey/task-details/task-details.component.ts (94%) rename web/src/app/{pages => components}/create-survey/task-details/task-details.module.ts (91%) rename web/src/app/{pages => components}/edit-survey/_edit-survey.component-theme.scss (100%) rename web/src/app/{pages => components}/edit-survey/edit-details/edit-details.component.html (100%) rename web/src/app/{pages => components}/edit-survey/edit-details/edit-details.component.scss (100%) rename web/src/app/{pages => components}/edit-survey/edit-details/edit-details.component.spec.ts (97%) rename web/src/app/{pages => components}/edit-survey/edit-details/edit-details.component.ts (97%) rename web/src/app/{pages => components}/edit-survey/edit-details/edit-details.module.ts (83%) rename web/src/app/{pages => components}/edit-survey/edit-job/_edit-job.component-theme.scss (100%) rename web/src/app/{pages => components}/edit-survey/edit-job/edit-job.component.html (100%) rename web/src/app/{pages => components}/edit-survey/edit-job/edit-job.component.scss (100%) rename web/src/app/{pages => components}/edit-survey/edit-job/edit-job.component.spec.ts (93%) rename web/src/app/{pages => components}/edit-survey/edit-job/edit-job.component.ts (95%) rename web/src/app/{pages => components}/edit-survey/edit-job/edit-job.module.ts (80%) rename web/src/app/{pages => components}/edit-survey/edit-survey.component.html (100%) rename web/src/app/{pages => components}/edit-survey/edit-survey.component.scss (100%) rename web/src/app/{pages => components}/edit-survey/edit-survey.component.spec.ts (99%) rename web/src/app/{pages => components}/edit-survey/edit-survey.component.ts (100%) rename web/src/app/{pages => components}/edit-survey/edit-survey.module.ts (89%) rename web/src/app/{pages => components}/edit-survey/job-dialog/job-dialog.component.html (100%) rename web/src/app/{pages => components}/edit-survey/job-dialog/job-dialog.component.scss (100%) rename web/src/app/{pages => components}/edit-survey/job-dialog/job-dialog.component.spec.ts (100%) rename web/src/app/{pages => components}/edit-survey/job-dialog/job-dialog.component.ts (100%) rename web/src/app/{pages => components}/edit-survey/job-dialog/job-dialog.module.ts (92%) rename web/src/app/{pages => components}/edit-survey/survey-json/survey-json.component.html (100%) rename web/src/app/{pages => components}/edit-survey/survey-json/survey-json.component.scss (100%) rename web/src/app/{pages => components}/edit-survey/survey-json/survey-json.component.ts (100%) rename web/src/app/{pages => components}/edit-survey/survey-json/survey-json.module.ts (100%) rename web/src/app/{pages => components}/error/error.component.html (100%) rename web/src/app/{pages => components}/error/error.component.scss (100%) rename web/src/app/{pages => components}/error/error.component.ts (100%) rename web/src/app/{pages => components}/error/error.module.ts (87%) rename web/src/app/{pages => components}/main-page-container/main-page-container.component.css (100%) rename web/src/app/{pages => components}/main-page-container/main-page-container.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page-container.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page-container.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page-container.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/drawing-tools.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/drawing-tools.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/drawing-tools.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/drawing-tools/drawing-tools.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/_job-dialog.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/job-dialog.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/job-dialog.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts (97%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/job-dialog.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/job-dialog.module.ts (94%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/task-editor.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/task-editor.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/main-page.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/main-page.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/main-page.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/main-page.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/main-page.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/_map.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/map.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/map.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/map.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/map.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/map/map.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts (96%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.css (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/job-list/job-list.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/job-list/job-list.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/job-list/job-list.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/job-list/job-list.module.ts (92%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/side-panel.component.css (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/side-panel.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/side-panel.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/side-panel.module.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/submission-form.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/submission-form.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts (98%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts (98%) rename web/src/app/{pages => components}/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts (94%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/_survey-header.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/survey-header.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/survey-header.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/survey-header.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/survey-header.component.ts (95%) rename web/src/app/{pages => components}/main-page-container/main-page/survey-header/survey-header.module.ts (87%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/_title-dialog.component-theme.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/title-dialog.component.html (100%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/title-dialog.component.scss (100%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/title-dialog.component.ts (100%) rename web/src/app/{pages => components}/main-page-container/main-page/title-dialog/title-dialog.module.ts (100%) rename web/src/app/components/{ => shared}/copy-survey-controls/copy-survey-controls.component.html (100%) rename web/src/app/components/{ => shared}/copy-survey-controls/copy-survey-controls.component.scss (100%) rename web/src/app/components/{ => shared}/copy-survey-controls/copy-survey-controls.component.spec.ts (100%) rename web/src/app/components/{ => shared}/copy-survey-controls/copy-survey-controls.component.ts (100%) rename web/src/app/components/{ => shared}/copy-survey-controls/copy-survey-controls.module.ts (100%) rename web/src/app/components/{ => shared}/data-visibility-control/data-visibility-control.component.html (100%) rename web/src/app/components/{ => shared}/data-visibility-control/data-visibility-control.component.ts (100%) rename web/src/app/components/{ => shared}/data-visibility-control/data-visibility-control.module.ts (100%) rename web/src/app/components/{ => shared}/general-access-control/_general-access-control.component-theme.scss (100%) rename web/src/app/components/{ => shared}/general-access-control/general-access-control.component.html (100%) rename web/src/app/components/{ => shared}/general-access-control/general-access-control.component.scss (100%) rename web/src/app/components/{ => shared}/general-access-control/general-access-control.component.ts (100%) rename web/src/app/components/{ => shared}/general-access-control/general-access-control.module.ts (100%) rename web/src/app/components/{ => shared}/header/_header.component-theme.scss (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/_account-popup.component-theme.scss (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/account-popup.component.html (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/account-popup.component.scss (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/account-popup.component.spec.ts (93%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/account-popup.component.ts (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/account-popup/account-popup.module.ts (82%) rename web/src/app/components/{ => shared}/header/current-user-widget/current-user-widget.component.html (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/current-user-widget.component.scss (100%) rename web/src/app/components/{ => shared}/header/current-user-widget/current-user-widget.component.spec.ts (92%) rename web/src/app/components/{ => shared}/header/current-user-widget/current-user-widget.component.ts (90%) rename web/src/app/components/{ => shared}/header/current-user-widget/current-user-widget.module.ts (81%) rename web/src/app/components/{ => shared}/header/header.component.html (100%) rename web/src/app/components/{ => shared}/header/header.component.scss (100%) rename web/src/app/components/{ => shared}/header/header.component.spec.ts (100%) rename web/src/app/components/{ => shared}/header/header.component.ts (98%) rename web/src/app/components/{ => shared}/header/header.module.ts (100%) rename web/src/app/components/{ => shared}/import-dialog/_import-dialog.component-theme.scss (100%) rename web/src/app/components/{ => shared}/import-dialog/import-dialog.component.html (100%) rename web/src/app/components/{ => shared}/import-dialog/import-dialog.component.scss (100%) rename web/src/app/components/{ => shared}/import-dialog/import-dialog.component.spec.ts (95%) rename web/src/app/components/{ => shared}/import-dialog/import-dialog.component.ts (100%) rename web/src/app/components/{ => shared}/import-dialog/import-dialog.module.ts (100%) rename web/src/app/components/{ => shared}/inline-editor/_inline-editor.component-theme.scss (100%) rename web/src/app/components/{ => shared}/inline-editor/inline-editor.component.html (100%) rename web/src/app/components/{ => shared}/inline-editor/inline-editor.component.scss (100%) rename web/src/app/components/{ => shared}/inline-editor/inline-editor.component.ts (100%) rename web/src/app/components/{ => shared}/inline-editor/inline-editor.module.ts (100%) rename web/src/app/components/{ => shared}/job-list-item/_job-list-item.component-theme.scss (100%) rename web/src/app/components/{ => shared}/job-list-item/job-list-item.component.html (100%) rename web/src/app/components/{ => shared}/job-list-item/job-list-item.component.scss (100%) rename web/src/app/components/{ => shared}/job-list-item/job-list-item.component.spec.ts (100%) rename web/src/app/components/{ => shared}/job-list-item/job-list-item.component.ts (100%) rename web/src/app/components/{ => shared}/job-list-item/job-list-item.module.ts (100%) rename web/src/app/components/{ => shared}/job-list-item/tree-data-source.ts (100%) rename web/src/app/components/{ => shared}/loi-editor/_loi-editor.component-theme.scss (100%) rename web/src/app/components/{ => shared}/loi-editor/loi-editor.component.html (100%) rename web/src/app/components/{ => shared}/loi-editor/loi-editor.component.scss (100%) rename web/src/app/components/{ => shared}/loi-editor/loi-editor.component.spec.ts (98%) rename web/src/app/components/{ => shared}/loi-editor/loi-editor.component.ts (97%) rename web/src/app/components/{ => shared}/loi-editor/loi-editor.module.ts (100%) rename web/src/app/components/{ => shared}/loi-properties-dialog/_loi-properties-dialog.component-theme.scss (100%) rename web/src/app/components/{ => shared}/loi-properties-dialog/loi-properties-dialog.component.html (100%) rename web/src/app/components/{ => shared}/loi-properties-dialog/loi-properties-dialog.component.scss (100%) rename web/src/app/components/{ => shared}/loi-properties-dialog/loi-properties-dialog.component.ts (100%) rename web/src/app/components/{ => shared}/loi-properties-dialog/loi-properties-dialog.module.ts (100%) rename web/src/app/components/{ => shared}/loi-selection/_loi-selection.component-theme.scss (100%) rename web/src/app/components/{ => shared}/loi-selection/loi-selection.component.html (100%) rename web/src/app/components/{ => shared}/loi-selection/loi-selection.component.scss (100%) rename web/src/app/components/{ => shared}/loi-selection/loi-selection.component.spec.ts (100%) rename web/src/app/components/{ => shared}/loi-selection/loi-selection.component.ts (100%) rename web/src/app/components/{ => shared}/loi-selection/loi-selection.module.ts (93%) rename web/src/app/components/{ => shared}/share-dialog/_share-dialog.component-theme.scss (100%) rename web/src/app/components/{ => shared}/share-dialog/share-dialog.component.html (100%) rename web/src/app/components/{ => shared}/share-dialog/share-dialog.component.scss (100%) rename web/src/app/components/{ => shared}/share-dialog/share-dialog.component.spec.ts (100%) rename web/src/app/components/{ => shared}/share-dialog/share-dialog.component.ts (100%) rename web/src/app/components/{ => shared}/share-dialog/share-dialog.module.ts (100%) rename web/src/app/components/{ => shared}/share-list/_share-list.component-theme.scss (100%) rename web/src/app/components/{ => shared}/share-list/share-list.component.html (100%) rename web/src/app/components/{ => shared}/share-list/share-list.component.scss (100%) rename web/src/app/components/{ => shared}/share-list/share-list.component.spec.ts (100%) rename web/src/app/components/{ => shared}/share-list/share-list.component.ts (100%) rename web/src/app/components/{ => shared}/share-list/share-list.module.ts (100%) rename web/src/app/components/{ => shared}/share-survey/_share-survey.component-theme.scss (100%) rename web/src/app/components/{ => shared}/share-survey/share-survey.component.html (100%) rename web/src/app/components/{ => shared}/share-survey/share-survey.component.scss (100%) rename web/src/app/components/{ => shared}/share-survey/share-survey.component.spec.ts (100%) rename web/src/app/components/{ => shared}/share-survey/share-survey.component.ts (82%) rename web/src/app/components/{ => shared}/share-survey/share-survey.module.ts (90%) rename web/src/app/components/{ => shared}/sign-in-page/_sign-in-page.component-theme.scss (100%) rename web/src/app/components/{ => shared}/sign-in-page/sign-in-page.component.html (100%) rename web/src/app/components/{ => shared}/sign-in-page/sign-in-page.component.scss (100%) rename web/src/app/components/{ => shared}/sign-in-page/sign-in-page.component.spec.ts (100%) rename web/src/app/components/{ => shared}/sign-in-page/sign-in-page.component.ts (100%) rename web/src/app/components/{ => shared}/sign-in-page/sign-in-page.module.ts (94%) rename web/src/app/components/{ => shared}/survey-list/_survey-list.component-theme.scss (100%) rename web/src/app/components/{ => shared}/survey-list/survey-list.component.html (100%) rename web/src/app/components/{ => shared}/survey-list/survey-list.component.scss (100%) rename web/src/app/components/{ => shared}/survey-list/survey-list.component.spec.ts (99%) rename web/src/app/components/{ => shared}/survey-list/survey-list.component.ts (98%) rename web/src/app/components/{ => shared}/survey-list/survey-list.module.ts (95%) rename web/src/app/components/{ => shared}/tasks-editor/_tasks-editor.component-theme.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/add-task-button/add-task-button.component.html (100%) rename web/src/app/components/{ => shared}/tasks-editor/add-task-button/add-task-button.component.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/add-task-button/add-task-button.component.spec.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/add-task-button/add-task-button.component.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/add-task-button/add-task-button.module.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-condition-form/_task-condition-form-theme.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-condition-form/task-condition-form.component.html (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-condition-form/task-condition-form.component.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-condition-form/task-condition-form.component.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-condition-form/task-condition-form.module.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/_edit-option.component-theme.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/edit-option.component.html (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/edit-option.component.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/edit-option.component.spec.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/edit-option.component.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/edit-option/edit-option.module.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/task-form.component.html (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/task-form.component.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/task-form.component.ts (99%) rename web/src/app/components/{ => shared}/tasks-editor/task-form/task-form.module.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/tasks-editor.component.html (100%) rename web/src/app/components/{ => shared}/tasks-editor/tasks-editor.component.scss (100%) rename web/src/app/components/{ => shared}/tasks-editor/tasks-editor.component.ts (100%) rename web/src/app/components/{ => shared}/tasks-editor/tasks-editor.module.ts (100%) rename web/src/app/components/{ => shared}/user-avatar/_user-avatar.component-theme.scss (100%) rename web/src/app/components/{ => shared}/user-avatar/user-avatar.component.html (100%) rename web/src/app/components/{ => shared}/user-avatar/user-avatar.component.scss (100%) rename web/src/app/components/{ => shared}/user-avatar/user-avatar.component.spec.ts (100%) rename web/src/app/components/{ => shared}/user-avatar/user-avatar.component.ts (100%) rename web/src/app/components/{ => shared}/user-avatar/user-avatar.module.ts (100%) rename web/src/app/{pages => components}/terms/_terms.component-theme.scss (100%) rename web/src/app/{pages => components}/terms/terms.component.html (100%) rename web/src/app/{pages => components}/terms/terms.component.scss (100%) rename web/src/app/{pages => components}/terms/terms.component.ts (100%) rename web/src/app/{pages => components}/terms/terms.module.ts (89%) diff --git a/web/src/app/app.module.ts b/web/src/app/app.module.ts index 55f877b5b..a5801a107 100644 --- a/web/src/app/app.module.ts +++ b/web/src/app/app.module.ts @@ -41,7 +41,7 @@ import {GoogleAuthProvider} from 'firebase/auth'; import {FirebaseUIModule, firebaseui} from 'firebaseui-angular'; import {AppComponent} from 'app/app.component'; -import {MainPageContainerModule} from 'app/pages/main-page-container/main-page-container.module'; +import {MainPageContainerModule} from 'app/components/main-page-container/main-page-container.module'; import {AppRoutingModule} from 'app/routing.module'; import {environment} from 'environments/environment'; diff --git a/web/src/app/pages/about/about.component.html b/web/src/app/components/about/about.component.html similarity index 100% rename from web/src/app/pages/about/about.component.html rename to web/src/app/components/about/about.component.html diff --git a/web/src/app/pages/about/about.component.scss b/web/src/app/components/about/about.component.scss similarity index 100% rename from web/src/app/pages/about/about.component.scss rename to web/src/app/components/about/about.component.scss diff --git a/web/src/app/pages/about/about.component.ts b/web/src/app/components/about/about.component.ts similarity index 100% rename from web/src/app/pages/about/about.component.ts rename to web/src/app/components/about/about.component.ts diff --git a/web/src/app/pages/about/about.module.ts b/web/src/app/components/about/about.module.ts similarity index 87% rename from web/src/app/pages/about/about.module.ts rename to web/src/app/components/about/about.module.ts index c7384e3e5..57275b577 100644 --- a/web/src/app/pages/about/about.module.ts +++ b/web/src/app/components/about/about.module.ts @@ -20,8 +20,8 @@ import {MatButton} from '@angular/material/button'; import {MatIcon} from '@angular/material/icon'; import {RouterModule} from '@angular/router'; -import {HeaderModule} from 'app/components/header/header.module'; -import {AboutComponent} from 'app/pages/about/about.component'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {AboutComponent} from 'app/components/about/about.component'; @NgModule({ declarations: [AboutComponent], diff --git a/web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.html b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.html similarity index 100% rename from web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.html rename to web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.html diff --git a/web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.scss b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.scss similarity index 100% rename from web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.scss rename to web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.scss diff --git a/web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.ts b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts similarity index 100% rename from web/src/app/pages/android-intent-landing-page/android-intent-landing-page.component.ts rename to web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts diff --git a/web/src/app/pages/android-intent-landing-page/android-intent-landing-page.module.ts b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts similarity index 100% rename from web/src/app/pages/android-intent-landing-page/android-intent-landing-page.module.ts rename to web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts diff --git a/web/src/app/pages/create-survey/_create-survey.component-theme.scss b/web/src/app/components/create-survey/_create-survey.component-theme.scss similarity index 100% rename from web/src/app/pages/create-survey/_create-survey.component-theme.scss rename to web/src/app/components/create-survey/_create-survey.component-theme.scss diff --git a/web/src/app/pages/create-survey/create-survey.component.html b/web/src/app/components/create-survey/create-survey.component.html similarity index 100% rename from web/src/app/pages/create-survey/create-survey.component.html rename to web/src/app/components/create-survey/create-survey.component.html diff --git a/web/src/app/pages/create-survey/create-survey.component.scss b/web/src/app/components/create-survey/create-survey.component.scss similarity index 100% rename from web/src/app/pages/create-survey/create-survey.component.scss rename to web/src/app/components/create-survey/create-survey.component.scss diff --git a/web/src/app/pages/create-survey/create-survey.component.spec.ts b/web/src/app/components/create-survey/create-survey.component.spec.ts similarity index 97% rename from web/src/app/pages/create-survey/create-survey.component.spec.ts rename to web/src/app/components/create-survey/create-survey.component.spec.ts index 87ca040b5..062400b35 100644 --- a/web/src/app/pages/create-survey/create-survey.component.spec.ts +++ b/web/src/app/components/create-survey/create-survey.component.spec.ts @@ -30,7 +30,7 @@ import {ActivatedRoute} from '@angular/router'; import {List, Map} from 'immutable'; import {Observable, Subject} from 'rxjs'; -import {ShareSurveyComponent} from 'app/components/share-survey/share-survey.component'; +import {ShareSurveyComponent} from 'app/components/shared/share-survey/share-survey.component'; import {Job} from 'app/models/job.model'; import {LocationOfInterest} from 'app/models/loi.model'; import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; @@ -38,10 +38,10 @@ import {Task, TaskType} from 'app/models/task/task.model'; import { CreateSurveyComponent, CreateSurveyPhase, -} from 'app/pages/create-survey/create-survey.component'; -import {DataSharingTermsComponent} from 'app/pages/create-survey/data-sharing-terms/data-sharing-terms.component'; -import {JobDetailsComponent} from 'app/pages/create-survey/job-details/job-details.component'; -import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; +} from 'app/components/create-survey/create-survey.component'; +import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; +import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; diff --git a/web/src/app/pages/create-survey/create-survey.component.ts b/web/src/app/components/create-survey/create-survey.component.ts similarity index 96% rename from web/src/app/pages/create-survey/create-survey.component.ts rename to web/src/app/components/create-survey/create-survey.component.ts index 052c4789c..87517813d 100644 --- a/web/src/app/pages/create-survey/create-survey.component.ts +++ b/web/src/app/components/create-survey/create-survey.component.ts @@ -24,10 +24,10 @@ import {Subscription, combineLatest, filter} from 'rxjs'; import {DataCollectionStrategy, Job} from 'app/models/job.model'; import {LocationOfInterest} from 'app/models/loi.model'; import {Survey, SurveyState} from 'app/models/survey.model'; -import {DataSharingTermsComponent} from 'app/pages/create-survey/data-sharing-terms/data-sharing-terms.component'; -import {JobDetailsComponent} from 'app/pages/create-survey/job-details/job-details.component'; -import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; -import {TaskDetailsComponent} from 'app/pages/create-survey/task-details/task-details.component'; +import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; +import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; +import {TaskDetailsComponent} from 'app/components/create-survey/task-details/task-details.component'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; diff --git a/web/src/app/pages/create-survey/create-survey.module.ts b/web/src/app/components/create-survey/create-survey.module.ts similarity index 74% rename from web/src/app/pages/create-survey/create-survey.module.ts rename to web/src/app/components/create-survey/create-survey.module.ts index a85071364..5b88bd6a9 100644 --- a/web/src/app/pages/create-survey/create-survey.module.ts +++ b/web/src/app/components/create-survey/create-survey.module.ts @@ -21,12 +21,12 @@ import {MatInputModule} from '@angular/material/input'; import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {CopySurveyControlsModule} from 'app/components/copy-survey-controls/copy-survey-controls.module'; -import {HeaderModule} from 'app/components/header/header.module'; -import {ShareSurveyModule} from 'app/components/share-survey/share-survey.module'; -import {CreateSurveyComponent} from 'app/pages/create-survey/create-survey.component'; -import {DataSharingTermsModule} from 'app/pages/create-survey/data-sharing-terms/data-sharing-terms.module'; -import {TaskDetailsModule} from 'app/pages/create-survey/task-details/task-details.module'; +import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {ShareSurveyModule} from 'app/components/shared/share-survey/share-survey.module'; +import {CreateSurveyComponent} from 'app/components/create-survey/create-survey.component'; +import {DataSharingTermsModule} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.module'; +import {TaskDetailsModule} from 'app/components/create-survey/task-details/task-details.module'; import {JobDetailsModule} from './job-details/job-details.module'; import {StepCardModule} from './step-card/step-card.module'; diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.html b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.html similarity index 100% rename from web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.html rename to web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.html diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.scss b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.scss similarity index 100% rename from web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.scss rename to web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.scss diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts similarity index 95% rename from web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts rename to web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts index 53baddf19..00c91af04 100644 --- a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts @@ -25,7 +25,7 @@ import { DATA_SHARING_TYPE_DESCRIPTION, DataSharingType, } from 'app/models/survey.model'; -import {DataSharingTermsComponent} from 'app/pages/create-survey/data-sharing-terms/data-sharing-terms.component'; +import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; describe('DataSharingTermsComponent', () => { let component: DataSharingTermsComponent; diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts similarity index 100% rename from web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.component.ts rename to web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts diff --git a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.module.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts similarity index 91% rename from web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.module.ts rename to web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts index 005cbc2cb..7fe4e52fe 100644 --- a/web/src/app/pages/create-survey/data-sharing-terms/data-sharing-terms.module.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts @@ -23,7 +23,7 @@ import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; import {MatRadioModule} from '@angular/material/radio'; -import {DataSharingTermsComponent} from 'app/pages/create-survey/data-sharing-terms/data-sharing-terms.component'; +import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; @NgModule({ declarations: [DataSharingTermsComponent], diff --git a/web/src/app/pages/create-survey/job-details/job-details.component.html b/web/src/app/components/create-survey/job-details/job-details.component.html similarity index 100% rename from web/src/app/pages/create-survey/job-details/job-details.component.html rename to web/src/app/components/create-survey/job-details/job-details.component.html diff --git a/web/src/app/pages/create-survey/job-details/job-details.component.scss b/web/src/app/components/create-survey/job-details/job-details.component.scss similarity index 100% rename from web/src/app/pages/create-survey/job-details/job-details.component.scss rename to web/src/app/components/create-survey/job-details/job-details.component.scss diff --git a/web/src/app/pages/create-survey/job-details/job-details.component.spec.ts b/web/src/app/components/create-survey/job-details/job-details.component.spec.ts similarity index 93% rename from web/src/app/pages/create-survey/job-details/job-details.component.spec.ts rename to web/src/app/components/create-survey/job-details/job-details.component.spec.ts index b7512a17f..508e66a13 100644 --- a/web/src/app/pages/create-survey/job-details/job-details.component.spec.ts +++ b/web/src/app/components/create-survey/job-details/job-details.component.spec.ts @@ -16,7 +16,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {JobDetailsComponent} from 'app/pages/create-survey/job-details/job-details.component'; +import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; describe('JobDetailsComponent', () => { let component: JobDetailsComponent; diff --git a/web/src/app/pages/create-survey/job-details/job-details.component.ts b/web/src/app/components/create-survey/job-details/job-details.component.ts similarity index 100% rename from web/src/app/pages/create-survey/job-details/job-details.component.ts rename to web/src/app/components/create-survey/job-details/job-details.component.ts diff --git a/web/src/app/pages/create-survey/job-details/job-details.module.ts b/web/src/app/components/create-survey/job-details/job-details.module.ts similarity index 91% rename from web/src/app/pages/create-survey/job-details/job-details.module.ts rename to web/src/app/components/create-survey/job-details/job-details.module.ts index d09f078bd..15179e6d5 100644 --- a/web/src/app/pages/create-survey/job-details/job-details.module.ts +++ b/web/src/app/components/create-survey/job-details/job-details.module.ts @@ -20,7 +20,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {MatButtonModule} from '@angular/material/button'; import {MatInputModule} from '@angular/material/input'; -import {JobDetailsComponent} from 'app/pages/create-survey/job-details/job-details.component'; +import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; @NgModule({ declarations: [JobDetailsComponent], diff --git a/web/src/app/pages/create-survey/step-card/_step-card.component-theme.scss b/web/src/app/components/create-survey/step-card/_step-card.component-theme.scss similarity index 100% rename from web/src/app/pages/create-survey/step-card/_step-card.component-theme.scss rename to web/src/app/components/create-survey/step-card/_step-card.component-theme.scss diff --git a/web/src/app/pages/create-survey/step-card/step-card.component.html b/web/src/app/components/create-survey/step-card/step-card.component.html similarity index 100% rename from web/src/app/pages/create-survey/step-card/step-card.component.html rename to web/src/app/components/create-survey/step-card/step-card.component.html diff --git a/web/src/app/pages/create-survey/step-card/step-card.component.scss b/web/src/app/components/create-survey/step-card/step-card.component.scss similarity index 100% rename from web/src/app/pages/create-survey/step-card/step-card.component.scss rename to web/src/app/components/create-survey/step-card/step-card.component.scss diff --git a/web/src/app/pages/create-survey/step-card/step-card.component.spec.ts b/web/src/app/components/create-survey/step-card/step-card.component.spec.ts similarity index 100% rename from web/src/app/pages/create-survey/step-card/step-card.component.spec.ts rename to web/src/app/components/create-survey/step-card/step-card.component.spec.ts diff --git a/web/src/app/pages/create-survey/step-card/step-card.component.ts b/web/src/app/components/create-survey/step-card/step-card.component.ts similarity index 100% rename from web/src/app/pages/create-survey/step-card/step-card.component.ts rename to web/src/app/components/create-survey/step-card/step-card.component.ts diff --git a/web/src/app/pages/create-survey/step-card/step-card.module.ts b/web/src/app/components/create-survey/step-card/step-card.module.ts similarity index 89% rename from web/src/app/pages/create-survey/step-card/step-card.module.ts rename to web/src/app/components/create-survey/step-card/step-card.module.ts index 642926120..5d14867fe 100644 --- a/web/src/app/pages/create-survey/step-card/step-card.module.ts +++ b/web/src/app/components/create-survey/step-card/step-card.module.ts @@ -17,7 +17,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {StepCardComponent} from 'app/pages/create-survey/step-card/step-card.component'; +import {StepCardComponent} from 'app/components/create-survey/step-card/step-card.component'; @NgModule({ declarations: [StepCardComponent], diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.html b/web/src/app/components/create-survey/survey-details/survey-details.component.html similarity index 100% rename from web/src/app/pages/create-survey/survey-details/survey-details.component.html rename to web/src/app/components/create-survey/survey-details/survey-details.component.html diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.scss b/web/src/app/components/create-survey/survey-details/survey-details.component.scss similarity index 100% rename from web/src/app/pages/create-survey/survey-details/survey-details.component.scss rename to web/src/app/components/create-survey/survey-details/survey-details.component.scss diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts b/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts similarity index 95% rename from web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts rename to web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts index 37ee05b04..e336397b6 100644 --- a/web/src/app/pages/create-survey/survey-details/survey-details.component.spec.ts +++ b/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts @@ -21,7 +21,7 @@ import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; +import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; describe('SurveyDetailsComponent', () => { let component: SurveyDetailsComponent; diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.component.ts b/web/src/app/components/create-survey/survey-details/survey-details.component.ts similarity index 100% rename from web/src/app/pages/create-survey/survey-details/survey-details.component.ts rename to web/src/app/components/create-survey/survey-details/survey-details.component.ts diff --git a/web/src/app/pages/create-survey/survey-details/survey-details.module.ts b/web/src/app/components/create-survey/survey-details/survey-details.module.ts similarity index 91% rename from web/src/app/pages/create-survey/survey-details/survey-details.module.ts rename to web/src/app/components/create-survey/survey-details/survey-details.module.ts index b6344d7b2..8544f235f 100644 --- a/web/src/app/pages/create-survey/survey-details/survey-details.module.ts +++ b/web/src/app/components/create-survey/survey-details/survey-details.module.ts @@ -20,7 +20,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {MatButtonModule} from '@angular/material/button'; import {MatInputModule} from '@angular/material/input'; -import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; +import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; @NgModule({ declarations: [SurveyDetailsComponent], diff --git a/web/src/app/pages/create-survey/survey-loi/survey-loi.component.html b/web/src/app/components/create-survey/survey-loi/survey-loi.component.html similarity index 100% rename from web/src/app/pages/create-survey/survey-loi/survey-loi.component.html rename to web/src/app/components/create-survey/survey-loi/survey-loi.component.html diff --git a/web/src/app/pages/create-survey/survey-loi/survey-loi.component.scss b/web/src/app/components/create-survey/survey-loi/survey-loi.component.scss similarity index 100% rename from web/src/app/pages/create-survey/survey-loi/survey-loi.component.scss rename to web/src/app/components/create-survey/survey-loi/survey-loi.component.scss diff --git a/web/src/app/pages/create-survey/survey-loi/survey-loi.component.spec.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts similarity index 97% rename from web/src/app/pages/create-survey/survey-loi/survey-loi.component.spec.ts rename to web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts index 46d57c308..ae491661d 100644 --- a/web/src/app/pages/create-survey/survey-loi/survey-loi.component.spec.ts +++ b/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts @@ -28,7 +28,7 @@ import {MatDialog} from '@angular/material/dialog'; import {List, Map} from 'immutable'; import {BehaviorSubject, of} from 'rxjs'; -import {LoiSelectionModule} from 'app/components/loi-selection/loi-selection.module'; +import {LoiSelectionModule} from 'app/components/shared/loi-selection/loi-selection.module'; import {LocationOfInterest} from 'app/models/loi.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; diff --git a/web/src/app/pages/create-survey/survey-loi/survey-loi.component.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.component.ts similarity index 100% rename from web/src/app/pages/create-survey/survey-loi/survey-loi.component.ts rename to web/src/app/components/create-survey/survey-loi/survey-loi.component.ts diff --git a/web/src/app/pages/create-survey/survey-loi/survey-loi.module.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts similarity index 91% rename from web/src/app/pages/create-survey/survey-loi/survey-loi.module.ts rename to web/src/app/components/create-survey/survey-loi/survey-loi.module.ts index 8c24f40bb..b6b5e0adf 100644 --- a/web/src/app/pages/create-survey/survey-loi/survey-loi.module.ts +++ b/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts @@ -17,7 +17,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {LoiEditorModule} from 'app/components/loi-editor/loi-editor.module'; +import {LoiEditorModule} from 'app/components/shared/loi-editor/loi-editor.module'; import {SurveyLoiComponent} from './survey-loi.component'; diff --git a/web/src/app/pages/create-survey/task-details/task-details.component.html b/web/src/app/components/create-survey/task-details/task-details.component.html similarity index 100% rename from web/src/app/pages/create-survey/task-details/task-details.component.html rename to web/src/app/components/create-survey/task-details/task-details.component.html diff --git a/web/src/app/pages/create-survey/task-details/task-details.component.spec.ts b/web/src/app/components/create-survey/task-details/task-details.component.spec.ts similarity index 100% rename from web/src/app/pages/create-survey/task-details/task-details.component.spec.ts rename to web/src/app/components/create-survey/task-details/task-details.component.spec.ts diff --git a/web/src/app/pages/create-survey/task-details/task-details.component.ts b/web/src/app/components/create-survey/task-details/task-details.component.ts similarity index 94% rename from web/src/app/pages/create-survey/task-details/task-details.component.ts rename to web/src/app/components/create-survey/task-details/task-details.component.ts index 3f2b59924..b298d471f 100644 --- a/web/src/app/pages/create-survey/task-details/task-details.component.ts +++ b/web/src/app/components/create-survey/task-details/task-details.component.ts @@ -18,7 +18,7 @@ import {Component, EventEmitter, Output, ViewChild} from '@angular/core'; import {List} from 'immutable'; import {Subscription} from 'rxjs'; -import {TasksEditorComponent} from 'app/components/tasks-editor/tasks-editor.component'; +import {TasksEditorComponent} from 'app/components/shared/tasks-editor/tasks-editor.component'; import {Task} from 'app/models/task/task.model'; import {TaskService} from 'app/services/task/task.service'; diff --git a/web/src/app/pages/create-survey/task-details/task-details.module.ts b/web/src/app/components/create-survey/task-details/task-details.module.ts similarity index 91% rename from web/src/app/pages/create-survey/task-details/task-details.module.ts rename to web/src/app/components/create-survey/task-details/task-details.module.ts index 32cf40c6e..dff34ef37 100644 --- a/web/src/app/pages/create-survey/task-details/task-details.module.ts +++ b/web/src/app/components/create-survey/task-details/task-details.module.ts @@ -17,7 +17,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {TasksEditorModule} from 'app/components/tasks-editor/tasks-editor.module'; +import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; import {TaskDetailsComponent} from './task-details.component'; diff --git a/web/src/app/pages/edit-survey/_edit-survey.component-theme.scss b/web/src/app/components/edit-survey/_edit-survey.component-theme.scss similarity index 100% rename from web/src/app/pages/edit-survey/_edit-survey.component-theme.scss rename to web/src/app/components/edit-survey/_edit-survey.component-theme.scss diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.html b/web/src/app/components/edit-survey/edit-details/edit-details.component.html similarity index 100% rename from web/src/app/pages/edit-survey/edit-details/edit-details.component.html rename to web/src/app/components/edit-survey/edit-details/edit-details.component.html diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.scss b/web/src/app/components/edit-survey/edit-details/edit-details.component.scss similarity index 100% rename from web/src/app/pages/edit-survey/edit-details/edit-details.component.scss rename to web/src/app/components/edit-survey/edit-details/edit-details.component.scss diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts similarity index 97% rename from web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts rename to web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts index 85d99f4e2..d1977c647 100644 --- a/web/src/app/pages/edit-survey/edit-details/edit-details.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts @@ -36,7 +36,7 @@ import {of} from 'rxjs'; import {Job} from 'app/models/job.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditDetailsComponent} from 'app/pages/edit-survey/edit-details/edit-details.component'; +import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.component.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts similarity index 97% rename from web/src/app/pages/edit-survey/edit-details/edit-details.component.ts rename to web/src/app/components/edit-survey/edit-details/edit-details.component.ts index 1f435dc82..36521df68 100644 --- a/web/src/app/pages/edit-survey/edit-details/edit-details.component.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts @@ -19,7 +19,7 @@ import {MatDialog} from '@angular/material/dialog'; import {Subscription} from 'rxjs'; import {DATA_SHARING_TYPE_DESCRIPTION, Survey} from 'app/models/survey.model'; -import {SurveyDetailsComponent} from 'app/pages/create-survey/survey-details/survey-details.component'; +import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/pages/edit-survey/edit-details/edit-details.module.ts b/web/src/app/components/edit-survey/edit-details/edit-details.module.ts similarity index 83% rename from web/src/app/pages/edit-survey/edit-details/edit-details.module.ts rename to web/src/app/components/edit-survey/edit-details/edit-details.module.ts index e17f1fe75..bbbb6d01c 100644 --- a/web/src/app/pages/edit-survey/edit-details/edit-details.module.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.module.ts @@ -19,8 +19,8 @@ import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; import {MatCardModule} from '@angular/material/card'; -import {SurveyDetailsModule} from 'app/pages/create-survey/survey-details/survey-details.module'; -import {EditDetailsComponent} from 'app/pages/edit-survey/edit-details/edit-details.component'; +import {SurveyDetailsModule} from 'app/components/create-survey/survey-details/survey-details.module'; +import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; @NgModule({ declarations: [EditDetailsComponent], diff --git a/web/src/app/pages/edit-survey/edit-job/_edit-job.component-theme.scss b/web/src/app/components/edit-survey/edit-job/_edit-job.component-theme.scss similarity index 100% rename from web/src/app/pages/edit-survey/edit-job/_edit-job.component-theme.scss rename to web/src/app/components/edit-survey/edit-job/_edit-job.component-theme.scss diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.html b/web/src/app/components/edit-survey/edit-job/edit-job.component.html similarity index 100% rename from web/src/app/pages/edit-survey/edit-job/edit-job.component.html rename to web/src/app/components/edit-survey/edit-job/edit-job.component.html diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.scss b/web/src/app/components/edit-survey/edit-job/edit-job.component.scss similarity index 100% rename from web/src/app/pages/edit-survey/edit-job/edit-job.component.scss rename to web/src/app/components/edit-survey/edit-job/edit-job.component.scss diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts similarity index 93% rename from web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts rename to web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts index b96d31af8..dcbdc5f13 100644 --- a/web/src/app/pages/edit-survey/edit-job/edit-job.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts @@ -28,13 +28,13 @@ import {User} from 'firebase/auth'; import {List, Map} from 'immutable'; import {Subject, from, of} from 'rxjs'; -import {LoiEditorComponent} from 'app/components/loi-editor/loi-editor.component'; -import {TasksEditorModule} from 'app/components/tasks-editor/tasks-editor.module'; +import {LoiEditorComponent} from 'app/components/shared/loi-editor/loi-editor.component'; +import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; import {DataCollectionStrategy, Job} from 'app/models/job.model'; import {LocationOfInterest} from 'app/models/loi.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditJobComponent} from 'app/pages/edit-survey/edit-job/edit-job.component'; +import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {DialogService} from 'app/services/dialog/dialog.service'; diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.component.ts b/web/src/app/components/edit-survey/edit-job/edit-job.component.ts similarity index 95% rename from web/src/app/pages/edit-survey/edit-job/edit-job.component.ts rename to web/src/app/components/edit-survey/edit-job/edit-job.component.ts index 30cfc05c2..732570962 100644 --- a/web/src/app/pages/edit-survey/edit-job/edit-job.component.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.component.ts @@ -19,8 +19,8 @@ import {ActivatedRoute, Params} from '@angular/router'; import {List} from 'immutable'; import {Subscription} from 'rxjs'; -import {LoiEditorComponent} from 'app/components/loi-editor/loi-editor.component'; -import {TasksEditorComponent} from 'app/components/tasks-editor/tasks-editor.component'; +import {LoiEditorComponent} from 'app/components/shared/loi-editor/loi-editor.component'; +import {TasksEditorComponent} from 'app/components/shared/tasks-editor/tasks-editor.component'; import {DataCollectionStrategy, Job} from 'app/models/job.model'; import {LocationOfInterest} from 'app/models/loi.model'; import {Task} from 'app/models/task/task.model'; diff --git a/web/src/app/pages/edit-survey/edit-job/edit-job.module.ts b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts similarity index 80% rename from web/src/app/pages/edit-survey/edit-job/edit-job.module.ts rename to web/src/app/components/edit-survey/edit-job/edit-job.module.ts index 891b828a2..3ccd6dbf0 100644 --- a/web/src/app/pages/edit-survey/edit-job/edit-job.module.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts @@ -22,9 +22,9 @@ import { } from '@angular/material/button-toggle'; import {MatIconModule} from '@angular/material/icon'; -import {LoiEditorModule} from 'app/components/loi-editor/loi-editor.module'; -import {TasksEditorModule} from 'app/components/tasks-editor/tasks-editor.module'; -import {EditJobComponent} from 'app/pages/edit-survey/edit-job/edit-job.component'; +import {LoiEditorModule} from 'app/components/shared/loi-editor/loi-editor.module'; +import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; +import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; @NgModule({ declarations: [EditJobComponent], diff --git a/web/src/app/pages/edit-survey/edit-survey.component.html b/web/src/app/components/edit-survey/edit-survey.component.html similarity index 100% rename from web/src/app/pages/edit-survey/edit-survey.component.html rename to web/src/app/components/edit-survey/edit-survey.component.html diff --git a/web/src/app/pages/edit-survey/edit-survey.component.scss b/web/src/app/components/edit-survey/edit-survey.component.scss similarity index 100% rename from web/src/app/pages/edit-survey/edit-survey.component.scss rename to web/src/app/components/edit-survey/edit-survey.component.scss diff --git a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts b/web/src/app/components/edit-survey/edit-survey.component.spec.ts similarity index 99% rename from web/src/app/pages/edit-survey/edit-survey.component.spec.ts rename to web/src/app/components/edit-survey/edit-survey.component.spec.ts index f469b612a..c4b81c8db 100644 --- a/web/src/app/pages/edit-survey/edit-survey.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-survey.component.spec.ts @@ -37,7 +37,7 @@ import {BehaviorSubject, Subject, of} from 'rxjs'; import {Job} from 'app/models/job.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditSurveyComponent} from 'app/pages/edit-survey/edit-survey.component'; +import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; diff --git a/web/src/app/pages/edit-survey/edit-survey.component.ts b/web/src/app/components/edit-survey/edit-survey.component.ts similarity index 100% rename from web/src/app/pages/edit-survey/edit-survey.component.ts rename to web/src/app/components/edit-survey/edit-survey.component.ts diff --git a/web/src/app/pages/edit-survey/edit-survey.module.ts b/web/src/app/components/edit-survey/edit-survey.module.ts similarity index 89% rename from web/src/app/pages/edit-survey/edit-survey.module.ts rename to web/src/app/components/edit-survey/edit-survey.module.ts index ad17dc120..3bca0eebc 100644 --- a/web/src/app/pages/edit-survey/edit-survey.module.ts +++ b/web/src/app/components/edit-survey/edit-survey.module.ts @@ -25,8 +25,8 @@ import {MatMenuModule} from '@angular/material/menu'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {RouterModule} from '@angular/router'; -import {CopySurveyControlsModule} from 'app/components/copy-survey-controls/copy-survey-controls.module'; -import {EditSurveyComponent} from 'app/pages/edit-survey/edit-survey.component'; +import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; +import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; import {SurveyHeaderModule} from '../main-page-container/main-page/survey-header/survey-header.module'; diff --git a/web/src/app/pages/edit-survey/job-dialog/job-dialog.component.html b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.html similarity index 100% rename from web/src/app/pages/edit-survey/job-dialog/job-dialog.component.html rename to web/src/app/components/edit-survey/job-dialog/job-dialog.component.html diff --git a/web/src/app/pages/edit-survey/job-dialog/job-dialog.component.scss b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.scss similarity index 100% rename from web/src/app/pages/edit-survey/job-dialog/job-dialog.component.scss rename to web/src/app/components/edit-survey/job-dialog/job-dialog.component.scss diff --git a/web/src/app/pages/edit-survey/job-dialog/job-dialog.component.spec.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts similarity index 100% rename from web/src/app/pages/edit-survey/job-dialog/job-dialog.component.spec.ts rename to web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts diff --git a/web/src/app/pages/edit-survey/job-dialog/job-dialog.component.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts similarity index 100% rename from web/src/app/pages/edit-survey/job-dialog/job-dialog.component.ts rename to web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts diff --git a/web/src/app/pages/edit-survey/job-dialog/job-dialog.module.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts similarity index 92% rename from web/src/app/pages/edit-survey/job-dialog/job-dialog.module.ts rename to web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts index 60b170003..16fbe8bd0 100644 --- a/web/src/app/pages/edit-survey/job-dialog/job-dialog.module.ts +++ b/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts @@ -22,7 +22,7 @@ import {MatDialogModule} from '@angular/material/dialog'; import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; -import {JobDialogComponent} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +import {JobDialogComponent} from 'app/components/edit-survey/job-dialog/job-dialog.component'; @NgModule({ declarations: [JobDialogComponent], diff --git a/web/src/app/pages/edit-survey/survey-json/survey-json.component.html b/web/src/app/components/edit-survey/survey-json/survey-json.component.html similarity index 100% rename from web/src/app/pages/edit-survey/survey-json/survey-json.component.html rename to web/src/app/components/edit-survey/survey-json/survey-json.component.html diff --git a/web/src/app/pages/edit-survey/survey-json/survey-json.component.scss b/web/src/app/components/edit-survey/survey-json/survey-json.component.scss similarity index 100% rename from web/src/app/pages/edit-survey/survey-json/survey-json.component.scss rename to web/src/app/components/edit-survey/survey-json/survey-json.component.scss diff --git a/web/src/app/pages/edit-survey/survey-json/survey-json.component.ts b/web/src/app/components/edit-survey/survey-json/survey-json.component.ts similarity index 100% rename from web/src/app/pages/edit-survey/survey-json/survey-json.component.ts rename to web/src/app/components/edit-survey/survey-json/survey-json.component.ts diff --git a/web/src/app/pages/edit-survey/survey-json/survey-json.module.ts b/web/src/app/components/edit-survey/survey-json/survey-json.module.ts similarity index 100% rename from web/src/app/pages/edit-survey/survey-json/survey-json.module.ts rename to web/src/app/components/edit-survey/survey-json/survey-json.module.ts diff --git a/web/src/app/pages/error/error.component.html b/web/src/app/components/error/error.component.html similarity index 100% rename from web/src/app/pages/error/error.component.html rename to web/src/app/components/error/error.component.html diff --git a/web/src/app/pages/error/error.component.scss b/web/src/app/components/error/error.component.scss similarity index 100% rename from web/src/app/pages/error/error.component.scss rename to web/src/app/components/error/error.component.scss diff --git a/web/src/app/pages/error/error.component.ts b/web/src/app/components/error/error.component.ts similarity index 100% rename from web/src/app/pages/error/error.component.ts rename to web/src/app/components/error/error.component.ts diff --git a/web/src/app/pages/error/error.module.ts b/web/src/app/components/error/error.module.ts similarity index 87% rename from web/src/app/pages/error/error.module.ts rename to web/src/app/components/error/error.module.ts index bb4f992c4..a1621ab1d 100644 --- a/web/src/app/pages/error/error.module.ts +++ b/web/src/app/components/error/error.module.ts @@ -19,8 +19,8 @@ import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; import {RouterModule} from '@angular/router'; -import {HeaderModule} from 'app/components/header/header.module'; -import {ErrorComponent} from 'app/pages/error/error.component'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {ErrorComponent} from 'app/components/error/error.component'; @NgModule({ declarations: [ErrorComponent], diff --git a/web/src/app/pages/main-page-container/main-page-container.component.css b/web/src/app/components/main-page-container/main-page-container.component.css similarity index 100% rename from web/src/app/pages/main-page-container/main-page-container.component.css rename to web/src/app/components/main-page-container/main-page-container.component.css diff --git a/web/src/app/pages/main-page-container/main-page-container.component.html b/web/src/app/components/main-page-container/main-page-container.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page-container.component.html rename to web/src/app/components/main-page-container/main-page-container.component.html diff --git a/web/src/app/pages/main-page-container/main-page-container.component.spec.ts b/web/src/app/components/main-page-container/main-page-container.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page-container.component.spec.ts rename to web/src/app/components/main-page-container/main-page-container.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page-container.component.ts b/web/src/app/components/main-page-container/main-page-container.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page-container.component.ts rename to web/src/app/components/main-page-container/main-page-container.component.ts diff --git a/web/src/app/pages/main-page-container/main-page-container.module.ts b/web/src/app/components/main-page-container/main-page-container.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page-container.module.ts rename to web/src/app/components/main-page-container/main-page-container.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme.scss b/web/src/app/components/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme.scss rename to web/src/app/components/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.html rename to web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.html diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.scss b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.scss rename to web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts rename to web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.component.ts rename to web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.module.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/drawing-tools/drawing-tools.module.ts rename to web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/_job-dialog.component-theme.scss b/web/src/app/components/main-page-container/main-page/job-dialog/_job-dialog.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/_job-dialog.component-theme.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/_job-dialog.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.html b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.html rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.html diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.scss b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.html b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.html rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.html diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.html b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.html rename to web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.html diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.scss b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts similarity index 97% rename from web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts index 5cb1cb1a7..09bca0018 100644 --- a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts @@ -30,7 +30,7 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {Router} from '@angular/router'; import {NEVER, of} from 'rxjs'; -import {InlineEditorModule} from 'app/components/inline-editor/inline-editor.module'; +import {InlineEditorModule} from 'app/components/shared/inline-editor/inline-editor.module'; import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.component.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts similarity index 94% rename from web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.module.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts index 272fea8e2..4754faa23 100644 --- a/web/src/app/pages/main-page-container/main-page/job-dialog/job-dialog.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts @@ -25,7 +25,7 @@ import {MatFormFieldModule} from '@angular/material/form-field'; import {MatIconModule} from '@angular/material/icon'; import {MatInputModule} from '@angular/material/input'; -import {InlineEditorModule} from 'app/components/inline-editor/inline-editor.module'; +import {InlineEditorModule} from 'app/components/shared/inline-editor/inline-editor.module'; import {EditStyleButtonModule} from './edit-style-button/edit-style-button.module'; import {JobDialogComponent} from './job-dialog.component'; diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme.scss b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.html b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.html rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.html diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.scss b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.html b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.html rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.html diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.scss b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.scss rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts rename to web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.html b/web/src/app/components/main-page-container/main-page/main-page.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/main-page.component.html rename to web/src/app/components/main-page-container/main-page/main-page.component.html diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.scss b/web/src/app/components/main-page-container/main-page/main-page.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/main-page.component.scss rename to web/src/app/components/main-page-container/main-page/main-page.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts b/web/src/app/components/main-page-container/main-page/main-page.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/main-page.component.spec.ts rename to web/src/app/components/main-page-container/main-page/main-page.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/main-page.component.ts b/web/src/app/components/main-page-container/main-page/main-page.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/main-page.component.ts rename to web/src/app/components/main-page-container/main-page/main-page.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/main-page.module.ts b/web/src/app/components/main-page-container/main-page/main-page.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/main-page.module.ts rename to web/src/app/components/main-page-container/main-page/main-page.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/map/_map.component-theme.scss b/web/src/app/components/main-page-container/main-page/map/_map.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/_map.component-theme.scss rename to web/src/app/components/main-page-container/main-page/map/_map.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.html b/web/src/app/components/main-page-container/main-page/map/map.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/map.component.html rename to web/src/app/components/main-page-container/main-page/map/map.component.html diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.scss b/web/src/app/components/main-page-container/main-page/map/map.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/map.component.scss rename to web/src/app/components/main-page-container/main-page/map/map.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts b/web/src/app/components/main-page-container/main-page/map/map.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/map.component.spec.ts rename to web/src/app/components/main-page-container/main-page/map/map.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/map/map.component.ts b/web/src/app/components/main-page-container/main-page/map/map.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/map.component.ts rename to web/src/app/components/main-page-container/main-page/map/map.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/map/map.module.ts b/web/src/app/components/main-page-container/main-page/map/map.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/map/map.module.ts rename to web/src/app/components/main-page-container/main-page/map/map.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme.scss b/web/src/app/components/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme.scss rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.html b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.html rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.html diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.scss b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.scss rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts similarity index 96% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index 38503b8e9..f1ca2c894 100644 --- a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -20,7 +20,7 @@ import {MatDialog} from '@angular/material/dialog'; import {List} from 'immutable'; import {Subscription, combineLatest, switchMap} from 'rxjs'; -import {LoiPropertiesDialogComponent} from 'app/components/loi-properties-dialog/loi-properties-dialog.component'; +import {LoiPropertiesDialogComponent} from 'app/components/shared/loi-properties-dialog/loi-properties-dialog.component'; import {LocationOfInterest} from 'app/models/loi.model'; import {Submission} from 'app/models/submission/submission.model'; import {Survey} from 'app/models/survey.model'; diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.css b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.css similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.css rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.css diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.html diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.html b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.html rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.html diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts rename to web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.html rename to web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.html diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.scss b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.scss rename to web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts rename to web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.component.ts rename to web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts similarity index 92% rename from web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.module.ts rename to web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts index 5e1ed9870..11346a7b4 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/job-list/job-list.module.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts @@ -19,7 +19,7 @@ import {MatButtonModule} from '@angular/material/button'; import {MatListModule} from '@angular/material/list'; import {BrowserModule} from '@angular/platform-browser'; -import {JobListItemModule} from 'app/components/job-list-item/job-list-item.module'; +import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; import {GroundIconModule} from 'app/modules/ground-icon.module'; import {JobListComponent} from './job-list.component'; diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.css b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.css similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.css rename to web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.css diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.html rename to web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.html diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/side-panel.component.ts rename to web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/side-panel.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/side-panel.module.ts rename to web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme.scss b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme.scss rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.html b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.html rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.html diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.scss b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.scss rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts similarity index 98% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts index 753759c51..07603fb9d 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts @@ -30,7 +30,7 @@ import {Router} from '@angular/router'; import {List, Map} from 'immutable'; import {NEVER, of} from 'rxjs'; -import {JobListItemModule} from 'app/components/job-list-item/job-list-item.module'; +import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; import {AuditInfo} from 'app/models/audit-info.model'; import {Coordinate} from 'app/models/geometry/coordinate'; import {Point} from 'app/models/geometry/point'; diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts similarity index 98% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts index 676ef5416..51ba7c254 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts @@ -20,7 +20,7 @@ import {List, Map} from 'immutable'; import {Observable} from 'rxjs'; import {first, map, switchMap} from 'rxjs/operators'; -import {JobListItemActionsType} from 'app/components/job-list-item/job-list-item.component'; +import {JobListItemActionsType} from 'app/components/shared/job-list-item/job-list-item.component'; import {AuditInfo} from 'app/models/audit-info.model'; import {Job} from 'app/models/job.model'; import {MultipleSelection} from 'app/models/submission/multiple-selection'; diff --git a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts similarity index 94% rename from web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts rename to web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts index 303fea8ce..9b7b7952b 100644 --- a/web/src/app/pages/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts @@ -25,7 +25,7 @@ import {MatListModule} from '@angular/material/list'; import {MatRadioModule} from '@angular/material/radio'; import {BrowserModule} from '@angular/platform-browser'; -import {JobListItemModule} from 'app/components/job-list-item/job-list-item.module'; +import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; import {SubmissionFormComponent} from './submission-form.component'; diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/_survey-header.component-theme.scss b/web/src/app/components/main-page-container/main-page/survey-header/_survey-header.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/survey-header/_survey-header.component-theme.scss rename to web/src/app/components/main-page-container/main-page/survey-header/_survey-header.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.html rename to web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.html diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.scss b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.scss rename to web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.spec.ts rename to web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts similarity index 95% rename from web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts rename to web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts index 96f601263..95c665670 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts @@ -18,7 +18,7 @@ import {Component, input} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {Subscription} from 'rxjs'; -import {ShareDialogComponent} from 'app/components/share-dialog/share-dialog.component'; +import {ShareDialogComponent} from 'app/components/shared/share-dialog/share-dialog.component'; import {Survey} from 'app/models/survey.model'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.module.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts similarity index 87% rename from web/src/app/pages/main-page-container/main-page/survey-header/survey-header.module.ts rename to web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts index 6059e9bb6..450d304e5 100644 --- a/web/src/app/pages/main-page-container/main-page/survey-header/survey-header.module.ts +++ b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts @@ -20,8 +20,8 @@ import {MatButtonModule} from '@angular/material/button'; import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; -import {HeaderModule} from 'app/components/header/header.module'; -import {ShareDialogModule} from 'app/components/share-dialog/share-dialog.module'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {ShareDialogModule} from 'app/components/shared/share-dialog/share-dialog.module'; import {SurveyHeaderComponent} from './survey-header.component'; diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/_title-dialog.component-theme.scss b/web/src/app/components/main-page-container/main-page/title-dialog/_title-dialog.component-theme.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/_title-dialog.component-theme.scss rename to web/src/app/components/main-page-container/main-page/title-dialog/_title-dialog.component-theme.scss diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.html b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.html similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.html rename to web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.html diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.scss b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.scss similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.scss rename to web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.scss diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts rename to web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.component.ts rename to web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts diff --git a/web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.module.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts similarity index 100% rename from web/src/app/pages/main-page-container/main-page/title-dialog/title-dialog.module.ts rename to web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts diff --git a/web/src/app/components/copy-survey-controls/copy-survey-controls.component.html b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.html similarity index 100% rename from web/src/app/components/copy-survey-controls/copy-survey-controls.component.html rename to web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.html diff --git a/web/src/app/components/copy-survey-controls/copy-survey-controls.component.scss b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.scss similarity index 100% rename from web/src/app/components/copy-survey-controls/copy-survey-controls.component.scss rename to web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.scss diff --git a/web/src/app/components/copy-survey-controls/copy-survey-controls.component.spec.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts similarity index 100% rename from web/src/app/components/copy-survey-controls/copy-survey-controls.component.spec.ts rename to web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts diff --git a/web/src/app/components/copy-survey-controls/copy-survey-controls.component.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts similarity index 100% rename from web/src/app/components/copy-survey-controls/copy-survey-controls.component.ts rename to web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts diff --git a/web/src/app/components/copy-survey-controls/copy-survey-controls.module.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts similarity index 100% rename from web/src/app/components/copy-survey-controls/copy-survey-controls.module.ts rename to web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts diff --git a/web/src/app/components/data-visibility-control/data-visibility-control.component.html b/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.html similarity index 100% rename from web/src/app/components/data-visibility-control/data-visibility-control.component.html rename to web/src/app/components/shared/data-visibility-control/data-visibility-control.component.html diff --git a/web/src/app/components/data-visibility-control/data-visibility-control.component.ts b/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts similarity index 100% rename from web/src/app/components/data-visibility-control/data-visibility-control.component.ts rename to web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts diff --git a/web/src/app/components/data-visibility-control/data-visibility-control.module.ts b/web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts similarity index 100% rename from web/src/app/components/data-visibility-control/data-visibility-control.module.ts rename to web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts diff --git a/web/src/app/components/general-access-control/_general-access-control.component-theme.scss b/web/src/app/components/shared/general-access-control/_general-access-control.component-theme.scss similarity index 100% rename from web/src/app/components/general-access-control/_general-access-control.component-theme.scss rename to web/src/app/components/shared/general-access-control/_general-access-control.component-theme.scss diff --git a/web/src/app/components/general-access-control/general-access-control.component.html b/web/src/app/components/shared/general-access-control/general-access-control.component.html similarity index 100% rename from web/src/app/components/general-access-control/general-access-control.component.html rename to web/src/app/components/shared/general-access-control/general-access-control.component.html diff --git a/web/src/app/components/general-access-control/general-access-control.component.scss b/web/src/app/components/shared/general-access-control/general-access-control.component.scss similarity index 100% rename from web/src/app/components/general-access-control/general-access-control.component.scss rename to web/src/app/components/shared/general-access-control/general-access-control.component.scss diff --git a/web/src/app/components/general-access-control/general-access-control.component.ts b/web/src/app/components/shared/general-access-control/general-access-control.component.ts similarity index 100% rename from web/src/app/components/general-access-control/general-access-control.component.ts rename to web/src/app/components/shared/general-access-control/general-access-control.component.ts diff --git a/web/src/app/components/general-access-control/general-access-control.module.ts b/web/src/app/components/shared/general-access-control/general-access-control.module.ts similarity index 100% rename from web/src/app/components/general-access-control/general-access-control.module.ts rename to web/src/app/components/shared/general-access-control/general-access-control.module.ts diff --git a/web/src/app/components/header/_header.component-theme.scss b/web/src/app/components/shared/header/_header.component-theme.scss similarity index 100% rename from web/src/app/components/header/_header.component-theme.scss rename to web/src/app/components/shared/header/_header.component-theme.scss diff --git a/web/src/app/components/header/current-user-widget/account-popup/_account-popup.component-theme.scss b/web/src/app/components/shared/header/current-user-widget/account-popup/_account-popup.component-theme.scss similarity index 100% rename from web/src/app/components/header/current-user-widget/account-popup/_account-popup.component-theme.scss rename to web/src/app/components/shared/header/current-user-widget/account-popup/_account-popup.component-theme.scss diff --git a/web/src/app/components/header/current-user-widget/account-popup/account-popup.component.html b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.html similarity index 100% rename from web/src/app/components/header/current-user-widget/account-popup/account-popup.component.html rename to web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.html diff --git a/web/src/app/components/header/current-user-widget/account-popup/account-popup.component.scss b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.scss similarity index 100% rename from web/src/app/components/header/current-user-widget/account-popup/account-popup.component.scss rename to web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.scss diff --git a/web/src/app/components/header/current-user-widget/account-popup/account-popup.component.spec.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts similarity index 93% rename from web/src/app/components/header/current-user-widget/account-popup/account-popup.component.spec.ts rename to web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts index dba99cce3..80a9fab85 100644 --- a/web/src/app/components/header/current-user-widget/account-popup/account-popup.component.spec.ts +++ b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts @@ -23,7 +23,7 @@ import { import {Router} from '@angular/router'; import {of} from 'rxjs'; -import {AccountPopupComponent} from 'app/components/header/current-user-widget/account-popup/account-popup.component'; +import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; import {AuthService} from 'app/services/auth/auth.service'; describe('AccountPopupComponent', () => { diff --git a/web/src/app/components/header/current-user-widget/account-popup/account-popup.component.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts similarity index 100% rename from web/src/app/components/header/current-user-widget/account-popup/account-popup.component.ts rename to web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts diff --git a/web/src/app/components/header/current-user-widget/account-popup/account-popup.module.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts similarity index 82% rename from web/src/app/components/header/current-user-widget/account-popup/account-popup.module.ts rename to web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts index 9187328e8..19d89bea1 100644 --- a/web/src/app/components/header/current-user-widget/account-popup/account-popup.module.ts +++ b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts @@ -19,8 +19,8 @@ import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; import {MatDialogModule} from '@angular/material/dialog'; -import {AccountPopupComponent} from 'app/components/header/current-user-widget/account-popup/account-popup.component'; -import {UserAvatarModule} from 'app/components/user-avatar/user-avatar.module'; +import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; +import {UserAvatarModule} from 'app/components/shared/user-avatar/user-avatar.module'; @NgModule({ declarations: [AccountPopupComponent], diff --git a/web/src/app/components/header/current-user-widget/current-user-widget.component.html b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.html similarity index 100% rename from web/src/app/components/header/current-user-widget/current-user-widget.component.html rename to web/src/app/components/shared/header/current-user-widget/current-user-widget.component.html diff --git a/web/src/app/components/header/current-user-widget/current-user-widget.component.scss b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.scss similarity index 100% rename from web/src/app/components/header/current-user-widget/current-user-widget.component.scss rename to web/src/app/components/shared/header/current-user-widget/current-user-widget.component.scss diff --git a/web/src/app/components/header/current-user-widget/current-user-widget.component.spec.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts similarity index 92% rename from web/src/app/components/header/current-user-widget/current-user-widget.component.spec.ts rename to web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts index 89e10bb8d..5f3461b39 100644 --- a/web/src/app/components/header/current-user-widget/current-user-widget.component.spec.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts @@ -18,7 +18,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatDialog} from '@angular/material/dialog'; import {Subject} from 'rxjs'; -import {CurrentUserWidgetComponent} from 'app/components/header/current-user-widget/current-user-widget.component'; +import {CurrentUserWidgetComponent} from 'app/components/shared/header/current-user-widget/current-user-widget.component'; import {User} from 'app/models/user.model'; import {AuthService} from 'app/services/auth/auth.service'; diff --git a/web/src/app/components/header/current-user-widget/current-user-widget.component.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts similarity index 90% rename from web/src/app/components/header/current-user-widget/current-user-widget.component.ts rename to web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts index 8c48f97b5..3cc54faec 100644 --- a/web/src/app/components/header/current-user-widget/current-user-widget.component.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts @@ -17,7 +17,7 @@ import {Component, ElementRef} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; -import {AccountPopupComponent} from 'app/components/header/current-user-widget/account-popup/account-popup.component'; +import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; import {AuthService} from 'app/services/auth/auth.service'; @Component({ diff --git a/web/src/app/components/header/current-user-widget/current-user-widget.module.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts similarity index 81% rename from web/src/app/components/header/current-user-widget/current-user-widget.module.ts rename to web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts index f350803fc..2c5d015ba 100644 --- a/web/src/app/components/header/current-user-widget/current-user-widget.module.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts @@ -18,8 +18,8 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; -import {CurrentUserWidgetComponent} from 'app/components/header/current-user-widget/current-user-widget.component'; -import {UserAvatarModule} from 'app/components/user-avatar/user-avatar.module'; +import {CurrentUserWidgetComponent} from 'app/components/shared/header/current-user-widget/current-user-widget.component'; +import {UserAvatarModule} from 'app/components/shared/user-avatar/user-avatar.module'; @NgModule({ declarations: [CurrentUserWidgetComponent], diff --git a/web/src/app/components/header/header.component.html b/web/src/app/components/shared/header/header.component.html similarity index 100% rename from web/src/app/components/header/header.component.html rename to web/src/app/components/shared/header/header.component.html diff --git a/web/src/app/components/header/header.component.scss b/web/src/app/components/shared/header/header.component.scss similarity index 100% rename from web/src/app/components/header/header.component.scss rename to web/src/app/components/shared/header/header.component.scss diff --git a/web/src/app/components/header/header.component.spec.ts b/web/src/app/components/shared/header/header.component.spec.ts similarity index 100% rename from web/src/app/components/header/header.component.spec.ts rename to web/src/app/components/shared/header/header.component.spec.ts diff --git a/web/src/app/components/header/header.component.ts b/web/src/app/components/shared/header/header.component.ts similarity index 98% rename from web/src/app/components/header/header.component.ts rename to web/src/app/components/shared/header/header.component.ts index 47dbecc02..8e666f48c 100644 --- a/web/src/app/components/header/header.component.ts +++ b/web/src/app/components/shared/header/header.component.ts @@ -21,7 +21,7 @@ import { DialogData, DialogType, JobDialogComponent, -} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {AuthService} from 'app/services/auth/auth.service'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; diff --git a/web/src/app/components/header/header.module.ts b/web/src/app/components/shared/header/header.module.ts similarity index 100% rename from web/src/app/components/header/header.module.ts rename to web/src/app/components/shared/header/header.module.ts diff --git a/web/src/app/components/import-dialog/_import-dialog.component-theme.scss b/web/src/app/components/shared/import-dialog/_import-dialog.component-theme.scss similarity index 100% rename from web/src/app/components/import-dialog/_import-dialog.component-theme.scss rename to web/src/app/components/shared/import-dialog/_import-dialog.component-theme.scss diff --git a/web/src/app/components/import-dialog/import-dialog.component.html b/web/src/app/components/shared/import-dialog/import-dialog.component.html similarity index 100% rename from web/src/app/components/import-dialog/import-dialog.component.html rename to web/src/app/components/shared/import-dialog/import-dialog.component.html diff --git a/web/src/app/components/import-dialog/import-dialog.component.scss b/web/src/app/components/shared/import-dialog/import-dialog.component.scss similarity index 100% rename from web/src/app/components/import-dialog/import-dialog.component.scss rename to web/src/app/components/shared/import-dialog/import-dialog.component.scss diff --git a/web/src/app/components/import-dialog/import-dialog.component.spec.ts b/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts similarity index 95% rename from web/src/app/components/import-dialog/import-dialog.component.spec.ts rename to web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts index eb9937c01..71b65a0c6 100644 --- a/web/src/app/components/import-dialog/import-dialog.component.spec.ts +++ b/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts @@ -26,7 +26,7 @@ import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {FileUploadModule} from '@iplab/ngx-file-upload'; import {NEVER} from 'rxjs'; -import {ImportDialogComponent} from 'app/components/import-dialog/import-dialog.component'; +import {ImportDialogComponent} from 'app/components/shared/import-dialog/import-dialog.component'; import {DataImportService} from 'app/services/data-import/data-import.service'; describe('ImportDialogComponent', () => { diff --git a/web/src/app/components/import-dialog/import-dialog.component.ts b/web/src/app/components/shared/import-dialog/import-dialog.component.ts similarity index 100% rename from web/src/app/components/import-dialog/import-dialog.component.ts rename to web/src/app/components/shared/import-dialog/import-dialog.component.ts diff --git a/web/src/app/components/import-dialog/import-dialog.module.ts b/web/src/app/components/shared/import-dialog/import-dialog.module.ts similarity index 100% rename from web/src/app/components/import-dialog/import-dialog.module.ts rename to web/src/app/components/shared/import-dialog/import-dialog.module.ts diff --git a/web/src/app/components/inline-editor/_inline-editor.component-theme.scss b/web/src/app/components/shared/inline-editor/_inline-editor.component-theme.scss similarity index 100% rename from web/src/app/components/inline-editor/_inline-editor.component-theme.scss rename to web/src/app/components/shared/inline-editor/_inline-editor.component-theme.scss diff --git a/web/src/app/components/inline-editor/inline-editor.component.html b/web/src/app/components/shared/inline-editor/inline-editor.component.html similarity index 100% rename from web/src/app/components/inline-editor/inline-editor.component.html rename to web/src/app/components/shared/inline-editor/inline-editor.component.html diff --git a/web/src/app/components/inline-editor/inline-editor.component.scss b/web/src/app/components/shared/inline-editor/inline-editor.component.scss similarity index 100% rename from web/src/app/components/inline-editor/inline-editor.component.scss rename to web/src/app/components/shared/inline-editor/inline-editor.component.scss diff --git a/web/src/app/components/inline-editor/inline-editor.component.ts b/web/src/app/components/shared/inline-editor/inline-editor.component.ts similarity index 100% rename from web/src/app/components/inline-editor/inline-editor.component.ts rename to web/src/app/components/shared/inline-editor/inline-editor.component.ts diff --git a/web/src/app/components/inline-editor/inline-editor.module.ts b/web/src/app/components/shared/inline-editor/inline-editor.module.ts similarity index 100% rename from web/src/app/components/inline-editor/inline-editor.module.ts rename to web/src/app/components/shared/inline-editor/inline-editor.module.ts diff --git a/web/src/app/components/job-list-item/_job-list-item.component-theme.scss b/web/src/app/components/shared/job-list-item/_job-list-item.component-theme.scss similarity index 100% rename from web/src/app/components/job-list-item/_job-list-item.component-theme.scss rename to web/src/app/components/shared/job-list-item/_job-list-item.component-theme.scss diff --git a/web/src/app/components/job-list-item/job-list-item.component.html b/web/src/app/components/shared/job-list-item/job-list-item.component.html similarity index 100% rename from web/src/app/components/job-list-item/job-list-item.component.html rename to web/src/app/components/shared/job-list-item/job-list-item.component.html diff --git a/web/src/app/components/job-list-item/job-list-item.component.scss b/web/src/app/components/shared/job-list-item/job-list-item.component.scss similarity index 100% rename from web/src/app/components/job-list-item/job-list-item.component.scss rename to web/src/app/components/shared/job-list-item/job-list-item.component.scss diff --git a/web/src/app/components/job-list-item/job-list-item.component.spec.ts b/web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts similarity index 100% rename from web/src/app/components/job-list-item/job-list-item.component.spec.ts rename to web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts diff --git a/web/src/app/components/job-list-item/job-list-item.component.ts b/web/src/app/components/shared/job-list-item/job-list-item.component.ts similarity index 100% rename from web/src/app/components/job-list-item/job-list-item.component.ts rename to web/src/app/components/shared/job-list-item/job-list-item.component.ts diff --git a/web/src/app/components/job-list-item/job-list-item.module.ts b/web/src/app/components/shared/job-list-item/job-list-item.module.ts similarity index 100% rename from web/src/app/components/job-list-item/job-list-item.module.ts rename to web/src/app/components/shared/job-list-item/job-list-item.module.ts diff --git a/web/src/app/components/job-list-item/tree-data-source.ts b/web/src/app/components/shared/job-list-item/tree-data-source.ts similarity index 100% rename from web/src/app/components/job-list-item/tree-data-source.ts rename to web/src/app/components/shared/job-list-item/tree-data-source.ts diff --git a/web/src/app/components/loi-editor/_loi-editor.component-theme.scss b/web/src/app/components/shared/loi-editor/_loi-editor.component-theme.scss similarity index 100% rename from web/src/app/components/loi-editor/_loi-editor.component-theme.scss rename to web/src/app/components/shared/loi-editor/_loi-editor.component-theme.scss diff --git a/web/src/app/components/loi-editor/loi-editor.component.html b/web/src/app/components/shared/loi-editor/loi-editor.component.html similarity index 100% rename from web/src/app/components/loi-editor/loi-editor.component.html rename to web/src/app/components/shared/loi-editor/loi-editor.component.html diff --git a/web/src/app/components/loi-editor/loi-editor.component.scss b/web/src/app/components/shared/loi-editor/loi-editor.component.scss similarity index 100% rename from web/src/app/components/loi-editor/loi-editor.component.scss rename to web/src/app/components/shared/loi-editor/loi-editor.component.scss diff --git a/web/src/app/components/loi-editor/loi-editor.component.spec.ts b/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts similarity index 98% rename from web/src/app/components/loi-editor/loi-editor.component.spec.ts rename to web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts index b60ac801c..e20963cb4 100644 --- a/web/src/app/components/loi-editor/loi-editor.component.spec.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts @@ -22,7 +22,7 @@ import {MatIconModule} from '@angular/material/icon'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {List, Map} from 'immutable'; -import {ImportDialogComponent} from 'app/components/import-dialog/import-dialog.component'; +import {ImportDialogComponent} from 'app/components/shared/import-dialog/import-dialog.component'; import {Coordinate} from 'app/models/geometry/coordinate'; import {Point} from 'app/models/geometry/point'; import {Job} from 'app/models/job.model'; diff --git a/web/src/app/components/loi-editor/loi-editor.component.ts b/web/src/app/components/shared/loi-editor/loi-editor.component.ts similarity index 97% rename from web/src/app/components/loi-editor/loi-editor.component.ts rename to web/src/app/components/shared/loi-editor/loi-editor.component.ts index c49b50433..08a60aa9e 100644 --- a/web/src/app/components/loi-editor/loi-editor.component.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.component.ts @@ -26,7 +26,7 @@ import { DialogData, DialogType, JobDialogComponent, -} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {ImportDialogComponent} from '../import-dialog/import-dialog.component'; diff --git a/web/src/app/components/loi-editor/loi-editor.module.ts b/web/src/app/components/shared/loi-editor/loi-editor.module.ts similarity index 100% rename from web/src/app/components/loi-editor/loi-editor.module.ts rename to web/src/app/components/shared/loi-editor/loi-editor.module.ts diff --git a/web/src/app/components/loi-properties-dialog/_loi-properties-dialog.component-theme.scss b/web/src/app/components/shared/loi-properties-dialog/_loi-properties-dialog.component-theme.scss similarity index 100% rename from web/src/app/components/loi-properties-dialog/_loi-properties-dialog.component-theme.scss rename to web/src/app/components/shared/loi-properties-dialog/_loi-properties-dialog.component-theme.scss diff --git a/web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.html b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.html similarity index 100% rename from web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.html rename to web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.html diff --git a/web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.scss b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.scss similarity index 100% rename from web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.scss rename to web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.scss diff --git a/web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.ts b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts similarity index 100% rename from web/src/app/components/loi-properties-dialog/loi-properties-dialog.component.ts rename to web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts diff --git a/web/src/app/components/loi-properties-dialog/loi-properties-dialog.module.ts b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts similarity index 100% rename from web/src/app/components/loi-properties-dialog/loi-properties-dialog.module.ts rename to web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts diff --git a/web/src/app/components/loi-selection/_loi-selection.component-theme.scss b/web/src/app/components/shared/loi-selection/_loi-selection.component-theme.scss similarity index 100% rename from web/src/app/components/loi-selection/_loi-selection.component-theme.scss rename to web/src/app/components/shared/loi-selection/_loi-selection.component-theme.scss diff --git a/web/src/app/components/loi-selection/loi-selection.component.html b/web/src/app/components/shared/loi-selection/loi-selection.component.html similarity index 100% rename from web/src/app/components/loi-selection/loi-selection.component.html rename to web/src/app/components/shared/loi-selection/loi-selection.component.html diff --git a/web/src/app/components/loi-selection/loi-selection.component.scss b/web/src/app/components/shared/loi-selection/loi-selection.component.scss similarity index 100% rename from web/src/app/components/loi-selection/loi-selection.component.scss rename to web/src/app/components/shared/loi-selection/loi-selection.component.scss diff --git a/web/src/app/components/loi-selection/loi-selection.component.spec.ts b/web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts similarity index 100% rename from web/src/app/components/loi-selection/loi-selection.component.spec.ts rename to web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts diff --git a/web/src/app/components/loi-selection/loi-selection.component.ts b/web/src/app/components/shared/loi-selection/loi-selection.component.ts similarity index 100% rename from web/src/app/components/loi-selection/loi-selection.component.ts rename to web/src/app/components/shared/loi-selection/loi-selection.component.ts diff --git a/web/src/app/components/loi-selection/loi-selection.module.ts b/web/src/app/components/shared/loi-selection/loi-selection.module.ts similarity index 93% rename from web/src/app/components/loi-selection/loi-selection.module.ts rename to web/src/app/components/shared/loi-selection/loi-selection.module.ts index 8e7fd6b76..5b553cf40 100644 --- a/web/src/app/components/loi-selection/loi-selection.module.ts +++ b/web/src/app/components/shared/loi-selection/loi-selection.module.ts @@ -21,7 +21,7 @@ import {MatListModule} from '@angular/material/list'; import {BrowserModule} from '@angular/platform-browser'; import {GroundIconModule} from 'app/modules/ground-icon.module'; -import {MapModule} from 'app/pages/main-page-container/main-page/map/map.module'; +import {MapModule} from 'app/components/main-page-container/main-page/map/map.module'; import {LoiSelectionComponent} from './loi-selection.component'; diff --git a/web/src/app/components/share-dialog/_share-dialog.component-theme.scss b/web/src/app/components/shared/share-dialog/_share-dialog.component-theme.scss similarity index 100% rename from web/src/app/components/share-dialog/_share-dialog.component-theme.scss rename to web/src/app/components/shared/share-dialog/_share-dialog.component-theme.scss diff --git a/web/src/app/components/share-dialog/share-dialog.component.html b/web/src/app/components/shared/share-dialog/share-dialog.component.html similarity index 100% rename from web/src/app/components/share-dialog/share-dialog.component.html rename to web/src/app/components/shared/share-dialog/share-dialog.component.html diff --git a/web/src/app/components/share-dialog/share-dialog.component.scss b/web/src/app/components/shared/share-dialog/share-dialog.component.scss similarity index 100% rename from web/src/app/components/share-dialog/share-dialog.component.scss rename to web/src/app/components/shared/share-dialog/share-dialog.component.scss diff --git a/web/src/app/components/share-dialog/share-dialog.component.spec.ts b/web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts similarity index 100% rename from web/src/app/components/share-dialog/share-dialog.component.spec.ts rename to web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts diff --git a/web/src/app/components/share-dialog/share-dialog.component.ts b/web/src/app/components/shared/share-dialog/share-dialog.component.ts similarity index 100% rename from web/src/app/components/share-dialog/share-dialog.component.ts rename to web/src/app/components/shared/share-dialog/share-dialog.component.ts diff --git a/web/src/app/components/share-dialog/share-dialog.module.ts b/web/src/app/components/shared/share-dialog/share-dialog.module.ts similarity index 100% rename from web/src/app/components/share-dialog/share-dialog.module.ts rename to web/src/app/components/shared/share-dialog/share-dialog.module.ts diff --git a/web/src/app/components/share-list/_share-list.component-theme.scss b/web/src/app/components/shared/share-list/_share-list.component-theme.scss similarity index 100% rename from web/src/app/components/share-list/_share-list.component-theme.scss rename to web/src/app/components/shared/share-list/_share-list.component-theme.scss diff --git a/web/src/app/components/share-list/share-list.component.html b/web/src/app/components/shared/share-list/share-list.component.html similarity index 100% rename from web/src/app/components/share-list/share-list.component.html rename to web/src/app/components/shared/share-list/share-list.component.html diff --git a/web/src/app/components/share-list/share-list.component.scss b/web/src/app/components/shared/share-list/share-list.component.scss similarity index 100% rename from web/src/app/components/share-list/share-list.component.scss rename to web/src/app/components/shared/share-list/share-list.component.scss diff --git a/web/src/app/components/share-list/share-list.component.spec.ts b/web/src/app/components/shared/share-list/share-list.component.spec.ts similarity index 100% rename from web/src/app/components/share-list/share-list.component.spec.ts rename to web/src/app/components/shared/share-list/share-list.component.spec.ts diff --git a/web/src/app/components/share-list/share-list.component.ts b/web/src/app/components/shared/share-list/share-list.component.ts similarity index 100% rename from web/src/app/components/share-list/share-list.component.ts rename to web/src/app/components/shared/share-list/share-list.component.ts diff --git a/web/src/app/components/share-list/share-list.module.ts b/web/src/app/components/shared/share-list/share-list.module.ts similarity index 100% rename from web/src/app/components/share-list/share-list.module.ts rename to web/src/app/components/shared/share-list/share-list.module.ts diff --git a/web/src/app/components/share-survey/_share-survey.component-theme.scss b/web/src/app/components/shared/share-survey/_share-survey.component-theme.scss similarity index 100% rename from web/src/app/components/share-survey/_share-survey.component-theme.scss rename to web/src/app/components/shared/share-survey/_share-survey.component-theme.scss diff --git a/web/src/app/components/share-survey/share-survey.component.html b/web/src/app/components/shared/share-survey/share-survey.component.html similarity index 100% rename from web/src/app/components/share-survey/share-survey.component.html rename to web/src/app/components/shared/share-survey/share-survey.component.html diff --git a/web/src/app/components/share-survey/share-survey.component.scss b/web/src/app/components/shared/share-survey/share-survey.component.scss similarity index 100% rename from web/src/app/components/share-survey/share-survey.component.scss rename to web/src/app/components/shared/share-survey/share-survey.component.scss diff --git a/web/src/app/components/share-survey/share-survey.component.spec.ts b/web/src/app/components/shared/share-survey/share-survey.component.spec.ts similarity index 100% rename from web/src/app/components/share-survey/share-survey.component.spec.ts rename to web/src/app/components/shared/share-survey/share-survey.component.spec.ts diff --git a/web/src/app/components/share-survey/share-survey.component.ts b/web/src/app/components/shared/share-survey/share-survey.component.ts similarity index 82% rename from web/src/app/components/share-survey/share-survey.component.ts rename to web/src/app/components/shared/share-survey/share-survey.component.ts index ab534616a..b2d694b9f 100644 --- a/web/src/app/components/share-survey/share-survey.component.ts +++ b/web/src/app/components/shared/share-survey/share-survey.component.ts @@ -1,7 +1,7 @@ import {Component} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; -import {ShareDialogComponent} from 'app/components/share-dialog/share-dialog.component'; +import {ShareDialogComponent} from 'app/components/shared/share-dialog/share-dialog.component'; @Component({ selector: 'share-survey', diff --git a/web/src/app/components/share-survey/share-survey.module.ts b/web/src/app/components/shared/share-survey/share-survey.module.ts similarity index 90% rename from web/src/app/components/share-survey/share-survey.module.ts rename to web/src/app/components/shared/share-survey/share-survey.module.ts index d2b8c0d8d..dd8cc28d9 100644 --- a/web/src/app/components/share-survey/share-survey.module.ts +++ b/web/src/app/components/shared/share-survey/share-survey.module.ts @@ -23,8 +23,8 @@ import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; import {MatInputModule} from '@angular/material/input'; -import {ShareDialogModule} from 'app/components/share-dialog/share-dialog.module'; -import {ShareListModule} from 'app/components/share-list/share-list.module'; +import {ShareDialogModule} from 'app/components/shared/share-dialog/share-dialog.module'; +import {ShareListModule} from 'app/components/shared/share-list/share-list.module'; import {ShareSurveyComponent} from './share-survey.component'; import {DataVisibilityControlModule} from '../data-visibility-control/data-visibility-control.module'; diff --git a/web/src/app/components/sign-in-page/_sign-in-page.component-theme.scss b/web/src/app/components/shared/sign-in-page/_sign-in-page.component-theme.scss similarity index 100% rename from web/src/app/components/sign-in-page/_sign-in-page.component-theme.scss rename to web/src/app/components/shared/sign-in-page/_sign-in-page.component-theme.scss diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.html b/web/src/app/components/shared/sign-in-page/sign-in-page.component.html similarity index 100% rename from web/src/app/components/sign-in-page/sign-in-page.component.html rename to web/src/app/components/shared/sign-in-page/sign-in-page.component.html diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.scss b/web/src/app/components/shared/sign-in-page/sign-in-page.component.scss similarity index 100% rename from web/src/app/components/sign-in-page/sign-in-page.component.scss rename to web/src/app/components/shared/sign-in-page/sign-in-page.component.scss diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.spec.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts similarity index 100% rename from web/src/app/components/sign-in-page/sign-in-page.component.spec.ts rename to web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts diff --git a/web/src/app/components/sign-in-page/sign-in-page.component.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.component.ts similarity index 100% rename from web/src/app/components/sign-in-page/sign-in-page.component.ts rename to web/src/app/components/shared/sign-in-page/sign-in-page.component.ts diff --git a/web/src/app/components/sign-in-page/sign-in-page.module.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts similarity index 94% rename from web/src/app/components/sign-in-page/sign-in-page.module.ts rename to web/src/app/components/shared/sign-in-page/sign-in-page.module.ts index b83b714d4..8be3705cf 100644 --- a/web/src/app/components/sign-in-page/sign-in-page.module.ts +++ b/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts @@ -22,7 +22,7 @@ import {MatIconModule} from '@angular/material/icon'; import {BrowserModule} from '@angular/platform-browser'; import {FirebaseUIModule} from 'firebaseui-angular'; -import {HeaderModule} from 'app/components/header/header.module'; +import {HeaderModule} from 'app/components/shared/header/header.module'; import {SignInPageComponent} from './sign-in-page.component'; diff --git a/web/src/app/components/survey-list/_survey-list.component-theme.scss b/web/src/app/components/shared/survey-list/_survey-list.component-theme.scss similarity index 100% rename from web/src/app/components/survey-list/_survey-list.component-theme.scss rename to web/src/app/components/shared/survey-list/_survey-list.component-theme.scss diff --git a/web/src/app/components/survey-list/survey-list.component.html b/web/src/app/components/shared/survey-list/survey-list.component.html similarity index 100% rename from web/src/app/components/survey-list/survey-list.component.html rename to web/src/app/components/shared/survey-list/survey-list.component.html diff --git a/web/src/app/components/survey-list/survey-list.component.scss b/web/src/app/components/shared/survey-list/survey-list.component.scss similarity index 100% rename from web/src/app/components/survey-list/survey-list.component.scss rename to web/src/app/components/shared/survey-list/survey-list.component.scss diff --git a/web/src/app/components/survey-list/survey-list.component.spec.ts b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts similarity index 99% rename from web/src/app/components/survey-list/survey-list.component.spec.ts rename to web/src/app/components/shared/survey-list/survey-list.component.spec.ts index 0a561122d..230e3f8f8 100644 --- a/web/src/app/components/survey-list/survey-list.component.spec.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts @@ -48,7 +48,7 @@ import { DialogData, DialogType, JobDialogComponent, -} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {AuthService} from 'app/services/auth/auth.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/survey-list/survey-list.component.ts b/web/src/app/components/shared/survey-list/survey-list.component.ts similarity index 98% rename from web/src/app/components/survey-list/survey-list.component.ts rename to web/src/app/components/shared/survey-list/survey-list.component.ts index 57bf0f0b8..9073cd89e 100644 --- a/web/src/app/components/survey-list/survey-list.component.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.ts @@ -28,7 +28,7 @@ import { DialogData, DialogType, JobDialogComponent, -} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {AuthService} from 'app/services/auth/auth.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/survey-list/survey-list.module.ts b/web/src/app/components/shared/survey-list/survey-list.module.ts similarity index 95% rename from web/src/app/components/survey-list/survey-list.module.ts rename to web/src/app/components/shared/survey-list/survey-list.module.ts index bc748bce8..ffe6f968d 100644 --- a/web/src/app/components/survey-list/survey-list.module.ts +++ b/web/src/app/components/shared/survey-list/survey-list.module.ts @@ -23,7 +23,7 @@ import {MatDialogModule} from '@angular/material/dialog'; import {MatGridListModule} from '@angular/material/grid-list'; import {MatIconModule} from '@angular/material/icon'; -import {HeaderModule} from 'app/components/header/header.module'; +import {HeaderModule} from 'app/components/shared/header/header.module'; import {SurveyListComponent} from './survey-list.component'; diff --git a/web/src/app/components/tasks-editor/_tasks-editor.component-theme.scss b/web/src/app/components/shared/tasks-editor/_tasks-editor.component-theme.scss similarity index 100% rename from web/src/app/components/tasks-editor/_tasks-editor.component-theme.scss rename to web/src/app/components/shared/tasks-editor/_tasks-editor.component-theme.scss diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.html b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.html similarity index 100% rename from web/src/app/components/tasks-editor/add-task-button/add-task-button.component.html rename to web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.html diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.scss b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.scss similarity index 100% rename from web/src/app/components/tasks-editor/add-task-button/add-task-button.component.scss rename to web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.scss diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts similarity index 100% rename from web/src/app/components/tasks-editor/add-task-button/add-task-button.component.spec.ts rename to web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.component.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts similarity index 100% rename from web/src/app/components/tasks-editor/add-task-button/add-task-button.component.ts rename to web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts diff --git a/web/src/app/components/tasks-editor/add-task-button/add-task-button.module.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts similarity index 100% rename from web/src/app/components/tasks-editor/add-task-button/add-task-button.module.ts rename to web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts diff --git a/web/src/app/components/tasks-editor/task-condition-form/_task-condition-form-theme.scss b/web/src/app/components/shared/tasks-editor/task-condition-form/_task-condition-form-theme.scss similarity index 100% rename from web/src/app/components/tasks-editor/task-condition-form/_task-condition-form-theme.scss rename to web/src/app/components/shared/tasks-editor/task-condition-form/_task-condition-form-theme.scss diff --git a/web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.html b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.html similarity index 100% rename from web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.html rename to web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.html diff --git a/web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.scss b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.scss similarity index 100% rename from web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.scss rename to web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.scss diff --git a/web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.ts b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-condition-form/task-condition-form.component.ts rename to web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts diff --git a/web/src/app/components/tasks-editor/task-condition-form/task-condition-form.module.ts b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.module.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-condition-form/task-condition-form.module.ts rename to web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.module.ts diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/_edit-option.component-theme.scss b/web/src/app/components/shared/tasks-editor/task-form/edit-option/_edit-option.component-theme.scss similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/_edit-option.component-theme.scss rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/_edit-option.component-theme.scss diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.html b/web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.html similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.html rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.html diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.scss b/web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.scss similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.scss rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.scss diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.spec.ts b/web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.spec.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.spec.ts rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.spec.ts diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.ts b/web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/edit-option.component.ts rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.component.ts diff --git a/web/src/app/components/tasks-editor/task-form/edit-option/edit-option.module.ts b/web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.module.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-form/edit-option/edit-option.module.ts rename to web/src/app/components/shared/tasks-editor/task-form/edit-option/edit-option.module.ts diff --git a/web/src/app/components/tasks-editor/task-form/task-form.component.html b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.html similarity index 100% rename from web/src/app/components/tasks-editor/task-form/task-form.component.html rename to web/src/app/components/shared/tasks-editor/task-form/task-form.component.html diff --git a/web/src/app/components/tasks-editor/task-form/task-form.component.scss b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.scss similarity index 100% rename from web/src/app/components/tasks-editor/task-form/task-form.component.scss rename to web/src/app/components/shared/tasks-editor/task-form/task-form.component.scss diff --git a/web/src/app/components/tasks-editor/task-form/task-form.component.ts b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts similarity index 99% rename from web/src/app/components/tasks-editor/task-form/task-form.component.ts rename to web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts index e1993a2c6..9ea3c9333 100644 --- a/web/src/app/components/tasks-editor/task-form/task-form.component.ts +++ b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts @@ -44,7 +44,7 @@ import { DialogData, DialogType, JobDialogComponent, -} from 'app/pages/edit-survey/job-dialog/job-dialog.component'; +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {moveItemInFormArray} from 'app/utils/utils'; diff --git a/web/src/app/components/tasks-editor/task-form/task-form.module.ts b/web/src/app/components/shared/tasks-editor/task-form/task-form.module.ts similarity index 100% rename from web/src/app/components/tasks-editor/task-form/task-form.module.ts rename to web/src/app/components/shared/tasks-editor/task-form/task-form.module.ts diff --git a/web/src/app/components/tasks-editor/tasks-editor.component.html b/web/src/app/components/shared/tasks-editor/tasks-editor.component.html similarity index 100% rename from web/src/app/components/tasks-editor/tasks-editor.component.html rename to web/src/app/components/shared/tasks-editor/tasks-editor.component.html diff --git a/web/src/app/components/tasks-editor/tasks-editor.component.scss b/web/src/app/components/shared/tasks-editor/tasks-editor.component.scss similarity index 100% rename from web/src/app/components/tasks-editor/tasks-editor.component.scss rename to web/src/app/components/shared/tasks-editor/tasks-editor.component.scss diff --git a/web/src/app/components/tasks-editor/tasks-editor.component.ts b/web/src/app/components/shared/tasks-editor/tasks-editor.component.ts similarity index 100% rename from web/src/app/components/tasks-editor/tasks-editor.component.ts rename to web/src/app/components/shared/tasks-editor/tasks-editor.component.ts diff --git a/web/src/app/components/tasks-editor/tasks-editor.module.ts b/web/src/app/components/shared/tasks-editor/tasks-editor.module.ts similarity index 100% rename from web/src/app/components/tasks-editor/tasks-editor.module.ts rename to web/src/app/components/shared/tasks-editor/tasks-editor.module.ts diff --git a/web/src/app/components/user-avatar/_user-avatar.component-theme.scss b/web/src/app/components/shared/user-avatar/_user-avatar.component-theme.scss similarity index 100% rename from web/src/app/components/user-avatar/_user-avatar.component-theme.scss rename to web/src/app/components/shared/user-avatar/_user-avatar.component-theme.scss diff --git a/web/src/app/components/user-avatar/user-avatar.component.html b/web/src/app/components/shared/user-avatar/user-avatar.component.html similarity index 100% rename from web/src/app/components/user-avatar/user-avatar.component.html rename to web/src/app/components/shared/user-avatar/user-avatar.component.html diff --git a/web/src/app/components/user-avatar/user-avatar.component.scss b/web/src/app/components/shared/user-avatar/user-avatar.component.scss similarity index 100% rename from web/src/app/components/user-avatar/user-avatar.component.scss rename to web/src/app/components/shared/user-avatar/user-avatar.component.scss diff --git a/web/src/app/components/user-avatar/user-avatar.component.spec.ts b/web/src/app/components/shared/user-avatar/user-avatar.component.spec.ts similarity index 100% rename from web/src/app/components/user-avatar/user-avatar.component.spec.ts rename to web/src/app/components/shared/user-avatar/user-avatar.component.spec.ts diff --git a/web/src/app/components/user-avatar/user-avatar.component.ts b/web/src/app/components/shared/user-avatar/user-avatar.component.ts similarity index 100% rename from web/src/app/components/user-avatar/user-avatar.component.ts rename to web/src/app/components/shared/user-avatar/user-avatar.component.ts diff --git a/web/src/app/components/user-avatar/user-avatar.module.ts b/web/src/app/components/shared/user-avatar/user-avatar.module.ts similarity index 100% rename from web/src/app/components/user-avatar/user-avatar.module.ts rename to web/src/app/components/shared/user-avatar/user-avatar.module.ts diff --git a/web/src/app/pages/terms/_terms.component-theme.scss b/web/src/app/components/terms/_terms.component-theme.scss similarity index 100% rename from web/src/app/pages/terms/_terms.component-theme.scss rename to web/src/app/components/terms/_terms.component-theme.scss diff --git a/web/src/app/pages/terms/terms.component.html b/web/src/app/components/terms/terms.component.html similarity index 100% rename from web/src/app/pages/terms/terms.component.html rename to web/src/app/components/terms/terms.component.html diff --git a/web/src/app/pages/terms/terms.component.scss b/web/src/app/components/terms/terms.component.scss similarity index 100% rename from web/src/app/pages/terms/terms.component.scss rename to web/src/app/components/terms/terms.component.scss diff --git a/web/src/app/pages/terms/terms.component.ts b/web/src/app/components/terms/terms.component.ts similarity index 100% rename from web/src/app/pages/terms/terms.component.ts rename to web/src/app/components/terms/terms.component.ts diff --git a/web/src/app/pages/terms/terms.module.ts b/web/src/app/components/terms/terms.module.ts similarity index 89% rename from web/src/app/pages/terms/terms.module.ts rename to web/src/app/components/terms/terms.module.ts index de9aa62be..22a907bed 100644 --- a/web/src/app/pages/terms/terms.module.ts +++ b/web/src/app/components/terms/terms.module.ts @@ -22,8 +22,8 @@ import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatIcon} from '@angular/material/icon'; import {RouterModule} from '@angular/router'; -import {HeaderModule} from 'app/components/header/header.module'; -import {TermsComponent} from 'app/pages/terms/terms.component'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {TermsComponent} from 'app/components/terms/terms.component'; @NgModule({ declarations: [TermsComponent], diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index f421073b5..b717c96d7 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -17,14 +17,14 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {SignInPageComponent} from 'app/components/sign-in-page/sign-in-page.component'; -import {SignInPageModule} from 'app/components/sign-in-page/sign-in-page.module'; -import {SurveyListComponent} from 'app/components/survey-list/survey-list.component'; -import {SurveyListModule} from 'app/components/survey-list/survey-list.module'; -import {CreateSurveyComponent} from 'app/pages/create-survey/create-survey.component'; -import {CreateSurveyModule} from 'app/pages/create-survey/create-survey.module'; -import {MainPageContainerComponent} from 'app/pages/main-page-container/main-page-container.component'; -import {MainPageContainerModule} from 'app/pages/main-page-container/main-page-container.module'; +import {SignInPageComponent} from 'app/components/shared/sign-in-page/sign-in-page.component'; +import {SignInPageModule} from 'app/components/shared/sign-in-page/sign-in-page.module'; +import {SurveyListComponent} from 'app/components/shared/survey-list/survey-list.component'; +import {SurveyListModule} from 'app/components/shared/survey-list/survey-list.module'; +import {CreateSurveyComponent} from 'app/components/create-survey/create-survey.component'; +import {CreateSurveyModule} from 'app/components/create-survey/create-survey.module'; +import {MainPageContainerComponent} from 'app/components/main-page-container/main-page-container.component'; +import {MainPageContainerModule} from 'app/components/main-page-container/main-page-container.module'; import {AuthGuard} from 'app/services/auth/auth.guard'; import {passlistGuard} from 'app/services/auth/passlist.guard'; import { @@ -47,17 +47,17 @@ import { } from 'app/services/navigation/navigation.constants'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {ShareSurveyComponent} from './components/share-survey/share-survey.component'; -import {AboutComponent} from './pages/about/about.component'; -import {AndroidIntentLandingPageComponent} from './pages/android-intent-landing-page/android-intent-landing-page.component'; -import {EditDetailsComponent} from './pages/edit-survey/edit-details/edit-details.component'; -import {EditJobComponent} from './pages/edit-survey/edit-job/edit-job.component'; -import {EditSurveyComponent} from './pages/edit-survey/edit-survey.component'; -import {EditSurveyModule} from './pages/edit-survey/edit-survey.module'; -import {SurveyJsonComponent} from './pages/edit-survey/survey-json/survey-json.component'; -import {ErrorComponent} from './pages/error/error.component'; -import {ErrorModule} from './pages/error/error.module'; -import {TermsComponent} from './pages/terms/terms.component'; +import {ShareSurveyComponent} from './components/shared/share-survey/share-survey.component'; +import {AboutComponent} from './components/about/about.component'; +import {AndroidIntentLandingPageComponent} from './components/android-intent-landing-page/android-intent-landing-page.component'; +import {EditDetailsComponent} from './components/edit-survey/edit-details/edit-details.component'; +import {EditJobComponent} from './components/edit-survey/edit-job/edit-job.component'; +import {EditSurveyComponent} from './components/edit-survey/edit-survey.component'; +import {EditSurveyModule} from './components/edit-survey/edit-survey.module'; +import {SurveyJsonComponent} from './components/edit-survey/survey-json/survey-json.component'; +import {ErrorComponent} from './components/error/error.component'; +import {ErrorModule} from './components/error/error.module'; +import {TermsComponent} from './components/terms/terms.component'; const routes: Routes = [ { diff --git a/web/src/ground-theme.scss b/web/src/ground-theme.scss index 2351635ac..7f2b64c6c 100644 --- a/web/src/ground-theme.scss +++ b/web/src/ground-theme.scss @@ -19,37 +19,37 @@ @use '@angular/material' as mat; @use './m3-theme'; -@use 'app/components/general-access-control/_general-access-control.component-theme' as general-access-control; -@use 'app/components/header/current-user-widget/account-popup/_account-popup.component-theme' as account-popup; -@use 'app/components/header/_header.component-theme.scss' as header; -@use 'app/components/import-dialog/_import-dialog.component-theme' as import-dialog; -@use 'app/components/inline-editor/inline-editor.component-theme' as inline-editor; -@use 'app/components/job-list-item/_job-list-item.component-theme' as job-list-item; -@use 'app/components/loi-editor/_loi-editor.component-theme.scss' as loi-editor; -@use 'app/components/loi-properties-dialog/loi-properties-dialog.component-theme' as loi-properties-dialog; -@use 'app/components/loi-selection/loi-selection.component-theme' as loi-selection; -@use 'app/components/share-dialog/_share-dialog.component-theme' as share-dialog; -@use 'app/components/share-list/_share-list.component-theme' as share-list; -@use 'app/components/share-survey/_share-survey.component-theme' as share-survey; -@use 'app/components/sign-in-page/_sign-in-page.component-theme' as sign-in-page; -@use 'app/components/survey-list/_survey-list.component-theme' as survey-list; -@use 'app/components/tasks-editor/_tasks-editor.component-theme' as tasks-editor; -@use 'app/components/tasks-editor/task-condition-form/_task-condition-form-theme' as task-condition-form; -@use 'app/components/tasks-editor/task-form/edit-option/_edit-option.component-theme' as edit-option; -@use 'app/components/user-avatar/_user-avatar.component-theme' as user-avatar; -@use 'app/pages/create-survey/_create-survey.component-theme' as create-survey; -@use 'app/pages/create-survey/step-card/_step-card.component-theme' as step-card; -@use 'app/pages/edit-survey/_edit-survey.component-theme.scss' as edit-survey; -@use 'app/pages/edit-survey/edit-job/_edit-job.component-theme' as edit-job; -@use 'app/pages/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme' as drawing-tools; -@use 'app/pages/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme' as task-editor; -@use 'app/pages/main-page-container/main-page/job-dialog/_job-dialog.component-theme' as job-dialog; -@use 'app/pages/main-page-container/main-page/map/_map.component-theme' as map; -@use 'app/pages/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme' as submission-form; -@use 'app/pages/main-page-container/main-page/survey-header/_survey-header.component-theme' as survey-header; -@use 'app/pages/main-page-container/main-page/title-dialog/_title-dialog.component-theme' as title-dialog; -@use 'app/pages/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme' as secondary-side-panel; -@use 'app/pages/terms/_terms.component-theme.scss' as terms; +@use 'app/components/shared/general-access-control/_general-access-control.component-theme' as general-access-control; +@use 'app/components/shared/header/current-user-widget/account-popup/_account-popup.component-theme' as account-popup; +@use 'app/components/shared/header/_header.component-theme.scss' as header; +@use 'app/components/shared/import-dialog/_import-dialog.component-theme' as import-dialog; +@use 'app/components/shared/inline-editor/inline-editor.component-theme' as inline-editor; +@use 'app/components/shared/job-list-item/_job-list-item.component-theme' as job-list-item; +@use 'app/components/shared/loi-editor/_loi-editor.component-theme.scss' as loi-editor; +@use 'app/components/shared/loi-properties-dialog/loi-properties-dialog.component-theme' as loi-properties-dialog; +@use 'app/components/shared/loi-selection/loi-selection.component-theme' as loi-selection; +@use 'app/components/shared/share-dialog/_share-dialog.component-theme' as share-dialog; +@use 'app/components/shared/share-list/_share-list.component-theme' as share-list; +@use 'app/components/shared/share-survey/_share-survey.component-theme' as share-survey; +@use 'app/components/shared/sign-in-page/_sign-in-page.component-theme' as sign-in-page; +@use 'app/components/shared/survey-list/_survey-list.component-theme' as survey-list; +@use 'app/components/shared/tasks-editor/_tasks-editor.component-theme' as tasks-editor; +@use 'app/components/shared/tasks-editor/task-condition-form/_task-condition-form-theme' as task-condition-form; +@use 'app/components/shared/tasks-editor/task-form/edit-option/_edit-option.component-theme' as edit-option; +@use 'app/components/shared/user-avatar/_user-avatar.component-theme' as user-avatar; +@use 'app/components/create-survey/_create-survey.component-theme' as create-survey; +@use 'app/components/create-survey/step-card/_step-card.component-theme' as step-card; +@use 'app/components/edit-survey/_edit-survey.component-theme.scss' as edit-survey; +@use 'app/components/edit-survey/edit-job/_edit-job.component-theme' as edit-job; +@use 'app/components/main-page-container/main-page/drawing-tools/_drawing-tools.component-theme' as drawing-tools; +@use 'app/components/main-page-container/main-page/job-dialog/task-editor/_task-editor.component-theme' as task-editor; +@use 'app/components/main-page-container/main-page/job-dialog/_job-dialog.component-theme' as job-dialog; +@use 'app/components/main-page-container/main-page/map/_map.component-theme' as map; +@use 'app/components/main-page-container/main-page/side-panel/submission-form/_submission-form.component-theme' as submission-form; +@use 'app/components/main-page-container/main-page/survey-header/_survey-header.component-theme' as survey-header; +@use 'app/components/main-page-container/main-page/title-dialog/_title-dialog.component-theme' as title-dialog; +@use 'app/components/main-page-container/main-page/secondary-side-panel/_secondary-side-panel.component-theme' as secondary-side-panel; +@use 'app/components/terms/_terms.component-theme.scss' as terms; @import 'firebaseui/dist/firebaseui.css'; From 3e0445d91b4fa2e053f5966032a4fed83944a791 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 16:12:54 -0500 Subject: [PATCH 24/34] Lint fix --- web/src/app/components/about/about.module.ts | 2 +- .../create-survey/create-survey.component.spec.ts | 10 +++++----- .../create-survey/create-survey.component.ts | 6 +++--- .../components/create-survey/create-survey.module.ts | 6 +++--- .../data-sharing-terms.component.spec.ts | 2 +- .../edit-details/edit-details.component.spec.ts | 2 +- .../edit-survey/edit-details/edit-details.component.ts | 2 +- .../edit-survey/edit-job/edit-job.component.spec.ts | 2 +- .../components/edit-survey/edit-job/edit-job.module.ts | 2 +- .../edit-survey/edit-survey.component.spec.ts | 2 +- .../app/components/edit-survey/edit-survey.module.ts | 2 +- web/src/app/components/error/error.module.ts | 2 +- .../shared/loi-editor/loi-editor.component.ts | 6 +++--- .../shared/loi-selection/loi-selection.module.ts | 2 +- .../shared/survey-list/survey-list.component.spec.ts | 10 +++++----- .../shared/survey-list/survey-list.component.ts | 10 +++++----- .../tasks-editor/task-form/task-form.component.ts | 10 +++++----- web/src/app/routing.module.ts | 10 +++++----- 18 files changed, 44 insertions(+), 44 deletions(-) diff --git a/web/src/app/components/about/about.module.ts b/web/src/app/components/about/about.module.ts index 57275b577..efbc03b4e 100644 --- a/web/src/app/components/about/about.module.ts +++ b/web/src/app/components/about/about.module.ts @@ -20,8 +20,8 @@ import {MatButton} from '@angular/material/button'; import {MatIcon} from '@angular/material/icon'; import {RouterModule} from '@angular/router'; -import {HeaderModule} from 'app/components/shared/header/header.module'; import {AboutComponent} from 'app/components/about/about.component'; +import {HeaderModule} from 'app/components/shared/header/header.module'; @NgModule({ declarations: [AboutComponent], diff --git a/web/src/app/components/create-survey/create-survey.component.spec.ts b/web/src/app/components/create-survey/create-survey.component.spec.ts index 062400b35..451369817 100644 --- a/web/src/app/components/create-survey/create-survey.component.spec.ts +++ b/web/src/app/components/create-survey/create-survey.component.spec.ts @@ -30,11 +30,6 @@ import {ActivatedRoute} from '@angular/router'; import {List, Map} from 'immutable'; import {Observable, Subject} from 'rxjs'; -import {ShareSurveyComponent} from 'app/components/shared/share-survey/share-survey.component'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; -import {Task, TaskType} from 'app/models/task/task.model'; import { CreateSurveyComponent, CreateSurveyPhase, @@ -42,6 +37,11 @@ import { import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; +import {ShareSurveyComponent} from 'app/components/shared/share-survey/share-survey.component'; +import {Job} from 'app/models/job.model'; +import {LocationOfInterest} from 'app/models/loi.model'; +import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; +import {Task, TaskType} from 'app/models/task/task.model'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; diff --git a/web/src/app/components/create-survey/create-survey.component.ts b/web/src/app/components/create-survey/create-survey.component.ts index 87517813d..17d5729ab 100644 --- a/web/src/app/components/create-survey/create-survey.component.ts +++ b/web/src/app/components/create-survey/create-survey.component.ts @@ -21,13 +21,13 @@ import {ActivatedRoute} from '@angular/router'; import {List} from 'immutable'; import {Subscription, combineLatest, filter} from 'rxjs'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Survey, SurveyState} from 'app/models/survey.model'; import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; import {TaskDetailsComponent} from 'app/components/create-survey/task-details/task-details.component'; +import {DataCollectionStrategy, Job} from 'app/models/job.model'; +import {LocationOfInterest} from 'app/models/loi.model'; +import {Survey, SurveyState} from 'app/models/survey.model'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; import {LocationOfInterestService} from 'app/services/loi/loi.service'; diff --git a/web/src/app/components/create-survey/create-survey.module.ts b/web/src/app/components/create-survey/create-survey.module.ts index 5b88bd6a9..313a6f51d 100644 --- a/web/src/app/components/create-survey/create-survey.module.ts +++ b/web/src/app/components/create-survey/create-survey.module.ts @@ -21,12 +21,12 @@ import {MatInputModule} from '@angular/material/input'; import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; -import {HeaderModule} from 'app/components/shared/header/header.module'; -import {ShareSurveyModule} from 'app/components/shared/share-survey/share-survey.module'; import {CreateSurveyComponent} from 'app/components/create-survey/create-survey.component'; import {DataSharingTermsModule} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.module'; import {TaskDetailsModule} from 'app/components/create-survey/task-details/task-details.module'; +import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; +import {HeaderModule} from 'app/components/shared/header/header.module'; +import {ShareSurveyModule} from 'app/components/shared/share-survey/share-survey.module'; import {JobDetailsModule} from './job-details/job-details.module'; import {StepCardModule} from './step-card/step-card.module'; diff --git a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts index 00c91af04..951e0fda4 100644 --- a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts @@ -21,11 +21,11 @@ import {ReactiveFormsModule} from '@angular/forms'; import {MatCardModule} from '@angular/material/card'; import {MatRadioModule} from '@angular/material/radio'; +import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; import { DATA_SHARING_TYPE_DESCRIPTION, DataSharingType, } from 'app/models/survey.model'; -import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; describe('DataSharingTermsComponent', () => { let component: DataSharingTermsComponent; diff --git a/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts index d1977c647..ed35fd630 100644 --- a/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts @@ -33,10 +33,10 @@ import {By} from '@angular/platform-browser'; import {Map} from 'immutable'; import {of} from 'rxjs'; +import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; import {Job} from 'app/models/job.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/edit-survey/edit-details/edit-details.component.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts index 36521df68..bcd0e92b6 100644 --- a/web/src/app/components/edit-survey/edit-details/edit-details.component.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts @@ -18,8 +18,8 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {Subscription} from 'rxjs'; -import {DATA_SHARING_TYPE_DESCRIPTION, Survey} from 'app/models/survey.model'; import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; +import {DATA_SHARING_TYPE_DESCRIPTION, Survey} from 'app/models/survey.model'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts index dcbdc5f13..d25f5bd06 100644 --- a/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts @@ -28,13 +28,13 @@ import {User} from 'firebase/auth'; import {List, Map} from 'immutable'; import {Subject, from, of} from 'rxjs'; +import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; import {LoiEditorComponent} from 'app/components/shared/loi-editor/loi-editor.component'; import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; import {DataCollectionStrategy, Job} from 'app/models/job.model'; import {LocationOfInterest} from 'app/models/loi.model'; import {Role} from 'app/models/role.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; import {AuthService} from 'app/services/auth/auth.service'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {DialogService} from 'app/services/dialog/dialog.service'; diff --git a/web/src/app/components/edit-survey/edit-job/edit-job.module.ts b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts index 3ccd6dbf0..c200fa13b 100644 --- a/web/src/app/components/edit-survey/edit-job/edit-job.module.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts @@ -22,9 +22,9 @@ import { } from '@angular/material/button-toggle'; import {MatIconModule} from '@angular/material/icon'; +import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; import {LoiEditorModule} from 'app/components/shared/loi-editor/loi-editor.module'; import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; -import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; @NgModule({ declarations: [EditJobComponent], diff --git a/web/src/app/components/edit-survey/edit-survey.component.spec.ts b/web/src/app/components/edit-survey/edit-survey.component.spec.ts index c4b81c8db..0b31dffaa 100644 --- a/web/src/app/components/edit-survey/edit-survey.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-survey.component.spec.ts @@ -35,9 +35,9 @@ import {RouterTestingModule} from '@angular/router/testing'; import {Map} from 'immutable'; import {BehaviorSubject, Subject, of} from 'rxjs'; +import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; import {Job} from 'app/models/job.model'; import {DataSharingType, Survey} from 'app/models/survey.model'; -import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; import {JobService} from 'app/services/job/job.service'; diff --git a/web/src/app/components/edit-survey/edit-survey.module.ts b/web/src/app/components/edit-survey/edit-survey.module.ts index 3bca0eebc..3a0b2fbd5 100644 --- a/web/src/app/components/edit-survey/edit-survey.module.ts +++ b/web/src/app/components/edit-survey/edit-survey.module.ts @@ -25,8 +25,8 @@ import {MatMenuModule} from '@angular/material/menu'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {RouterModule} from '@angular/router'; -import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; +import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; import {SurveyHeaderModule} from '../main-page-container/main-page/survey-header/survey-header.module'; diff --git a/web/src/app/components/error/error.module.ts b/web/src/app/components/error/error.module.ts index a1621ab1d..1581d761d 100644 --- a/web/src/app/components/error/error.module.ts +++ b/web/src/app/components/error/error.module.ts @@ -19,8 +19,8 @@ import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; import {RouterModule} from '@angular/router'; -import {HeaderModule} from 'app/components/shared/header/header.module'; import {ErrorComponent} from 'app/components/error/error.component'; +import {HeaderModule} from 'app/components/shared/header/header.module'; @NgModule({ declarations: [ErrorComponent], diff --git a/web/src/app/components/shared/loi-editor/loi-editor.component.ts b/web/src/app/components/shared/loi-editor/loi-editor.component.ts index 08a60aa9e..2cd7fdfc0 100644 --- a/web/src/app/components/shared/loi-editor/loi-editor.component.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.component.ts @@ -19,14 +19,14 @@ import {MatDialog} from '@angular/material/dialog'; import {MatSlideToggleChange} from '@angular/material/slide-toggle'; import {List} from 'immutable'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Survey} from 'app/models/survey.model'; import { DialogData, DialogType, JobDialogComponent, } from 'app/components/edit-survey/job-dialog/job-dialog.component'; +import {DataCollectionStrategy, Job} from 'app/models/job.model'; +import {LocationOfInterest} from 'app/models/loi.model'; +import {Survey} from 'app/models/survey.model'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {ImportDialogComponent} from '../import-dialog/import-dialog.component'; diff --git a/web/src/app/components/shared/loi-selection/loi-selection.module.ts b/web/src/app/components/shared/loi-selection/loi-selection.module.ts index 5b553cf40..68cd47450 100644 --- a/web/src/app/components/shared/loi-selection/loi-selection.module.ts +++ b/web/src/app/components/shared/loi-selection/loi-selection.module.ts @@ -20,8 +20,8 @@ import {MatButtonModule} from '@angular/material/button'; import {MatListModule} from '@angular/material/list'; import {BrowserModule} from '@angular/platform-browser'; -import {GroundIconModule} from 'app/modules/ground-icon.module'; import {MapModule} from 'app/components/main-page-container/main-page/map/map.module'; +import {GroundIconModule} from 'app/modules/ground-icon.module'; import {LoiSelectionComponent} from './loi-selection.component'; diff --git a/web/src/app/components/shared/survey-list/survey-list.component.spec.ts b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts index 230e3f8f8..4e418188d 100644 --- a/web/src/app/components/shared/survey-list/survey-list.component.spec.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts @@ -34,6 +34,11 @@ import {By} from '@angular/platform-browser'; import {List, Map} from 'immutable'; import {of} from 'rxjs'; +import { + DialogData, + DialogType, + JobDialogComponent, +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {AclEntry} from 'app/models/acl-entry.model'; import {Job} from 'app/models/job.model'; import {Role} from 'app/models/role.model'; @@ -44,11 +49,6 @@ import { SurveyState, } from 'app/models/survey.model'; import {Task, TaskType} from 'app/models/task/task.model'; -import { - DialogData, - DialogType, - JobDialogComponent, -} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {AuthService} from 'app/services/auth/auth.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/shared/survey-list/survey-list.component.ts b/web/src/app/components/shared/survey-list/survey-list.component.ts index 9073cd89e..82f1d621a 100644 --- a/web/src/app/components/shared/survey-list/survey-list.component.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.ts @@ -19,16 +19,16 @@ import {MatDialog} from '@angular/material/dialog'; import {List, Map} from 'immutable'; import {Subscription} from 'rxjs'; -import { - Survey, - SurveyGeneralAccess, - SurveyState, -} from 'app/models/survey.model'; import { DialogData, DialogType, JobDialogComponent, } from 'app/components/edit-survey/job-dialog/job-dialog.component'; +import { + Survey, + SurveyGeneralAccess, + SurveyState, +} from 'app/models/survey.model'; import {AuthService} from 'app/services/auth/auth.service'; import {NavigationService} from 'app/services/navigation/navigation.service'; import {SurveyService} from 'app/services/survey/survey.service'; diff --git a/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts index 9ea3c9333..0f8610d35 100644 --- a/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts +++ b/web/src/app/components/shared/tasks-editor/task-form/task-form.component.ts @@ -34,17 +34,17 @@ import { import {MatDialog} from '@angular/material/dialog'; import {List} from 'immutable'; +import { + DialogData, + DialogType, + JobDialogComponent, +} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {Cardinality} from 'app/models/task/multiple-choice.model'; import { TaskConditionExpressionType, TaskConditionMatchType, } from 'app/models/task/task-condition.model'; import {TaskType} from 'app/models/task/task.model'; -import { - DialogData, - DialogType, - JobDialogComponent, -} from 'app/components/edit-survey/job-dialog/job-dialog.component'; import {DataStoreService} from 'app/services/data-store/data-store.service'; import {moveItemInFormArray} from 'app/utils/utils'; diff --git a/web/src/app/routing.module.ts b/web/src/app/routing.module.ts index b717c96d7..36b704f54 100644 --- a/web/src/app/routing.module.ts +++ b/web/src/app/routing.module.ts @@ -17,14 +17,14 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {SignInPageComponent} from 'app/components/shared/sign-in-page/sign-in-page.component'; -import {SignInPageModule} from 'app/components/shared/sign-in-page/sign-in-page.module'; -import {SurveyListComponent} from 'app/components/shared/survey-list/survey-list.component'; -import {SurveyListModule} from 'app/components/shared/survey-list/survey-list.module'; import {CreateSurveyComponent} from 'app/components/create-survey/create-survey.component'; import {CreateSurveyModule} from 'app/components/create-survey/create-survey.module'; import {MainPageContainerComponent} from 'app/components/main-page-container/main-page-container.component'; import {MainPageContainerModule} from 'app/components/main-page-container/main-page-container.module'; +import {SignInPageComponent} from 'app/components/shared/sign-in-page/sign-in-page.component'; +import {SignInPageModule} from 'app/components/shared/sign-in-page/sign-in-page.module'; +import {SurveyListComponent} from 'app/components/shared/survey-list/survey-list.component'; +import {SurveyListModule} from 'app/components/shared/survey-list/survey-list.module'; import {AuthGuard} from 'app/services/auth/auth.guard'; import {passlistGuard} from 'app/services/auth/passlist.guard'; import { @@ -47,7 +47,6 @@ import { } from 'app/services/navigation/navigation.constants'; import {NavigationService} from 'app/services/navigation/navigation.service'; -import {ShareSurveyComponent} from './components/shared/share-survey/share-survey.component'; import {AboutComponent} from './components/about/about.component'; import {AndroidIntentLandingPageComponent} from './components/android-intent-landing-page/android-intent-landing-page.component'; import {EditDetailsComponent} from './components/edit-survey/edit-details/edit-details.component'; @@ -57,6 +56,7 @@ import {EditSurveyModule} from './components/edit-survey/edit-survey.module'; import {SurveyJsonComponent} from './components/edit-survey/survey-json/survey-json.component'; import {ErrorComponent} from './components/error/error.component'; import {ErrorModule} from './components/error/error.module'; +import {ShareSurveyComponent} from './components/shared/share-survey/share-survey.component'; import {TermsComponent} from './components/terms/terms.component'; const routes: Routes = [ From 613709a2039143d41a07e307c458e4bad6c45507 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 17:11:24 -0500 Subject: [PATCH 25/34] Add spaces between curly brackets to functions/ --- functions/.eslintrc.json | 3 +- functions/.prettierrc.js | 4 +- functions/src/common/auth.ts | 14 ++--- .../src/common/broadcast-survey-update.ts | 2 +- functions/src/common/context.ts | 8 +-- functions/src/common/datastore.ts | 20 +++---- functions/src/common/mail-service.ts | 8 +-- functions/src/common/utils.ts | 2 +- functions/src/export-csv.ts | 28 +++++----- functions/src/export-geojson.spec.ts | 38 +++++++------ functions/src/export-geojson.ts | 22 ++++---- functions/src/handlers.ts | 12 ++-- functions/src/import-geojson.spec.ts | 56 ++++++++++--------- functions/src/import-geojson.ts | 32 +++++------ functions/src/index.ts | 36 +++++++----- functions/src/on-create-loi.ts | 36 ++++++------ .../src/on-create-passlist-entry.spec.ts | 14 ++--- functions/src/on-create-passlist-entry.ts | 12 ++-- functions/src/on-write-job.ts | 6 +- functions/src/on-write-loi.ts | 6 +- functions/src/on-write-submission.spec.ts | 26 ++++----- functions/src/on-write-submission.ts | 10 ++-- functions/src/on-write-survey.ts | 6 +- functions/src/profile-refresh.ts | 6 +- functions/src/session-login.ts | 4 +- functions/src/testing/http-test-helpers.ts | 6 +- 26 files changed, 216 insertions(+), 201 deletions(-) diff --git a/functions/.eslintrc.json b/functions/.eslintrc.json index d1ffdb39e..6ef627425 100644 --- a/functions/.eslintrc.json +++ b/functions/.eslintrc.json @@ -8,6 +8,7 @@ }, "root": true, "rules": { - "eqeqeq": ["error", "always", {"null": "ignore"}] + "eqeqeq": ["error", "always", {"null": "ignore"}], + "space-in-brackets": ["error", "always"] } } diff --git a/functions/.prettierrc.js b/functions/.prettierrc.js index ff1548339..c850055c3 100644 --- a/functions/.prettierrc.js +++ b/functions/.prettierrc.js @@ -1,3 +1,5 @@ module.exports = { - ...require('gts/.prettierrc.json') + ...require('gts/.prettierrc.json'), + bracketSpacing: true } + \ No newline at end of file diff --git a/functions/src/common/auth.ts b/functions/src/common/auth.ts index 617fbbfe9..6bfacc504 100644 --- a/functions/src/common/auth.ts +++ b/functions/src/common/auth.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {DecodedIdToken, getAuth} from 'firebase-admin/auth'; -import {DocumentSnapshot} from 'firebase-admin/firestore'; -import {https, Response} from 'firebase-functions/v1'; -import {EmulatorIdToken} from '../handlers'; -import {GroundProtos} from '@ground/proto'; -import {registry} from '@ground/lib'; +import { DecodedIdToken, getAuth } from 'firebase-admin/auth'; +import { DocumentSnapshot } from 'firebase-admin/firestore'; +import { https, Response } from 'firebase-functions/v1'; +import { EmulatorIdToken } from '../handlers'; +import { GroundProtos } from '@ground/proto'; +import { registry } from '@ground/lib'; import Pb = GroundProtos.ground.v1beta1; const s = registry.getFieldIds(Pb.Survey); @@ -71,7 +71,7 @@ export async function setSessionCookie( ): Promise { const token = getAuthBearer(req); const expiresIn = 60 * 60 * 24 * 5 * 1000; // 5 days - const cookie = await getAuth().createSessionCookie(token!, {expiresIn}); + const cookie = await getAuth().createSessionCookie(token!, { expiresIn }); res.cookie(SESSION_COOKIE_NAME, cookie, { maxAge: expiresIn, httpOnly: true, diff --git a/functions/src/common/broadcast-survey-update.ts b/functions/src/common/broadcast-survey-update.ts index dea341b8b..bca4410ab 100644 --- a/functions/src/common/broadcast-survey-update.ts +++ b/functions/src/common/broadcast-survey-update.ts @@ -27,5 +27,5 @@ import * as admin from 'firebase-admin'; export async function broadcastSurveyUpdate(topic: string): Promise { console.debug(`Sending message to ${topic}`); - return admin.messaging().send({topic}); + return admin.messaging().send({ topic }); } diff --git a/functions/src/common/context.ts b/functions/src/common/context.ts index e2a36718f..9903551f8 100644 --- a/functions/src/common/context.ts +++ b/functions/src/common/context.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Datastore} from './datastore'; -import {MailService} from './mail-service'; -import {initializeApp, getApp} from 'firebase-admin/app'; -import {getFirestore} from 'firebase-admin/firestore'; +import { Datastore } from './datastore'; +import { MailService } from './mail-service'; +import { initializeApp, getApp } from 'firebase-admin/app'; +import { getFirestore } from 'firebase-admin/firestore'; let datastore: Datastore | undefined; let mailService: MailService | undefined; diff --git a/functions/src/common/datastore.ts b/functions/src/common/datastore.ts index b61c09f3d..d726af9b9 100644 --- a/functions/src/common/datastore.ts +++ b/functions/src/common/datastore.ts @@ -15,13 +15,13 @@ */ import * as functions from 'firebase-functions'; -import {firestore} from 'firebase-admin'; -import {DocumentData, FieldPath, GeoPoint} from 'firebase-admin/firestore'; -import {registry} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; +import { firestore } from 'firebase-admin'; +import { DocumentData, FieldPath, GeoPoint } from 'firebase-admin/firestore'; +import { registry } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; import Pb = GroundProtos.ground.v1beta1; -import {leftOuterJoinSorted, QueryIterator} from './query-iterator'; +import { leftOuterJoinSorted, QueryIterator } from './query-iterator'; const l = registry.getFieldIds(Pb.LocationOfInterest); const sb = registry.getFieldIds(Pb.Submission); @@ -104,7 +104,7 @@ export class Datastore { constructor(db: firestore.Firestore) { this.db_ = db; - db.settings({ignoreUndefinedProperties: true}); + db.settings({ ignoreUndefinedProperties: true }); } /** @@ -112,14 +112,14 @@ export class Datastore { * These attributes are merged with other existing ones if already present. */ async mergeUserProfile(user: functions.auth.UserRecord) { - const {uid, email, displayName, photoURL} = user; + const { uid, email, displayName, photoURL } = user; await this.db_.doc(`users/${uid}`).set( { email, displayName, photoURL: photoURL && Datastore.trimPhotoURLSizeSuffix(photoURL), }, - {merge: true} + { merge: true } ); } @@ -226,7 +226,7 @@ export class Datastore { async updateSubmissionCount(surveyId: string, loiId: string, count: number) { const loiRef = this.db_.doc(loi(surveyId, loiId)); - await loiRef.update({[l.submissionCount]: count}); + await loiRef.update({ [l.submissionCount]: count }); } async updateLoiProperties( @@ -235,7 +235,7 @@ export class Datastore { loiDoc: DocumentData ) { const loiRef = this.db_.doc(loi(surveyId, loiId)); - await loiRef.update({[l.properties]: loiDoc[l.properties]}); + await loiRef.update({ [l.properties]: loiDoc[l.properties] }); } static toFirestoreMap(geometry: any) { diff --git a/functions/src/common/mail-service.ts b/functions/src/common/mail-service.ts index 54ca60b4b..3043e353b 100644 --- a/functions/src/common/mail-service.ts +++ b/functions/src/common/mail-service.ts @@ -16,7 +16,7 @@ import * as nodemailer from 'nodemailer'; import sanitizeHtml from 'sanitize-html'; -import {Datastore} from './datastore'; +import { Datastore } from './datastore'; type MailConfig = { server?: MailServerConfig; @@ -45,14 +45,14 @@ export class MailService { private sender_: string; constructor(mailServerConfig: MailServerConfig) { - const {host, port, username, password, sender} = mailServerConfig; + const { host, port, username, password, sender } = mailServerConfig; this.sender_ = sender || username; this.transporter_ = nodemailer.createTransport({ host, port, - auth: {user: username, pass: password}, + auth: { user: username, pass: password }, sender: this.sender_, }); } @@ -63,7 +63,7 @@ export class MailService { * @param email - Email object containing recipient, subject, and body. */ async sendMail(email: MailServiceEmail): Promise { - const {html} = email; + const { html } = email; const safeHtml = sanitizeHtml(html, { allowedTags: ['br', 'a'], diff --git a/functions/src/common/utils.ts b/functions/src/common/utils.ts index 86904e189..cd50928f7 100644 --- a/functions/src/common/utils.ts +++ b/functions/src/common/utils.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {GroundProtos} from '@ground/proto'; +import { GroundProtos } from '@ground/proto'; import Pb = GroundProtos.ground.v1beta1; diff --git a/functions/src/export-csv.ts b/functions/src/export-csv.ts index 4ac4f7378..6b6477662 100644 --- a/functions/src/export-csv.ts +++ b/functions/src/export-csv.ts @@ -16,17 +16,17 @@ import * as functions from 'firebase-functions'; import * as csv from '@fast-csv/format'; -import {canExport, hasOrganizerRole} from './common/auth'; -import {isAccessibleLoi} from './common/utils'; -import {geojsonToWKT} from '@terraformer/wkt'; -import {getDatastore} from './common/context'; +import { canExport, hasOrganizerRole } from './common/auth'; +import { isAccessibleLoi } from './common/utils'; +import { geojsonToWKT } from '@terraformer/wkt'; +import { getDatastore } from './common/context'; import * as HttpStatus from 'http-status-codes'; -import {DecodedIdToken} from 'firebase-admin/auth'; -import {List} from 'immutable'; -import {QuerySnapshot} from 'firebase-admin/firestore'; -import {timestampToInt, toMessage} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; -import {toGeoJsonGeometry} from '@ground/lib'; +import { DecodedIdToken } from 'firebase-admin/auth'; +import { List } from 'immutable'; +import { QuerySnapshot } from 'firebase-admin/firestore'; +import { timestampToInt, toMessage } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; +import { toGeoJsonGeometry } from '@ground/lib'; import Pb = GroundProtos.ground.v1beta1; @@ -40,7 +40,7 @@ export async function exportCsvHandler( user: DecodedIdToken ) { const db = getDatastore(); - const {uid: userId} = user; + const { uid: userId } = user; const surveyId = req.query.survey as string; const jobId = req.query.job as string; @@ -73,7 +73,7 @@ export async function exportCsvHandler( .send('Unsupported or corrupt job'); return; } - const {name: jobName} = job; + const { name: jobName } = job; const isOrganizer = hasOrganizerRole(user, surveyDoc); @@ -164,11 +164,11 @@ function writeRow( // Header: One column for each loi property (merged over all properties across all LOIs) getPropertiesByName(loi, loiProperties).forEach(v => row.push(quote(v))); if (submission) { - const {taskData: data} = submission; + const { taskData: data } = submission; // Header: One column for each task tasks.forEach(task => row.push(quote(getValue(task, data)))); // Header: contributor_username, contributor_email, created_client_timestamp, created_server_timestamp - const {created} = submission; + const { created } = submission; row.push(quote(created?.displayName)); row.push(quote(created?.emailAddress)); row.push( diff --git a/functions/src/export-geojson.spec.ts b/functions/src/export-geojson.spec.ts index 62d5aa2e1..8673ac98a 100644 --- a/functions/src/export-geojson.spec.ts +++ b/functions/src/export-geojson.spec.ts @@ -22,14 +22,14 @@ import { createGetRequestSpy, createResponseSpy, } from './testing/http-test-helpers'; -import {DecodedIdToken} from 'firebase-admin/auth'; +import { DecodedIdToken } from 'firebase-admin/auth'; import HttpStatus from 'http-status-codes'; -import {DATA_COLLECTOR_ROLE} from './common/auth'; -import {resetDatastore} from './common/context'; -import {Firestore} from 'firebase-admin/firestore'; -import {exportGeojsonHandler} from './export-geojson'; -import {registry} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; +import { DATA_COLLECTOR_ROLE } from './common/auth'; +import { resetDatastore } from './common/context'; +import { Firestore } from 'firebase-admin/firestore'; +import { exportGeojsonHandler } from './export-geojson'; +import { registry } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; import Pb = GroundProtos.ground.v1beta1; const sv = registry.getFieldIds(Pb.Survey); @@ -122,13 +122,15 @@ describe('export()', () => { [l.jobId]: job1.id, [l.customTag]: 'POINT_001', [l.geometry]: { - [g.point]: {[p.coordinates]: {[c.latitude]: 10.1, [c.longitude]: 125.6}}, + [g.point]: { + [p.coordinates]: { [c.latitude]: 10.1, [c.longitude]: 125.6 }, + }, }, [l.submissionCount]: 0, [l.source]: Pb.LocationOfInterest.Source.FIELD_DATA, [l.properties]: { - area: {[pr.numericValue]: 3.08}, - name: {[pr.stringValue]: 'Dinagat Islands'}, + area: { [pr.numericValue]: 3.08 }, + name: { [pr.stringValue]: 'Dinagat Islands' }, }, [l.ownerId]: userId, }; @@ -138,12 +140,14 @@ describe('export()', () => { [l.jobId]: job1.id, [l.customTag]: 'POINT_002', [l.geometry]: { - [g.point]: {[p.coordinates]: {[c.latitude]: 47.05, [c.longitude]: 8.3}}, + [g.point]: { + [p.coordinates]: { [c.latitude]: 47.05, [c.longitude]: 8.3 }, + }, }, [l.submissionCount]: 0, [l.source]: Pb.LocationOfInterest.Source.FIELD_DATA, [l.properties]: { - name: {[pr.stringValue]: 'Luzern'}, + name: { [pr.stringValue]: 'Luzern' }, }, }; const testCases = [ @@ -159,8 +163,8 @@ describe('export()', () => { features: [ { type: 'Feature', - properties: {area: 3.08, name: 'Dinagat Islands'}, - geometry: {type: 'Point', coordinates: [125.6, 10.1]}, + properties: { area: 3.08, name: 'Dinagat Islands' }, + geometry: { type: 'Point', coordinates: [125.6, 10.1] }, }, ], }, @@ -177,14 +181,14 @@ describe('export()', () => { }); testCases.forEach( - ({desc, jobId, survey, jobs, lois, expectedFilename, expectedGeojson}) => + ({ desc, jobId, survey, jobs, lois, expectedFilename, expectedGeojson }) => it(desc, async () => { // Populate database. mockFirestore.doc(`surveys/${survey.id}`).set(survey); - jobs?.forEach(({id, ...job}) => + jobs?.forEach(({ id, ...job }) => mockFirestore.doc(`surveys/${survey.id}/jobs/${id}`).set(job) ); - lois?.forEach(({id, ...loi}) => + lois?.forEach(({ id, ...loi }) => mockFirestore.doc(`surveys/${survey.id}/lois/${id}`).set(loi) ); diff --git a/functions/src/export-geojson.ts b/functions/src/export-geojson.ts index 18162ffcd..595851dd9 100644 --- a/functions/src/export-geojson.ts +++ b/functions/src/export-geojson.ts @@ -15,14 +15,14 @@ */ import * as functions from 'firebase-functions'; -import {canExport, hasOrganizerRole} from './common/auth'; -import {getDatastore} from './common/context'; -import {isAccessibleLoi} from './common/utils'; +import { canExport, hasOrganizerRole } from './common/auth'; +import { getDatastore } from './common/context'; +import { isAccessibleLoi } from './common/utils'; import * as HttpStatus from 'http-status-codes'; -import {DecodedIdToken} from 'firebase-admin/auth'; -import {toMessage} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; -import {toGeoJsonGeometry} from '@ground/lib'; +import { DecodedIdToken } from 'firebase-admin/auth'; +import { toMessage } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; +import { toGeoJsonGeometry } from '@ground/lib'; import Pb = GroundProtos.ground.v1beta1; @@ -35,7 +35,7 @@ export async function exportGeojsonHandler( user: DecodedIdToken ) { const db = getDatastore(); - const {uid: userId} = user; + const { uid: userId } = user; const surveyId = req.query.survey as string; const jobId = req.query.job as string; @@ -68,7 +68,7 @@ export async function exportGeojsonHandler( .send('Unsupported or corrupt job'); return; } - const {name: jobName} = job; + const { name: jobName } = job; const isOrganizer = hasOrganizerRole(user, surveyDoc); @@ -143,8 +143,8 @@ function getFileName(jobName: string | null) { function propertiesPbToObject(pb: { [k: string]: Pb.LocationOfInterest.IProperty; -}): {[k: string]: string | number} { - const properties: {[k: string]: string | number} = {}; +}): { [k: string]: string | number } { + const properties: { [k: string]: string | number } = {}; for (const k of Object.keys(pb).sort()) { const v = pb[k].stringValue || pb[k].numericValue; if (v !== null && v !== undefined) { diff --git a/functions/src/handlers.ts b/functions/src/handlers.ts index e830d1d51..93b9f6695 100644 --- a/functions/src/handlers.ts +++ b/functions/src/handlers.ts @@ -15,14 +15,14 @@ */ import cors from 'cors'; -import {DecodedIdToken} from 'firebase-admin/auth'; -import {https, Response} from 'firebase-functions'; -import {getDecodedIdToken} from './common/auth'; -import {INTERNAL_SERVER_ERROR, UNAUTHORIZED} from 'http-status-codes'; +import { DecodedIdToken } from 'firebase-admin/auth'; +import { https, Response } from 'firebase-functions'; +import { getDecodedIdToken } from './common/auth'; +import { INTERNAL_SERVER_ERROR, UNAUTHORIZED } from 'http-status-codes'; import cookieParser from 'cookie-parser'; import HttpStatus from 'http-status-codes'; -const corsOptions = {origin: true}; +const corsOptions = { origin: true }; const corsMiddleware = cors(corsOptions); /** Token to be used when running on local emulator for debugging. */ @@ -30,7 +30,7 @@ export class EmulatorIdToken implements DecodedIdToken { aud = ''; auth_time = 0; exp = 0; - firebase = {identities: {}, sign_in_provider: ''}; + firebase = { identities: {}, sign_in_provider: '' }; iat = 0; iss = ''; sub = ''; diff --git a/functions/src/import-geojson.spec.ts b/functions/src/import-geojson.spec.ts index b92af975d..e5cffe7cc 100644 --- a/functions/src/import-geojson.spec.ts +++ b/functions/src/import-geojson.spec.ts @@ -22,16 +22,16 @@ import { createPostRequestSpy, createResponseSpy, } from './testing/http-test-helpers'; -import {importGeoJsonCallback} from './import-geojson'; -import {DecodedIdToken} from 'firebase-admin/auth'; -import {Blob, FormData} from 'formdata-node'; +import { importGeoJsonCallback } from './import-geojson'; +import { DecodedIdToken } from 'firebase-admin/auth'; +import { Blob, FormData } from 'formdata-node'; import HttpStatus from 'http-status-codes'; -import {invokeCallbackAsync} from './handlers'; -import {SURVEY_ORGANIZER_ROLE} from './common/auth'; -import {resetDatastore} from './common/context'; -import {Firestore} from 'firebase-admin/firestore'; -import {registry} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; +import { invokeCallbackAsync } from './handlers'; +import { SURVEY_ORGANIZER_ROLE } from './common/auth'; +import { resetDatastore } from './common/context'; +import { Firestore } from 'firebase-admin/firestore'; +import { registry } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; import Pb = GroundProtos.ground.v1beta1; const sv = registry.getFieldIds(Pb.Survey); @@ -75,13 +75,15 @@ describe('importGeoJson()', () => { const pointLoi = { [l.jobId]: 'job123', [l.geometry]: { - [g.point]: {[p.coordinates]: {[c.latitude]: 10.1, [c.longitude]: 125.6}}, + [g.point]: { + [p.coordinates]: { [c.latitude]: 10.1, [c.longitude]: 125.6 }, + }, }, [l.submissionCount]: 0, [l.source]: 1, // IMPORTED [l.properties]: { - name: {[pr.stringValue]: 'Dinagat Islands'}, - area: {[pr.numericValue]: 3.08}, + name: { [pr.stringValue]: 'Dinagat Islands' }, + area: { [pr.numericValue]: 3.08 }, }, }; const geoJsonWithPolygon = { @@ -109,10 +111,10 @@ describe('importGeoJson()', () => { [g.polygon]: { [pg.shell]: { [lr.coordinates]: [ - {[c.latitude]: 0, [c.longitude]: 100}, - {[c.latitude]: 0, [c.longitude]: 101}, - {[c.latitude]: 1, [c.longitude]: 101}, - {[c.latitude]: 0, [c.longitude]: 100}, + { [c.latitude]: 0, [c.longitude]: 100 }, + { [c.latitude]: 0, [c.longitude]: 101 }, + { [c.latitude]: 1, [c.longitude]: 101 }, + { [c.latitude]: 0, [c.longitude]: 100 }, ], }, }, @@ -158,10 +160,10 @@ describe('importGeoJson()', () => { { [pg.shell]: { [lr.coordinates]: [ - {[c.latitude]: 0, [c.longitude]: 100}, - {[c.latitude]: 0, [c.longitude]: 101}, - {[c.latitude]: 1, [c.longitude]: 101}, - {[c.latitude]: 0, [c.longitude]: 100}, + { [c.latitude]: 0, [c.longitude]: 100 }, + { [c.latitude]: 0, [c.longitude]: 101 }, + { [c.latitude]: 1, [c.longitude]: 101 }, + { [c.latitude]: 0, [c.longitude]: 100 }, ], }, }, @@ -169,10 +171,10 @@ describe('importGeoJson()', () => { { [pg.shell]: { [lr.coordinates]: [ - {[c.latitude]: 1, [c.longitude]: 120}, - {[c.latitude]: 1, [c.longitude]: 121}, - {[c.latitude]: 2, [c.longitude]: 121}, - {[c.latitude]: 1, [c.longitude]: 120}, + { [c.latitude]: 1, [c.longitude]: 120 }, + { [c.latitude]: 1, [c.longitude]: 121 }, + { [c.latitude]: 2, [c.longitude]: 121 }, + { [c.latitude]: 1, [c.longitude]: 120 }, ], }, }, @@ -217,7 +219,7 @@ describe('importGeoJson()', () => { }, { desc: 'imports unsupported feature type', - input: {...geoJsonWithPoint, type: 'UnsupportedFeature'}, + input: { ...geoJsonWithPoint, type: 'UnsupportedFeature' }, expectedStatus: HttpStatus.BAD_REQUEST, expected: [], }, @@ -253,14 +255,14 @@ describe('importGeoJson()', () => { return form; } - testCases.forEach(({desc, input, expectedStatus, expected}) => + testCases.forEach(({ desc, input, expectedStatus, expected }) => it(desc, async () => { // Add survey. mockFirestore.doc(`surveys/${surveyId}`).set(survey); // Build mock request and response. const req = await createPostRequestSpy( - {url: '/importGeoJson'}, + { url: '/importGeoJson' }, createPostData(surveyId, jobId, input) ); const res = createResponseSpy(); diff --git a/functions/src/import-geojson.ts b/functions/src/import-geojson.ts index 042757455..d73c93cda 100644 --- a/functions/src/import-geojson.ts +++ b/functions/src/import-geojson.ts @@ -16,15 +16,15 @@ import functions from 'firebase-functions'; import HttpStatus from 'http-status-codes'; -import {getDatastore} from './common/context'; +import { getDatastore } from './common/context'; import Busboy from 'busboy'; import JSONStream from 'jsonstream-ts'; -import {canImport} from './common/auth'; -import {DecodedIdToken} from 'firebase-admin/auth'; -import {GroundProtos} from '@ground/proto'; -import {toDocumentData, toGeometryPb, isGeometryValid} from '@ground/lib'; -import {Feature, GeoJsonProperties} from 'geojson'; -import {ErrorHandler} from './handlers'; +import { canImport } from './common/auth'; +import { DecodedIdToken } from 'firebase-admin/auth'; +import { GroundProtos } from '@ground/proto'; +import { toDocumentData, toGeometryPb, isGeometryValid } from '@ground/lib'; +import { Feature, GeoJsonProperties } from 'geojson'; +import { ErrorHandler } from './handlers'; import Pb = GroundProtos.ground.v1beta1; @@ -50,12 +50,12 @@ export function importGeoJsonCallback( ); } - const busboy = Busboy({headers: req.headers}); + const busboy = Busboy({ headers: req.headers }); let hasError = false; // Dictionary used to accumulate task step values, keyed by step name. - const params: {[name: string]: string} = {}; + const params: { [name: string]: string } = {}; // Accumulate Promises for insert operations, so we don't finalize the res // stream before operations are complete. @@ -67,7 +67,7 @@ export function importGeoJsonCallback( // This code will process each file uploaded. busboy.on('file', async (_fieldname, fileStream) => { - const {survey: surveyId, job: jobId} = params; + const { survey: surveyId, job: jobId } = params; if (!surveyId || !jobId) { return error(HttpStatus.BAD_REQUEST, 'Missing survey and/or job ID'); } @@ -117,7 +117,7 @@ export function importGeoJsonCallback( await Promise.all(inserts); const count = inserts.length; console.debug(`${count} LOIs imported`); - res.send(JSON.stringify({count})); + res.send(JSON.stringify({ count })); done(); } catch (err) { console.debug(err); @@ -158,11 +158,11 @@ export function importGeoJsonCallback( * data uses the 'CRS84' coordinate reference system. */ function onGeoJsonCrs( - geoJsonCrs: {type: string; properties: {name?: string}} | undefined + geoJsonCrs: { type: string; properties: { name?: string } } | undefined ) { let crs = 'CRS84'; if (geoJsonCrs) { - const {type, properties} = geoJsonCrs; + const { type, properties } = geoJsonCrs; switch (type) { case 'name': crs = properties?.name ?? 'CRS84'; @@ -222,7 +222,7 @@ function toLoiPb( ownerId: string ): Pb.LocationOfInterest { // TODO: Add created/modified metadata. - const {id, geometry, properties} = feature; + const { id, geometry, properties } = feature; const geometryPb = toGeometryPb(geometry); return new Pb.LocationOfInterest({ jobId, @@ -245,7 +245,7 @@ export function toLoiPbProperties(properties: GeoJsonProperties): { function toLoiPbProperty(value: any): Pb.LocationOfInterest.Property { return new Pb.LocationOfInterest.Property( typeof value === 'number' - ? {numericValue: value} - : {stringValue: value?.toString() || ''} + ? { numericValue: value } + : { stringValue: value?.toString() || '' } ); } diff --git a/functions/src/index.ts b/functions/src/index.ts index 794bd3352..a6f471ca0 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -16,21 +16,27 @@ import 'module-alias/register'; import * as functions from 'firebase-functions'; -import {onHttpsRequest, onHttpsRequestAsync} from './handlers'; -import {handleProfileRefresh} from './profile-refresh'; -import {sessionLoginHandler} from './session-login'; -import {importGeoJsonCallback} from './import-geojson'; -import {exportCsvHandler} from './export-csv'; -import {exportGeojsonHandler} from './export-geojson'; -import {onCall} from 'firebase-functions/v2/https'; -import {onCreateLoiHandler} from './on-create-loi'; -import {onCreatePasslistEntryHandler} from './on-create-passlist-entry'; -import {onWriteJobHandler} from './on-write-job'; -import {onWriteLoiHandler} from './on-write-loi'; -import {onWriteSubmissionHandler} from './on-write-submission'; -import {onWriteSurveyHandler} from './on-write-survey'; -import {job, loi, passlistEntry, submission, survey} from './common/datastore'; -import {initializeFirebaseApp} from './common/context'; +import { onHttpsRequest, onHttpsRequestAsync } from './handlers'; +import { handleProfileRefresh } from './profile-refresh'; +import { sessionLoginHandler } from './session-login'; +import { importGeoJsonCallback } from './import-geojson'; +import { exportCsvHandler } from './export-csv'; +import { exportGeojsonHandler } from './export-geojson'; +import { onCall } from 'firebase-functions/v2/https'; +import { onCreateLoiHandler } from './on-create-loi'; +import { onCreatePasslistEntryHandler } from './on-create-passlist-entry'; +import { onWriteJobHandler } from './on-write-job'; +import { onWriteLoiHandler } from './on-write-loi'; +import { onWriteSubmissionHandler } from './on-write-submission'; +import { onWriteSurveyHandler } from './on-write-survey'; +import { + job, + loi, + passlistEntry, + submission, + survey, +} from './common/datastore'; +import { initializeFirebaseApp } from './common/context'; // Ensure Firebase is initialized. initializeFirebaseApp(); diff --git a/functions/src/on-create-loi.ts b/functions/src/on-create-loi.ts index 77107379d..eb12040fe 100644 --- a/functions/src/on-create-loi.ts +++ b/functions/src/on-create-loi.ts @@ -14,23 +14,23 @@ * limitations under the License. */ -import {EventContext} from 'firebase-functions'; -import {QueryDocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {getDatastore} from './common/context'; -import {Datastore} from './common/datastore'; -import {broadcastSurveyUpdate} from './common/broadcast-survey-update'; -import {GroundProtos} from '@ground/proto'; -import {toDocumentData, toGeoJsonGeometry, toMessage} from '@ground/lib'; -import {geojsonToWKT} from '@terraformer/wkt'; -import {toLoiPbProperties} from './import-geojson'; +import { EventContext } from 'firebase-functions'; +import { QueryDocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { getDatastore } from './common/context'; +import { Datastore } from './common/datastore'; +import { broadcastSurveyUpdate } from './common/broadcast-survey-update'; +import { GroundProtos } from '@ground/proto'; +import { toDocumentData, toGeoJsonGeometry, toMessage } from '@ground/lib'; +import { geojsonToWKT } from '@terraformer/wkt'; +import { toLoiPbProperties } from './import-geojson'; import Pb = GroundProtos.ground.v1beta1; -type Properties = {[key: string]: string | number}; +type Properties = { [key: string]: string | number }; -type Headers = {[key: string]: string}; +type Headers = { [key: string]: string }; -type Body = {[key: string]: any}; +type Body = { [key: string]: any }; type PropertyGenerator = { headers?: Headers; @@ -40,7 +40,7 @@ type PropertyGenerator = { url: string; }; -const defaultHeaders = {'Content-Type': 'application/json'}; +const defaultHeaders = { 'Content-Type': 'application/json' }; /** * Handles the creation of a Location of Interest (LOI) document in Firestore. @@ -73,14 +73,14 @@ export async function onCreateLoiHandler( const propertyGenerator = propertyGeneratorDoc.data() as PropertyGenerator; if (propertyGeneratorDoc.id === 'whisp') { - const {body, headers, prefix, url} = propertyGenerator; + const { body, headers, prefix, url } = propertyGenerator; const wkt = geojsonToWKT(Datastore.fromFirestoreMap(geometry)); const newProperties = await fetchWhispProperties( url, - {...defaultHeaders, ...headers}, - {wkt, ...body} + { ...defaultHeaders, ...headers }, + { wkt, ...body } ); properties = await updateProperties(properties, newProperties, prefix); @@ -95,7 +95,7 @@ export async function onCreateLoiHandler( surveyId, loiId, toDocumentData( - new Pb.LocationOfInterest({properties: toLoiPbProperties(properties)}) + new Pb.LocationOfInterest({ properties: toLoiPbProperties(properties) }) ) ); @@ -158,7 +158,7 @@ function removePrefixedKeys(obj: Properties, prefix: string): Properties { function propertiesPbToObject(pb: { [k: string]: Pb.LocationOfInterest.IProperty; }): Properties { - const properties: {[k: string]: string | number} = {}; + const properties: { [k: string]: string | number } = {}; for (const k of Object.keys(pb)) { const v = pb[k].stringValue || pb[k].numericValue; if (v !== null && v !== undefined) { diff --git a/functions/src/on-create-passlist-entry.spec.ts b/functions/src/on-create-passlist-entry.spec.ts index 5ad238c0f..6a0d04cc7 100644 --- a/functions/src/on-create-passlist-entry.spec.ts +++ b/functions/src/on-create-passlist-entry.spec.ts @@ -20,11 +20,11 @@ import { newEventContext, stubAdminApi, } from '@ground/lib/dist/testing/firestore'; -import {resetDatastore} from './common/context'; -import {Firestore} from 'firebase-admin/firestore'; +import { resetDatastore } from './common/context'; +import { Firestore } from 'firebase-admin/firestore'; import * as functions from './index'; import * as context from './common/context'; -import {MailService} from './common/mail-service'; +import { MailService } from './common/mail-service'; const test = require('firebase-functions-test')(); @@ -71,21 +71,21 @@ describe('onCreatePasslistEntry()', () => { it('mail server config exists', async () => { const docRef = mockFirestore.doc('config/mail'); - docRef.set({server: serverConfig}); + docRef.set({ server: serverConfig }); const docSnapshot = await docRef.get(); const data = docSnapshot.data(); - expect(data).toEqual({server: serverConfig}); + expect(data).toEqual({ server: serverConfig }); expect(docSnapshot.exists).toBe(true); expect(docSnapshot.id).toBe('mail'); }); it('sends email notification', async () => { - mockFirestore.doc('config/mail').set({server: serverConfig}); + mockFirestore.doc('config/mail').set({ server: serverConfig }); mockFirestore.doc('config/mail/templates/passlisted').set(mail); mockFirestore.doc(`passlists/${mail.to}`).set({}); await test.wrap(functions.onCreatePasslistEntry)( newDocumentSnapshot({}), - newEventContext({entryId: mail.to}) + newEventContext({ entryId: mail.to }) ); expect(getMailServiceMock).toHaveBeenCalled(); expect(mailServiceMock.sendMail).toHaveBeenCalled(); diff --git a/functions/src/on-create-passlist-entry.ts b/functions/src/on-create-passlist-entry.ts index d68f7fb4c..63cf3bd0c 100644 --- a/functions/src/on-create-passlist-entry.ts +++ b/functions/src/on-create-passlist-entry.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {EventContext} from 'firebase-functions'; -import {QueryDocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {getDatastore, getMailService} from './common/context'; -import {MailServiceEmail} from './common/mail-service'; -import {stringFormat} from './common/utils'; +import { EventContext } from 'firebase-functions'; +import { QueryDocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { getDatastore, getMailService } from './common/context'; +import { MailServiceEmail } from './common/mail-service'; +import { stringFormat } from './common/utils'; /** * Handles the creation of a passlist entry. @@ -44,7 +44,7 @@ export async function onCreatePasslistEntryHandler( return; } - const {subject, html: htmlBody} = template; + const { subject, html: htmlBody } = template; const mail = { to: entryId, diff --git a/functions/src/on-write-job.ts b/functions/src/on-write-job.ts index 8ddfa956b..19a0b7036 100644 --- a/functions/src/on-write-job.ts +++ b/functions/src/on-write-job.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Change, EventContext} from 'firebase-functions'; -import {DocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {broadcastSurveyUpdate} from './common/broadcast-survey-update'; +import { Change, EventContext } from 'firebase-functions'; +import { DocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { broadcastSurveyUpdate } from './common/broadcast-survey-update'; export async function onWriteJobHandler( _: Change, diff --git a/functions/src/on-write-loi.ts b/functions/src/on-write-loi.ts index 3db754c36..662404386 100644 --- a/functions/src/on-write-loi.ts +++ b/functions/src/on-write-loi.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Change, EventContext} from 'firebase-functions'; -import {DocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {broadcastSurveyUpdate} from './common/broadcast-survey-update'; +import { Change, EventContext } from 'firebase-functions'; +import { DocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { broadcastSurveyUpdate } from './common/broadcast-survey-update'; export async function onWriteLoiHandler( _: Change, diff --git a/functions/src/on-write-submission.spec.ts b/functions/src/on-write-submission.spec.ts index 7cccc913f..647950de8 100644 --- a/functions/src/on-write-submission.spec.ts +++ b/functions/src/on-write-submission.spec.ts @@ -22,11 +22,11 @@ import { createMockFirestore, } from '@ground/lib/dist/testing/firestore'; import * as functions from './index'; -import {loi} from './common/datastore'; -import {Firestore} from 'firebase-admin/firestore'; -import {resetDatastore} from './common/context'; -import {registry} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; +import { loi } from './common/datastore'; +import { Firestore } from 'firebase-admin/firestore'; +import { resetDatastore } from './common/context'; +import { registry } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; const test = require('firebase-functions-test')(); @@ -37,8 +37,8 @@ const sb = registry.getFieldIds(Pb.Submission); describe('onWriteSubmission()', () => { let mockFirestore: Firestore; const SURVEY_ID = 'survey1'; - const SUBMISSION = newDocumentSnapshot({loiId: 'loi1', [sb.loiId]: 'loi1'}); - const CONTEXT = newEventContext({surveyId: SURVEY_ID}); + const SUBMISSION = newDocumentSnapshot({ loiId: 'loi1', [sb.loiId]: 'loi1' }); + const CONTEXT = newEventContext({ surveyId: SURVEY_ID }); const SURVEY_PATH = `surveys/${SURVEY_ID}`; const SUBMISSIONS_PATH = `${SURVEY_PATH}/submissions`; const LOI_ID = 'loi1'; @@ -77,31 +77,31 @@ describe('onWriteSubmission()', () => { installSubmissionCountSpy(SUBMISSIONS_PATH, LOI_ID, 2); await test.wrap(functions.onWriteSubmission)( - {before: undefined, after: SUBMISSION}, + { before: undefined, after: SUBMISSION }, CONTEXT ); const loi = await mockFirestore.doc(LOI_PATH).get(); - expect(loi.data()).toEqual({[l.submissionCount]: 2}); + expect(loi.data()).toEqual({ [l.submissionCount]: 2 }); }); it('update submission count on delete', async () => { installSubmissionCountSpy(SUBMISSIONS_PATH, LOI_ID, 1); await test.wrap(functions.onWriteSubmission)( - {before: SUBMISSION, after: undefined}, + { before: SUBMISSION, after: undefined }, CONTEXT ); const loi = await mockFirestore.doc(LOI_PATH).get(); - expect(loi.data()).toEqual({[l.submissionCount]: 1}); + expect(loi.data()).toEqual({ [l.submissionCount]: 1 }); }); it('do nothing on invalid change', async () => { installSubmissionCountSpy(SUBMISSIONS_PATH, LOI_ID, 1); await test.wrap(functions.onWriteSubmission)( - {before: undefined, after: undefined}, + { before: undefined, after: undefined }, CONTEXT ); @@ -119,7 +119,7 @@ describe('onWriteSubmission()', () => { await expectAsync( test.wrap(functions.onWriteSubmission)( - {before: undefined, after: SUBMISSION}, + { before: undefined, after: SUBMISSION }, CONTEXT ) ).toBeRejected(); diff --git a/functions/src/on-write-submission.ts b/functions/src/on-write-submission.ts index 10aea46ec..6acd18d95 100644 --- a/functions/src/on-write-submission.ts +++ b/functions/src/on-write-submission.ts @@ -15,11 +15,11 @@ */ // import * as admin from 'firebase-admin'; -import {Change, EventContext} from 'firebase-functions'; -import {DocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {getDatastore} from './common/context'; -import {registry} from '@ground/lib'; -import {GroundProtos} from '@ground/proto'; +import { Change, EventContext } from 'firebase-functions'; +import { DocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { getDatastore } from './common/context'; +import { registry } from '@ground/lib'; +import { GroundProtos } from '@ground/proto'; import Pb = GroundProtos.ground.v1beta1; const sb = registry.getFieldIds(Pb.Submission); diff --git a/functions/src/on-write-survey.ts b/functions/src/on-write-survey.ts index 1fc695c1b..7a03498f1 100644 --- a/functions/src/on-write-survey.ts +++ b/functions/src/on-write-survey.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Change, EventContext} from 'firebase-functions'; -import {DocumentSnapshot} from 'firebase-functions/v1/firestore'; -import {broadcastSurveyUpdate} from './common/broadcast-survey-update'; +import { Change, EventContext } from 'firebase-functions'; +import { DocumentSnapshot } from 'firebase-functions/v1/firestore'; +import { broadcastSurveyUpdate } from './common/broadcast-survey-update'; export function onWriteSurveyHandler( _: Change, diff --git a/functions/src/profile-refresh.ts b/functions/src/profile-refresh.ts index 1a5a822d6..2a1cd8f97 100644 --- a/functions/src/profile-refresh.ts +++ b/functions/src/profile-refresh.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {getDatastore} from './common/context'; -import {CallableRequest, HttpsError} from 'firebase-functions/v2/https'; -import {getAuth} from 'firebase-admin/auth'; +import { getDatastore } from './common/context'; +import { CallableRequest, HttpsError } from 'firebase-functions/v2/https'; +import { getAuth } from 'firebase-admin/auth'; type ProfileRefreshResponse = String | HttpsError; type ProfileRefreshRequest = CallableRequest; diff --git a/functions/src/session-login.ts b/functions/src/session-login.ts index aa39fd3d3..831bf326a 100644 --- a/functions/src/session-login.ts +++ b/functions/src/session-login.ts @@ -15,8 +15,8 @@ */ import * as functions from 'firebase-functions'; -import {setSessionCookie} from './common/auth'; -import {UNAUTHORIZED} from 'http-status-codes'; +import { setSessionCookie } from './common/auth'; +import { UNAUTHORIZED } from 'http-status-codes'; /** * Generates and sets a session cookie for the current user. diff --git a/functions/src/testing/http-test-helpers.ts b/functions/src/testing/http-test-helpers.ts index 0581287af..8bab09339 100644 --- a/functions/src/testing/http-test-helpers.ts +++ b/functions/src/testing/http-test-helpers.ts @@ -15,9 +15,9 @@ */ import functions from 'firebase-functions'; -import {buffer} from 'node:stream/consumers'; -import {FormDataEncoder} from 'form-data-encoder'; -import {FormData} from 'formdata-node'; +import { buffer } from 'node:stream/consumers'; +import { FormDataEncoder } from 'form-data-encoder'; +import { FormData } from 'formdata-node'; export async function createPostRequestSpy( args: object, From 79e350478cbbad055b31ad2887e9afa580ca6493 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Mon, 15 Dec 2025 17:11:46 -0500 Subject: [PATCH 26/34] Add spaces inside curly brackets in web/ --- web/.eslintrc.json | 1 + web/.prettierrc.js | 4 +- web/src/app/app.component.ts | 8 +- web/src/app/app.module.ts | 36 ++++---- web/src/app/app.spec.ts | 6 +- .../app/components/about/about.component.ts | 4 +- web/src/app/components/about/about.module.ts | 14 +-- .../android-intent-landing-page.component.ts | 10 +-- .../android-intent-landing-page.module.ts | 8 +- .../create-survey.component.spec.ts | 72 +++++++-------- .../create-survey/create-survey.component.ts | 42 ++++----- .../create-survey/create-survey.module.ts | 32 +++---- .../data-sharing-terms.component.spec.ts | 14 +-- .../data-sharing-terms.component.ts | 6 +- .../data-sharing-terms.module.ts | 18 ++-- .../job-details/job-details.component.spec.ts | 4 +- .../job-details/job-details.component.ts | 4 +- .../job-details/job-details.module.ts | 12 +-- .../step-card/step-card.component.spec.ts | 6 +- .../step-card/step-card.component.ts | 2 +- .../step-card/step-card.module.ts | 6 +- .../survey-details.component.spec.ts | 14 +-- .../survey-details.component.ts | 4 +- .../survey-details/survey-details.module.ts | 12 +-- .../survey-loi/survey-loi.component.spec.ts | 48 +++++----- .../survey-loi/survey-loi.component.ts | 18 ++-- .../survey-loi/survey-loi.module.ts | 8 +- .../task-details.component.spec.ts | 30 +++---- .../task-details/task-details.component.ts | 12 +-- .../task-details/task-details.module.ts | 8 +- .../edit-details.component.spec.ts | 40 ++++----- .../edit-details/edit-details.component.ts | 24 ++--- .../edit-details/edit-details.module.ts | 12 +-- .../edit-job/edit-job.component.spec.ts | 54 +++++------ .../edit-job/edit-job.component.ts | 32 +++---- .../edit-survey/edit-job/edit-job.module.ts | 12 +-- .../edit-survey/edit-survey.component.spec.ts | 70 +++++++-------- .../edit-survey/edit-survey.component.ts | 24 ++--- .../edit-survey/edit-survey.module.ts | 26 +++--- .../job-dialog/job-dialog.component.spec.ts | 6 +- .../job-dialog/job-dialog.component.ts | 4 +- .../job-dialog/job-dialog.module.ts | 16 ++-- .../survey-json/survey-json.component.ts | 6 +- .../survey-json/survey-json.module.ts | 16 ++-- .../app/components/error/error.component.ts | 6 +- web/src/app/components/error/error.module.ts | 12 +-- .../main-page-container.component.spec.ts | 24 ++--- .../main-page-container.component.ts | 8 +- .../main-page-container.module.ts | 12 +-- .../drawing-tools.component.spec.ts | 32 +++---- .../drawing-tools/drawing-tools.component.ts | 18 ++-- .../drawing-tools/drawing-tools.module.ts | 18 ++-- .../color-picker.component.spec.ts | 10 +-- .../color-picker/color-picker.component.ts | 6 +- .../color-picker/color-picker.module.ts | 18 ++-- .../edit-style-button.component.spec.ts | 8 +- .../edit-style-button.component.ts | 10 +-- .../edit-style-button.module.ts | 10 +-- .../job-dialog/job-dialog.component.spec.ts | 48 +++++----- .../job-dialog/job-dialog.component.ts | 24 ++--- .../main-page/job-dialog/job-dialog.module.ts | 28 +++--- .../option-editor.component.spec.ts | 18 ++-- .../option-editor/option-editor.component.ts | 2 +- .../option-editor/option-editor.module.ts | 18 ++-- .../task-editor/task-editor.component.spec.ts | 32 +++---- .../task-editor/task-editor.component.ts | 22 ++--- .../task-editor/task-editor.module.ts | 24 ++--- .../main-page/main-page.component.spec.ts | 56 ++++++------ .../main-page/main-page.component.ts | 26 +++--- .../main-page/main-page.module.ts | 28 +++--- .../main-page/map/map.component.spec.ts | 48 +++++----- .../main-page/map/map.component.ts | 50 ++++++----- .../main-page/map/map.module.ts | 10 +-- .../loi-panel/loi-panel.component.spec.ts | 34 +++---- .../loi-panel/loi-panel.component.ts | 26 +++--- .../loi-panel/loi-panel.module.ts | 18 ++-- .../secondary-side-panel.component.spec.ts | 18 ++-- .../secondary-side-panel.component.ts | 4 +- .../secondary-side-panel.module.ts | 18 ++-- .../submission-panel.component.spec.ts | 34 +++---- .../submission-panel.component.ts | 40 +++++---- .../submission-panel.module.ts | 18 ++-- .../job-list/job-list.component.spec.ts | 36 ++++---- .../side-panel/job-list/job-list.component.ts | 10 +-- .../side-panel/job-list/job-list.module.ts | 14 +-- .../side-panel/side-panel.component.ts | 6 +- .../main-page/side-panel/side-panel.module.ts | 18 ++-- .../submission-form.component.spec.ts | 90 +++++++++---------- .../submission-form.component.ts | 61 +++++++------ .../submission-form/submission-form.module.ts | 24 ++--- .../survey-header.component.spec.ts | 20 ++--- .../survey-header/survey-header.component.ts | 14 +-- .../survey-header/survey-header.module.ts | 16 ++-- .../title-dialog.component.spec.ts | 18 ++-- .../title-dialog/title-dialog.component.ts | 12 +-- .../title-dialog/title-dialog.module.ts | 14 +-- .../copy-survey-controls.component.spec.ts | 14 +-- .../copy-survey-controls.component.ts | 10 +-- .../copy-survey-controls.module.ts | 12 +-- .../data-visibility-control.component.ts | 12 +-- .../data-visibility-control.module.ts | 8 +- .../general-access-control.component.ts | 12 +-- .../general-access-control.module.ts | 22 ++--- .../account-popup.component.spec.ts | 18 ++-- .../account-popup/account-popup.component.ts | 6 +- .../account-popup/account-popup.module.ts | 12 +-- .../current-user-widget.component.spec.ts | 16 ++-- .../current-user-widget.component.ts | 10 +-- .../current-user-widget.module.ts | 10 +-- .../shared/header/header.component.spec.ts | 34 +++---- .../shared/header/header.component.ts | 18 ++-- .../components/shared/header/header.module.ts | 16 ++-- .../import-dialog.component.spec.ts | 22 ++--- .../import-dialog/import-dialog.component.ts | 14 +-- .../import-dialog/import-dialog.module.ts | 16 ++-- .../inline-editor/inline-editor.component.ts | 4 +- .../inline-editor/inline-editor.module.ts | 8 +- .../job-list-item.component.spec.ts | 88 +++++++++--------- .../job-list-item/job-list-item.component.ts | 32 +++---- .../job-list-item/job-list-item.module.ts | 20 ++--- .../shared/job-list-item/tree-data-source.ts | 16 ++-- .../loi-editor/loi-editor.component.spec.ts | 38 ++++---- .../shared/loi-editor/loi-editor.component.ts | 20 ++--- .../shared/loi-editor/loi-editor.module.ts | 14 +-- .../loi-properties-dialog.component.ts | 6 +- .../loi-properties-dialog.module.ts | 22 ++--- .../loi-selection.component.spec.ts | 38 ++++---- .../loi-selection/loi-selection.component.ts | 16 ++-- .../loi-selection/loi-selection.module.ts | 16 ++-- .../share-dialog.component.spec.ts | 30 +++---- .../share-dialog/share-dialog.component.ts | 28 +++--- .../share-dialog/share-dialog.module.ts | 20 ++--- .../share-list/share-list.component.spec.ts | 42 ++++----- .../shared/share-list/share-list.component.ts | 18 ++-- .../shared/share-list/share-list.module.ts | 20 ++--- .../share-survey.component.spec.ts | 12 +-- .../share-survey/share-survey.component.ts | 6 +- .../share-survey/share-survey.module.ts | 26 +++--- .../sign-in-page.component.spec.ts | 20 ++--- .../sign-in-page/sign-in-page.component.ts | 12 +-- .../sign-in-page/sign-in-page.module.ts | 18 ++-- .../survey-list/survey-list.component.spec.ts | 62 ++++++------- .../survey-list/survey-list.component.ts | 16 ++-- .../shared/survey-list/survey-list.module.ts | 20 ++--- .../add-task-button.component.spec.ts | 6 +- .../add-task-button.component.ts | 8 +- .../add-task-button/add-task-button.module.ts | 6 +- .../task-condition-form.component.ts | 12 +-- .../task-condition-form.module.ts | 10 +-- .../edit-option/edit-option.component.spec.ts | 18 ++-- .../edit-option/edit-option.component.ts | 6 +- .../edit-option/edit-option.module.ts | 20 ++--- .../task-form/task-form.component.ts | 22 ++--- .../task-form/task-form.module.ts | 28 +++--- .../tasks-editor/tasks-editor.component.ts | 18 ++-- .../tasks-editor/tasks-editor.module.ts | 18 ++-- .../user-avatar/user-avatar.component.spec.ts | 4 +- .../user-avatar/user-avatar.component.ts | 2 +- .../shared/user-avatar/user-avatar.module.ts | 6 +- .../app/components/terms/terms.component.ts | 12 +-- web/src/app/components/terms/terms.module.ts | 18 ++-- .../firebase-data-converter.spec.ts | 4 +- .../app/converters/firebase-data-converter.ts | 32 +++---- .../app/converters/geometry-converter.spec.ts | 26 +++--- web/src/app/converters/geometry-converter.ts | 16 ++-- .../app/converters/geometry-data-converter.ts | 16 ++-- .../app/converters/loi-data-converter.spec.ts | 28 +++--- web/src/app/converters/loi-data-converter.ts | 14 +-- .../app/converters/proto-model-converter.ts | 24 ++--- .../submission-data-converter.spec.ts | 31 ++++--- .../converters/submission-data-converter.ts | 28 +++--- .../converters/survey-data-converter.spec.ts | 6 +- .../app/converters/survey-data-converter.ts | 22 ++--- web/src/app/models/acl-entry.model.ts | 2 +- web/src/app/models/audit-info.model.ts | 4 +- web/src/app/models/copiable.ts | 2 +- web/src/app/models/geometry/coordinate.ts | 2 +- web/src/app/models/geometry/line-string.ts | 8 +- web/src/app/models/geometry/linear-ring.ts | 8 +- web/src/app/models/geometry/multi-polygon.ts | 6 +- web/src/app/models/geometry/point.ts | 8 +- web/src/app/models/geometry/polygon.ts | 10 ++- web/src/app/models/job.model.ts | 6 +- web/src/app/models/loi.model.ts | 4 +- .../models/submission/multiple-selection.ts | 2 +- web/src/app/models/submission/result.model.ts | 4 +- .../app/models/submission/submission.model.ts | 8 +- web/src/app/models/survey.model.ts | 14 +-- .../app/models/task/multiple-choice.model.ts | 4 +- .../app/models/task/task-condition.model.ts | 2 +- web/src/app/models/task/task.model.ts | 8 +- web/src/app/modules/ground-icon.module.ts | 6 +- web/src/app/routing.module.ts | 60 ++++++------- .../services/app-config/app-config.service.ts | 6 +- web/src/app/services/auth/auth.guard.ts | 16 ++-- .../app/services/auth/auth.service.spec.ts | 28 +++--- web/src/app/services/auth/auth.service.ts | 32 +++---- web/src/app/services/auth/passlist.guard.ts | 8 +- .../data-import/data-import.service.spec.ts | 10 +-- .../data-import/data-import.service.ts | 6 +- .../data-store/data-store.service.spec.ts | 8 +- .../services/data-store/data-store.service.ts | 72 ++++++++------- .../services/dialog/dialog.service.spec.ts | 8 +- web/src/app/services/dialog/dialog.service.ts | 4 +- .../draft-survey/draft-survey.service.spec.ts | 8 +- .../draft-survey/draft-survey.service.ts | 34 +++---- .../drawing-tools/drawing-tools.service.ts | 4 +- .../services/ground-pin/ground-pin.service.ts | 10 +-- .../http-client/http-client.service.ts | 10 +-- web/src/app/services/job/job.service.spec.ts | 16 ++-- web/src/app/services/job/job.service.ts | 24 ++--- web/src/app/services/loi/loi.service.spec.ts | 36 ++++---- web/src/app/services/loi/loi.service.ts | 26 +++--- .../navigation/navigation.service.spec.ts | 14 +-- .../services/navigation/navigation.service.ts | 18 ++-- web/src/app/services/navigation/url-params.ts | 2 +- .../notification/notification.service.spec.ts | 8 +- .../notification/notification.service.ts | 4 +- .../submission/submission.service.spec.ts | 22 ++--- .../services/submission/submission.service.ts | 32 +++---- .../services/survey/survey.service.spec.ts | 12 +-- web/src/app/services/survey/survey.service.ts | 33 +++---- .../app/services/task/task.service.spec.ts | 16 ++-- web/src/app/services/task/task.service.ts | 18 ++-- web/src/app/utils/utils.ts | 6 +- web/src/environments/environment.dev.ts | 4 +- web/src/environments/environment.local.ts | 2 +- web/src/environments/environment.prod.ts | 4 +- web/src/environments/environment.test.ts | 2 +- web/src/environments/environment.ts | 2 +- web/src/main.ts | 8 +- web/src/testing/activated-route-stub.ts | 4 +- web/src/testing/helpers.ts | 8 +- web/src/testing/test-data.ts | 10 +-- 234 files changed, 2107 insertions(+), 2081 deletions(-) diff --git a/web/.eslintrc.json b/web/.eslintrc.json index 2c3c85abe..81336de4d 100644 --- a/web/.eslintrc.json +++ b/web/.eslintrc.json @@ -13,6 +13,7 @@ "node/no-unpublished-require": "off", "@typescript-eslint/no-unused-vars": ["off", { "varsIgnorePattern": "_.*" }], "object-curly-spacing": ["error", "always"], + "space-in-brackets": ["error", "always"], "sort-imports": [ "error", { diff --git a/web/.prettierrc.js b/web/.prettierrc.js index ff1548339..c850055c3 100644 --- a/web/.prettierrc.js +++ b/web/.prettierrc.js @@ -1,3 +1,5 @@ module.exports = { - ...require('gts/.prettierrc.json') + ...require('gts/.prettierrc.json'), + bracketSpacing: true } + \ No newline at end of file diff --git a/web/src/app/app.component.ts b/web/src/app/app.component.ts index f0460ea22..21794f2ea 100644 --- a/web/src/app/app.component.ts +++ b/web/src/app/app.component.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {DOCUMENT} from '@angular/common'; -import {Component, Inject} from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { Component, Inject } from '@angular/core'; -import {environment} from 'environments/environment'; -import {Env} from 'environments/environment-enums'; +import { environment } from 'environments/environment'; +import { Env } from 'environments/environment-enums'; /** * Top-level component. Delegates routing of sub-components to paths defined diff --git a/web/src/app/app.module.ts b/web/src/app/app.module.ts index a5801a107..7021fa706 100644 --- a/web/src/app/app.module.ts +++ b/web/src/app/app.module.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {HttpClientModule} from '@angular/common/http'; -import {NgModule} from '@angular/core'; -import {AngularFireModule} from '@angular/fire/compat'; -import {AngularFireAuthModule} from '@angular/fire/compat/auth'; -import {USE_EMULATOR as USE_DATABASE_EMULATOR} from '@angular/fire/compat/database'; +import { HttpClientModule } from '@angular/common/http'; +import { NgModule } from '@angular/core'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFireAuthModule } from '@angular/fire/compat/auth'; +import { USE_EMULATOR as USE_DATABASE_EMULATOR } from '@angular/fire/compat/database'; import { AngularFirestoreModule, SETTINGS as FIRESTORE_SETTINGS, @@ -33,17 +33,17 @@ import { DEFAULTS as RC_DEFAULTS, SETTINGS as RC_SETTINGS, } from '@angular/fire/compat/remote-config'; -import {AngularFireStorageModule} from '@angular/fire/compat/storage'; -import {BrowserModule} from '@angular/platform-browser'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {initializeApp} from 'firebase/app'; -import {GoogleAuthProvider} from 'firebase/auth'; -import {FirebaseUIModule, firebaseui} from 'firebaseui-angular'; +import { AngularFireStorageModule } from '@angular/fire/compat/storage'; +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { initializeApp } from 'firebase/app'; +import { GoogleAuthProvider } from 'firebase/auth'; +import { FirebaseUIModule, firebaseui } from 'firebaseui-angular'; -import {AppComponent} from 'app/app.component'; -import {MainPageContainerModule} from 'app/components/main-page-container/main-page-container.module'; -import {AppRoutingModule} from 'app/routing.module'; -import {environment} from 'environments/environment'; +import { AppComponent } from 'app/app.component'; +import { MainPageContainerModule } from 'app/components/main-page-container/main-page-container.module'; +import { AppRoutingModule } from 'app/routing.module'; +import { environment } from 'environments/environment'; const firebaseUiAuthConfig: firebaseui.auth.Config = { // Popup is required to prevent some browsers and Chrome incognito for getting @@ -62,15 +62,15 @@ initializeApp(environment.firebase); providers: [ { provide: FIRESTORE_SETTINGS, - useValue: {ignoreUndefinedProperties: true}, + useValue: { ignoreUndefinedProperties: true }, }, { provide: RC_SETTINGS, - useValue: {minimumFetchIntervalMillis: 3600000}, + useValue: { minimumFetchIntervalMillis: 3600000 }, }, { provide: RC_DEFAULTS, - useValue: {google_play_id: ''}, + useValue: { google_play_id: '' }, }, // Emulator ports defined in ../firebase.local.json // TODO(#979): Set up auth emulator and enable rules. diff --git a/web/src/app/app.spec.ts b/web/src/app/app.spec.ts index 52036811d..d501ab8ff 100644 --- a/web/src/app/app.spec.ts +++ b/web/src/app/app.spec.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {TestBed, waitForAsync} from '@angular/core/testing'; -import {RouterTestingModule} from '@angular/router/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; -import {AppComponent} from 'app/app.component'; +import { AppComponent } from 'app/app.component'; describe('AppComponent', () => { beforeEach(waitForAsync(() => { diff --git a/web/src/app/components/about/about.component.ts b/web/src/app/components/about/about.component.ts index 660940d34..adfd7cfc4 100644 --- a/web/src/app/components/about/about.component.ts +++ b/web/src/app/components/about/about.component.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {Location} from '@angular/common'; -import {Component} from '@angular/core'; +import { Location } from '@angular/common'; +import { Component } from '@angular/core'; @Component({ selector: 'ground-about-page', diff --git a/web/src/app/components/about/about.module.ts b/web/src/app/components/about/about.module.ts index efbc03b4e..60898c9a0 100644 --- a/web/src/app/components/about/about.module.ts +++ b/web/src/app/components/about/about.module.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButton} from '@angular/material/button'; -import {MatIcon} from '@angular/material/icon'; -import {RouterModule} from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButton } from '@angular/material/button'; +import { MatIcon } from '@angular/material/icon'; +import { RouterModule } from '@angular/router'; -import {AboutComponent} from 'app/components/about/about.component'; -import {HeaderModule} from 'app/components/shared/header/header.module'; +import { AboutComponent } from 'app/components/about/about.component'; +import { HeaderModule } from 'app/components/shared/header/header.module'; @NgModule({ declarations: [AboutComponent], diff --git a/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts index faa3ac56b..64924d528 100644 --- a/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts +++ b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.component.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {Component, Inject, LOCALE_ID, OnInit} from '@angular/core'; -import {Router} from '@angular/router'; -import {firstValueFrom} from 'rxjs'; +import { Component, Inject, LOCALE_ID, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { firstValueFrom } from 'rxjs'; -import {AppConfigService} from 'app/services/app-config/app-config.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; +import { AppConfigService } from 'app/services/app-config/app-config.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-android-landing-page', diff --git a/web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts index bae278eb2..acd1c1e5f 100644 --- a/web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts +++ b/web/src/app/components/android-intent-landing-page/android-intent-landing-page.module.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; -import {AndroidIntentLandingPageComponent} from './android-intent-landing-page.component'; +import { AndroidIntentLandingPageComponent } from './android-intent-landing-page.component'; @NgModule({ declarations: [AndroidIntentLandingPageComponent], diff --git a/web/src/app/components/create-survey/create-survey.component.spec.ts b/web/src/app/components/create-survey/create-survey.component.spec.ts index 451369817..7a7d8dce6 100644 --- a/web/src/app/components/create-survey/create-survey.component.spec.ts +++ b/web/src/app/components/create-survey/create-survey.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, @@ -23,33 +23,33 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {By} from '@angular/platform-browser'; -import {ActivatedRoute} from '@angular/router'; -import {List, Map} from 'immutable'; -import {Observable, Subject} from 'rxjs'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { List, Map } from 'immutable'; +import { Observable, Subject } from 'rxjs'; import { CreateSurveyComponent, CreateSurveyPhase, } from 'app/components/create-survey/create-survey.component'; -import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; -import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; -import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; -import {ShareSurveyComponent} from 'app/components/shared/share-survey/share-survey.component'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey, SurveyState} from 'app/models/survey.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {JobService} from 'app/services/job/job.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {TaskService} from 'app/services/task/task.service'; -import {ActivatedRouteStub} from 'testing/activated-route-stub'; +import { DataSharingTermsComponent } from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import { JobDetailsComponent } from 'app/components/create-survey/job-details/job-details.component'; +import { SurveyDetailsComponent } from 'app/components/create-survey/survey-details/survey-details.component'; +import { ShareSurveyComponent } from 'app/components/shared/share-survey/share-survey.component'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { DataSharingType, Survey, SurveyState } from 'app/models/survey.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { JobService } from 'app/services/job/job.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { SURVEY_ID_NEW } from 'app/services/navigation/navigation.constants'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { TaskService } from 'app/services/task/task.service'; +import { ActivatedRouteStub } from 'testing/activated-route-stub'; describe('CreateSurveyComponent', () => { let component: CreateSurveyComponent; @@ -79,7 +79,7 @@ describe('CreateSurveyComponent', () => { /* jobs= */ Map(), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const surveyWithoutJob = new Survey( surveyId, @@ -88,7 +88,7 @@ describe('CreateSurveyComponent', () => { /* jobs= */ Map(), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const job = new Job(jobId, /* index */ 0, 'red', name, /* tasks= */ Map()); const newJob = new Job(jobId, -1); @@ -101,7 +101,7 @@ describe('CreateSurveyComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.CUSTOM, customText: 'Good day, sir'} + { type: DataSharingType.CUSTOM, customText: 'Good day, sir' } ); const jobWithTask = new Job( jobId, @@ -127,7 +127,7 @@ describe('CreateSurveyComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE}, + { type: DataSharingType.PRIVATE }, SurveyState.READY ); beforeEach(waitForAsync(() => { @@ -211,13 +211,13 @@ describe('CreateSurveyComponent', () => { ], schemas: [NO_ERRORS_SCHEMA], providers: [ - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: SurveyService, useValue: surveyServiceSpy}, - {provide: DraftSurveyService, useValue: draftSurveyServiceSpy}, - {provide: JobService, useValue: jobServiceSpy}, - {provide: LocationOfInterestService, useValue: loiServiceSpy}, - {provide: ActivatedRoute, useValue: route}, - {provide: TaskService, useValue: taskServiceSpy}, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: SurveyService, useValue: surveyServiceSpy }, + { provide: DraftSurveyService, useValue: draftSurveyServiceSpy }, + { provide: JobService, useValue: jobServiceSpy }, + { provide: LocationOfInterestService, useValue: loiServiceSpy }, + { provide: ActivatedRoute, useValue: route }, + { provide: TaskService, useValue: taskServiceSpy }, ], }).compileComponents(); })); @@ -404,7 +404,7 @@ describe('CreateSurveyComponent', () => { expect(jobServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( surveyId, - newJob.copyWith({name}) + newJob.copyWith({ name }) ); })); }); @@ -433,7 +433,7 @@ describe('CreateSurveyComponent', () => { expect(jobServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( surveyId, - job.copyWith({name}) + job.copyWith({ name }) ); })); diff --git a/web/src/app/components/create-survey/create-survey.component.ts b/web/src/app/components/create-survey/create-survey.component.ts index 17d5729ab..25b1ee736 100644 --- a/web/src/app/components/create-survey/create-survey.component.ts +++ b/web/src/app/components/create-survey/create-survey.component.ts @@ -16,27 +16,27 @@ import '@angular/localize/init'; -import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; -import {List} from 'immutable'; -import {Subscription, combineLatest, filter} from 'rxjs'; - -import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; -import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; -import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; -import {TaskDetailsComponent} from 'app/components/create-survey/task-details/task-details.component'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Survey, SurveyState} from 'app/models/survey.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {JobService} from 'app/services/job/job.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {SURVEY_ID_NEW} from 'app/services/navigation/navigation.constants'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {TaskService} from 'app/services/task/task.service'; - -import {SurveyLoiComponent} from './survey-loi/survey-loi.component'; +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { List } from 'immutable'; +import { Subscription, combineLatest, filter } from 'rxjs'; + +import { DataSharingTermsComponent } from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import { JobDetailsComponent } from 'app/components/create-survey/job-details/job-details.component'; +import { SurveyDetailsComponent } from 'app/components/create-survey/survey-details/survey-details.component'; +import { TaskDetailsComponent } from 'app/components/create-survey/task-details/task-details.component'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Survey, SurveyState } from 'app/models/survey.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { JobService } from 'app/services/job/job.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { SURVEY_ID_NEW } from 'app/services/navigation/navigation.constants'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { TaskService } from 'app/services/task/task.service'; + +import { SurveyLoiComponent } from './survey-loi/survey-loi.component'; export enum CreateSurveyPhase { LOADING, diff --git a/web/src/app/components/create-survey/create-survey.module.ts b/web/src/app/components/create-survey/create-survey.module.ts index 313a6f51d..948edebb3 100644 --- a/web/src/app/components/create-survey/create-survey.module.ts +++ b/web/src/app/components/create-survey/create-survey.module.ts @@ -14,24 +14,24 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatInputModule} from '@angular/material/input'; -import {MatProgressBarModule} from '@angular/material/progress-bar'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import {CreateSurveyComponent} from 'app/components/create-survey/create-survey.component'; -import {DataSharingTermsModule} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.module'; -import {TaskDetailsModule} from 'app/components/create-survey/task-details/task-details.module'; -import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; -import {HeaderModule} from 'app/components/shared/header/header.module'; -import {ShareSurveyModule} from 'app/components/shared/share-survey/share-survey.module'; +import { CreateSurveyComponent } from 'app/components/create-survey/create-survey.component'; +import { DataSharingTermsModule } from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.module'; +import { TaskDetailsModule } from 'app/components/create-survey/task-details/task-details.module'; +import { CopySurveyControlsModule } from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; +import { HeaderModule } from 'app/components/shared/header/header.module'; +import { ShareSurveyModule } from 'app/components/shared/share-survey/share-survey.module'; -import {JobDetailsModule} from './job-details/job-details.module'; -import {StepCardModule} from './step-card/step-card.module'; -import {SurveyDetailsModule} from './survey-details/survey-details.module'; -import {SurveyLoiModule} from './survey-loi/survey-loi.module'; +import { JobDetailsModule } from './job-details/job-details.module'; +import { StepCardModule } from './step-card/step-card.module'; +import { SurveyDetailsModule } from './survey-details/survey-details.module'; +import { SurveyLoiModule } from './survey-loi/survey-loi.module'; @NgModule({ declarations: [CreateSurveyComponent], diff --git a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts index 951e0fda4..661e4ca6c 100644 --- a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.spec.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {ReactiveFormsModule} from '@angular/forms'; -import {MatCardModule} from '@angular/material/card'; -import {MatRadioModule} from '@angular/material/radio'; +import { CommonModule } from '@angular/common'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatCardModule } from '@angular/material/card'; +import { MatRadioModule } from '@angular/material/radio'; -import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import { DataSharingTermsComponent } from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; import { DATA_SHARING_TYPE_DESCRIPTION, DataSharingType, diff --git a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts index 6d95dcb6c..2dd5016cc 100644 --- a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.component.ts @@ -16,8 +16,8 @@ import '@angular/localize/init'; -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { DATA_SHARING_TYPE_DESCRIPTION, @@ -67,7 +67,7 @@ export class DataSharingTermsComponent implements OnInit { this.formGroup = this.formBuilder.group({ [this.typeControlKey]: DataSharingType.PRIVATE, [this.customTextControlKey]: [ - {value: '', disabled: true}, + { value: '', disabled: true }, Validators.required, ], }); diff --git a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts index 7fe4e52fe..8e09ef0cb 100644 --- a/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts +++ b/web/src/app/components/create-survey/data-sharing-terms/data-sharing-terms.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; -import {MatRadioModule} from '@angular/material/radio'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatRadioModule } from '@angular/material/radio'; -import {DataSharingTermsComponent} from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; +import { DataSharingTermsComponent } from 'app/components/create-survey/data-sharing-terms/data-sharing-terms.component'; @NgModule({ declarations: [DataSharingTermsComponent], diff --git a/web/src/app/components/create-survey/job-details/job-details.component.spec.ts b/web/src/app/components/create-survey/job-details/job-details.component.spec.ts index 508e66a13..5b70de466 100644 --- a/web/src/app/components/create-survey/job-details/job-details.component.spec.ts +++ b/web/src/app/components/create-survey/job-details/job-details.component.spec.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; -import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; +import { JobDetailsComponent } from 'app/components/create-survey/job-details/job-details.component'; describe('JobDetailsComponent', () => { let component: JobDetailsComponent; diff --git a/web/src/app/components/create-survey/job-details/job-details.component.ts b/web/src/app/components/create-survey/job-details/job-details.component.ts index 3bbc48991..349f65472 100644 --- a/web/src/app/components/create-survey/job-details/job-details.component.ts +++ b/web/src/app/components/create-survey/job-details/job-details.component.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @Component({ selector: 'job-details', diff --git a/web/src/app/components/create-survey/job-details/job-details.module.ts b/web/src/app/components/create-survey/job-details/job-details.module.ts index 15179e6d5..6a54a4b37 100644 --- a/web/src/app/components/create-survey/job-details/job-details.module.ts +++ b/web/src/app/components/create-survey/job-details/job-details.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatInputModule} from '@angular/material/input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatInputModule } from '@angular/material/input'; -import {JobDetailsComponent} from 'app/components/create-survey/job-details/job-details.component'; +import { JobDetailsComponent } from 'app/components/create-survey/job-details/job-details.component'; @NgModule({ declarations: [JobDetailsComponent], diff --git a/web/src/app/components/create-survey/step-card/step-card.component.spec.ts b/web/src/app/components/create-survey/step-card/step-card.component.spec.ts index 004a1c90f..cf086c7b7 100644 --- a/web/src/app/components/create-survey/step-card/step-card.component.spec.ts +++ b/web/src/app/components/create-survey/step-card/step-card.component.spec.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {BrowserModule} from '@angular/platform-browser'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { BrowserModule } from '@angular/platform-browser'; -import {StepCardComponent} from './step-card.component'; +import { StepCardComponent } from './step-card.component'; describe('StepCardComponent', () => { let component: StepCardComponent; diff --git a/web/src/app/components/create-survey/step-card/step-card.component.ts b/web/src/app/components/create-survey/step-card/step-card.component.ts index c1030872d..c8199988d 100644 --- a/web/src/app/components/create-survey/step-card/step-card.component.ts +++ b/web/src/app/components/create-survey/step-card/step-card.component.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Component, Input} from '@angular/core'; +import { Component, Input } from '@angular/core'; @Component({ selector: 'ground-step-card', diff --git a/web/src/app/components/create-survey/step-card/step-card.module.ts b/web/src/app/components/create-survey/step-card/step-card.module.ts index 5d14867fe..e8c93171a 100644 --- a/web/src/app/components/create-survey/step-card/step-card.module.ts +++ b/web/src/app/components/create-survey/step-card/step-card.module.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; -import {StepCardComponent} from 'app/components/create-survey/step-card/step-card.component'; +import { StepCardComponent } from 'app/components/create-survey/step-card/step-card.component'; @NgModule({ declarations: [StepCardComponent], diff --git a/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts b/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts index e336397b6..3ade13176 100644 --- a/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts +++ b/web/src/app/components/create-survey/survey-details/survey-details.component.spec.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {ReactiveFormsModule} from '@angular/forms'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; +import { SurveyDetailsComponent } from 'app/components/create-survey/survey-details/survey-details.component'; describe('SurveyDetailsComponent', () => { let component: SurveyDetailsComponent; diff --git a/web/src/app/components/create-survey/survey-details/survey-details.component.ts b/web/src/app/components/create-survey/survey-details/survey-details.component.ts index 4783f3473..8158ff8a9 100644 --- a/web/src/app/components/create-survey/survey-details/survey-details.component.ts +++ b/web/src/app/components/create-survey/survey-details/survey-details.component.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @Component({ selector: 'survey-details', diff --git a/web/src/app/components/create-survey/survey-details/survey-details.module.ts b/web/src/app/components/create-survey/survey-details/survey-details.module.ts index 8544f235f..b78a31f90 100644 --- a/web/src/app/components/create-survey/survey-details/survey-details.module.ts +++ b/web/src/app/components/create-survey/survey-details/survey-details.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatInputModule} from '@angular/material/input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatInputModule } from '@angular/material/input'; -import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; +import { SurveyDetailsComponent } from 'app/components/create-survey/survey-details/survey-details.component'; @NgModule({ declarations: [SurveyDetailsComponent], diff --git a/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts index ae491661d..29f7e3324 100644 --- a/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts +++ b/web/src/app/components/create-survey/survey-loi/survey-loi.component.spec.ts @@ -14,29 +14,29 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NO_ERRORS_SCHEMA} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, fakeAsync, waitForAsync, } from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {MatDialog} from '@angular/material/dialog'; -import {List, Map} from 'immutable'; -import {BehaviorSubject, of} from 'rxjs'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { MatDialog } from '@angular/material/dialog'; +import { List, Map } from 'immutable'; +import { BehaviorSubject, of } from 'rxjs'; -import {LoiSelectionModule} from 'app/components/shared/loi-selection/loi-selection.module'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { LoiSelectionModule } from 'app/components/shared/loi-selection/loi-selection.module'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {SurveyLoiComponent} from './survey-loi.component'; +import { SurveyLoiComponent } from './survey-loi.component'; describe('SurveyLoiComponent', () => { let fixture: ComponentFixture; @@ -48,7 +48,7 @@ describe('SurveyLoiComponent', () => { const mockLois$ = new BehaviorSubject>( List([ - {id: 'id1', jobId: 'jobId1'} as LocationOfInterest, + { id: 'id1', jobId: 'jobId1' } as LocationOfInterest, ]) ); @@ -59,7 +59,7 @@ describe('SurveyLoiComponent', () => { Map(), Map(), '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const mockSurvey$ = of(mockSurvey); @@ -88,13 +88,13 @@ describe('SurveyLoiComponent', () => { declarations: [SurveyLoiComponent], imports: [LoiSelectionModule, CommonModule], providers: [ - {provide: AngularFirestore, useValue: {}}, - {provide: AngularFireAuth, useValue: {}}, - {provide: AuthService, useValue: {}}, - {provide: LocationOfInterestService, useValue: loiServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: SurveyService, useValue: surveyServiceSpy}, - {provide: MatDialog, useValue: {}}, + { provide: AngularFirestore, useValue: {} }, + { provide: AngularFireAuth, useValue: {} }, + { provide: AuthService, useValue: {} }, + { provide: LocationOfInterestService, useValue: loiServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: SurveyService, useValue: surveyServiceSpy }, + { provide: MatDialog, useValue: {} }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/create-survey/survey-loi/survey-loi.component.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.component.ts index d34ecf888..bf8af7415 100644 --- a/web/src/app/components/create-survey/survey-loi/survey-loi.component.ts +++ b/web/src/app/components/create-survey/survey-loi/survey-loi.component.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {List} from 'immutable'; +import { Component } from '@angular/core'; +import { List } from 'immutable'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {JobService} from 'app/services/job/job.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {TaskService} from 'app/services/task/task.service'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { JobService } from 'app/services/job/job.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { TaskService } from 'app/services/task/task.service'; @Component({ selector: 'survey-loi', @@ -55,7 +55,7 @@ export class SurveyLoiComponent { await this.jobService.addOrUpdateJob( this.surveyService.getActiveSurvey().id, - this.job.copyWith({tasks, strategy}) + this.job.copyWith({ tasks, strategy }) ); } } diff --git a/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts b/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts index b6b5e0adf..11b1cf002 100644 --- a/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts +++ b/web/src/app/components/create-survey/survey-loi/survey-loi.module.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; -import {LoiEditorModule} from 'app/components/shared/loi-editor/loi-editor.module'; +import { LoiEditorModule } from 'app/components/shared/loi-editor/loi-editor.module'; -import {SurveyLoiComponent} from './survey-loi.component'; +import { SurveyLoiComponent } from './survey-loi.component'; @NgModule({ declarations: [SurveyLoiComponent], diff --git a/web/src/app/components/create-survey/task-details/task-details.component.spec.ts b/web/src/app/components/create-survey/task-details/task-details.component.spec.ts index d42f4f5b0..2ce919c1d 100644 --- a/web/src/app/components/create-survey/task-details/task-details.component.spec.ts +++ b/web/src/app/components/create-survey/task-details/task-details.component.spec.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatDialogModule} from '@angular/material/dialog'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatDialogModule } from '@angular/material/dialog'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; -import {Job} from 'app/models/job.model'; -import {Role} from 'app/models/role.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {DialogService} from 'app/services/dialog/dialog.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { Job } from 'app/models/job.model'; +import { Role } from 'app/models/role.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { DialogService } from 'app/services/dialog/dialog.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {TaskDetailsComponent} from './task-details.component'; +import { TaskDetailsComponent } from './task-details.component'; describe('TaskDetailsComponent', () => { let component: TaskDetailsComponent; @@ -39,7 +39,7 @@ describe('TaskDetailsComponent', () => { Map(), Map(), '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(async () => { @@ -47,8 +47,8 @@ describe('TaskDetailsComponent', () => { declarations: [TaskDetailsComponent], imports: [MatDialogModule], providers: [ - {provide: DataStoreService, useValue: {generateId: () => '123'}}, - {provide: DialogService, useValue: {}}, + { provide: DataStoreService, useValue: { generateId: () => '123' } }, + { provide: DialogService, useValue: {} }, { provide: SurveyService, useValue: { diff --git a/web/src/app/components/create-survey/task-details/task-details.component.ts b/web/src/app/components/create-survey/task-details/task-details.component.ts index b298d471f..83ef4a4ad 100644 --- a/web/src/app/components/create-survey/task-details/task-details.component.ts +++ b/web/src/app/components/create-survey/task-details/task-details.component.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {Component, EventEmitter, Output, ViewChild} from '@angular/core'; -import {List} from 'immutable'; -import {Subscription} from 'rxjs'; +import { Component, EventEmitter, Output, ViewChild } from '@angular/core'; +import { List } from 'immutable'; +import { Subscription } from 'rxjs'; -import {TasksEditorComponent} from 'app/components/shared/tasks-editor/tasks-editor.component'; -import {Task} from 'app/models/task/task.model'; -import {TaskService} from 'app/services/task/task.service'; +import { TasksEditorComponent } from 'app/components/shared/tasks-editor/tasks-editor.component'; +import { Task } from 'app/models/task/task.model'; +import { TaskService } from 'app/services/task/task.service'; @Component({ selector: 'task-details', diff --git a/web/src/app/components/create-survey/task-details/task-details.module.ts b/web/src/app/components/create-survey/task-details/task-details.module.ts index dff34ef37..675a61803 100644 --- a/web/src/app/components/create-survey/task-details/task-details.module.ts +++ b/web/src/app/components/create-survey/task-details/task-details.module.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; -import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; +import { TasksEditorModule } from 'app/components/shared/tasks-editor/tasks-editor.module'; -import {TaskDetailsComponent} from './task-details.component'; +import { TaskDetailsComponent } from './task-details.component'; @NgModule({ declarations: [TaskDetailsComponent], diff --git a/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts index ed35fd630..54db46f14 100644 --- a/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.spec.ts @@ -14,32 +14,32 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NO_ERRORS_SCHEMA} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, fakeAsync, flushMicrotasks, } from '@angular/core/testing'; -import {MatCardModule} from '@angular/material/card'; +import { MatCardModule } from '@angular/material/card'; import { MatDialog, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {By} from '@angular/platform-browser'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; - -import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; -import {Job} from 'app/models/job.model'; -import {Role} from 'app/models/role.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { MatIconModule } from '@angular/material/icon'; +import { By } from '@angular/platform-browser'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; + +import { EditDetailsComponent } from 'app/components/edit-survey/edit-details/edit-details.component'; +import { Job } from 'app/models/job.model'; +import { Role } from 'app/models/role.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; import { DialogData, @@ -57,7 +57,7 @@ describe('EditDetailsComponent', () => { Map(), Map(), '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const newSurveyId = 'newSurveyId'; let dialogRefSpy: jasmine.SpyObj< @@ -88,23 +88,23 @@ describe('EditDetailsComponent', () => { imports: [CommonModule, MatDialogModule, MatCardModule, MatIconModule], schemas: [NO_ERRORS_SCHEMA], providers: [ - {provide: MatDialog, useValue: dialogSpy}, + { provide: MatDialog, useValue: dialogSpy }, { provide: DraftSurveyService, - useValue: {getSurvey$: () => of(survey)}, + useValue: { getSurvey$: () => of(survey) }, }, { provide: NavigationService, useValue: navigationServiceSpy, }, - {provide: SurveyService, useValue: surveyServiceSpy}, + { provide: SurveyService, useValue: surveyServiceSpy }, ], }).compileComponents(); }); beforeEach(() => { dialogRefSpy.afterClosed.and.returnValue( - of({dialogType: DialogType.CopySurvey} as DialogData) + of({ dialogType: DialogType.CopySurvey } as DialogData) ); fixture = TestBed.createComponent(EditDetailsComponent); diff --git a/web/src/app/components/edit-survey/edit-details/edit-details.component.ts b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts index bcd0e92b6..9ade3914d 100644 --- a/web/src/app/components/edit-survey/edit-details/edit-details.component.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.component.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {Component, OnInit, ViewChild} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {Subscription} from 'rxjs'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { Subscription } from 'rxjs'; -import {SurveyDetailsComponent} from 'app/components/create-survey/survey-details/survey-details.component'; -import {DATA_SHARING_TYPE_DESCRIPTION, Survey} from 'app/models/survey.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { SurveyDetailsComponent } from 'app/components/create-survey/survey-details/survey-details.component'; +import { DATA_SHARING_TYPE_DESCRIPTION, Survey } from 'app/models/survey.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; import { DialogData, @@ -62,7 +62,7 @@ export class EditDetailsComponent implements OnInit { this.draftSurveyService.getSurvey$().subscribe(survey => { this.survey = survey; if (this.survey.dataSharingTerms) { - const {type, customText} = this.survey.dataSharingTerms; + const { type, customText } = this.survey.dataSharingTerms; this.dataSharingTermsDetails = { description: DATA_SHARING_TYPE_DESCRIPTION.get(type)!, customText, @@ -87,7 +87,7 @@ export class EditDetailsComponent implements OnInit { openDeleteSurveyDialog() { this.dialog .open(JobDialogComponent, { - data: {dialogType: DialogType.DeleteSurvey}, + data: { dialogType: DialogType.DeleteSurvey }, panelClass: 'small-width-dialog', }) .afterClosed() @@ -103,13 +103,13 @@ export class EditDetailsComponent implements OnInit { openCopySurveyDialog() { this.dialog .open(JobDialogComponent, { - data: {dialogType: DialogType.CopySurvey}, + data: { dialogType: DialogType.CopySurvey }, panelClass: 'small-width-dialog', }) .afterClosed() .subscribe(async (result: DialogData) => { if (result?.dialogType === DialogType.CopySurvey) { - const {id: surveyId} = this.survey!; + const { id: surveyId } = this.survey!; const newSurveyId = await this.surveyService.copySurvey(surveyId); diff --git a/web/src/app/components/edit-survey/edit-details/edit-details.module.ts b/web/src/app/components/edit-survey/edit-details/edit-details.module.ts index bbbb6d01c..985613b36 100644 --- a/web/src/app/components/edit-survey/edit-details/edit-details.module.ts +++ b/web/src/app/components/edit-survey/edit-details/edit-details.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; -import {SurveyDetailsModule} from 'app/components/create-survey/survey-details/survey-details.module'; -import {EditDetailsComponent} from 'app/components/edit-survey/edit-details/edit-details.component'; +import { SurveyDetailsModule } from 'app/components/create-survey/survey-details/survey-details.module'; +import { EditDetailsComponent } from 'app/components/edit-survey/edit-details/edit-details.component'; @NgModule({ declarations: [EditDetailsComponent], diff --git a/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts index d25f5bd06..65c36b348 100644 --- a/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.component.spec.ts @@ -14,33 +14,33 @@ * limitations under the License. */ -import {Component, Input} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; +import { Component, Input } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatButtonToggle, MatButtonToggleGroup, } from '@angular/material/button-toggle'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {By} from '@angular/platform-browser'; -import {ActivatedRoute} from '@angular/router'; -import {User} from 'firebase/auth'; -import {List, Map} from 'immutable'; -import {Subject, from, of} from 'rxjs'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { User } from 'firebase/auth'; +import { List, Map } from 'immutable'; +import { Subject, from, of } from 'rxjs'; -import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; -import {LoiEditorComponent} from 'app/components/shared/loi-editor/loi-editor.component'; -import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Role} from 'app/models/role.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {DialogService} from 'app/services/dialog/dialog.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { EditJobComponent } from 'app/components/edit-survey/edit-job/edit-job.component'; +import { LoiEditorComponent } from 'app/components/shared/loi-editor/loi-editor.component'; +import { TasksEditorModule } from 'app/components/shared/tasks-editor/tasks-editor.module'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Role } from 'app/models/role.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { DialogService } from 'app/services/dialog/dialog.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; @Component({ selector: 'loi-editor', @@ -69,7 +69,7 @@ describe('EditJobComponent', () => { Map(), Map(), '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const jobId = 'job-123'; const user$ = new Subject(); @@ -85,9 +85,9 @@ describe('EditJobComponent', () => { TasksEditorModule, ], providers: [ - {provide: AuthService, useValue: {getUser$: () => user$}}, - {provide: DataStoreService, useValue: {generateId: () => '123'}}, - {provide: DialogService, useValue: {}}, + { provide: AuthService, useValue: { getUser$: () => user$ } }, + { provide: DataStoreService, useValue: { generateId: () => '123' } }, + { provide: DialogService, useValue: {} }, { provide: SurveyService, useValue: { @@ -104,7 +104,7 @@ describe('EditJobComponent', () => { { provide: ActivatedRoute, useValue: { - params: from([{id: jobId}]), + params: from([{ id: jobId }]), }, }, { diff --git a/web/src/app/components/edit-survey/edit-job/edit-job.component.ts b/web/src/app/components/edit-survey/edit-job/edit-job.component.ts index 732570962..c9c98cd91 100644 --- a/web/src/app/components/edit-survey/edit-job/edit-job.component.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.component.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {Component, ViewChild} from '@angular/core'; -import {ActivatedRoute, Params} from '@angular/router'; -import {List} from 'immutable'; -import {Subscription} from 'rxjs'; - -import {LoiEditorComponent} from 'app/components/shared/loi-editor/loi-editor.component'; -import {TasksEditorComponent} from 'app/components/shared/tasks-editor/tasks-editor.component'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Task} from 'app/models/task/task.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {TaskService} from 'app/services/task/task.service'; +import { Component, ViewChild } from '@angular/core'; +import { ActivatedRoute, Params } from '@angular/router'; +import { List } from 'immutable'; +import { Subscription } from 'rxjs'; + +import { LoiEditorComponent } from 'app/components/shared/loi-editor/loi-editor.component'; +import { TasksEditorComponent } from 'app/components/shared/tasks-editor/tasks-editor.component'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Task } from 'app/models/task/task.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { TaskService } from 'app/services/task/task.service'; enum EditJobSection { TASKS, @@ -134,7 +134,7 @@ export class EditJobComponent { ); this.draftSurveyService.addOrUpdateJob( - this.job!.copyWith({tasks, strategy}) + this.job!.copyWith({ tasks, strategy }) ); this.job = this.draftSurveyService.getSurvey().getJob(this.jobId!); diff --git a/web/src/app/components/edit-survey/edit-job/edit-job.module.ts b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts index c200fa13b..15fe84497 100644 --- a/web/src/app/components/edit-survey/edit-job/edit-job.module.ts +++ b/web/src/app/components/edit-survey/edit-job/edit-job.module.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { MatButtonToggle, MatButtonToggleGroup, } from '@angular/material/button-toggle'; -import {MatIconModule} from '@angular/material/icon'; +import { MatIconModule } from '@angular/material/icon'; -import {EditJobComponent} from 'app/components/edit-survey/edit-job/edit-job.component'; -import {LoiEditorModule} from 'app/components/shared/loi-editor/loi-editor.module'; -import {TasksEditorModule} from 'app/components/shared/tasks-editor/tasks-editor.module'; +import { EditJobComponent } from 'app/components/edit-survey/edit-job/edit-job.component'; +import { LoiEditorModule } from 'app/components/shared/loi-editor/loi-editor.module'; +import { TasksEditorModule } from 'app/components/shared/tasks-editor/tasks-editor.module'; @NgModule({ declarations: [EditJobComponent], diff --git a/web/src/app/components/edit-survey/edit-survey.component.spec.ts b/web/src/app/components/edit-survey/edit-survey.component.spec.ts index 0b31dffaa..fcdb0dcac 100644 --- a/web/src/app/components/edit-survey/edit-survey.component.spec.ts +++ b/web/src/app/components/edit-survey/edit-survey.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA, WritableSignal, signal} from '@angular/core'; +import { NO_ERRORS_SCHEMA, WritableSignal, signal } from '@angular/core'; import { ComponentFixture, TestBed, @@ -24,26 +24,26 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {MatDialog, MatDialogRef} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {By} from '@angular/platform-browser'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {ActivatedRoute} from '@angular/router'; -import {RouterTestingModule} from '@angular/router/testing'; -import {Map} from 'immutable'; -import {BehaviorSubject, Subject, of} from 'rxjs'; - -import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; -import {Job} from 'app/models/job.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {JobService} from 'app/services/job/job.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {ActivatedRouteStub} from 'testing/activated-route-stub'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; +import { Map } from 'immutable'; +import { BehaviorSubject, Subject, of } from 'rxjs'; + +import { EditSurveyComponent } from 'app/components/edit-survey/edit-survey.component'; +import { Job } from 'app/models/job.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { JobService } from 'app/services/job/job.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { ActivatedRouteStub } from 'testing/activated-route-stub'; import { DialogData, @@ -98,7 +98,7 @@ describe('EditSurveyComponent', () => { ]), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(waitForAsync(() => { @@ -169,13 +169,13 @@ describe('EditSurveyComponent', () => { declarations: [EditSurveyComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: SurveyService, useValue: surveyServiceSpy}, - {provide: DraftSurveyService, useValue: draftSurveyServiceSpy}, - {provide: JobService, useValue: jobServiceSpy}, - {provide: DataStoreService, useValue: dataStoreServiceSpy}, - {provide: ActivatedRoute, useValue: route}, - {provide: MatDialog, useValue: dialogSpy}, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: SurveyService, useValue: surveyServiceSpy }, + { provide: DraftSurveyService, useValue: draftSurveyServiceSpy }, + { provide: JobService, useValue: jobServiceSpy }, + { provide: DataStoreService, useValue: dataStoreServiceSpy }, + { provide: ActivatedRoute, useValue: route }, + { provide: MatDialog, useValue: dialogSpy }, ], }).compileComponents(); })); @@ -240,7 +240,7 @@ describe('EditSurveyComponent', () => { expectedLabel: jobName2, expectedRouterLink: `./job/${jobId2}`, }, - ].forEach(({buttonSelector, expectedLabel, expectedRouterLink}) => { + ].forEach(({ buttonSelector, expectedLabel, expectedRouterLink }) => { it('displays button with correct label and router link', () => { const button = fixture.debugElement.query(By.css(buttonSelector)) .nativeElement as HTMLElement; @@ -259,13 +259,13 @@ describe('EditSurveyComponent', () => { .nativeElement as HTMLElement; const newJobName = 'new job name'; dialogRefSpy.afterClosed.and.returnValue( - of({dialogType: DialogType.AddJob, jobName: newJobName}) + of({ dialogType: DialogType.AddJob, jobName: newJobName }) ); addButton.click(); expect(draftSurveyServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( - newJob.copyWith({name: newJobName}) + newJob.copyWith({ name: newJobName }) ); flush(); discardPeriodicTasks(); @@ -276,7 +276,7 @@ describe('EditSurveyComponent', () => { .nativeElement as HTMLElement; const newJobName = 'new job name'; dialogRefSpy.afterClosed.and.returnValue( - of({dialogType: DialogType.RenameJob, jobName: newJobName}) + of({ dialogType: DialogType.RenameJob, jobName: newJobName }) ); menuButton.click(); @@ -289,7 +289,7 @@ describe('EditSurveyComponent', () => { renameButton.click(); expect(draftSurveyServiceSpy.addOrUpdateJob).toHaveBeenCalledOnceWith( - job1.copyWith({name: newJobName}) + job1.copyWith({ name: newJobName }) ); flush(); discardPeriodicTasks(); @@ -323,7 +323,7 @@ describe('EditSurveyComponent', () => { const menuButton = fixture.debugElement.query(By.css('#menu-button-0')) .nativeElement as HTMLElement; dialogRefSpy.afterClosed.and.returnValue( - of({dialogType: DialogType.DeleteJob, jobName: ''}) + of({ dialogType: DialogType.DeleteJob, jobName: '' }) ); menuButton.click(); diff --git a/web/src/app/components/edit-survey/edit-survey.component.ts b/web/src/app/components/edit-survey/edit-survey.component.ts index 0266c951e..f6476a9cb 100644 --- a/web/src/app/components/edit-survey/edit-survey.component.ts +++ b/web/src/app/components/edit-survey/edit-survey.component.ts @@ -16,21 +16,21 @@ import '@angular/localize/init'; -import {Component, effect} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {List} from 'immutable'; - -import {Job} from 'app/models/job.model'; -import {Survey} from 'app/models/survey.model'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {JobService} from 'app/services/job/job.service'; +import { Component, effect } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { List } from 'immutable'; + +import { Job } from 'app/models/job.model'; +import { Survey } from 'app/models/survey.model'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { JobService } from 'app/services/job/job.service'; import { SURVEYS_SHARE, SURVEY_SEGMENT, } from 'app/services/navigation/navigation.constants'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {environment} from 'environments/environment'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { environment } from 'environments/environment'; import { DialogData, @@ -135,7 +135,7 @@ export class EditSurveyComponent { autoFocus: [DialogType.AddJob, DialogType.RenameJob].includes(dialogType) ? `#${JobDialogComponent.JOB_NAME_FIELD_ID}` : 'first-tabbable', - data: {dialogType, jobName: job.name ?? ''}, + data: { dialogType, jobName: job.name ?? '' }, panelClass: 'small-width-dialog', }); diff --git a/web/src/app/components/edit-survey/edit-survey.module.ts b/web/src/app/components/edit-survey/edit-survey.module.ts index 3a0b2fbd5..ef9b02b5c 100644 --- a/web/src/app/components/edit-survey/edit-survey.module.ts +++ b/web/src/app/components/edit-survey/edit-survey.module.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatIconModule} from '@angular/material/icon'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {RouterModule} from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { RouterModule } from '@angular/router'; -import {EditSurveyComponent} from 'app/components/edit-survey/edit-survey.component'; -import {CopySurveyControlsModule} from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; +import { EditSurveyComponent } from 'app/components/edit-survey/edit-survey.component'; +import { CopySurveyControlsModule } from 'app/components/shared/copy-survey-controls/copy-survey-controls.module'; -import {SurveyHeaderModule} from '../main-page-container/main-page/survey-header/survey-header.module'; +import { SurveyHeaderModule } from '../main-page-container/main-page/survey-header/survey-header.module'; @NgModule({ declarations: [EditSurveyComponent], diff --git a/web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts index 398f25de5..2f338be89 100644 --- a/web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts +++ b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.spec.ts @@ -25,7 +25,7 @@ import { MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {By} from '@angular/platform-browser'; +import { By } from '@angular/platform-browser'; import { DialogData, @@ -50,8 +50,8 @@ describe('JobDialogComponent', () => { declarations: [JobDialogComponent], imports: [MatDialogModule], providers: [ - {provide: MatDialogRef, useValue: dialogRefSpy}, - {provide: MAT_DIALOG_DATA, useValue: mockDialogData}, + { provide: MatDialogRef, useValue: dialogRefSpy }, + { provide: MAT_DIALOG_DATA, useValue: mockDialogData }, ], }).compileComponents(); }); diff --git a/web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts index 01b00c7a3..f8bdd477b 100644 --- a/web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts +++ b/web/src/app/components/edit-survey/job-dialog/job-dialog.component.ts @@ -16,8 +16,8 @@ import '@angular/localize/init'; -import {Component, Inject} from '@angular/core'; -import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; +import { Component, Inject } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; export enum DialogType { AddJob, diff --git a/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts b/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts index 16fbe8bd0..1a05034ec 100644 --- a/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts +++ b/web/src/app/components/edit-survey/job-dialog/job-dialog.module.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; -import {JobDialogComponent} from 'app/components/edit-survey/job-dialog/job-dialog.component'; +import { JobDialogComponent } from 'app/components/edit-survey/job-dialog/job-dialog.component'; @NgModule({ declarations: [JobDialogComponent], diff --git a/web/src/app/components/edit-survey/survey-json/survey-json.component.ts b/web/src/app/components/edit-survey/survey-json/survey-json.component.ts index 63bb6f4e6..a51f164a6 100644 --- a/web/src/app/components/edit-survey/survey-json/survey-json.component.ts +++ b/web/src/app/components/edit-survey/survey-json/survey-json.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component} from '@angular/core'; +import { Component } from '@angular/core'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { SurveyService } from 'app/services/survey/survey.service'; @Component({ selector: 'survey-json', diff --git a/web/src/app/components/edit-survey/survey-json/survey-json.module.ts b/web/src/app/components/edit-survey/survey-json/survey-json.module.ts index 4d363bb86..336234923 100644 --- a/web/src/app/components/edit-survey/survey-json/survey-json.module.ts +++ b/web/src/app/components/edit-survey/survey-json/survey-json.module.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; -import {SurveyJsonComponent} from './survey-json.component'; +import { SurveyJsonComponent } from './survey-json.component'; @NgModule({ declarations: [SurveyJsonComponent], diff --git a/web/src/app/components/error/error.component.ts b/web/src/app/components/error/error.component.ts index 9c6a2960a..23106853f 100644 --- a/web/src/app/components/error/error.component.ts +++ b/web/src/app/components/error/error.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component, OnInit} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; enum ErrorType { GENERIC, diff --git a/web/src/app/components/error/error.module.ts b/web/src/app/components/error/error.module.ts index 1581d761d..7a1e1ab06 100644 --- a/web/src/app/components/error/error.module.ts +++ b/web/src/app/components/error/error.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {RouterModule} from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { RouterModule } from '@angular/router'; -import {ErrorComponent} from 'app/components/error/error.component'; -import {HeaderModule} from 'app/components/shared/header/header.module'; +import { ErrorComponent } from 'app/components/error/error.component'; +import { HeaderModule } from 'app/components/shared/header/header.module'; @NgModule({ declarations: [ErrorComponent], diff --git a/web/src/app/components/main-page-container/main-page-container.component.spec.ts b/web/src/app/components/main-page-container/main-page-container.component.spec.ts index 221e10f9d..f85b12905 100644 --- a/web/src/app/components/main-page-container/main-page-container.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page-container.component.spec.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {ActivatedRoute} from '@angular/router'; -import {NEVER} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { NEVER } from 'rxjs'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {ActivatedRouteStub} from 'testing/activated-route-stub'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { ActivatedRouteStub } from 'testing/activated-route-stub'; -import {MainPageComponent} from './main-page/main-page.component'; -import {MainPageContainerComponent} from './main-page-container.component'; +import { MainPageComponent } from './main-page/main-page.component'; +import { MainPageContainerComponent } from './main-page-container.component'; const navigationService = { init: () => {}, @@ -47,9 +47,9 @@ describe('MainPageContainerComponent', () => { TestBed.configureTestingModule({ declarations: [MainPageContainerComponent, MainPageComponent], providers: [ - {provide: ActivatedRoute, useValue: route}, - {provide: NavigationService, useValue: navigationService}, - {provide: SurveyService, useValue: surveyService}, + { provide: ActivatedRoute, useValue: route }, + { provide: NavigationService, useValue: navigationService }, + { provide: SurveyService, useValue: surveyService }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page-container.component.ts b/web/src/app/components/main-page-container/main-page-container.component.ts index b65156a1b..46d00022d 100644 --- a/web/src/app/components/main-page-container/main-page-container.component.ts +++ b/web/src/app/components/main-page-container/main-page-container.component.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {Component, effect, input} from '@angular/core'; -import {toObservable, toSignal} from '@angular/core/rxjs-interop'; -import {switchMap} from 'rxjs/operators'; +import { Component, effect, input } from '@angular/core'; +import { toObservable, toSignal } from '@angular/core/rxjs-interop'; +import { switchMap } from 'rxjs/operators'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { SurveyService } from 'app/services/survey/survey.service'; @Component({ selector: 'ground-main-page-container', diff --git a/web/src/app/components/main-page-container/main-page-container.module.ts b/web/src/app/components/main-page-container/main-page-container.module.ts index 8d97e2c25..5cd25a1fa 100644 --- a/web/src/app/components/main-page-container/main-page-container.module.ts +++ b/web/src/app/components/main-page-container/main-page-container.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {RouterModule} from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { RouterModule } from '@angular/router'; -import {MainPageModule} from './main-page/main-page.module'; -import {MainPageContainerComponent} from './main-page-container.component'; +import { MainPageModule } from './main-page/main-page.module'; +import { MainPageContainerComponent } from './main-page-container.component'; @NgModule({ declarations: [MainPageContainerComponent], diff --git a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts index d1d634b3f..bcfa1c623 100644 --- a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.spec.ts @@ -22,23 +22,23 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {By} from '@angular/platform-browser'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {Map} from 'immutable'; -import {BehaviorSubject, of} from 'rxjs'; - -import {Job} from 'app/models/job.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; +import { By } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { Map } from 'immutable'; +import { BehaviorSubject, of } from 'rxjs'; + +import { Job } from 'app/models/job.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; import { DrawingToolsService, EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; -import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; +import { GroundPinService } from 'app/services/ground-pin/ground-pin.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; -import {DrawingToolsComponent} from './drawing-tools.component'; -import {DrawingToolsModule} from './drawing-tools.module'; +import { DrawingToolsComponent } from './drawing-tools.component'; +import { DrawingToolsModule } from './drawing-tools.module'; describe('DrawingToolsComponent', () => { let fixture: ComponentFixture; @@ -78,7 +78,7 @@ describe('DrawingToolsComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(waitForAsync(() => { @@ -107,9 +107,9 @@ describe('DrawingToolsComponent', () => { imports: [DrawingToolsModule, BrowserAnimationsModule], declarations: [DrawingToolsComponent], providers: [ - {provide: AuthService, useValue: authServiceSpy}, - {provide: DrawingToolsService, useValue: drawingToolsServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, + { provide: AuthService, useValue: authServiceSpy }, + { provide: DrawingToolsService, useValue: drawingToolsServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, ], }).compileComponents(); })); diff --git a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts index cfab9c26a..cb8e3ecbe 100644 --- a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts +++ b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.component.ts @@ -24,20 +24,20 @@ import { effect, input, } from '@angular/core'; -import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; -import {List} from 'immutable'; -import {Observable, Subscription} from 'rxjs'; -import {map} from 'rxjs/operators'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { List } from 'immutable'; +import { Observable, Subscription } from 'rxjs'; +import { map } from 'rxjs/operators'; -import {Job} from 'app/models/job.model'; -import {Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; +import { Job } from 'app/models/job.model'; +import { Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; import { DrawingToolsService, EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; -import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; +import { GroundPinService } from 'app/services/ground-pin/ground-pin.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-drawing-tools', diff --git a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts index e8088f76a..eaaf1da4d 100644 --- a/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts +++ b/web/src/app/components/main-page-container/main-page/drawing-tools/drawing-tools.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; // ? -import {MatButtonToggleModule} from '@angular/material/button-toggle'; -import {MatExpansionModule} from '@angular/material/expansion'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatSelectModule} from '@angular/material/select'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; // ? +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSelectModule } from '@angular/material/select'; -import {DrawingToolsComponent} from './drawing-tools.component'; +import { DrawingToolsComponent } from './drawing-tools.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts index 890b7cc5f..0f602617d 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.spec.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {ColorPickerComponent} from './color-picker.component'; +import { ColorPickerComponent } from './color-picker.component'; describe('ColorPickerComponent', () => { let component: ColorPickerComponent; @@ -34,8 +34,8 @@ describe('ColorPickerComponent', () => { declarations: [ColorPickerComponent], imports: [MatDialogModule], providers: [ - {provide: MAT_DIALOG_DATA, useValue: {}}, - {provide: MatDialogRef, useValue: dialogRef}, + { provide: MAT_DIALOG_DATA, useValue: {} }, + { provide: MatDialogRef, useValue: dialogRef }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts index a542eea48..5861c5681 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.component.ts @@ -28,9 +28,9 @@ import { MatDialogConfig, MatDialogRef, } from '@angular/material/dialog'; -import {ColorEvent} from 'ngx-color'; +import { ColorEvent } from 'ngx-color'; -import {Job} from 'app/models/job.model'; +import { Job } from 'app/models/job.model'; @Component({ selector: 'ground-color-picker', @@ -48,7 +48,7 @@ export class ColorPickerComponent implements OnInit { constructor( private dialog: MatDialog, matDialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) data: {trigger: ElementRef} + @Inject(MAT_DIALOG_DATA) data: { trigger: ElementRef } ) { this.matDialogRef = matDialogRef; this.triggerElementRef = data.trigger; diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts index 242953bf9..dfb99db63 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/color-picker/color-picker.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {ColorCircleModule} from 'ngx-color/circle'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { ColorCircleModule } from 'ngx-color/circle'; -import {ColorPickerComponent} from './color-picker.component'; +import { ColorPickerComponent } from './color-picker.component'; @NgModule({ declarations: [ColorPickerComponent], diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts index f468165f2..99b557726 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.spec.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {MatDialogModule} from '@angular/material/dialog'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialogModule } from '@angular/material/dialog'; -import {EditStyleButtonComponent} from './edit-style-button.component'; +import { EditStyleButtonComponent } from './edit-style-button.component'; describe('EditStyleButtonComponent', () => { let component: EditStyleButtonComponent; diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts index 484c0cd1d..a21b7da77 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.component.ts @@ -22,12 +22,12 @@ import { OnInit, Output, } from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; +import { MatDialog } from '@angular/material/dialog'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; -import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; +import { GroundPinService } from 'app/services/ground-pin/ground-pin.service'; -import {ColorPickerComponent} from './color-picker/color-picker.component'; +import { ColorPickerComponent } from './color-picker/color-picker.component'; @Component({ selector: 'ground-edit-style-button', @@ -58,7 +58,7 @@ export class EditStyleButtonComponent implements OnInit { const target = new ElementRef(evt.currentTarget); this.dialog .open(ColorPickerComponent, { - data: {trigger: target}, + data: { trigger: target }, }) .componentInstance.onColorPicked.subscribe((color: string) => { this.markerColor = color; diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts index 5c160822f..6a51befaa 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/edit-style-button/edit-style-button.module.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; -import {EditStyleButtonComponent} from './edit-style-button.component'; +import { EditStyleButtonComponent } from './edit-style-button.component'; @NgModule({ declarations: [EditStyleButtonComponent], diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts index 09bca0018..4d5f5f805 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.spec.ts @@ -14,34 +14,34 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatCheckboxModule} from '@angular/material/checkbox'; +import { Component } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatCheckboxModule } from '@angular/material/checkbox'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {Router} from '@angular/router'; -import {NEVER, of} from 'rxjs'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { Router } from '@angular/router'; +import { NEVER, of } from 'rxjs'; -import {InlineEditorModule} from 'app/components/shared/inline-editor/inline-editor.module'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; +import { InlineEditorModule } from 'app/components/shared/inline-editor/inline-editor.module'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; -import {EditStyleButtonModule} from './edit-style-button/edit-style-button.module'; -import {JobDialogComponent} from './job-dialog.component'; -import {TaskEditorModule} from './task-editor/task-editor.module'; +import { EditStyleButtonModule } from './edit-style-button/edit-style-button.module'; +import { JobDialogComponent } from './job-dialog.component'; +import { TaskEditorModule } from './task-editor/task-editor.module'; -@Component({selector: 'mat-dialog-content', template: ''}) +@Component({ selector: 'mat-dialog-content', template: '' }) class MatDialogContent {} -@Component({selector: 'mat-dialog-actions', template: ''}) +@Component({ selector: 'mat-dialog-actions', template: '' }) class MatDialogActions {} describe('JobDialogComponent', () => { @@ -69,13 +69,13 @@ describe('JobDialogComponent', () => { MatCheckboxModule, ], providers: [ - {provide: DataStoreService, useValue: {generateId: () => '123'}}, - {provide: MAT_DIALOG_DATA, useValue: {createJob: true}}, - {provide: MatDialogRef, useValue: dialogRef}, - {provide: Router, useValue: routerSpy}, + { provide: DataStoreService, useValue: { generateId: () => '123' } }, + { provide: MAT_DIALOG_DATA, useValue: { createJob: true } }, + { provide: MatDialogRef, useValue: dialogRef }, + { provide: Router, useValue: routerSpy }, { provide: AuthService, - useValue: {getUser$: () => NEVER}, + useValue: { getUser$: () => NEVER }, }, ], }).compileComponents(); @@ -93,5 +93,5 @@ describe('JobDialogComponent', () => { }); function createRouterSpy() { - return jasmine.createSpyObj('Router', ['navigate'], {events: of()}); + return jasmine.createSpyObj('Router', ['navigate'], { events: of() }); } diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts index c0d2a8d5e..0872ef3b7 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.component.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {CdkDragDrop} from '@angular/cdk/drag-drop'; +import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectorRef, Component, @@ -23,19 +23,19 @@ import { QueryList, ViewChildren, } from '@angular/core'; -import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; -import {List} from 'immutable'; -import {Subscription} from 'rxjs'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { List } from 'immutable'; +import { Subscription } from 'rxjs'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {DialogService} from 'app/services/dialog/dialog.service'; -import {JobService} from 'app/services/job/job.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { DialogService } from 'app/services/dialog/dialog.service'; +import { JobService } from 'app/services/job/job.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; -import {MarkerColorEvent} from './edit-style-button/edit-style-button.component'; -import {TaskEditorComponent} from './task-editor/task-editor.component'; +import { MarkerColorEvent } from './edit-style-button/edit-style-button.component'; +import { TaskEditorComponent } from './task-editor/task-editor.component'; // To make ESLint happy: /*global alert*/ diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts index 4754faa23..ac2678866 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/job-dialog.module.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {DragDropModule} from '@angular/cdk/drag-drop'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; -import {InlineEditorModule} from 'app/components/shared/inline-editor/inline-editor.module'; +import { InlineEditorModule } from 'app/components/shared/inline-editor/inline-editor.module'; -import {EditStyleButtonModule} from './edit-style-button/edit-style-button.module'; -import {JobDialogComponent} from './job-dialog.component'; -import {TaskEditorModule} from './task-editor/task-editor.module'; +import { EditStyleButtonModule } from './edit-style-button/edit-style-button.module'; +import { JobDialogComponent } from './job-dialog.component'; +import { TaskEditorModule } from './task-editor/task-editor.module'; @NgModule({ declarations: [JobDialogComponent], diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts index f3d4fdb24..9d3aab856 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.spec.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import { CommonModule } from '@angular/common'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import {OptionEditorComponent} from './option-editor.component'; +import { OptionEditorComponent } from './option-editor.component'; describe('OptionEditorComponent', () => { let component: OptionEditorComponent; diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts index c185b94ed..7bd1b9388 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.component.ts @@ -42,7 +42,7 @@ export class OptionEditorComponent implements OnInit, OnChanges { @Input() index?: number; @Output() update = new EventEmitter(); @Output() delete = new EventEmitter(); - @ViewChild('optionInput', {static: true}) optionInput?: ElementRef; + @ViewChild('optionInput', { static: true }) optionInput?: ElementRef; optionGroup: FormGroup; diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts index 35192a11a..4238056cb 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/option-editor/option-editor.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatTooltipModule} from '@angular/material/tooltip'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import {OptionEditorComponent} from './option-editor.component'; +import { OptionEditorComponent } from './option-editor.component'; @NgModule({ declarations: [OptionEditorComponent], diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts index 48b513025..f560ab727 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.spec.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {BrowserModule} from '@angular/platform-browser'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {Router} from '@angular/router'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { BrowserModule } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { Router } from '@angular/router'; -import {JobService} from 'app/services/job/job.service'; +import { JobService } from 'app/services/job/job.service'; -import {TaskEditorComponent} from './task-editor.component'; +import { TaskEditorComponent } from './task-editor.component'; describe('TaskFieldEditorComponent', () => { let component: TaskEditorComponent; @@ -51,8 +51,8 @@ describe('TaskFieldEditorComponent', () => { NoopAnimationsModule, ], providers: [ - {provide: Router, useValue: {}}, - {provide: JobService, useValue: {}}, + { provide: Router, useValue: {} }, + { provide: JobService, useValue: {} }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts index 2e6235884..5291737f4 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.component.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {CdkDragDrop} from '@angular/cdk/drag-drop'; +import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectorRef, Component, @@ -39,19 +39,19 @@ import { ValidationErrors, Validators, } from '@angular/forms'; -import {List} from 'immutable'; -import {Subscription, firstValueFrom} from 'rxjs'; +import { List } from 'immutable'; +import { Subscription, firstValueFrom } from 'rxjs'; import { Cardinality, MultipleChoice, } from 'app/models/task/multiple-choice.model'; -import {Option} from 'app/models/task/option.model'; -import {TaskType} from 'app/models/task/task.model'; -import {DialogService} from 'app/services/dialog/dialog.service'; -import {JobService} from 'app/services/job/job.service'; +import { Option } from 'app/models/task/option.model'; +import { TaskType } from 'app/models/task/task.model'; +import { DialogService } from 'app/services/dialog/dialog.service'; +import { JobService } from 'app/services/job/job.service'; -import {OptionEditorComponent} from './option-editor/option-editor.component'; +import { OptionEditorComponent } from './option-editor/option-editor.component'; export interface TaskTypeSelectOption { icon: string; @@ -86,7 +86,7 @@ export class TaskEditorComponent implements OnInit, OnChanges, OnDestroy { subscription: Subscription = new Subscription(); taskGroup: FormGroup; - @ViewChild('questionInput', {static: true}) questionInput?: ElementRef; + @ViewChild('questionInput', { static: true }) questionInput?: ElementRef; @HostListener('click') onTaskFocus() { @@ -242,7 +242,7 @@ export class TaskEditorComponent implements OnInit, OnChanges, OnDestroy { this.taskOptions.options ); } - this.taskGroup.patchValue({selectTaskOption: event}); + this.taskGroup.patchValue({ selectTaskOption: event }); if (event.type === TaskType.MULTIPLE_CHOICE) { if (!this.taskOptions?.options?.size) { this.onAddOption(); @@ -266,7 +266,7 @@ export class TaskEditorComponent implements OnInit, OnChanges, OnDestroy { * @param index: index of the option to be updated. * @returns void */ - onOptionUpdate(event: {label: string; code: string}, index: number): void { + onOptionUpdate(event: { label: string; code: string }, index: number): void { const option = this.jobService.createOption(event.code, event.label, index); const options = this.setTaskOptions(index, option); this.emitTaskOptions(options); diff --git a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts index 15dec0794..1a92e4a19 100644 --- a/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts +++ b/web/src/app/components/main-page-container/main-page/job-dialog/task-editor/task-editor.module.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import {DragDropModule} from '@angular/cdk/drag-drop'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import {OptionEditorModule} from './option-editor/option-editor.module'; -import {TaskEditorComponent} from './task-editor.component'; +import { OptionEditorModule } from './option-editor/option-editor.module'; +import { TaskEditorComponent } from './task-editor.component'; @NgModule({ declarations: [TaskEditorComponent], diff --git a/web/src/app/components/main-page-container/main-page/main-page.component.spec.ts b/web/src/app/components/main-page-container/main-page/main-page.component.spec.ts index 413fb0bc2..bc9ce09e2 100644 --- a/web/src/app/components/main-page-container/main-page/main-page.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/main-page.component.spec.ts @@ -14,27 +14,27 @@ * limitations under the License. */ -import {Component, NO_ERRORS_SCHEMA, signal} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {MatDialog} from '@angular/material/dialog'; -import {ActivatedRoute, Router} from '@angular/router'; -import {NEVER, of} from 'rxjs'; - -import {AuthService} from 'app/services/auth/auth.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {ActivatedRouteStub} from 'testing/activated-route-stub'; - -import {MainPageComponent} from './main-page.component'; - -@Component({selector: 'ground-map', template: ''}) +import { Component, NO_ERRORS_SCHEMA, signal } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { MatDialog } from '@angular/material/dialog'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NEVER, of } from 'rxjs'; + +import { AuthService } from 'app/services/auth/auth.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { ActivatedRouteStub } from 'testing/activated-route-stub'; + +import { MainPageComponent } from './main-page.component'; + +@Component({ selector: 'ground-map', template: '' }) class MapComponent {} -@Component({selector: 'mat-sidenav', template: ''}) +@Component({ selector: 'mat-sidenav', template: '' }) class MatSideNavComponent { opened = false; } @@ -72,21 +72,21 @@ describe('MainPageComponent', () => { TestBed.configureTestingModule({ declarations: [MainPageComponent, MapComponent, MatSideNavComponent], providers: [ - {provide: ActivatedRoute, useValue: route}, - {provide: MatDialog, useValue: dialog}, + { provide: ActivatedRoute, useValue: route }, + { provide: MatDialog, useValue: dialog }, { provide: LocationOfInterestService, useValue: loiService, }, - {provide: SubmissionService, useValue: submissionService}, - {provide: SurveyService, useValue: surveyService}, - {provide: NavigationService, useValue: navigationService}, - {provide: AngularFirestore, useValue: {}}, - {provide: AngularFireAuth, useValue: {}}, - {provide: Router, useValue: {}}, + { provide: SubmissionService, useValue: submissionService }, + { provide: SurveyService, useValue: surveyService }, + { provide: NavigationService, useValue: navigationService }, + { provide: AngularFirestore, useValue: {} }, + { provide: AngularFireAuth, useValue: {} }, + { provide: Router, useValue: {} }, { provide: AuthService, - useValue: {getUser$: () => NEVER, isAuthenticated$: () => NEVER}, + useValue: { getUser$: () => NEVER, isAuthenticated$: () => NEVER }, }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/web/src/app/components/main-page-container/main-page/main-page.component.ts b/web/src/app/components/main-page-container/main-page/main-page.component.ts index 3facbe06c..9a05b9ea2 100644 --- a/web/src/app/components/main-page-container/main-page/main-page.component.ts +++ b/web/src/app/components/main-page-container/main-page/main-page.component.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {Component, OnInit, effect, input} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {Subscription} from 'rxjs'; +import { Component, OnInit, effect, input } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { Subscription } from 'rxjs'; -import {Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {JOB_ID_NEW} from 'app/services/navigation/navigation.constants'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; -import {environment} from 'environments/environment'; +import { Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { JOB_ID_NEW } from 'app/services/navigation/navigation.constants'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { SurveyService } from 'app/services/survey/survey.service'; +import { environment } from 'environments/environment'; -import {TitleDialogComponent} from './title-dialog/title-dialog.component'; +import { TitleDialogComponent } from './title-dialog/title-dialog.component'; /** * Root component for main application page showing map, jobs list, and @@ -55,7 +55,7 @@ export class MainPageComponent implements OnInit { private dialog: MatDialog ) { effect(() => { - const {loiId, submissionId} = this.urlParamsSignal(); + const { loiId, submissionId } = this.urlParamsSignal(); if (loiId) this.loiService.selectLocationOfInterest(loiId); if (submissionId) this.submissionService.selectSubmission(submissionId); }); diff --git a/web/src/app/components/main-page-container/main-page/main-page.module.ts b/web/src/app/components/main-page-container/main-page/main-page.module.ts index fd30ed3dc..2d3164ba8 100644 --- a/web/src/app/components/main-page-container/main-page/main-page.module.ts +++ b/web/src/app/components/main-page-container/main-page/main-page.module.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatSidenavModule} from '@angular/material/sidenav'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatSidenavModule } from '@angular/material/sidenav'; -import {DrawingToolsModule} from './drawing-tools/drawing-tools.module'; -import {JobDialogModule} from './job-dialog/job-dialog.module'; -import {MainPageComponent} from './main-page.component'; -import {MapModule} from './map/map.module'; -import {SecondarySidePanelModule} from './secondary-side-panel/secondary-side-panel.module'; -import {SidePanelModule} from './side-panel/side-panel.module'; -import {SurveyHeaderModule} from './survey-header/survey-header.module'; +import { DrawingToolsModule } from './drawing-tools/drawing-tools.module'; +import { JobDialogModule } from './job-dialog/job-dialog.module'; +import { MainPageComponent } from './main-page.component'; +import { MapModule } from './map/map.module'; +import { SecondarySidePanelModule } from './secondary-side-panel/secondary-side-panel.module'; +import { SidePanelModule } from './side-panel/side-panel.module'; +import { SurveyHeaderModule } from './survey-header/survey-header.module'; @NgModule({ declarations: [MainPageComponent], diff --git a/web/src/app/components/main-page-container/main-page/map/map.component.spec.ts b/web/src/app/components/main-page-container/main-page/map/map.component.spec.ts index 1f54bc2fe..c6420ec29 100644 --- a/web/src/app/components/main-page-container/main-page/map/map.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/map/map.component.spec.ts @@ -21,29 +21,29 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {GoogleMapsModule} from '@angular/google-maps'; -import {List, Map} from 'immutable'; -import {BehaviorSubject, of} from 'rxjs'; - -import {Coordinate} from 'app/models/geometry/coordinate'; -import {MultiPolygon} from 'app/models/geometry/multi-polygon'; -import {Point} from 'app/models/geometry/point'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { GoogleMapsModule } from '@angular/google-maps'; +import { List, Map } from 'immutable'; +import { BehaviorSubject, of } from 'rxjs'; + +import { Coordinate } from 'app/models/geometry/coordinate'; +import { MultiPolygon } from 'app/models/geometry/multi-polygon'; +import { Point } from 'app/models/geometry/point'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; import { DrawingToolsService, EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {polygonShellCoordsToPolygon} from 'testing/helpers'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { polygonShellCoordsToPolygon } from 'testing/helpers'; -import {MapComponent} from './map.component'; +import { MapComponent } from './map.component'; describe('MapComponent', () => { let component: MapComponent; @@ -92,7 +92,7 @@ describe('MapComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const poi1 = new LocationOfInterest( poiId1, @@ -209,10 +209,10 @@ describe('MapComponent', () => { provide: LocationOfInterestService, useValue: loiServiceSpy, }, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: SubmissionService, useValue: submissionServiceSpy}, - {provide: DrawingToolsService, useValue: drawingToolsServiceSpy}, - {provide: AuthService, useValue: {}}, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: DrawingToolsService, useValue: drawingToolsServiceSpy }, + { provide: AuthService, useValue: {} }, { provide: AngularFireAuth, useValue: { @@ -223,7 +223,7 @@ describe('MapComponent', () => { }), }, }, - {provide: AngularFirestore, useValue: {}}, + { provide: AngularFirestore, useValue: {} }, ], }).compileComponents(); })); diff --git a/web/src/app/components/main-page-container/main-page/map/map.component.ts b/web/src/app/components/main-page-container/main-page/map/map.component.ts index f8d0ecd9b..f3655c1ea 100644 --- a/web/src/app/components/main-page-container/main-page/map/map.component.ts +++ b/web/src/app/components/main-page-container/main-page/map/map.component.ts @@ -25,30 +25,30 @@ import { ViewChild, input, } from '@angular/core'; -import {toObservable} from '@angular/core/rxjs-interop'; -import {GoogleMap} from '@angular/google-maps'; -import {Map as ImmutableMap, List} from 'immutable'; -import {BehaviorSubject, Observable, Subscription, combineLatest} from 'rxjs'; -import {filter, map} from 'rxjs/operators'; - -import {Coordinate} from 'app/models/geometry/coordinate'; -import {Geometry, GeometryType} from 'app/models/geometry/geometry'; -import {MultiPolygon} from 'app/models/geometry/multi-polygon'; -import {Point} from 'app/models/geometry/point'; -import {Polygon} from 'app/models/geometry/polygon'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {Survey} from 'app/models/survey.model'; -import {TaskType} from 'app/models/task/task.model'; +import { toObservable } from '@angular/core/rxjs-interop'; +import { GoogleMap } from '@angular/google-maps'; +import { Map as ImmutableMap, List } from 'immutable'; +import { BehaviorSubject, Observable, Subscription, combineLatest } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; + +import { Coordinate } from 'app/models/geometry/coordinate'; +import { Geometry, GeometryType } from 'app/models/geometry/geometry'; +import { MultiPolygon } from 'app/models/geometry/multi-polygon'; +import { Point } from 'app/models/geometry/point'; +import { Polygon } from 'app/models/geometry/polygon'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { Survey } from 'app/models/survey.model'; +import { TaskType } from 'app/models/task/task.model'; import { DrawingToolsService, EditMode, } from 'app/services/drawing-tools/drawing-tools.service'; -import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; +import { GroundPinService } from 'app/services/ground-pin/ground-pin.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; // To make ESLint happy: /*global google*/ @@ -407,7 +407,7 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { : survey.getJob(loi.jobId)?.name; if (loi.geometry instanceof Point) { - const {id, jobId, geometry} = loi; + const { id, jobId, geometry } = loi; const marker = this.addLocationOfInterestMarkerToMap( id, jobId, @@ -461,7 +461,7 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { color: string | undefined = this.DEFAULT_MARKER_COLOR, markerText?: string | undefined ): google.maps.marker.AdvancedMarkerElement { - const {y: latitude, x: longitude} = geometry.coord; + const { y: latitude, x: longitude } = geometry.coord; const options: google.maps.marker.AdvancedMarkerElementOptions = { map: this.map.googleMap, @@ -668,7 +668,7 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { const polygons = this.polygons.get(locationOfInterestId); polygons?.forEach(polygon => - polygon.setOptions({strokeWeight: enlargedPolygonStrokeWeight}) + polygon.setOptions({ strokeWeight: enlargedPolygonStrokeWeight }) ); this.fitMapToLocationsOfInterest( @@ -700,7 +700,9 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { const linearRings = [polygonModel.shell, ...polygonModel.holes]; const paths = linearRings.map(linearRing => linearRing.points - .map(({x, y}: {x: number; y: number}) => new google.maps.LatLng(y, x)) + .map( + ({ x, y }: { x: number; y: number }) => new google.maps.LatLng(y, x) + ) .toJS() ); return new google.maps.Polygon({ diff --git a/web/src/app/components/main-page-container/main-page/map/map.module.ts b/web/src/app/components/main-page-container/main-page/map/map.module.ts index 1fc4134e4..b58cf0d6c 100644 --- a/web/src/app/components/main-page-container/main-page/map/map.module.ts +++ b/web/src/app/components/main-page-container/main-page/map/map.module.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {GoogleMapsModule} from '@angular/google-maps'; -import {MatButtonModule} from '@angular/material/button'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { GoogleMapsModule } from '@angular/google-maps'; +import { MatButtonModule } from '@angular/material/button'; +import { BrowserModule } from '@angular/platform-browser'; -import {MapComponent} from './map.component'; +import { MapComponent } from './map.component'; @NgModule({ imports: [BrowserModule, GoogleMapsModule, MatButtonModule], diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts index 6ee296248..db34b9717 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.spec.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {MatDialog} from '@angular/material/dialog'; -import {List, Map} from 'immutable'; -import {of} from 'rxjs'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialog } from '@angular/material/dialog'; +import { List, Map } from 'immutable'; +import { of } from 'rxjs'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; -import {LocationOfInterestPanelComponent} from './loi-panel.component'; +import { LocationOfInterestPanelComponent } from './loi-panel.component'; describe('LocationOfInterestPanelComponent', () => { let component: LocationOfInterestPanelComponent; @@ -43,13 +43,13 @@ describe('LocationOfInterestPanelComponent', () => { Map(), Map(), 'owner1', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const mockLoi = new LocationOfInterest( 'loi1', 'job1', - {chainId: 'point1'} as any, + { chainId: 'point1' } as any, Map() ); @@ -74,10 +74,10 @@ describe('LocationOfInterestPanelComponent', () => { TestBed.configureTestingModule({ declarations: [LocationOfInterestPanelComponent], providers: [ - {provide: LocationOfInterestService, useValue: loiServiceSpy}, - {provide: SubmissionService, useValue: submissionServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: MatDialog, useValue: dialogSpy}, + { provide: LocationOfInterestService, useValue: loiServiceSpy }, + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: MatDialog, useValue: dialogSpy }, ], }).compileComponents(); })); diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts index f1ca2c894..3f35f9998 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.component.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {Component, OnDestroy, OnInit, input} from '@angular/core'; -import {toObservable} from '@angular/core/rxjs-interop'; -import {MatDialog} from '@angular/material/dialog'; -import {List} from 'immutable'; -import {Subscription, combineLatest, switchMap} from 'rxjs'; +import { Component, OnDestroy, OnInit, input } from '@angular/core'; +import { toObservable } from '@angular/core/rxjs-interop'; +import { MatDialog } from '@angular/material/dialog'; +import { List } from 'immutable'; +import { Subscription, combineLatest, switchMap } from 'rxjs'; -import {LoiPropertiesDialogComponent} from 'app/components/shared/loi-properties-dialog/loi-properties-dialog.component'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {Survey} from 'app/models/survey.model'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {getLoiIcon} from 'app/utils/utils'; +import { LoiPropertiesDialogComponent } from 'app/components/shared/loi-properties-dialog/loi-properties-dialog.component'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { Survey } from 'app/models/survey.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { getLoiIcon } from 'app/utils/utils'; @Component({ selector: 'ground-loi-panel', diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts index ec4ddd881..78852f8fc 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/loi-panel/loi-panel.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatListModule} from '@angular/material/list'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { BrowserModule } from '@angular/platform-browser'; -import {LocationOfInterestPanelComponent} from './loi-panel.component'; +import { LocationOfInterestPanelComponent } from './loi-panel.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts index 061302c24..fefa92e61 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.spec.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; -import {DataSharingType, Survey} from 'app/models/survey.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; import { NavigationService, SideNavMode, } from 'app/services/navigation/navigation.service'; -import {SecondarySidePanelComponent} from './secondary-side-panel.component'; +import { SecondarySidePanelComponent } from './secondary-side-panel.component'; describe('SecondarySidePanelComponent', () => { let component: SecondarySidePanelComponent; @@ -39,7 +39,7 @@ describe('SecondarySidePanelComponent', () => { Map(), Map(), 'owner1', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(waitForAsync(() => { @@ -64,7 +64,9 @@ describe('SecondarySidePanelComponent', () => { TestBed.configureTestingModule({ declarations: [SecondarySidePanelComponent], - providers: [{provide: NavigationService, useValue: navigationServiceSpy}], + providers: [ + { provide: NavigationService, useValue: navigationServiceSpy }, + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts index 391673bb0..a40be4a1f 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.component.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import {Component, input} from '@angular/core'; +import { Component, input } from '@angular/core'; -import {Survey} from 'app/models/survey.model'; +import { Survey } from 'app/models/survey.model'; import { NavigationService, SideNavMode, diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts index 8fe03b036..37b00a458 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/secondary-side-panel.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatIconModule} from '@angular/material/icon'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { BrowserModule } from '@angular/platform-browser'; -import {LocationOfInterestPanelModule} from './loi-panel/loi-panel.module'; -import {SecondarySidePanelComponent} from './secondary-side-panel.component'; -import {SubmissionPanelModule} from './submission-panel/submission-panel.module'; +import { LocationOfInterestPanelModule } from './loi-panel/loi-panel.module'; +import { SecondarySidePanelComponent } from './secondary-side-panel.component'; +import { SubmissionPanelModule } from './submission-panel/submission-panel.module'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts index 1557f9450..443cee26c 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.spec.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {AngularFireStorage} from '@angular/fire/compat/storage'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { AngularFireStorage } from '@angular/fire/compat/storage'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; -import {AuditInfo} from 'app/models/audit-info.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; +import { AuditInfo } from 'app/models/audit-info.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; -import {SubmissionPanelComponent} from './submission-panel.component'; +import { SubmissionPanelComponent } from './submission-panel.component'; describe('SubmissionPanelComponent', () => { let component: SubmissionPanelComponent; @@ -43,7 +43,7 @@ describe('SubmissionPanelComponent', () => { Map(), Map(), 'owner1', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const mockUser = { @@ -58,7 +58,7 @@ describe('SubmissionPanelComponent', () => { const mockSubmission = new Submission( 'sub1', 'loi1', - {id: 'job1'} as any, + { id: 'job1' } as any, mockAuditInfo, mockAuditInfo, Map() @@ -84,9 +84,9 @@ describe('SubmissionPanelComponent', () => { declarations: [SubmissionPanelComponent], imports: [MatProgressSpinnerModule], providers: [ - {provide: SubmissionService, useValue: submissionServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: AngularFireStorage, useValue: storageSpy}, + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: AngularFireStorage, useValue: storageSpy }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts index c0f3af01d..2020a1853 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {Component, Input, OnDestroy, OnInit, input} from '@angular/core'; -import {AngularFireStorage} from '@angular/fire/compat/storage'; -import {List} from 'immutable'; -import {Subscription, firstValueFrom} from 'rxjs'; - -import {Point} from 'app/models/geometry/point'; -import {MultipleSelection} from 'app/models/submission/multiple-selection'; -import {Result} from 'app/models/submission/result.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {Survey} from 'app/models/survey.model'; -import {Option} from 'app/models/task/option.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; +import { Component, Input, OnDestroy, OnInit, input } from '@angular/core'; +import { AngularFireStorage } from '@angular/fire/compat/storage'; +import { List } from 'immutable'; +import { Subscription, firstValueFrom } from 'rxjs'; + +import { Point } from 'app/models/geometry/point'; +import { MultipleSelection } from 'app/models/submission/multiple-selection'; +import { Result } from 'app/models/submission/result.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { Survey } from 'app/models/survey.model'; +import { Option } from 'app/models/task/option.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; @Component({ selector: 'submission-panel', @@ -119,12 +119,14 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { ); } - getTaskSubmissionResult({id: taskId}: Task): Result | undefined { + getTaskSubmissionResult({ id: taskId }: Task): Result | undefined { return this.submission?.data.get(taskId); } getMultipleChoiceOption(task: Task, optionId: string) { - return task.multipleChoice?.options.find(({id}: Option) => id === optionId); + return task.multipleChoice?.options.find( + ({ id }: Option) => id === optionId + ); } getTaskMultipleChoiceSelections(task: Task): MultipleSelection { @@ -147,9 +149,9 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getCaptureLocationCoord(task: Task): string { // x represents longitude, y represents latitude - const {coord, accuracy, altitude} = this.getTaskSubmissionResult(task)! + const { coord, accuracy, altitude } = this.getTaskSubmissionResult(task)! .value as Point; - const {x, y} = coord; + const { x, y } = coord; const lng = Math.abs(x).toString() + (x > 0 ? '° E' : '° W'); const lat = Math.abs(y).toString() + (y > 0 ? '° N' : '° S'); const result = [`${lat}, ${lng}`]; @@ -167,7 +169,7 @@ export class SubmissionPanelComponent implements OnInit, OnDestroy { getTime(task: Task): string { return ( this.getTaskSubmissionResult(task)?.value as Date - ).toLocaleTimeString([], {hour: 'numeric', minute: 'numeric'}); + ).toLocaleTimeString([], { hour: 'numeric', minute: 'numeric' }); } selectGeometry(task: Task): void { diff --git a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts index 481405462..ce6c3d73a 100644 --- a/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts +++ b/web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatIconModule} from '@angular/material/icon'; -import {MatListModule} from '@angular/material/list'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { BrowserModule } from '@angular/platform-browser'; -import {SubmissionPanelComponent} from './submission-panel.component'; +import { SubmissionPanelComponent } from './submission-panel.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts index 5464d6431..1e916fd46 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.spec.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {MatListModule} from '@angular/material/list'; -import {Router} from '@angular/router'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { MatListModule } from '@angular/material/list'; +import { Router } from '@angular/router'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; -import {Job} from 'app/models/job.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { Job } from 'app/models/job.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {JobListComponent} from './job-list.component'; +import { JobListComponent } from './job-list.component'; const mockSurvey = new Survey( 'survey001', @@ -46,7 +46,7 @@ const mockSurvey = new Survey( }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const authState = { @@ -78,13 +78,13 @@ describe('JobListComponent', () => { provide: Router, useValue: routerSpy, }, - {provide: NavigationService, useValue: navigationService}, - {provide: AngularFirestore, useValue: {}}, + { provide: NavigationService, useValue: navigationService }, + { provide: AngularFirestore, useValue: {} }, { provide: AngularFireAuth, useValue: mockAngularFireAuth, }, - {provide: DataStoreService, useValue: {user$: () => of()}}, + { provide: DataStoreService, useValue: { user$: () => of() } }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts index c165cfd55..6c7407ef4 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.component.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {Component, computed, input} from '@angular/core'; -import {List} from 'immutable'; +import { Component, computed, input } from '@angular/core'; +import { List } from 'immutable'; -import {Job} from 'app/models/job.model'; -import {Survey} from 'app/models/survey.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; +import { Job } from 'app/models/job.model'; +import { Survey } from 'app/models/survey.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; @Component({ selector: 'ground-job-list', diff --git a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts index 11346a7b4..b05c5d738 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/job-list/job-list.module.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatListModule} from '@angular/material/list'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatListModule } from '@angular/material/list'; +import { BrowserModule } from '@angular/platform-browser'; -import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; -import {GroundIconModule} from 'app/modules/ground-icon.module'; +import { JobListItemModule } from 'app/components/shared/job-list-item/job-list-item.module'; +import { GroundIconModule } from 'app/modules/ground-icon.module'; -import {JobListComponent} from './job-list.component'; +import { JobListComponent } from './job-list.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts index 44943b021..cdb31f919 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component, input} from '@angular/core'; -import {Observable} from 'rxjs'; +import { Component, input } from '@angular/core'; +import { Observable } from 'rxjs'; -import {Survey} from 'app/models/survey.model'; +import { Survey } from 'app/models/survey.model'; import { NavigationService, SideNavMode, diff --git a/web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts index 595d7271a..0ede2244d 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/side-panel.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatIconModule} from '@angular/material/icon'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { BrowserModule } from '@angular/platform-browser'; -import {JobListModule} from './job-list/job-list.module'; -import {SidePanelComponent} from './side-panel.component'; -import {SubmissionFormModule} from './submission-form/submission-form.module'; +import { JobListModule } from './job-list/job-list.module'; +import { SidePanelComponent } from './side-panel.component'; +import { SubmissionFormModule } from './submission-form/submission-form.module'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts index 07603fb9d..3e7c3e2d5 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.spec.ts @@ -14,47 +14,47 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA, signal} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatRadioModule} from '@angular/material/radio'; -import {By} from '@angular/platform-browser'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {Router} from '@angular/router'; -import {List, Map} from 'immutable'; -import {NEVER, of} from 'rxjs'; - -import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; -import {AuditInfo} from 'app/models/audit-info.model'; -import {Coordinate} from 'app/models/geometry/coordinate'; -import {Point} from 'app/models/geometry/point'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {MultipleSelection} from 'app/models/submission/multiple-selection'; -import {Result} from 'app/models/submission/result.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; +import { NO_ERRORS_SCHEMA, signal } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatRadioModule } from '@angular/material/radio'; +import { By } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { Router } from '@angular/router'; +import { List, Map } from 'immutable'; +import { NEVER, of } from 'rxjs'; + +import { JobListItemModule } from 'app/components/shared/job-list-item/job-list-item.module'; +import { AuditInfo } from 'app/models/audit-info.model'; +import { Coordinate } from 'app/models/geometry/coordinate'; +import { Point } from 'app/models/geometry/point'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { MultipleSelection } from 'app/models/submission/multiple-selection'; +import { Result } from 'app/models/submission/result.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; import { Cardinality, MultipleChoice, } from 'app/models/task/multiple-choice.model'; -import {Option} from 'app/models/task/option.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {UrlParams} from 'app/services/navigation/url-params'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; - -import {SubmissionFormComponent} from './submission-form.component'; +import { Option } from 'app/models/task/option.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { UrlParams } from 'app/services/navigation/url-params'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { SurveyService } from 'app/services/survey/survey.service'; + +import { SubmissionFormComponent } from './submission-form.component'; class MockModel { static task001: Task = new Task( @@ -105,10 +105,10 @@ class MockModel { 'survey001', 'title', 'description', - Map({job001: MockModel.job001}), + Map({ job001: MockModel.job001 }), /*acl=*/ Map({}), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); static loi001 = new LocationOfInterest( @@ -195,16 +195,16 @@ describe('SubmissionFormComponent', () => { JobListItemModule, ], providers: [ - {provide: DataStoreService, useValue: {}}, + { provide: DataStoreService, useValue: {} }, { provide: LocationOfInterestService, useValue: loiService, }, - {provide: SurveyService, useValue: surveyService}, - {provide: SubmissionService, useValue: submissionService}, - {provide: Router, useValue: routerSpy}, - {provide: NavigationService, useValue: navigationService}, - {provide: AuthService, useValue: {getUser$: () => NEVER}}, + { provide: SurveyService, useValue: surveyService }, + { provide: SubmissionService, useValue: submissionService }, + { provide: Router, useValue: routerSpy }, + { provide: NavigationService, useValue: navigationService }, + { provide: AuthService, useValue: { getUser$: () => NEVER } }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts index 51ba7c254..f51c55800 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.component.ts @@ -14,32 +14,37 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms'; -import {List, Map} from 'immutable'; -import {Observable} from 'rxjs'; -import {first, map, switchMap} from 'rxjs/operators'; +import { Component } from '@angular/core'; +import { + FormBuilder, + FormControl, + FormGroup, + Validators, +} from '@angular/forms'; +import { List, Map } from 'immutable'; +import { Observable } from 'rxjs'; +import { first, map, switchMap } from 'rxjs/operators'; -import {JobListItemActionsType} from 'app/components/shared/job-list-item/job-list-item.component'; -import {AuditInfo} from 'app/models/audit-info.model'; -import {Job} from 'app/models/job.model'; -import {MultipleSelection} from 'app/models/submission/multiple-selection'; -import {Result} from 'app/models/submission/result.model'; +import { JobListItemActionsType } from 'app/components/shared/job-list-item/job-list-item.component'; +import { AuditInfo } from 'app/models/audit-info.model'; +import { Job } from 'app/models/job.model'; +import { MultipleSelection } from 'app/models/submission/multiple-selection'; +import { Result } from 'app/models/submission/result.model'; import { Submission, SubmissionData, } from 'app/models/submission/submission.model'; -import {Survey} from 'app/models/survey.model'; -import {Cardinality} from 'app/models/task/multiple-choice.model'; -import {Option} from 'app/models/task/option.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {LoadingState} from 'app/services/loading-state.model'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { Survey } from 'app/models/survey.model'; +import { Cardinality } from 'app/models/task/multiple-choice.model'; +import { Option } from 'app/models/task/option.model'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { LoadingState } from 'app/services/loading-state.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { SurveyService } from 'app/services/survey/survey.service'; // To make ESLint happy: /*global alert*/ @@ -155,7 +160,7 @@ export class SubmissionFormComponent { } private convertSubmissionToFormGroup(submission: Submission): FormGroup { - const group: {[taskId: string]: FormControl} = {}; + const group: { [taskId: string]: FormControl } = {}; for (const [taskId, task] of submission.job!.tasks!) { const result = submission!.data?.get(taskId); switch (task.type) { @@ -199,7 +204,7 @@ export class SubmissionFormComponent { } private addControlsForTextTask( - group: {[taskId: string]: FormControl}, + group: { [taskId: string]: FormControl }, task: Task, result?: Result ): void { @@ -210,7 +215,7 @@ export class SubmissionFormComponent { } private addControlsForNumberTask( - group: {[taskId: string]: FormControl}, + group: { [taskId: string]: FormControl }, task: Task, result?: Result ): void { @@ -229,7 +234,7 @@ export class SubmissionFormComponent { } private addControlsForMultipleChoiceTask( - group: {[taskId: string]: FormControl}, + group: { [taskId: string]: FormControl }, task: Task, result?: Result ): void { @@ -263,7 +268,7 @@ export class SubmissionFormComponent { } private addControlsForSelectOneTask( - group: {[taskId: string]: FormControl}, + group: { [taskId: string]: FormControl }, task: Task, result?: Result ): void { @@ -283,11 +288,11 @@ export class SubmissionFormComponent { } private addControlsForSelectMultipleTask( - group: {[taskId: string]: FormControl}, + group: { [taskId: string]: FormControl }, task: Task, result?: Result ): void { - const {values: selectedOptions} = result?.value as MultipleSelection; + const { values: selectedOptions } = result?.value as MultipleSelection; for (const option of task.multipleChoice!.options) { group[option.id] = new FormControl(selectedOptions?.contains(option.id)); } diff --git a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts index 9b7b7952b..bfaccf2bf 100644 --- a/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts +++ b/web/src/app/components/main-page-container/main-page/side-panel/submission-form/submission-form.module.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatRadioModule} from '@angular/material/radio'; -import {BrowserModule} from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatRadioModule } from '@angular/material/radio'; +import { BrowserModule } from '@angular/platform-browser'; -import {JobListItemModule} from 'app/components/shared/job-list-item/job-list-item.module'; +import { JobListItemModule } from 'app/components/shared/job-list-item/job-list-item.module'; -import {SubmissionFormComponent} from './submission-form.component'; +import { SubmissionFormComponent } from './submission-form.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts index 83c52a6ac..9e5628f55 100644 --- a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.spec.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {Router} from '@angular/router'; -import {NEVER, of} from 'rxjs'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { Router } from '@angular/router'; +import { NEVER, of } from 'rxjs'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {SurveyHeaderComponent} from './survey-header.component'; +import { SurveyHeaderComponent } from './survey-header.component'; describe('SurveyHeaderComponent', () => { let component: SurveyHeaderComponent; @@ -37,7 +37,7 @@ describe('SurveyHeaderComponent', () => { providers: [ { provide: DataStoreService, - useValue: {getAccessDeniedMessage: () => ''}, + useValue: { getAccessDeniedMessage: () => '' }, }, { provide: SurveyService, diff --git a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts index 95c665670..1a9a9ca50 100644 --- a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts +++ b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {Component, input} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {Subscription} from 'rxjs'; +import { Component, input } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { Subscription } from 'rxjs'; -import {ShareDialogComponent} from 'app/components/shared/share-dialog/share-dialog.component'; -import {Survey} from 'app/models/survey.model'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { ShareDialogComponent } from 'app/components/shared/share-dialog/share-dialog.component'; +import { Survey } from 'app/models/survey.model'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; @Component({ selector: 'ground-survey-header', diff --git a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts index 450d304e5..fea88079b 100644 --- a/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts +++ b/web/src/app/components/main-page-container/main-page/survey-header/survey-header.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; -import {HeaderModule} from 'app/components/shared/header/header.module'; -import {ShareDialogModule} from 'app/components/shared/share-dialog/share-dialog.module'; +import { HeaderModule } from 'app/components/shared/header/header.module'; +import { ShareDialogModule } from 'app/components/shared/share-dialog/share-dialog.module'; -import {SurveyHeaderComponent} from './survey-header.component'; +import { SurveyHeaderComponent } from './survey-header.component'; @NgModule({ declarations: [SurveyHeaderComponent], diff --git a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts index f63ee52ed..cf4ddb537 100644 --- a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts +++ b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.spec.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {MatDialogModule, MatDialogRef} from '@angular/material/dialog'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {TitleDialogComponent} from './title-dialog.component'; +import { TitleDialogComponent } from './title-dialog.component'; describe('TitleDialogComponent', () => { let component: TitleDialogComponent; @@ -37,9 +37,9 @@ describe('TitleDialogComponent', () => { declarations: [TitleDialogComponent], imports: [MatDialogModule], providers: [ - {provide: MatDialogRef, useValue: dialogRef}, - {provide: SurveyService, useValue: surveyService}, - {provide: NavigationService, useValue: navigationService}, + { provide: MatDialogRef, useValue: dialogRef }, + { provide: SurveyService, useValue: surveyService }, + { provide: NavigationService, useValue: navigationService }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts index 21f13299f..690803e76 100644 --- a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts +++ b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.component.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {FormControl, FormGroup} from '@angular/forms'; -import {MatDialogRef} from '@angular/material/dialog'; +import { Component } from '@angular/core'; +import { FormControl, FormGroup } from '@angular/forms'; +import { MatDialogRef } from '@angular/material/dialog'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; @Component({ selector: 'ground-title-dialog', @@ -34,7 +34,7 @@ export class TitleDialogComponent { private navigationService: NavigationService, private surveyService: SurveyService ) { - this.surveyTitleForm = new FormGroup({title: new FormControl()}); + this.surveyTitleForm = new FormGroup({ title: new FormControl() }); } async onCreateSurvey() { diff --git a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts index 4107858ea..580c98d87 100644 --- a/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts +++ b/web/src/app/components/main-page-container/main-page/title-dialog/title-dialog.module.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; -import {TitleDialogComponent} from './title-dialog.component'; +import { TitleDialogComponent } from './title-dialog.component'; @NgModule({ declarations: [TitleDialogComponent], diff --git a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts index ca72eeb6b..d0722a9e3 100644 --- a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts +++ b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.spec.ts @@ -20,13 +20,13 @@ import { fakeAsync, tick, } from '@angular/core/testing'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {NotificationService} from 'app/services/notification/notification.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { NotificationService } from 'app/services/notification/notification.service'; -import {CopySurveyControlsComponent} from './copy-survey-controls.component'; +import { CopySurveyControlsComponent } from './copy-survey-controls.component'; describe('ShareButtonsComponent', () => { let component: CopySurveyControlsComponent; @@ -49,8 +49,8 @@ describe('ShareButtonsComponent', () => { declarations: [CopySurveyControlsComponent], imports: [MatIconModule, MatButtonModule], providers: [ - {provide: NavigationService, useValue: navigationService}, - {provide: NotificationService, useValue: notificationService}, + { provide: NavigationService, useValue: navigationService }, + { provide: NotificationService, useValue: notificationService }, ], }).compileComponents(); diff --git a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts index a847ea41f..4dda2bfd5 100644 --- a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts +++ b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core'; +import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {NotificationService} from 'app/services/notification/notification.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { NotificationService } from 'app/services/notification/notification.service'; /** * Implements the controls for copying the survey link and QR code @@ -33,7 +33,7 @@ import {NotificationService} from 'app/services/notification/notification.servic export class CopySurveyControlsComponent implements OnInit { @Input() surveyId = ''; - @ViewChild('qrCodeElement', {read: ElementRef}) + @ViewChild('qrCodeElement', { read: ElementRef }) qrCodeElement!: ElementRef; surveyAppLink = ''; @@ -74,7 +74,7 @@ export class CopySurveyControlsComponent implements OnInit { return; } - const data = [new ClipboardItem({[blob.type]: blob})]; + const data = [new ClipboardItem({ [blob.type]: blob })]; navigator.clipboard.write(data).then( () => { this.notificationService.success( diff --git a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts index 4b1d071ca..28ba583b6 100644 --- a/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts +++ b/web/src/app/components/shared/copy-survey-controls/copy-survey-controls.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; -import {QRCodeModule} from 'angularx-qrcode'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { QRCodeModule } from 'angularx-qrcode'; -import {CopySurveyControlsComponent} from './copy-survey-controls.component'; +import { CopySurveyControlsComponent } from './copy-survey-controls.component'; @NgModule({ declarations: [CopySurveyControlsComponent], diff --git a/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts b/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts index 5cd9017ff..54a07b865 100644 --- a/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts +++ b/web/src/app/components/shared/data-visibility-control/data-visibility-control.component.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {MatSlideToggleChange} from '@angular/material/slide-toggle'; -import {Subscription} from 'rxjs'; +import { Component } from '@angular/core'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { Subscription } from 'rxjs'; -import {Survey, SurveyDataVisibility} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; +import { Survey, SurveyDataVisibility } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; @Component({ selector: 'ground-data-visibility-control', diff --git a/web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts b/web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts index e853a7144..6e1531dce 100644 --- a/web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts +++ b/web/src/app/components/shared/data-visibility-control/data-visibility-control.module.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import {DataVisibilityControlComponent} from './data-visibility-control.component'; +import { DataVisibilityControlComponent } from './data-visibility-control.component'; @NgModule({ declarations: [DataVisibilityControlComponent], diff --git a/web/src/app/components/shared/general-access-control/general-access-control.component.ts b/web/src/app/components/shared/general-access-control/general-access-control.component.ts index b14f73640..747f9c311 100644 --- a/web/src/app/components/shared/general-access-control/general-access-control.component.ts +++ b/web/src/app/components/shared/general-access-control/general-access-control.component.ts @@ -16,13 +16,13 @@ import '@angular/localize/init'; -import {Component} from '@angular/core'; -import {Map} from 'immutable'; -import {Subscription} from 'rxjs'; +import { Component } from '@angular/core'; +import { Map } from 'immutable'; +import { Subscription } from 'rxjs'; -import {Survey, SurveyGeneralAccess} from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; +import { Survey, SurveyGeneralAccess } from 'app/models/survey.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; const generalAccessLabels = Map([ [ diff --git a/web/src/app/components/shared/general-access-control/general-access-control.module.ts b/web/src/app/components/shared/general-access-control/general-access-control.module.ts index 1165d007c..c46a25359 100644 --- a/web/src/app/components/shared/general-access-control/general-access-control.module.ts +++ b/web/src/app/components/shared/general-access-control/general-access-control.module.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatSelectModule} from '@angular/material/select'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; -import {GeneralAccessControlComponent} from './general-access-control.component'; +import { GeneralAccessControlComponent } from './general-access-control.component'; @NgModule({ declarations: [GeneralAccessControlComponent], diff --git a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts index 80a9fab85..e7f893d0f 100644 --- a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts +++ b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.spec.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {Router} from '@angular/router'; -import {of} from 'rxjs'; +import { Router } from '@angular/router'; +import { of } from 'rxjs'; -import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; -import {AuthService} from 'app/services/auth/auth.service'; +import { AccountPopupComponent } from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; +import { AuthService } from 'app/services/auth/auth.service'; describe('AccountPopupComponent', () => { let component: AccountPopupComponent; @@ -37,10 +37,10 @@ describe('AccountPopupComponent', () => { declarations: [AccountPopupComponent], imports: [MatDialogModule], providers: [ - {provide: AuthService, useValue: {getUser$: () => of()}}, - {provide: MAT_DIALOG_DATA, useValue: {}}, - {provide: MatDialogRef, useValue: dialogRef}, - {provide: Router, useValue: routerSpy}, + { provide: AuthService, useValue: { getUser$: () => of() } }, + { provide: MAT_DIALOG_DATA, useValue: {} }, + { provide: MatDialogRef, useValue: dialogRef }, + { provide: Router, useValue: routerSpy }, ], }).compileComponents(); })); diff --git a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts index b73be5711..3d218cb29 100644 --- a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts +++ b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {Component, ElementRef, Inject, OnInit} from '@angular/core'; +import { Component, ElementRef, Inject, OnInit } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogRef, } from '@angular/material/dialog'; -import {AuthService} from 'app/services/auth/auth.service'; +import { AuthService } from 'app/services/auth/auth.service'; @Component({ selector: 'ground-account-popup', @@ -35,7 +35,7 @@ export class AccountPopupComponent implements OnInit { constructor( matDialogRef: MatDialogRef, public auth: AuthService, - @Inject(MAT_DIALOG_DATA) data: {trigger: ElementRef} + @Inject(MAT_DIALOG_DATA) data: { trigger: ElementRef } ) { this.matDialogRef = matDialogRef; this.triggerElementRef = data.trigger; diff --git a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts index 19d89bea1..e25a72380 100644 --- a/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts +++ b/web/src/app/components/shared/header/current-user-widget/account-popup/account-popup.module.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; -import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; -import {UserAvatarModule} from 'app/components/shared/user-avatar/user-avatar.module'; +import { AccountPopupComponent } from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; +import { UserAvatarModule } from 'app/components/shared/user-avatar/user-avatar.module'; @NgModule({ declarations: [AccountPopupComponent], diff --git a/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts index 5f3461b39..9bdc421d6 100644 --- a/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.spec.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatDialog} from '@angular/material/dialog'; -import {Subject} from 'rxjs'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatDialog } from '@angular/material/dialog'; +import { Subject } from 'rxjs'; -import {CurrentUserWidgetComponent} from 'app/components/shared/header/current-user-widget/current-user-widget.component'; -import {User} from 'app/models/user.model'; -import {AuthService} from 'app/services/auth/auth.service'; +import { CurrentUserWidgetComponent } from 'app/components/shared/header/current-user-widget/current-user-widget.component'; +import { User } from 'app/models/user.model'; +import { AuthService } from 'app/services/auth/auth.service'; describe('CurrentUserWidgetComponent', () => { let component: CurrentUserWidgetComponent; @@ -30,8 +30,8 @@ describe('CurrentUserWidgetComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ providers: [ - {provide: AuthService, useValue: {user$, getUser$: () => user$}}, - {provide: MatDialog, useValue: {}}, + { provide: AuthService, useValue: { user$, getUser$: () => user$ } }, + { provide: MatDialog, useValue: {} }, ], declarations: [CurrentUserWidgetComponent], }).compileComponents(); diff --git a/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts index 3cc54faec..b43305e56 100644 --- a/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.component.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {Component, ElementRef} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; +import { Component, ElementRef } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; -import {AccountPopupComponent} from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; -import {AuthService} from 'app/services/auth/auth.service'; +import { AccountPopupComponent } from 'app/components/shared/header/current-user-widget/account-popup/account-popup.component'; +import { AuthService } from 'app/services/auth/auth.service'; @Component({ selector: 'ground-current-user-widget', @@ -31,7 +31,7 @@ export class CurrentUserWidgetComponent { openProfileDialog(evt: MouseEvent): void { const target = new ElementRef(evt.currentTarget); this.dialog.open(AccountPopupComponent, { - data: {trigger: target}, + data: { trigger: target }, }); } } diff --git a/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts b/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts index 2c5d015ba..324e7e820 100644 --- a/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts +++ b/web/src/app/components/shared/header/current-user-widget/current-user-widget.module.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; -import {CurrentUserWidgetComponent} from 'app/components/shared/header/current-user-widget/current-user-widget.component'; -import {UserAvatarModule} from 'app/components/shared/user-avatar/user-avatar.module'; +import { CurrentUserWidgetComponent } from 'app/components/shared/header/current-user-widget/current-user-widget.component'; +import { UserAvatarModule } from 'app/components/shared/user-avatar/user-avatar.module'; @NgModule({ declarations: [CurrentUserWidgetComponent], diff --git a/web/src/app/components/shared/header/header.component.spec.ts b/web/src/app/components/shared/header/header.component.spec.ts index 9701842cc..2e6752e53 100644 --- a/web/src/app/components/shared/header/header.component.spec.ts +++ b/web/src/app/components/shared/header/header.component.spec.ts @@ -14,19 +14,19 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatDialog} from '@angular/material/dialog'; -import {MatMenuModule} from '@angular/material/menu'; -import {Router} from '@angular/router'; -import {of} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatDialog } from '@angular/material/dialog'; +import { MatMenuModule } from '@angular/material/menu'; +import { Router } from '@angular/router'; +import { of } from 'rxjs'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {HeaderComponent} from './header.component'; +import { HeaderComponent } from './header.component'; describe('HeaderComponent', () => { let component: HeaderComponent; @@ -39,13 +39,13 @@ describe('HeaderComponent', () => { providers: [ { provide: DataStoreService, - useValue: {getAccessDeniedMessage: () => ''}, + useValue: { getAccessDeniedMessage: () => '' }, }, - {provide: MatDialog, useValue: {}}, - {provide: AuthService, useValue: {getUser$: () => of()}}, - {provide: DraftSurveyService, useValue: {}}, - {provide: Router, useValue: {events: of()}}, - {provide: SurveyService, useValue: {canManageSurvey: () => false}}, + { provide: MatDialog, useValue: {} }, + { provide: AuthService, useValue: { getUser$: () => of() } }, + { provide: DraftSurveyService, useValue: {} }, + { provide: Router, useValue: { events: of() } }, + { provide: SurveyService, useValue: { canManageSurvey: () => false } }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/web/src/app/components/shared/header/header.component.ts b/web/src/app/components/shared/header/header.component.ts index 8e666f48c..25d11967c 100644 --- a/web/src/app/components/shared/header/header.component.ts +++ b/web/src/app/components/shared/header/header.component.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import {Component, OnInit} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; +import { Component, OnInit } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; import { DialogData, DialogType, JobDialogComponent, } from 'app/components/edit-survey/job-dialog/job-dialog.component'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; export enum HeaderState { DEFAULT = 1, @@ -55,7 +55,7 @@ export class HeaderComponent implements OnInit { async ngOnInit(): Promise { this.surveyService.getActiveSurvey$().subscribe(survey => { - const {id: surveyId} = survey; + const { id: surveyId } = survey; this.surveyId = surveyId; @@ -92,7 +92,7 @@ export class HeaderComponent implements OnInit { } const dialogRef = this.dialog.open(JobDialogComponent, { - data: {dialogType: DialogType.UndoJobs}, + data: { dialogType: DialogType.UndoJobs }, panelClass: 'small-width-dialog', }); @@ -112,7 +112,7 @@ export class HeaderComponent implements OnInit { } this.dialog.open(JobDialogComponent, { - data: {dialogType: DialogType.InvalidSurvey}, + data: { dialogType: DialogType.InvalidSurvey }, panelClass: 'small-width-dialog', }); } diff --git a/web/src/app/components/shared/header/header.module.ts b/web/src/app/components/shared/header/header.module.ts index 9d0a7dc17..c72e72005 100644 --- a/web/src/app/components/shared/header/header.module.ts +++ b/web/src/app/components/shared/header/header.module.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import {CurrentUserWidgetModule} from './current-user-widget/current-user-widget.module'; -import {HeaderComponent} from './header.component'; +import { CurrentUserWidgetModule } from './current-user-widget/current-user-widget.module'; +import { HeaderComponent } from './header.component'; @NgModule({ declarations: [HeaderComponent], diff --git a/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts b/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts index 71b65a0c6..d50b804a7 100644 --- a/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts +++ b/web/src/app/components/shared/import-dialog/import-dialog.component.spec.ts @@ -14,20 +14,20 @@ * limitations under the License. */ -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {ReactiveFormsModule} from '@angular/forms'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef, } from '@angular/material/dialog'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {FileUploadModule} from '@iplab/ngx-file-upload'; -import {NEVER} from 'rxjs'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { FileUploadModule } from '@iplab/ngx-file-upload'; +import { NEVER } from 'rxjs'; -import {ImportDialogComponent} from 'app/components/shared/import-dialog/import-dialog.component'; -import {DataImportService} from 'app/services/data-import/data-import.service'; +import { ImportDialogComponent } from 'app/components/shared/import-dialog/import-dialog.component'; +import { DataImportService } from 'app/services/data-import/data-import.service'; describe('ImportDialogComponent', () => { let component: ImportDialogComponent; @@ -44,9 +44,9 @@ describe('ImportDialogComponent', () => { MatSnackBarModule, ], providers: [ - {provide: DataImportService, useValue: {}}, - {provide: MatDialogRef, useValue: {afterClosed: () => NEVER}}, - {provide: MAT_DIALOG_DATA, useValue: {}}, + { provide: DataImportService, useValue: {} }, + { provide: MatDialogRef, useValue: { afterClosed: () => NEVER } }, + { provide: MAT_DIALOG_DATA, useValue: {} }, ], }).compileComponents(); })); diff --git a/web/src/app/components/shared/import-dialog/import-dialog.component.ts b/web/src/app/components/shared/import-dialog/import-dialog.component.ts index 560085bc6..84d7c941f 100644 --- a/web/src/app/components/shared/import-dialog/import-dialog.component.ts +++ b/web/src/app/components/shared/import-dialog/import-dialog.component.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {HttpErrorResponse} from '@angular/common/http'; -import {Component, Inject, NgZone} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; -import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; +import { HttpErrorResponse } from '@angular/common/http'; +import { Component, Inject, NgZone } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import {DataImportService} from 'app/services/data-import/data-import.service'; -import {NotificationService} from 'app/services/notification/notification.service'; +import { DataImportService } from 'app/services/data-import/data-import.service'; +import { NotificationService } from 'app/services/notification/notification.service'; @Component({ selector: 'ground-import-dialog', @@ -37,7 +37,7 @@ export class ImportDialogComponent { constructor( @Inject(MAT_DIALOG_DATA) - public data: {surveyId: string; jobId: string}, + public data: { surveyId: string; jobId: string }, private formBuilder: FormBuilder, private dataImportService: DataImportService, private readonly dialogRef: MatDialogRef, diff --git a/web/src/app/components/shared/import-dialog/import-dialog.module.ts b/web/src/app/components/shared/import-dialog/import-dialog.module.ts index 9a0150e0b..84b0e21e1 100644 --- a/web/src/app/components/shared/import-dialog/import-dialog.module.ts +++ b/web/src/app/components/shared/import-dialog/import-dialog.module.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {FileUploadModule} from '@iplab/ngx-file-upload'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { FileUploadModule } from '@iplab/ngx-file-upload'; -import {ImportDialogComponent} from './import-dialog.component'; +import { ImportDialogComponent } from './import-dialog.component'; @NgModule({ declarations: [ImportDialogComponent], diff --git a/web/src/app/components/shared/inline-editor/inline-editor.component.ts b/web/src/app/components/shared/inline-editor/inline-editor.component.ts index ffbcd882e..07df3c6f5 100644 --- a/web/src/app/components/shared/inline-editor/inline-editor.component.ts +++ b/web/src/app/components/shared/inline-editor/inline-editor.component.ts @@ -39,13 +39,13 @@ export class InlineEditorComponent { constructor() {} onFocusOut(event: FocusEvent) { - const {target} = event; + const { target } = event; if (!target || !(target instanceof HTMLInputElement)) return; this.focusOut.emit(target.value); } handleKeyPress(event: KeyboardEvent) { - const {key, target} = event; + const { key, target } = event; if (!target || !(target instanceof HTMLInputElement)) return; switch (key) { case 'Enter': diff --git a/web/src/app/components/shared/inline-editor/inline-editor.module.ts b/web/src/app/components/shared/inline-editor/inline-editor.module.ts index 5be856260..dc33cc8d5 100644 --- a/web/src/app/components/shared/inline-editor/inline-editor.module.ts +++ b/web/src/app/components/shared/inline-editor/inline-editor.module.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {AutoSizeInputModule} from 'ngx-autosize-input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { AutoSizeInputModule } from 'ngx-autosize-input'; -import {InlineEditorComponent} from './inline-editor.component'; +import { InlineEditorComponent } from './inline-editor.component'; @NgModule({ declarations: [InlineEditorComponent], diff --git a/web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts b/web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts index 7e7028c58..353381c8e 100644 --- a/web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts +++ b/web/src/app/components/shared/job-list-item/job-list-item.component.spec.ts @@ -14,40 +14,40 @@ * limitations under the License. */ -import {HarnessLoader} from '@angular/cdk/testing'; -import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; -import {CdkTreeModule} from '@angular/cdk/tree'; -import {Signal, WritableSignal, signal} from '@angular/core'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {MatButtonHarness} from '@angular/material/button/testing'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatTreeModule} from '@angular/material/tree'; -import {MatTreeHarness} from '@angular/material/tree/testing'; -import {Router} from '@angular/router'; -import {List, Map} from 'immutable'; -import {Subject, of} from 'rxjs'; - -import {AuditInfo} from 'app/models/audit-info.model'; -import {Coordinate} from 'app/models/geometry/coordinate'; -import {Point} from 'app/models/geometry/point'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Submission} from 'app/models/submission/submission.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {GroundIconModule} from 'app/modules/ground-icon.module'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {UrlParams} from 'app/services/navigation/url-params'; -import {SubmissionService} from 'app/services/submission/submission.service'; -import {SurveyService} from 'app/services/survey/survey.service'; - -import {JobListItemComponent} from './job-list-item.component'; +import { HarnessLoader } from '@angular/cdk/testing'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { CdkTreeModule } from '@angular/cdk/tree'; +import { Signal, WritableSignal, signal } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { MatButtonHarness } from '@angular/material/button/testing'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatTreeModule } from '@angular/material/tree'; +import { MatTreeHarness } from '@angular/material/tree/testing'; +import { Router } from '@angular/router'; +import { List, Map } from 'immutable'; +import { Subject, of } from 'rxjs'; + +import { AuditInfo } from 'app/models/audit-info.model'; +import { Coordinate } from 'app/models/geometry/coordinate'; +import { Point } from 'app/models/geometry/point'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Submission } from 'app/models/submission/submission.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { GroundIconModule } from 'app/modules/ground-icon.module'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { UrlParams } from 'app/services/navigation/url-params'; +import { SubmissionService } from 'app/services/submission/submission.service'; +import { SurveyService } from 'app/services/survey/survey.service'; + +import { JobListItemComponent } from './job-list-item.component'; const authState = { displayName: null, @@ -96,7 +96,7 @@ describe('JobListItemComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); function createLois(count: number): List { @@ -191,14 +191,14 @@ describe('JobListItemComponent', () => { CdkTreeModule, ], providers: [ - {provide: DataStoreService, useValue: {user$: () => of()}}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: Router, useValue: {}}, - {provide: SurveyService, useValue: surveyServiceSpy}, - {provide: LocationOfInterestService, useValue: loiServiceSpy}, - {provide: SubmissionService, useValue: submissionServiceSpy}, - {provide: AngularFirestore, useValue: {}}, - {provide: AuthService, useValue: {}}, + { provide: DataStoreService, useValue: { user$: () => of() } }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: Router, useValue: {} }, + { provide: SurveyService, useValue: surveyServiceSpy }, + { provide: LocationOfInterestService, useValue: loiServiceSpy }, + { provide: SubmissionService, useValue: submissionServiceSpy }, + { provide: AngularFirestore, useValue: {} }, + { provide: AuthService, useValue: {} }, { provide: AngularFireAuth, useValue: mockAngularFireAuth, @@ -261,7 +261,7 @@ describe('JobListItemComponent', () => { const loiId = lois.first()!.id; const selectLoiButton = await loader.getHarness( - MatButtonHarness.with({selector: '.loi-tree-node'}) + MatButtonHarness.with({ selector: '.loi-tree-node' }) ); await selectLoiButton.click(); diff --git a/web/src/app/components/shared/job-list-item/job-list-item.component.ts b/web/src/app/components/shared/job-list-item/job-list-item.component.ts index f10694d17..e4a5a8180 100644 --- a/web/src/app/components/shared/job-list-item/job-list-item.component.ts +++ b/web/src/app/components/shared/job-list-item/job-list-item.component.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {FlatTreeControl} from '@angular/cdk/tree'; -import {Component, Input, OnDestroy, OnInit, effect} from '@angular/core'; -import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; -import {List} from 'immutable'; -import {Subscription} from 'rxjs'; - -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {GroundPinService} from 'app/services/ground-pin/ground-pin.service'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {environment} from 'environments/environment'; - -import {DynamicDataSource, DynamicFlatNode} from './tree-data-source'; +import { FlatTreeControl } from '@angular/cdk/tree'; +import { Component, Input, OnDestroy, OnInit, effect } from '@angular/core'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { List } from 'immutable'; +import { Subscription } from 'rxjs'; + +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { GroundPinService } from 'app/services/ground-pin/ground-pin.service'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { environment } from 'environments/environment'; + +import { DynamicDataSource, DynamicFlatNode } from './tree-data-source'; @Component({ selector: 'ground-job-list-item', @@ -71,7 +71,7 @@ export class JobListItemComponent implements OnInit, OnDestroy { this.dataSource = new DynamicDataSource(this.treeControl, this.loiService); effect(() => { - const {surveyId, loiId} = this.urlParamsSignal(); + const { surveyId, loiId } = this.urlParamsSignal(); this.surveyId = surveyId; this.loiId = loiId; }); diff --git a/web/src/app/components/shared/job-list-item/job-list-item.module.ts b/web/src/app/components/shared/job-list-item/job-list-item.module.ts index b7a6d7518..2f9262a27 100644 --- a/web/src/app/components/shared/job-list-item/job-list-item.module.ts +++ b/web/src/app/components/shared/job-list-item/job-list-item.module.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CdkTreeModule} from '@angular/cdk/tree'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {MatTreeModule} from '@angular/material/tree'; -import {BrowserModule} from '@angular/platform-browser'; +import { CdkTreeModule } from '@angular/cdk/tree'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatTreeModule } from '@angular/material/tree'; +import { BrowserModule } from '@angular/platform-browser'; -import {JobListItemComponent} from './job-list-item.component'; +import { JobListItemComponent } from './job-list-item.component'; @NgModule({ imports: [ diff --git a/web/src/app/components/shared/job-list-item/tree-data-source.ts b/web/src/app/components/shared/job-list-item/tree-data-source.ts index 2cc46cc4b..909384e69 100644 --- a/web/src/app/components/shared/job-list-item/tree-data-source.ts +++ b/web/src/app/components/shared/job-list-item/tree-data-source.ts @@ -19,14 +19,14 @@ import { DataSource, SelectionChange, } from '@angular/cdk/collections'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import {List} from 'immutable'; -import {BehaviorSubject, Observable, Subscription, merge} from 'rxjs'; -import {map, shareReplay} from 'rxjs/operators'; - -import {LocationOfInterest} from 'app/models/loi.model'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {getLoiIcon} from 'app/utils/utils'; +import { FlatTreeControl } from '@angular/cdk/tree'; +import { List } from 'immutable'; +import { BehaviorSubject, Observable, Subscription, merge } from 'rxjs'; +import { map, shareReplay } from 'rxjs/operators'; + +import { LocationOfInterest } from 'app/models/loi.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { getLoiIcon } from 'app/utils/utils'; /** Flat node with with information on name, level, and if it is expandable. * Loi specific nodes have additional fields for loi info and number of diff --git a/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts b/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts index e20963cb4..78586195d 100644 --- a/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.component.spec.ts @@ -14,23 +14,23 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {GoogleMapsModule} from '@angular/google-maps'; -import {MatDialog} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {List, Map} from 'immutable'; - -import {ImportDialogComponent} from 'app/components/shared/import-dialog/import-dialog.component'; -import {Coordinate} from 'app/models/geometry/coordinate'; -import {Point} from 'app/models/geometry/point'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; - -import {LoiEditorComponent} from './loi-editor.component'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { GoogleMapsModule } from '@angular/google-maps'; +import { MatDialog } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { List, Map } from 'immutable'; + +import { ImportDialogComponent } from 'app/components/shared/import-dialog/import-dialog.component'; +import { Coordinate } from 'app/models/geometry/coordinate'; +import { Point } from 'app/models/geometry/point'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; + +import { LoiEditorComponent } from './loi-editor.component'; describe('LoiEditorComponent', () => { let component: LoiEditorComponent; @@ -71,7 +71,7 @@ describe('LoiEditorComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(() => { @@ -125,7 +125,7 @@ describe('LoiEditorComponent', () => { importButton.click(); expect(matDialogSpy.open).toHaveBeenCalledWith(ImportDialogComponent, { - data: {surveyId: survey.id, jobId: jobId2}, + data: { surveyId: survey.id, jobId: jobId2 }, width: '350px', maxHeight: '800px', }); diff --git a/web/src/app/components/shared/loi-editor/loi-editor.component.ts b/web/src/app/components/shared/loi-editor/loi-editor.component.ts index 2cd7fdfc0..1fede6fb4 100644 --- a/web/src/app/components/shared/loi-editor/loi-editor.component.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.component.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {Component, EventEmitter, Input, Output} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {MatSlideToggleChange} from '@angular/material/slide-toggle'; -import {List} from 'immutable'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { List } from 'immutable'; import { DialogData, DialogType, JobDialogComponent, } from 'app/components/edit-survey/job-dialog/job-dialog.component'; -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Survey} from 'app/models/survey.model'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Survey } from 'app/models/survey.model'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; -import {ImportDialogComponent} from '../import-dialog/import-dialog.component'; +import { ImportDialogComponent } from '../import-dialog/import-dialog.component'; @Component({ selector: 'loi-editor', @@ -54,7 +54,7 @@ export class LoiEditorComponent { importLois() { this.dialog.open(ImportDialogComponent, { - data: {surveyId: this.survey.id, jobId: this.job.id}, + data: { surveyId: this.survey.id, jobId: this.job.id }, width: '350px', maxHeight: '800px', }); diff --git a/web/src/app/components/shared/loi-editor/loi-editor.module.ts b/web/src/app/components/shared/loi-editor/loi-editor.module.ts index 1ae0f4033..7c16ca312 100644 --- a/web/src/app/components/shared/loi-editor/loi-editor.module.ts +++ b/web/src/app/components/shared/loi-editor/loi-editor.module.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import {LoiEditorComponent} from './loi-editor.component'; -import {LoiSelectionModule} from '../loi-selection/loi-selection.module'; +import { LoiEditorComponent } from './loi-editor.component'; +import { LoiSelectionModule } from '../loi-selection/loi-selection.module'; @NgModule({ declarations: [LoiEditorComponent], diff --git a/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts index 914c86d90..5c9a4faee 100644 --- a/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts +++ b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.component.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import {Component, Inject} from '@angular/core'; -import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; +import { Component, Inject } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'ground-loi-properties-dialog', @@ -26,7 +26,7 @@ export class LoiPropertiesDialogComponent { iconColor: string; iconName: string; loiDisplayName: string; - properties: {[key: string]: string | number}; + properties: { [key: string]: string | number }; constructor( private dialogRef: MatDialogRef, diff --git a/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts index 084e398f7..e6192f2b8 100644 --- a/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts +++ b/web/src/app/components/shared/loi-properties-dialog/loi-properties-dialog.module.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatSelectModule} from '@angular/material/select'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; -import {LoiPropertiesDialogComponent} from './loi-properties-dialog.component'; +import { LoiPropertiesDialogComponent } from './loi-properties-dialog.component'; @NgModule({ declarations: [LoiPropertiesDialogComponent], diff --git a/web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts b/web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts index 00b4679ea..51df57ff9 100644 --- a/web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts +++ b/web/src/app/components/shared/loi-selection/loi-selection.component.spec.ts @@ -14,23 +14,23 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {GoogleMapsModule} from '@angular/google-maps'; -import {MatDialog} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatListModule} from '@angular/material/list'; -import {List, Map} from 'immutable'; - -import {Coordinate} from 'app/models/geometry/coordinate'; -import {Point} from 'app/models/geometry/point'; -import {Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {GroundIconModule} from 'app/modules/ground-icon.module'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; - -import {LoiSelectionComponent} from './loi-selection.component'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { GoogleMapsModule } from '@angular/google-maps'; +import { MatDialog } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { List, Map } from 'immutable'; + +import { Coordinate } from 'app/models/geometry/coordinate'; +import { Point } from 'app/models/geometry/point'; +import { Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { GroundIconModule } from 'app/modules/ground-icon.module'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; + +import { LoiSelectionComponent } from './loi-selection.component'; describe('LoiSelectionComponent', () => { let component: LoiSelectionComponent; @@ -67,7 +67,7 @@ describe('LoiSelectionComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); beforeEach(() => { @@ -138,7 +138,7 @@ describe('LoiSelectionComponent', () => { it('shows updated list of LOIs', () => { fixture.componentInstance.lois = List([ - {...poi1, properties: Map({name: 'Test 1'})}, + { ...poi1, properties: Map({ name: 'Test 1' }) }, poi2, ]); fixture.detectChanges(); diff --git a/web/src/app/components/shared/loi-selection/loi-selection.component.ts b/web/src/app/components/shared/loi-selection/loi-selection.component.ts index 5c071938d..02ce7adb7 100644 --- a/web/src/app/components/shared/loi-selection/loi-selection.component.ts +++ b/web/src/app/components/shared/loi-selection/loi-selection.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {Component, EventEmitter, Input, Output} from '@angular/core'; -import {List} from 'immutable'; - -import {DataCollectionStrategy, Job} from 'app/models/job.model'; -import {LocationOfInterest} from 'app/models/loi.model'; -import {Survey} from 'app/models/survey.model'; -import {LocationOfInterestService} from 'app/services/loi/loi.service'; -import {getLoiIcon} from 'app/utils/utils'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { List } from 'immutable'; + +import { DataCollectionStrategy, Job } from 'app/models/job.model'; +import { LocationOfInterest } from 'app/models/loi.model'; +import { Survey } from 'app/models/survey.model'; +import { LocationOfInterestService } from 'app/services/loi/loi.service'; +import { getLoiIcon } from 'app/utils/utils'; @Component({ selector: 'loi-selection', diff --git a/web/src/app/components/shared/loi-selection/loi-selection.module.ts b/web/src/app/components/shared/loi-selection/loi-selection.module.ts index 68cd47450..6ab6f7e9c 100644 --- a/web/src/app/components/shared/loi-selection/loi-selection.module.ts +++ b/web/src/app/components/shared/loi-selection/loi-selection.module.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatListModule} from '@angular/material/list'; -import {BrowserModule} from '@angular/platform-browser'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatListModule } from '@angular/material/list'; +import { BrowserModule } from '@angular/platform-browser'; -import {MapModule} from 'app/components/main-page-container/main-page/map/map.module'; -import {GroundIconModule} from 'app/modules/ground-icon.module'; +import { MapModule } from 'app/components/main-page-container/main-page/map/map.module'; +import { GroundIconModule } from 'app/modules/ground-icon.module'; -import {LoiSelectionComponent} from './loi-selection.component'; +import { LoiSelectionComponent } from './loi-selection.component'; @NgModule({ declarations: [LoiSelectionComponent], diff --git a/web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts b/web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts index ba1407622..f56ac82fa 100644 --- a/web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts +++ b/web/src/app/components/shared/share-dialog/share-dialog.component.spec.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule, MatDialogRef} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatSelectModule} from '@angular/material/select'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {Map} from 'immutable'; -import {of} from 'rxjs'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { Map } from 'immutable'; +import { of } from 'rxjs'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; -import {ShareDialogComponent} from './share-dialog.component'; +import { ShareDialogComponent } from './share-dialog.component'; describe('ShareDialogComponent', () => { let component: ShareDialogComponent; @@ -49,11 +49,11 @@ describe('ShareDialogComponent', () => { ReactiveFormsModule, ], providers: [ - {provide: MatDialogRef, useValue: {}}, + { provide: MatDialogRef, useValue: {} }, { provide: DraftSurveyService, useValue: { - getSurvey$: () => of({acl: Map()}), + getSurvey$: () => of({ acl: Map() }), updateAcl: () => null, }, }, diff --git a/web/src/app/components/shared/share-dialog/share-dialog.component.ts b/web/src/app/components/shared/share-dialog/share-dialog.component.ts index 312531710..c52000134 100644 --- a/web/src/app/components/shared/share-dialog/share-dialog.component.ts +++ b/web/src/app/components/shared/share-dialog/share-dialog.component.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Component} from '@angular/core'; +import { Component } from '@angular/core'; import { AbstractControl, FormControl, @@ -22,16 +22,16 @@ import { ValidatorFn, Validators, } from '@angular/forms'; -import {MatDialogRef} from '@angular/material/dialog'; -import {MatSelectChange} from '@angular/material/select'; -import {Map} from 'immutable'; -import {Subscription} from 'rxjs'; +import { MatDialogRef } from '@angular/material/dialog'; +import { MatSelectChange } from '@angular/material/select'; +import { Map } from 'immutable'; +import { Subscription } from 'rxjs'; -import {AclEntry} from 'app/models/acl-entry.model'; -import {Role} from 'app/models/role.model'; -import {Survey} from 'app/models/survey.model'; -import {ROLE_OPTIONS} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; +import { AclEntry } from 'app/models/acl-entry.model'; +import { Role } from 'app/models/role.model'; +import { Survey } from 'app/models/survey.model'; +import { ROLE_OPTIONS } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; @Component({ selector: 'ground-share-dialog', @@ -85,7 +85,7 @@ export class ShareDialogComponent { if (!this.survey || !this.acl) { return; } - const {email, role} = this.addUserForm.value; + const { email, role } = this.addUserForm.value; // Add new email/role and update change state. Validation rules prevent // the same email from being added twice. @@ -93,7 +93,7 @@ export class ShareDialogComponent { this.updateChangeState(); // Clear "Add data collector" field. - this.addUserForm.setValue({email: '', role: Role.DATA_COLLECTOR}); + this.addUserForm.setValue({ email: '', role: Role.DATA_COLLECTOR }); this.onSaveClicked(); } @@ -163,11 +163,11 @@ export class ShareDialogComponent { private notInListValidator(): ValidatorFn { // eslint-disable-next-line @typescript-eslint/no-explicit-any - return (control: AbstractControl): {[key: string]: any} | null => { + return (control: AbstractControl): { [key: string]: any } | null => { const emailsInAcl = this.acl?.map(entry => entry.email) || []; const newEmail = control.value; return emailsInAcl.includes(newEmail) - ? {forbiddenName: {value: control.value}} + ? { forbiddenName: { value: control.value } } : null; }; } diff --git a/web/src/app/components/shared/share-dialog/share-dialog.module.ts b/web/src/app/components/shared/share-dialog/share-dialog.module.ts index 6f015bd83..49597f86f 100644 --- a/web/src/app/components/shared/share-dialog/share-dialog.module.ts +++ b/web/src/app/components/shared/share-dialog/share-dialog.module.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatSelectModule} from '@angular/material/select'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; -import {ShareDialogComponent} from './share-dialog.component'; +import { ShareDialogComponent } from './share-dialog.component'; @NgModule({ declarations: [ShareDialogComponent], diff --git a/web/src/app/components/shared/share-list/share-list.component.spec.ts b/web/src/app/components/shared/share-list/share-list.component.spec.ts index 7fcd021f8..a7158a3aa 100644 --- a/web/src/app/components/shared/share-list/share-list.component.spec.ts +++ b/web/src/app/components/shared/share-list/share-list.component.spec.ts @@ -14,22 +14,22 @@ * limitations under the License. */ -import {HarnessLoader} from '@angular/cdk/testing'; -import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; -import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; -import {MatListModule} from '@angular/material/list'; -import {MatListHarness} from '@angular/material/list/testing'; -import {MatSelectModule} from '@angular/material/select'; -import {Map} from 'immutable'; -import {Subject, firstValueFrom, of} from 'rxjs'; - -import {Role} from 'app/models/role.model'; -import {DataSharingType, Survey} from 'app/models/survey.model'; -import {User} from 'app/models/user.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; - -import {ShareListComponent} from './share-list.component'; +import { HarnessLoader } from '@angular/cdk/testing'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatListModule } from '@angular/material/list'; +import { MatListHarness } from '@angular/material/list/testing'; +import { MatSelectModule } from '@angular/material/select'; +import { Map } from 'immutable'; +import { Subject, firstValueFrom, of } from 'rxjs'; + +import { Role } from 'app/models/role.model'; +import { DataSharingType, Survey } from 'app/models/survey.model'; +import { User } from 'app/models/user.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; + +import { ShareListComponent } from './share-list.component'; describe('ShareListComponent', () => { let component: ShareListComponent; @@ -53,7 +53,7 @@ describe('ShareListComponent', () => { /* jobs= */ Map(), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); const user = new User('user1', 'user1@gmail.com', true); @@ -77,8 +77,8 @@ describe('ShareListComponent', () => { declarations: [ShareListComponent], imports: [MatListModule, MatSelectModule], providers: [ - {provide: DraftSurveyService, useValue: draftSurveyServiceSpy}, - {provide: AuthService, useValue: authServiceSpy}, + { provide: DraftSurveyService, useValue: draftSurveyServiceSpy }, + { provide: AuthService, useValue: authServiceSpy }, ], }).compileComponents(); })); @@ -107,9 +107,9 @@ describe('ShareListComponent', () => { surveyTitle, surveyDescription, /* jobs= */ Map(), - /* acl= */ Map({a: Role.OWNER, b: Role.OWNER}), + /* acl= */ Map({ a: Role.OWNER, b: Role.OWNER }), /* ownerId= */ 'user1', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ) ); fixture.detectChanges(); diff --git a/web/src/app/components/shared/share-list/share-list.component.ts b/web/src/app/components/shared/share-list/share-list.component.ts index c9b3f1406..41e6e140d 100644 --- a/web/src/app/components/shared/share-list/share-list.component.ts +++ b/web/src/app/components/shared/share-list/share-list.component.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {Component} from '@angular/core'; -import {MatSelectChange} from '@angular/material/select'; -import {Map} from 'immutable'; -import {Subscription} from 'rxjs'; +import { Component } from '@angular/core'; +import { MatSelectChange } from '@angular/material/select'; +import { Map } from 'immutable'; +import { Subscription } from 'rxjs'; -import {AclEntry} from 'app/models/acl-entry.model'; -import {Role} from 'app/models/role.model'; -import {Survey} from 'app/models/survey.model'; -import {AuthService, ROLE_OPTIONS} from 'app/services/auth/auth.service'; -import {DraftSurveyService} from 'app/services/draft-survey/draft-survey.service'; +import { AclEntry } from 'app/models/acl-entry.model'; +import { Role } from 'app/models/role.model'; +import { Survey } from 'app/models/survey.model'; +import { AuthService, ROLE_OPTIONS } from 'app/services/auth/auth.service'; +import { DraftSurveyService } from 'app/services/draft-survey/draft-survey.service'; @Component({ selector: 'ground-share-list', diff --git a/web/src/app/components/shared/share-list/share-list.module.ts b/web/src/app/components/shared/share-list/share-list.module.ts index 29e3c2e03..44aa77605 100644 --- a/web/src/app/components/shared/share-list/share-list.module.ts +++ b/web/src/app/components/shared/share-list/share-list.module.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatSelectModule} from '@angular/material/select'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; -import {ShareListComponent} from './share-list.component'; +import { ShareListComponent } from './share-list.component'; @NgModule({ declarations: [ShareListComponent], diff --git a/web/src/app/components/shared/share-survey/share-survey.component.spec.ts b/web/src/app/components/shared/share-survey/share-survey.component.spec.ts index e45cefcda..17bc61152 100644 --- a/web/src/app/components/shared/share-survey/share-survey.component.spec.ts +++ b/web/src/app/components/shared/share-survey/share-survey.component.spec.ts @@ -1,10 +1,10 @@ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatCardModule} from '@angular/material/card'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; -import {ShareSurveyComponent} from './share-survey.component'; +import { ShareSurveyComponent } from './share-survey.component'; describe('ShareSurveyComponent', () => { let component: ShareSurveyComponent; diff --git a/web/src/app/components/shared/share-survey/share-survey.component.ts b/web/src/app/components/shared/share-survey/share-survey.component.ts index b2d694b9f..8586a0529 100644 --- a/web/src/app/components/shared/share-survey/share-survey.component.ts +++ b/web/src/app/components/shared/share-survey/share-survey.component.ts @@ -1,7 +1,7 @@ -import {Component} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; +import { Component } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; -import {ShareDialogComponent} from 'app/components/shared/share-dialog/share-dialog.component'; +import { ShareDialogComponent } from 'app/components/shared/share-dialog/share-dialog.component'; @Component({ selector: 'share-survey', diff --git a/web/src/app/components/shared/share-survey/share-survey.module.ts b/web/src/app/components/shared/share-survey/share-survey.module.ts index dd8cc28d9..143b20847 100644 --- a/web/src/app/components/shared/share-survey/share-survey.module.ts +++ b/web/src/app/components/shared/share-survey/share-survey.module.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; -import {ShareDialogModule} from 'app/components/shared/share-dialog/share-dialog.module'; -import {ShareListModule} from 'app/components/shared/share-list/share-list.module'; +import { ShareDialogModule } from 'app/components/shared/share-dialog/share-dialog.module'; +import { ShareListModule } from 'app/components/shared/share-list/share-list.module'; -import {ShareSurveyComponent} from './share-survey.component'; -import {DataVisibilityControlModule} from '../data-visibility-control/data-visibility-control.module'; -import {GeneralAccessControlModule} from '../general-access-control/general-access-control.module'; +import { ShareSurveyComponent } from './share-survey.component'; +import { DataVisibilityControlModule } from '../data-visibility-control/data-visibility-control.module'; +import { GeneralAccessControlModule } from '../general-access-control/general-access-control.module'; @NgModule({ declarations: [ShareSurveyComponent], diff --git a/web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts index 521fc5220..66b6f8c6d 100644 --- a/web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts +++ b/web/src/app/components/shared/sign-in-page/sign-in-page.component.spec.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {NO_ERRORS_SCHEMA} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {NavigationEnd, Router} from '@angular/router'; -import {BehaviorSubject, NEVER, of} from 'rxjs'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { NavigationEnd, Router } from '@angular/router'; +import { BehaviorSubject, NEVER, of } from 'rxjs'; -import {AuthService} from 'app/services/auth/auth.service'; -import {DataStoreService} from 'app/services/data-store/data-store.service'; +import { AuthService } from 'app/services/auth/auth.service'; +import { DataStoreService } from 'app/services/data-store/data-store.service'; -import {SignInPageComponent} from './sign-in-page.component'; +import { SignInPageComponent } from './sign-in-page.component'; describe('SignInPageComponent', () => { let component: SignInPageComponent; @@ -34,12 +34,12 @@ describe('SignInPageComponent', () => { providers: [ { provide: DataStoreService, - useValue: {getAccessDeniedMessage: () => ''}, + useValue: { getAccessDeniedMessage: () => '' }, }, - {provide: Router, useValue: {events: of()}}, + { provide: Router, useValue: { events: of() } }, { provide: AuthService, - useValue: {getUser$: () => NEVER, isAuthenticated$: () => NEVER}, + useValue: { getUser$: () => NEVER, isAuthenticated$: () => NEVER }, }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/web/src/app/components/shared/sign-in-page/sign-in-page.component.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.component.ts index 2d2f62c03..83deab76e 100644 --- a/web/src/app/components/shared/sign-in-page/sign-in-page.component.ts +++ b/web/src/app/components/shared/sign-in-page/sign-in-page.component.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {FirebaseUISignInFailure} from 'firebaseui-angular'; -import {Observable, Subscription, filter} from 'rxjs'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { FirebaseUISignInFailure } from 'firebaseui-angular'; +import { Observable, Subscription, filter } from 'rxjs'; -import {AuthService} from 'app/services/auth/auth.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {environment} from 'environments/environment'; +import { AuthService } from 'app/services/auth/auth.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { environment } from 'environments/environment'; @Component({ templateUrl: './sign-in-page.component.html', diff --git a/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts b/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts index 8be3705cf..a30a8230b 100644 --- a/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts +++ b/web/src/app/components/shared/sign-in-page/sign-in-page.module.ts @@ -14,17 +14,17 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatIconModule} from '@angular/material/icon'; -import {BrowserModule} from '@angular/platform-browser'; -import {FirebaseUIModule} from 'firebaseui-angular'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { BrowserModule } from '@angular/platform-browser'; +import { FirebaseUIModule } from 'firebaseui-angular'; -import {HeaderModule} from 'app/components/shared/header/header.module'; +import { HeaderModule } from 'app/components/shared/header/header.module'; -import {SignInPageComponent} from './sign-in-page.component'; +import { SignInPageComponent } from './sign-in-page.component'; @NgModule({ declarations: [SignInPageComponent], diff --git a/web/src/app/components/shared/survey-list/survey-list.component.spec.ts b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts index 4e418188d..ac990319b 100644 --- a/web/src/app/components/shared/survey-list/survey-list.component.spec.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Component} from '@angular/core'; +import { Component } from '@angular/core'; import { ComponentFixture, TestBed, @@ -22,40 +22,40 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {AngularFireAuth} from '@angular/fire/compat/auth'; -import {AngularFirestore} from '@angular/fire/compat/firestore'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDialog, MatDialogRef} from '@angular/material/dialog'; -import {MatGridListModule} from '@angular/material/grid-list'; -import {MatIconModule} from '@angular/material/icon'; -import {By} from '@angular/platform-browser'; -import {List, Map} from 'immutable'; -import {of} from 'rxjs'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { AngularFirestore } from '@angular/fire/compat/firestore'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; +import { By } from '@angular/platform-browser'; +import { List, Map } from 'immutable'; +import { of } from 'rxjs'; import { DialogData, DialogType, JobDialogComponent, } from 'app/components/edit-survey/job-dialog/job-dialog.component'; -import {AclEntry} from 'app/models/acl-entry.model'; -import {Job} from 'app/models/job.model'; -import {Role} from 'app/models/role.model'; +import { AclEntry } from 'app/models/acl-entry.model'; +import { Job } from 'app/models/job.model'; +import { Role } from 'app/models/role.model'; import { DataSharingType, Survey, SurveyGeneralAccess, SurveyState, } from 'app/models/survey.model'; -import {Task, TaskType} from 'app/models/task/task.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { Task, TaskType } from 'app/models/task/task.model'; +import { AuthService } from 'app/services/auth/auth.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; -import {SurveyListComponent} from './survey-list.component'; +import { SurveyListComponent } from './survey-list.component'; -@Component({selector: 'ground-header', template: ''}) +@Component({ selector: 'ground-header', template: '' }) class HeaderComponent {} describe('SurveyListComponent', () => { @@ -84,7 +84,7 @@ describe('SurveyListComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE} + { type: DataSharingType.PRIVATE } ); // A survey that has gone through creation flow @@ -111,7 +111,7 @@ describe('SurveyListComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE}, + { type: DataSharingType.PRIVATE }, SurveyState.READY ); @@ -139,7 +139,7 @@ describe('SurveyListComponent', () => { }), /* acl= */ Map(), /* ownerId= */ '', - {type: DataSharingType.PRIVATE}, + { type: DataSharingType.PRIVATE }, SurveyState.READY, SurveyGeneralAccess.PUBLIC ); @@ -181,12 +181,12 @@ describe('SurveyListComponent', () => { ], declarations: [SurveyListComponent, HeaderComponent], providers: [ - {provide: MatDialog, useValue: dialogSpy}, - {provide: SurveyService, useValue: surveyServiceSpy}, - {provide: NavigationService, useValue: navigationServiceSpy}, - {provide: AngularFirestore, useValue: {}}, - {provide: AngularFireAuth, useValue: {}}, - {provide: AuthService, useValue: authServiceSpy}, + { provide: MatDialog, useValue: dialogSpy }, + { provide: SurveyService, useValue: surveyServiceSpy }, + { provide: NavigationService, useValue: navigationServiceSpy }, + { provide: AngularFirestore, useValue: {} }, + { provide: AngularFireAuth, useValue: {} }, + { provide: AuthService, useValue: authServiceSpy }, ], }).compileComponents(); })); @@ -201,7 +201,7 @@ describe('SurveyListComponent', () => { authServiceSpy.canManageSurvey.and.returnValue(true); authServiceSpy.isPasslisted.and.returnValue(Promise.resolve(true)); dialogRefSpy.afterClosed.and.returnValue( - of({dialogType: DialogType.SurveyCreationDenied} as DialogData) + of({ dialogType: DialogType.SurveyCreationDenied } as DialogData) ); fixture = TestBed.createComponent(SurveyListComponent); component = fixture.componentInstance; diff --git a/web/src/app/components/shared/survey-list/survey-list.component.ts b/web/src/app/components/shared/survey-list/survey-list.component.ts index 82f1d621a..ad96c1bb7 100644 --- a/web/src/app/components/shared/survey-list/survey-list.component.ts +++ b/web/src/app/components/shared/survey-list/survey-list.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {List, Map} from 'immutable'; -import {Subscription} from 'rxjs'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { List, Map } from 'immutable'; +import { Subscription } from 'rxjs'; import { DialogData, @@ -29,9 +29,9 @@ import { SurveyGeneralAccess, SurveyState, } from 'app/models/survey.model'; -import {AuthService} from 'app/services/auth/auth.service'; -import {NavigationService} from 'app/services/navigation/navigation.service'; -import {SurveyService} from 'app/services/survey/survey.service'; +import { AuthService } from 'app/services/auth/auth.service'; +import { NavigationService } from 'app/services/navigation/navigation.service'; +import { SurveyService } from 'app/services/survey/survey.service'; export enum SurveyListFilter { ALL, @@ -125,7 +125,7 @@ export class SurveyListComponent implements OnInit, OnDestroy { if (!isPasslisted) { this.dialog .open(JobDialogComponent, { - data: {dialogType: DialogType.SurveyCreationDenied}, + data: { dialogType: DialogType.SurveyCreationDenied }, panelClass: 'small-width-dialog', }) .afterClosed() diff --git a/web/src/app/components/shared/survey-list/survey-list.module.ts b/web/src/app/components/shared/survey-list/survey-list.module.ts index ffe6f968d..2db1af290 100644 --- a/web/src/app/components/shared/survey-list/survey-list.module.ts +++ b/web/src/app/components/shared/survey-list/survey-list.module.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatGridListModule} from '@angular/material/grid-list'; -import {MatIconModule} from '@angular/material/icon'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; -import {HeaderModule} from 'app/components/shared/header/header.module'; +import { HeaderModule } from 'app/components/shared/header/header.module'; -import {SurveyListComponent} from './survey-list.component'; +import { SurveyListComponent } from './survey-list.component'; @NgModule({ declarations: [SurveyListComponent], diff --git a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts index 8a4869160..3069ba0f5 100644 --- a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts +++ b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.spec.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatIconModule} from '@angular/material/icon'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatIconModule } from '@angular/material/icon'; -import {AddTaskButtonComponent} from './add-task-button.component'; +import { AddTaskButtonComponent } from './add-task-button.component'; describe('TaskButtonComponent', () => { let component: AddTaskButtonComponent; diff --git a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts index 4a9a9bb39..b2717a8e5 100644 --- a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts +++ b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.component.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {Component, Input} from '@angular/core'; +import { Component, Input } from '@angular/core'; -import {Tasks} from '../task-form/task-form.component'; -import {TaskGroup} from '../tasks-editor.component'; +import { Tasks } from '../task-form/task-form.component'; +import { TaskGroup } from '../tasks-editor.component'; @Component({ selector: 'add-task-button', @@ -31,7 +31,7 @@ export class AddTaskButtonComponent { icon = 'question_mark'; ngOnInit(): void { - const {icon, label} = Tasks[this.taskGroup ?? TaskGroup.QUESTION]; + const { icon, label } = Tasks[this.taskGroup ?? TaskGroup.QUESTION]; this.text = label; diff --git a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts index e1dbefa32..56757c1b6 100644 --- a/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts +++ b/web/src/app/components/shared/tasks-editor/add-task-button/add-task-button.module.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import {NgModule} from '@angular/core'; -import {MatIconModule} from '@angular/material/icon'; +import { NgModule } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; -import {AddTaskButtonComponent} from './add-task-button.component'; +import { AddTaskButtonComponent } from './add-task-button.component'; @NgModule({ declarations: [AddTaskButtonComponent], diff --git a/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts index b204ea526..0dfa0e08a 100644 --- a/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts +++ b/web/src/app/components/shared/tasks-editor/task-condition-form/task-condition-form.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import {Component, Input, Pipe, PipeTransform} from '@angular/core'; -import {AbstractControl, FormArray, FormGroup} from '@angular/forms'; -import {List} from 'immutable'; +import { Component, Input, Pipe, PipeTransform } from '@angular/core'; +import { AbstractControl, FormArray, FormGroup } from '@angular/forms'; +import { List } from 'immutable'; -import {Option} from 'app/models/task/option.model'; -import {Task} from 'app/models/task/task.model'; +import { Option } from 'app/models/task/option.model'; +import { Task } from 'app/models/task/task.model'; -@Pipe({name: 'getTaskOptions', pure: false}) +@Pipe({ name: 'getTaskOptions', pure: false }) export class TaskOptionsPipe implements PipeTransform { transform(tasks: List, filter: string): List