diff --git a/.browserslistrc b/.browserslistrc index 13f7236..bc4ef54 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -5,9 +5,8 @@ # You can see what browsers were selected by your queries by running: # npx browserslist -> 0.5% +> 0.2% last 2 versions -last 3 years +last 4 years Firefox ESR not dead -not IE 11 # For IE 9-11 support, remove 'not'. diff --git a/package.json b/package.json index 3911704..8eac551 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "e2e": "ng e2e" }, "prettier": { - "singleQuote": true + "singleQuote": true, + "printWidth": 120 }, "private": true, "dependencies": { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f7b665e..c8b88c7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,6 @@ import { Component, HostListener, OnInit } from '@angular/core'; import { UDSApiService } from './uds-api.service'; -// External -declare const django: any; -declare const cookieconsent: any; @Component({ diff --git a/src/app/gui/components/service/service.component.ts b/src/app/gui/components/service/service.component.ts index 16b2e0f..9d3968b 100644 --- a/src/app/gui/components/service/service.component.ts +++ b/src/app/gui/components/service/service.component.ts @@ -2,8 +2,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { JSONService, JSONTransport } from '../../../types/services'; import { UDSApiService } from '../../../uds-api.service'; -declare const django: any; - const MAX_NAME_LENGTH = 32; @Component({ diff --git a/src/app/gui/credentials-modal/credentials-modal.component.ts b/src/app/gui/credentials-modal/credentials-modal.component.ts index 88a567a..5fb35f2 100644 --- a/src/app/gui/credentials-modal/credentials-modal.component.ts +++ b/src/app/gui/credentials-modal/credentials-modal.component.ts @@ -1,8 +1,6 @@ import {Component, Inject} from '@angular/core'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -declare const django: any; - @Component({ selector: 'uds-credentials-modal', templateUrl: './credentials-modal.component.html', diff --git a/src/app/gui/modal/modal.component.ts b/src/app/gui/modal/modal.component.ts index f9f3b37..54335cf 100644 --- a/src/app/gui/modal/modal.component.ts +++ b/src/app/gui/modal/modal.component.ts @@ -3,8 +3,6 @@ import { Component, OnInit, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { interval, Subscription, Observable } from 'rxjs'; -declare const django: any; - export enum DialogType { alert = 0, yesno = 1, diff --git a/src/app/helpers/plugin.ts b/src/app/helpers/plugin.ts index 00629b7..8f367d6 100644 --- a/src/app/helpers/plugin.ts +++ b/src/app/helpers/plugin.ts @@ -3,8 +3,6 @@ import { UDSApiServiceType } from '../uds-api.service-type'; import { toPromise } from '../gui/uds-gui.service'; import { JSONTransportURLService } from '../types/services'; -declare const django: any; - /** * Plugin manipulation class */ diff --git a/src/app/pages/client-download/client-download.component.ts b/src/app/pages/client-download/client-download.component.ts index 05e7b1e..7f1e101 100644 --- a/src/app/pages/client-download/client-download.component.ts +++ b/src/app/pages/client-download/client-download.component.ts @@ -2,8 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { UDSApiService } from '../../uds-api.service'; import { Downloadable } from '../../types/config'; -declare const django: any; - @Component({ selector: 'uds-client-download', templateUrl: './client-download.component.html', diff --git a/src/app/pages/error/error.component.ts b/src/app/pages/error/error.component.ts index c611709..b512e69 100644 --- a/src/app/pages/error/error.component.ts +++ b/src/app/pages/error/error.component.ts @@ -2,9 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { UDSApiService } from '../../uds-api.service'; -declare const django: any; -declare const udsData: any; - @Component({ selector: 'uds-error', templateUrl: './error.component.html', diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 11a557e..fca9e7e 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -3,8 +3,6 @@ import { Component, OnInit } from '@angular/core'; import { UDSApiService } from '../../uds-api.service'; import { Authenticator } from '../../types/config'; -declare const django: any; - @Component({ selector: 'uds-login', templateUrl: './login.component.html', diff --git a/src/app/pages/mfa/mfa.component.ts b/src/app/pages/mfa/mfa.component.ts index 55724aa..65884f4 100644 --- a/src/app/pages/mfa/mfa.component.ts +++ b/src/app/pages/mfa/mfa.component.ts @@ -1,8 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { UDSApiService } from '../../uds-api.service'; -declare const django: any; - @Component({ selector: 'uds-mfa', templateUrl: './mfa.component.html', diff --git a/src/app/pages/services/services.component.ts b/src/app/pages/services/services.component.ts index 2cd41e4..58d8b20 100644 --- a/src/app/pages/services/services.component.ts +++ b/src/app/pages/services/services.component.ts @@ -6,8 +6,6 @@ import { JSONService, } from '../../types/services'; -declare const django: any; - class GroupedServices { services: JSONService[]; diff --git a/src/app/translate.directive.ts b/src/app/translate.directive.ts index 4904a40..7ab2d37 100644 --- a/src/app/translate.directive.ts +++ b/src/app/translate.directive.ts @@ -1,7 +1,5 @@ import { Directive, OnInit, ElementRef } from '@angular/core'; -declare const django: any; - @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: 'uds-translate' diff --git a/src/app/uds-api.service.ts b/src/app/uds-api.service.ts index 82b5b70..77906c9 100644 --- a/src/app/uds-api.service.ts +++ b/src/app/uds-api.service.ts @@ -19,8 +19,6 @@ import { UDSApiServiceType } from './uds-api.service-type'; import { environment } from '../environments/environment'; -declare const udsData: any; -declare const csrf: any; const DARK_THEME = 'dark-theme'; const LIGHT_THEME = 'light-theme'; diff --git a/src/polyfills.ts b/src/polyfills.ts deleted file mode 100644 index a412169..0000000 --- a/src/polyfills.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/guide/browser-support - */ - -/*************************************************************************************************** -* BROWSER POLYFILLS -*/ - -/** IE10 and IE11 requires the following for the Reflect API. */ -import 'core-js/es/reflect'; // Run `npm install --save web-animations-js`. - -/** - * By default, zone.js will patch all possible macroTask and DomEvents - * user can disable parts of macroTask/DomEvents patch by setting following flags - */ - - // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame - // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick - // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames - - /* - * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js - * with the following flag, it will bypass `zone.js` patch for IE/Edge - */ -// (window as any).__Zone_enable_cross_context_check = true; - -/*************************************************************************************************** - * Zone JS is required by default for Angular itself. - */ -import 'zone.js'; // Included with Angular CLI. - - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json index f8d1973..9d434ff 100644 --- a/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -5,13 +5,11 @@ "baseUrl": "./", "types": [] }, - "angularCompilerOptions": { - "strictTemplates": true - }, "files": [ - "main.ts", + "main.ts" ], "include": [ - "src/**/*.d.ts" + "app/**/*.d.ts", + "**/*.d.ts", ] } diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 7ac83e2..b9d0a76 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -8,9 +8,9 @@ "node" ] }, - "angularCompilerOptions": { - "strictTemplates": true - }, + "files": [ + "test.ts" + ], "include": [ "**/*.spec.ts", "**/*.d.ts" diff --git a/src/typings.d.ts b/src/typings.d.ts index c1c411a..8d1ee67 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -5,6 +5,7 @@ interface NodeModule { id: string; } /* UDS injected modules */ -// declare const django: any; -// declare var udsData: any; - +declare const django: any; +declare const udsData: any; +declare const cookieconsent: any; +declare const csrf: any; diff --git a/tsconfig.json b/tsconfig.json index 4d38c39..ed966d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,28 +1,33 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, - "angularCompilerOptions": { - "strictTemplates": true, - }, "compilerOptions": { - "strict": true, - "downlevelIteration": true, - "importHelpers": true, + "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, + "downlevelIteration": true, "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, "target": "ES2022", - "typeRoots": [ - "node_modules/@types" - ], + "module": "ES2022", + "useDefineForClassFields": false, "lib": [ - "es2017", + "ES2022", "dom" - ], - "module": "es2020", - "baseUrl": "./", - "useDefineForClassFields": true + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true } -} \ No newline at end of file +}