From f8166f087b11d86d934564159b566ea6e1a1062b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 2 Oct 2023 11:20:15 -0400 Subject: [PATCH 1/3] chore(git): adding eol = lf to git attributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..4eb2283c1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +text eol=lf \ No newline at end of file From 889248837ae1782f798ce58fa28dbf172e1bc730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 2 Oct 2023 11:20:53 -0400 Subject: [PATCH 2/3] chore(*): adding a plugin to prettier to sort imports --- .prettierrc | 7 +++- package-lock.json | 87 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/.prettierrc b/.prettierrc index b10dedda7..a280fba60 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,10 @@ { "singleQuote": true, "trailingComma": "none", - "endOfLine": "lf" + "endOfLine": "lf", + "importOrder": ["^@angular/(.*)$", "^@igo2/(.*)$", "^ol/(.*)$", "", "^[./]"], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true, + "importOrderParserPlugins": ["typescript", "decorators-legacy"], + "plugins": ["@trivago/prettier-plugin-sort-imports"] } diff --git a/package-lock.json b/package-lock.json index 7ed0810d9..246f9bc93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "@angular/cli": "^16.2.2", "@angular/compiler-cli": "^16.2.5", "@cypress/schematic": "^2.5.1", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/geojson": "^7946.0.10", "@types/hammerjs": "^2.0.41", "@types/jasmine": "^4.3.5", @@ -5018,6 +5019,86 @@ "node": ">= 6" } }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.0.tgz", + "integrity": "sha512-YBepjbt+ZNBVmN3ev1amQH3lWCmHyt5qTbLCp/syXJRu/Kw2koXh44qayB1gMRxcL/gV8egmjN5xWSrYyfUtyw==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.17.3", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/traverse": { + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", + "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -12357,6 +12438,12 @@ "colors": "1.4.0" } }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", diff --git a/package.json b/package.json index af004d6d6..4fc994bf0 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "@angular/cli": "^16.2.2", "@angular/compiler-cli": "^16.2.5", "@cypress/schematic": "^2.5.1", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/geojson": "^7946.0.10", "@types/hammerjs": "^2.0.41", "@types/jasmine": "^4.3.5", From dfed3f212938e0bc605231af614e20c5924bc6d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 2 Oct 2023 11:22:01 -0400 Subject: [PATCH 3/3] chore(*): format all files to sort imports --- src/app/app.component.ts | 15 ++- src/app/app.module.ts | 57 ++++---- src/app/pages/footer/footer.component.ts | 1 + src/app/pages/footer/footer.module.ts | 6 +- src/app/pages/header/header.component.ts | 1 + src/app/pages/header/header.module.ts | 8 +- .../expansion-panel-header.component.ts | 6 +- .../expansion-panel.animations.ts | 6 +- .../expansion-panel.component.ts | 6 +- .../expansion-panel/expansion-panel.module.ts | 9 +- .../map-overlay/map-overlay.component.ts | 9 +- .../portal/map-overlay/map-overlay.module.ts | 2 +- src/app/pages/portal/portal.animation.ts | 10 +- src/app/pages/portal/portal.component.ts | 125 +++++++++--------- src/app/pages/portal/portal.module.ts | 39 +++--- .../pages/portal/sidenav/sidenav.component.ts | 16 +-- .../pages/portal/sidenav/sidenav.module.ts | 12 +- .../toast-panel-for-expansion.animations.ts | 6 +- .../toast-panel-for-expansion.component.ts | 7 +- .../toast-panel-for-expansion.module.ts | 2 +- .../toast-panel/toast-panel.animations.ts | 6 +- .../toast-panel/toast-panel.component.ts | 70 +++++----- .../portal/toast-panel/toast-panel.module.ts | 8 +- .../welcome-window.component.ts | 5 +- .../welcome-window/welcome-window.module.ts | 10 +- .../welcome-window.service.spec.ts | 2 +- .../welcome-window/welcome-window.service.ts | 2 +- src/app/services/pwa.service.ts | 6 +- src/environments/environment.github.ts | 7 +- src/environments/environment.prod.ts | 6 +- src/environments/environment.ts | 8 +- src/main.ts | 4 +- src/polyfills.ts | 13 +- src/test.ts | 4 +- 34 files changed, 255 insertions(+), 239 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b308a6366..ffd8bcf5e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,14 +1,17 @@ -import { Component, Inject, OnInit } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -import { Title, Meta } from '@angular/platform-browser'; -import { DomUtils, userAgent } from '@igo2/utils'; -import { LanguageService, ConfigService, MessageService } from '@igo2/core'; +import { Component, Inject, OnInit } from '@angular/core'; +import { Meta, Title } from '@angular/platform-browser'; +import { NavigationEnd, Router } from '@angular/router'; + import { AuthOptions } from '@igo2/auth'; +import { ConfigService, LanguageService, MessageService } from '@igo2/core'; import { AnalyticsListenerService } from '@igo2/integration'; -import { PwaService } from './services/pwa.service'; -import { NavigationEnd, Router } from '@angular/router'; +import { DomUtils, userAgent } from '@igo2/utils'; + import { delay, first } from 'rxjs'; +import { PwaService } from './services/pwa.service'; + @Component({ selector: 'app-root', templateUrl: './app.component.html', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac8eb2001..8d9aafe93 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,51 +1,52 @@ -import { BrowserModule } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { APP_INITIALIZER, ApplicationRef, Injector, NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; +import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; +import { + MAT_TOOLTIP_DEFAULT_OPTIONS, + MatTooltipDefaultOptions +} from '@angular/material/tooltip'; +import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { RouterModule } from '@angular/router'; +import { ServiceWorkerModule } from '@angular/service-worker'; + +import { IgoAuthModule } from '@igo2/auth'; +import { IgoSpinnerModule, IgoStopPropagationModule } from '@igo2/common'; import { - provideConfigOptions, - IgoMessageModule, + ConfigService, IgoGestureModule, - RouteService, + IgoMessageModule, LanguageService, - ConfigService + RouteService, + provideConfigOptions } from '@igo2/core'; -import { IgoSpinnerModule, IgoStopPropagationModule } from '@igo2/common'; -import { IgoAuthModule } from '@igo2/auth'; import { - provideWorkspaceSearchSource, - provideIChercheSearchSource, - provideIChercheReverseSearchSource, - provideNominatimSearchSource, + provideCadastreSearchSource, provideCoordinatesReverseSearchSource, + provideIChercheReverseSearchSource, + provideIChercheSearchSource, provideILayerSearchSource, - provideStoredQueriesSearchSource, - provideOsrmDirectionsSource, + provideNominatimSearchSource, provideOptionsApi, - provideCadastreSearchSource, - provideStyleListOptions + provideOsrmDirectionsSource, + provideStoredQueriesSearchSource, + provideStyleListOptions, + provideWorkspaceSearchSource } from '@igo2/geo'; +import { loadTheme } from '@igo2/utils'; + +import { concatMap, first } from 'rxjs'; import { environment } from '../environments/environment'; -import { PortalModule } from './pages'; import { AppComponent } from './app.component'; -import { HeaderModule } from './pages/header/header.module'; +import { PortalModule } from './pages'; import { FooterModule } from './pages/footer/footer.module'; -import { ServiceWorkerModule } from '@angular/service-worker'; - -import { - MAT_TOOLTIP_DEFAULT_OPTIONS, - MatTooltipDefaultOptions -} from '@angular/material/tooltip'; -import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; -import { concatMap, first } from 'rxjs'; -import { loadTheme } from '@igo2/utils'; -import { DOCUMENT } from '@angular/common'; +import { HeaderModule } from './pages/header/header.module'; const DEFAULT_THEME: string = 'blue-theme'; diff --git a/src/app/pages/footer/footer.component.ts b/src/app/pages/footer/footer.component.ts index fe4df3e93..8f1d73064 100644 --- a/src/app/pages/footer/footer.component.ts +++ b/src/app/pages/footer/footer.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; + import { LanguageService } from '@igo2/core'; @Component({ diff --git a/src/app/pages/footer/footer.module.ts b/src/app/pages/footer/footer.module.ts index 41d91734a..7f1f6991a 100644 --- a/src/app/pages/footer/footer.module.ts +++ b/src/app/pages/footer/footer.module.ts @@ -1,8 +1,10 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { FooterComponent } from './footer.component'; +import { NgModule } from '@angular/core'; + import { IgoLanguageModule } from '@igo2/core'; +import { FooterComponent } from './footer.component'; + @NgModule({ declarations: [FooterComponent], imports: [CommonModule, IgoLanguageModule], diff --git a/src/app/pages/header/header.component.ts b/src/app/pages/header/header.component.ts index 87c948149..c525410bb 100644 --- a/src/app/pages/header/header.component.ts +++ b/src/app/pages/header/header.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; + import { ConfigService, LanguageService } from '@igo2/core'; @Component({ diff --git a/src/app/pages/header/header.module.ts b/src/app/pages/header/header.module.ts index 6be225a88..cd82c724d 100644 --- a/src/app/pages/header/header.module.ts +++ b/src/app/pages/header/header.module.ts @@ -1,9 +1,11 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { HeaderComponent } from './header.component'; -import { IgoLanguageModule } from '@igo2/core'; +import { NgModule } from '@angular/core'; import { MatToolbarModule } from '@angular/material/toolbar'; +import { IgoLanguageModule } from '@igo2/core'; + +import { HeaderComponent } from './header.component'; + @NgModule({ declarations: [HeaderComponent], imports: [CommonModule, IgoLanguageModule, MatToolbarModule], diff --git a/src/app/pages/portal/expansion-panel/expansion-panel-header.component.ts b/src/app/pages/portal/expansion-panel/expansion-panel-header.component.ts index 099517ff8..5fc4484b3 100644 --- a/src/app/pages/portal/expansion-panel/expansion-panel-header.component.ts +++ b/src/app/pages/portal/expansion-panel/expansion-panel-header.component.ts @@ -1,10 +1,10 @@ import { + ChangeDetectionStrategy, Component, - Input, - Output, EventEmitter, HostBinding, - ChangeDetectionStrategy + Input, + Output } from '@angular/core'; @Component({ diff --git a/src/app/pages/portal/expansion-panel/expansion-panel.animations.ts b/src/app/pages/portal/expansion-panel/expansion-panel.animations.ts index b2685f224..9a95e25d7 100644 --- a/src/app/pages/portal/expansion-panel/expansion-panel.animations.ts +++ b/src/app/pages/portal/expansion-panel/expansion-panel.animations.ts @@ -1,10 +1,10 @@ import { - trigger, + AnimationTriggerMetadata, + animate, state, style, transition, - animate, - AnimationTriggerMetadata + trigger } from '@angular/animations'; export function showContent( diff --git a/src/app/pages/portal/expansion-panel/expansion-panel.component.ts b/src/app/pages/portal/expansion-panel/expansion-panel.component.ts index a00eb72b2..99018f7e3 100644 --- a/src/app/pages/portal/expansion-panel/expansion-panel.component.ts +++ b/src/app/pages/portal/expansion-panel/expansion-panel.component.ts @@ -1,10 +1,10 @@ import { + ChangeDetectionStrategy, Component, - Input, - Output, EventEmitter, HostBinding, - ChangeDetectionStrategy + Input, + Output } from '@angular/core'; import { showContent } from './expansion-panel.animations'; diff --git a/src/app/pages/portal/expansion-panel/expansion-panel.module.ts b/src/app/pages/portal/expansion-panel/expansion-panel.module.ts index 35b1952db..31ba306d6 100644 --- a/src/app/pages/portal/expansion-panel/expansion-panel.module.ts +++ b/src/app/pages/portal/expansion-panel/expansion-panel.module.ts @@ -1,18 +1,17 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; - +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 { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core'; import { IgoBackdropModule } from '@igo2/common'; +import { IgoLanguageModule } from '@igo2/core'; -import { ExpansionPanelComponent } from './expansion-panel.component'; import { ExpansionPanelHeaderComponent } from './expansion-panel-header.component'; -import { MatTooltipModule } from '@angular/material/tooltip'; +import { ExpansionPanelComponent } from './expansion-panel.component'; @NgModule({ imports: [ diff --git a/src/app/pages/portal/map-overlay/map-overlay.component.ts b/src/app/pages/portal/map-overlay/map-overlay.component.ts index ff12b322a..b56b7d6b4 100644 --- a/src/app/pages/portal/map-overlay/map-overlay.component.ts +++ b/src/app/pages/portal/map-overlay/map-overlay.component.ts @@ -1,7 +1,10 @@ -import { Component, AfterViewInit, OnDestroy } from '@angular/core'; -import { Subscription } from 'rxjs'; +import { AfterViewInit, Component, OnDestroy } from '@angular/core'; + import { Context, ContextService } from '@igo2/context'; -import { MediaService, ConfigService } from '@igo2/core'; +import { ConfigService, MediaService } from '@igo2/core'; + +import { Subscription } from 'rxjs'; + import { MapOverlay } from './map-overlay.interface'; @Component({ diff --git a/src/app/pages/portal/map-overlay/map-overlay.module.ts b/src/app/pages/portal/map-overlay/map-overlay.module.ts index cbf4f02be..ed3c0d5b8 100644 --- a/src/app/pages/portal/map-overlay/map-overlay.module.ts +++ b/src/app/pages/portal/map-overlay/map-overlay.module.ts @@ -1,5 +1,5 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { MapOverlayComponent } from './map-overlay.component'; diff --git a/src/app/pages/portal/portal.animation.ts b/src/app/pages/portal/portal.animation.ts index 1daa3c7ca..b8676eb11 100644 --- a/src/app/pages/portal/portal.animation.ts +++ b/src/app/pages/portal/portal.animation.ts @@ -1,14 +1,14 @@ -import './portal.variables.scss'; - import { - trigger, + AnimationTriggerMetadata, + animate, state, style, transition, - animate, - AnimationTriggerMetadata + trigger } from '@angular/animations'; +import './portal.variables.scss'; + export function expansionPanelAnimation(): AnimationTriggerMetadata[] { return [ trigger('expansionPanelSize', [ diff --git a/src/app/pages/portal/portal.component.ts b/src/app/pages/portal/portal.component.ts index 0d0845aa8..2ded7b399 100644 --- a/src/app/pages/portal/portal.component.ts +++ b/src/app/pages/portal/portal.component.ts @@ -1,110 +1,109 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; import { + ChangeDetectorRef, Component, - OnInit, + ElementRef, OnDestroy, - ChangeDetectorRef, - ViewChild, - ElementRef + OnInit, + ViewChild } from '@angular/core'; -import { ActivatedRoute, Params } from '@angular/router'; -import { Subscription, of, BehaviorSubject, combineLatest } from 'rxjs'; -import { debounceTime, take, pairwise, skipWhile, first } from 'rxjs/operators'; import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog'; -import MapBrowserEvent from 'ol/MapBrowserEvent'; -import * as olProj from 'ol/proj'; -import olFeature from 'ol/Feature'; -import type { default as OlGeometry } from 'ol/geom/Geometry'; +import { MatPaginator } from '@angular/material/paginator'; +import { ActivatedRoute, Params } from '@angular/router'; +import { AuthOptions, AuthService } from '@igo2/auth'; import { - MediaService, - Media, - MediaOrientation, - ConfigService, - LanguageService, - MessageService, - StorageService -} from '@igo2/core'; -import { - ActionbarMode, - Workspace, - WorkspaceStore, ActionStore, + ActionbarMode, + EntityRecord, EntityStore, - // getEntityTitle, + EntityTablePaginatorOptions, + Tool, // getEntityTitle, Toolbox, - Tool, Widget, - EntityTablePaginatorOptions, - EntityRecord + Workspace, + WorkspaceStore } from '@igo2/common'; -import { AuthOptions, AuthService } from '@igo2/auth'; import { DetailedContext } from '@igo2/context'; import { + ConfigService, + LanguageService, + Media, + MediaOrientation, + MediaService, + MessageService, + StorageService +} from '@igo2/core'; +import { + CapabilitiesService, + ConfigFileToGeoDBService, DataSourceService, - Feature, + EditionWorkspace, + EditionWorkspaceService, FEATURE, - featureToSearchResult, + Feature, + FeatureMotion, + FeatureWorkspace, GoogleLinks, IgoMap, + ImageLayer, + ImportService, LayerService, + MapExtent, QuerySearchSource, + QueryService, Research, SearchResult, SearchSource, SearchSourceService, - CapabilitiesService, - sourceCanSearch, - sourceCanReverseSearch, - ImportService, - handleFileImportError, - handleFileImportSuccess, - featureFromOl, - QueryService, + VectorLayer, WfsWorkspace, - FeatureWorkspace, - EditionWorkspace, - EditionWorkspaceService, - generateIdFromSourceOptions, - computeOlFeaturesExtent, addStopToStore, - ImageLayer, - VectorLayer, - MapExtent, + computeOlFeaturesExtent, + featureFromOl, + featureToSearchResult, + generateIdFromSourceOptions, + handleFileImportError, + handleFileImportSuccess, moveToOlFeatures, - FeatureMotion, - ConfigFileToGeoDBService + sourceCanReverseSearch, + sourceCanSearch } from '@igo2/geo'; - import { - ToolState, + ContextState, + DirectionState, MapState, - SearchState, QueryState, - ContextState, - WorkspaceState, - DirectionState + SearchState, + ToolState, + WorkspaceState } from '@igo2/integration'; +import { ObjectUtils } from '@igo2/utils'; + +import olFeature from 'ol/Feature'; +import MapBrowserEvent from 'ol/MapBrowserEvent'; +import olFormatGeoJSON from 'ol/format/GeoJSON'; +import type { default as OlGeometry } from 'ol/geom/Geometry'; +import * as olProj from 'ol/proj'; + +import { BehaviorSubject, Subscription, combineLatest, of } from 'rxjs'; +import { debounceTime, first, pairwise, skipWhile, take } from 'rxjs/operators'; import { - expansionPanelAnimation, - toastPanelAnimation, - controlsAnimations, controlSlideX, controlSlideY, + controlsAnimations, + expansionPanelAnimation, mapSlideX, - mapSlideY + mapSlideY, + toastPanelAnimation } from './portal.animation'; -import { HttpClient, HttpParams } from '@angular/common/http'; - import { WelcomeWindowComponent } from './welcome-window/welcome-window.component'; import { WelcomeWindowService } from './welcome-window/welcome-window.service'; -import { MatPaginator } from '@angular/material/paginator'; -import { ObjectUtils } from '@igo2/utils'; -import olFormatGeoJSON from 'ol/format/GeoJSON'; @Component({ selector: 'app-portal', diff --git a/src/app/pages/portal/portal.module.ts b/src/app/pages/portal/portal.module.ts index 1f402cb04..8867ceb06 100644 --- a/src/app/pages/portal/portal.module.ts +++ b/src/app/pages/portal/portal.module.ts @@ -1,50 +1,45 @@ -import { NgModule } from '@angular/core'; 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 { MatSidenavModule } from '@angular/material/sidenav'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatDialogModule } from '@angular/material/dialog'; -import { IgoCoreModule } from '@igo2/core'; import { IgoActionModule, - IgoWorkspaceModule, - IgoEntityModule, - IgoPanelModule, IgoBackdropModule, - IgoFlexibleModule, IgoContextMenuModule, - IgoToolModule, + IgoEntityModule, IgoEntityTableModule, IgoEntityTablePaginatorModule, - IgoInteractiveTourModule + IgoFlexibleModule, + IgoInteractiveTourModule, + IgoPanelModule, + IgoToolModule, + IgoWorkspaceModule } from '@igo2/common'; - import { - IgoGeoWorkspaceModule, + IgoContextManagerModule, + IgoContextMapButtonModule +} from '@igo2/context'; +import { IgoCoreModule } from '@igo2/core'; +import { IgoFeatureModule, + IgoGeoWorkspaceModule, IgoImportExportModule, IgoMapModule, IgoQueryModule, IgoSearchModule } from '@igo2/geo'; -import { - IgoContextManagerModule, - IgoContextMapButtonModule -} from '@igo2/context'; - import { IgoIntegrationModule } from '@igo2/integration'; -import { MapOverlayModule } from './map-overlay/map-overlay.module'; import { AppExpansionPanelModule } from './expansion-panel/expansion-panel.module'; -import { AppToastPanelModule } from './toast-panel/toast-panel.module'; -import { AppSidenavModule } from './sidenav/sidenav.module'; - +import { MapOverlayModule } from './map-overlay/map-overlay.module'; import { PortalComponent } from './portal.component'; +import { AppSidenavModule } from './sidenav/sidenav.module'; import { AppToastPanelForExpansionModule } from './toast-panel-for-expansion/toast-panel-for-expansion.module'; - +import { AppToastPanelModule } from './toast-panel/toast-panel.module'; import { IgoWelcomeWindowModule } from './welcome-window/welcome-window.module'; @NgModule({ diff --git a/src/app/pages/portal/sidenav/sidenav.component.ts b/src/app/pages/portal/sidenav/sidenav.component.ts index f53b3345c..4180a4a89 100644 --- a/src/app/pages/portal/sidenav/sidenav.component.ts +++ b/src/app/pages/portal/sidenav/sidenav.component.ts @@ -1,19 +1,19 @@ import { + ChangeDetectionStrategy, Component, + EventEmitter, Input, - Output, - OnInit, OnDestroy, - EventEmitter, - ChangeDetectionStrategy + OnInit, + Output } from '@angular/core'; -import { BehaviorSubject, Subscription } from 'rxjs'; - import { Tool, Toolbox } from '@igo2/common'; -import { IgoMap } from '@igo2/geo'; -import { ToolState, CatalogState } from '@igo2/integration'; import { ConfigService } from '@igo2/core'; +import { IgoMap } from '@igo2/geo'; +import { CatalogState, ToolState } from '@igo2/integration'; + +import { BehaviorSubject, Subscription } from 'rxjs'; @Component({ selector: 'app-sidenav', diff --git a/src/app/pages/portal/sidenav/sidenav.module.ts b/src/app/pages/portal/sidenav/sidenav.module.ts index a87c5fe9a..df651e259 100644 --- a/src/app/pages/portal/sidenav/sidenav.module.ts +++ b/src/app/pages/portal/sidenav/sidenav.module.ts @@ -1,20 +1,20 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core'; import { - IgoPanelModule, IgoFlexibleModule, - IgoToolModule, + IgoHomeButtonModule, IgoInteractiveTourModule, - IgoHomeButtonModule + IgoPanelModule, + IgoToolModule } from '@igo2/common'; -import { IgoFeatureModule } from '@igo2/geo'; import { IgoContextManagerModule } from '@igo2/context'; +import { IgoLanguageModule } from '@igo2/core'; +import { IgoFeatureModule } from '@igo2/geo'; import { SidenavComponent } from './sidenav.component'; diff --git a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.animations.ts b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.animations.ts index 720faceec..c3f94d816 100644 --- a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.animations.ts +++ b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.animations.ts @@ -1,10 +1,10 @@ import { - trigger, + AnimationTriggerMetadata, + animate, state, style, transition, - animate, - AnimationTriggerMetadata + trigger } from '@angular/animations'; export function showContent( diff --git a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.component.ts b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.component.ts index 1f34c1b03..09bf8e3f5 100644 --- a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.component.ts +++ b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.component.ts @@ -1,11 +1,12 @@ import { + ChangeDetectionStrategy, Component, - Input, - Output, EventEmitter, HostBinding, - ChangeDetectionStrategy + Input, + Output } from '@angular/core'; + import { showContent } from './toast-panel-for-expansion.animations'; @Component({ diff --git a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.module.ts b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.module.ts index 5d7d37dcf..fc60ac262 100644 --- a/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.module.ts +++ b/src/app/pages/portal/toast-panel-for-expansion/toast-panel-for-expansion.module.ts @@ -1,5 +1,5 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; diff --git a/src/app/pages/portal/toast-panel/toast-panel.animations.ts b/src/app/pages/portal/toast-panel/toast-panel.animations.ts index 720faceec..c3f94d816 100644 --- a/src/app/pages/portal/toast-panel/toast-panel.animations.ts +++ b/src/app/pages/portal/toast-panel/toast-panel.animations.ts @@ -1,10 +1,10 @@ import { - trigger, + AnimationTriggerMetadata, + animate, state, style, transition, - animate, - AnimationTriggerMetadata + trigger } from '@angular/animations'; export function showContent( diff --git a/src/app/pages/portal/toast-panel/toast-panel.component.ts b/src/app/pages/portal/toast-panel/toast-panel.component.ts index 513b00870..c22c7de8a 100644 --- a/src/app/pages/portal/toast-panel/toast-panel.component.ts +++ b/src/app/pages/portal/toast-panel/toast-panel.component.ts @@ -1,58 +1,60 @@ import { + ChangeDetectionStrategy, Component, - Input, - Output, EventEmitter, HostBinding, HostListener, - ChangeDetectionStrategy, + Input, + OnDestroy, OnInit, - OnDestroy + Output } from '@angular/core'; -import { BehaviorSubject, Observable, combineLatest, Subscription } from 'rxjs'; -import { debounceTime, map, skipWhile, tap } from 'rxjs/operators'; -import olFormatGeoJSON from 'ol/format/GeoJSON'; -import olFeature from 'ol/Feature'; -import olPoint from 'ol/geom/Point'; import { - getEntityTitle, - EntityStore, - ActionStore, Action, - ActionbarMode + ActionStore, + ActionbarMode, + EntityStore, + getEntityTitle } from '@igo2/common'; +import { + ConfigService, + LanguageService, + Media, + MediaService, + StorageScope, + StorageService, + StorageServiceEvent +} from '@igo2/core'; import { Feature, - SearchResult, - IgoMap, FeatureMotion, - moveToOlFeatures, - featureToOl, - featuresAreTooDeepInView, + GeoServiceDefinition, + IgoMap, + Layer, + LayerService, + PropertyTypeDetectorService, + SearchResult, + computeOlFeaturesExtent, featureFromOl, - getCommonVectorStyle, - getCommonVectorSelectedStyle, + featureToOl, featuresAreOutOfView, - computeOlFeaturesExtent, - PropertyTypeDetectorService, + featuresAreTooDeepInView, generateIdFromSourceOptions, - LayerService, - Layer, - GeoServiceDefinition + getCommonVectorSelectedStyle, + getCommonVectorStyle, + moveToOlFeatures } from '@igo2/geo'; -import { - Media, - MediaService, - LanguageService, - StorageService, - StorageScope, - StorageServiceEvent, - ConfigService -} from '@igo2/core'; import { QueryState, StorageState, WorkspaceState } from '@igo2/integration'; import { ObjectUtils } from '@igo2/utils'; +import olFeature from 'ol/Feature'; +import olFormatGeoJSON from 'ol/format/GeoJSON'; +import olPoint from 'ol/geom/Point'; + +import { BehaviorSubject, Observable, Subscription, combineLatest } from 'rxjs'; +import { debounceTime, map, skipWhile, tap } from 'rxjs/operators'; + interface ExtendedGeoServiceDefinition extends GeoServiceDefinition { propertyForUrl: string; } diff --git a/src/app/pages/portal/toast-panel/toast-panel.module.ts b/src/app/pages/portal/toast-panel/toast-panel.module.ts index 3d1478af0..11bdbce22 100644 --- a/src/app/pages/portal/toast-panel/toast-panel.module.ts +++ b/src/app/pages/portal/toast-panel/toast-panel.module.ts @@ -1,20 +1,20 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatMenuModule } from '@angular/material/menu'; import { MatTooltipModule } from '@angular/material/tooltip'; import { + IgoActionModule, IgoPanelModule, - IgoStopPropagationModule, - IgoActionModule + IgoStopPropagationModule } from '@igo2/common'; import { IgoLanguageModule } from '@igo2/core'; import { IgoFeatureModule, IgoSearchResultsModule } from '@igo2/geo'; import { ToastPanelComponent } from './toast-panel.component'; -import { MatBadgeModule } from '@angular/material/badge'; @NgModule({ imports: [ diff --git a/src/app/pages/portal/welcome-window/welcome-window.component.ts b/src/app/pages/portal/welcome-window/welcome-window.component.ts index 608eb3ba7..dcacf8081 100644 --- a/src/app/pages/portal/welcome-window/welcome-window.component.ts +++ b/src/app/pages/portal/welcome-window/welcome-window.component.ts @@ -1,8 +1,11 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; + import { ConfigService, LanguageService } from '@igo2/core'; -import { BehaviorSubject, Observable, of, Subscription } from 'rxjs'; + +import { BehaviorSubject, Observable, Subscription, of } from 'rxjs'; import { map } from 'rxjs/operators'; + import { WelcomeWindowService } from './welcome-window.service'; @Component({ diff --git a/src/app/pages/portal/welcome-window/welcome-window.module.ts b/src/app/pages/portal/welcome-window/welcome-window.module.ts index 98df12f48..31da887c0 100644 --- a/src/app/pages/portal/welcome-window/welcome-window.module.ts +++ b/src/app/pages/portal/welcome-window/welcome-window.module.ts @@ -1,16 +1,16 @@ -import { NgModule } from '@angular/core'; 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 { MatIconModule } from '@angular/material/icon'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatDialogModule } from '@angular/material/dialog'; -import { WelcomeWindowComponent } from './welcome-window.component'; +import { IgoCustomHtmlModule, IgoInteractiveTourModule } from '@igo2/common'; import { IgoLanguageModule } from '@igo2/core'; -import { IgoInteractiveTourModule, IgoCustomHtmlModule } from '@igo2/common'; + +import { WelcomeWindowComponent } from './welcome-window.component'; @NgModule({ imports: [ diff --git a/src/app/pages/portal/welcome-window/welcome-window.service.spec.ts b/src/app/pages/portal/welcome-window/welcome-window.service.spec.ts index ed622d5fb..0a56cff1a 100644 --- a/src/app/pages/portal/welcome-window/welcome-window.service.spec.ts +++ b/src/app/pages/portal/welcome-window/welcome-window.service.spec.ts @@ -1,7 +1,7 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { WelcomeWindowService } from './welcome-window.service'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('WelcomeWindowService', () => { beforeEach(() => diff --git a/src/app/pages/portal/welcome-window/welcome-window.service.ts b/src/app/pages/portal/welcome-window/welcome-window.service.ts index c03c754fb..2f0b06848 100644 --- a/src/app/pages/portal/welcome-window/welcome-window.service.ts +++ b/src/app/pages/portal/welcome-window/welcome-window.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; +import { MatDialogConfig } from '@angular/material/dialog'; import { ConfigService, StorageService } from '@igo2/core'; -import { MatDialogConfig } from '@angular/material/dialog'; @Injectable({ providedIn: 'root' diff --git a/src/app/services/pwa.service.ts b/src/app/services/pwa.service.ts index 7bb12e83a..55641f83f 100644 --- a/src/app/services/pwa.service.ts +++ b/src/app/services/pwa.service.ts @@ -1,8 +1,10 @@ import { Injectable } from '@angular/core'; -import { LanguageService } from '@igo2/core'; import { SwUpdate } from '@angular/service-worker'; -import { interval } from 'rxjs'; + import { ConfirmDialogService } from '@igo2/common'; +import { LanguageService } from '@igo2/core'; + +import { interval } from 'rxjs'; import { skip, tap } from 'rxjs/operators'; @Injectable({ diff --git a/src/environments/environment.github.ts b/src/environments/environment.github.ts index c04510d94..cd00d0827 100644 --- a/src/environments/environment.github.ts +++ b/src/environments/environment.github.ts @@ -1,16 +1,17 @@ import { LanguageOptions } from '@igo2/core'; import { - SearchSourceOptions, - ImportExportServiceOptions, CatalogServiceOptions, + CommonVectorStyleOptions, + ImportExportServiceOptions, Projection, - CommonVectorStyleOptions + SearchSourceOptions } from '@igo2/geo'; import { AppOptions, InteractiveTourConfigOptions } from './environnement.interface'; + interface Environment { production: boolean; igo: { diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3906290a7..6b9c2b355 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,11 +1,11 @@ import { LanguageOptions } from '@igo2/core'; import { - SearchSourceOptions, + CommonVectorStyleOptions, ImportExportServiceOptions, OptionsApiOptions, Projection, - SpatialFilterOptions, - CommonVectorStyleOptions + SearchSourceOptions, + SpatialFilterOptions } from '@igo2/geo'; import { diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 32fcdc931..25967c974 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -2,18 +2,18 @@ // The build system defaults to the dev environment which uses `environment.ts`, but if you do // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. - import { AuthOptions, AuthStorageOptions } from '@igo2/auth'; import { DOMOptions } from '@igo2/common'; import { ContextServiceOptions } from '@igo2/context'; import { LanguageOptions } from '@igo2/core'; import { - SearchSourceOptions, CatalogServiceOptions, - Projection, + CommonVectorStyleOptions, ImportExportServiceOptions, - CommonVectorStyleOptions + Projection, + SearchSourceOptions } from '@igo2/geo'; + import { AppOptions, InteractiveTourConfigOptions diff --git a/src/main.ts b/src/main.ts index 667dc866c..0fa4f834b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,11 @@ import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import 'hammerjs'; + import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; -import 'hammerjs'; - if (environment.production) { enableProdMode(); } diff --git a/src/polyfills.ts b/src/polyfills.ts index 42399e198..c5c964758 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -17,20 +17,21 @@ /*************************************************************************************************** * BROWSER POLYFILLS */ - -import 'core-js/es/object'; -import 'core-js/es/string'; - +import 'core-js/es/array/flat-map'; import 'core-js/es/array/includes'; -import 'core-js/es/array/flat-map'; // Run `npm install --save classlist.js`. +import 'core-js/es/object'; +// Run `npm install --save classlist.js`. /** Evergreen browsers require these. **/ import 'core-js/es/reflect'; +import 'core-js/es/string'; /*************************************************************************************************** * Zone JS is required by Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. +import 'zone.js/dist/zone'; + +// Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/src/test.ts b/src/test.ts index f8a017708..ae4c3c5f3 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,13 +1,13 @@ // This file is required by karma.conf.js and loads recursively all the .spec // and framework files - -import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; +import 'zone.js/dist/zone-testing'; + // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule,