Browse Source

Update angular. (#958)

* Update angular.

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Another build test

* Update deps

* Update deps.

* Update

* Add a user

* Try root.

* Install cli manually.

* Fix files

* More updates.

* Fix formatting.
pull/961/head
Sebastian Stehle 3 years ago
committed by GitHub
parent
commit
d873083212
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .dockerignore
  2. 2
      .gitignore
  3. 17
      Dockerfile
  4. 2
      backend/src/Squidex.Infrastructure/Reflection/AssemblyTypeProvider.cs
  5. 18
      dev/frontend-build/Dockerfile
  6. 16
      frontend/.browserslistrc
  7. 21
      frontend/angular.json
  8. 6166
      frontend/package-lock.json
  9. 45
      frontend/package.json
  10. 19
      frontend/patches/resize-observer-polyfill+1.5.1.patch
  11. 2
      frontend/src/app/app.module.ts
  12. 4
      frontend/src/app/features/dashboard/module.ts
  13. 12
      frontend/src/app/features/dashboard/pages/dashboard-page.component.scss
  14. 12
      frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.scss
  15. 2
      frontend/src/app/framework/angular/forms/model.ts
  16. 1
      frontend/src/app/framework/services/resize.service.ts
  17. 10
      frontend/src/app/framework/utils/markdown.ts
  18. 4
      frontend/src/app/shared/components/cards/api-calls-card.component.html
  19. 4
      frontend/src/app/shared/components/cards/api-performance-card.component.html
  20. 4
      frontend/src/app/shared/components/cards/api-traffic-card.component.html
  21. 4
      frontend/src/app/shared/components/cards/asset-uploads-count-card.component.html
  22. 4
      frontend/src/app/shared/components/cards/asset-uploads-size-card.component.html
  23. 33
      frontend/src/app/shared/components/cards/shared.ts
  24. 4
      frontend/src/app/shared/module.ts
  25. 56
      frontend/src/polyfills.ts
  26. 26
      frontend/src/test.ts
  27. 3
      frontend/tsconfig.app.json
  28. 9
      frontend/tsconfig.json
  29. 4
      frontend/tsconfig.spec.json

9
.dockerignore

@ -5,8 +5,12 @@
*.log
*.received.txt
**/.angular
.vs
.git
.github
.idea
.vscode
# Build results
**/bin
@ -21,15 +25,12 @@
# NodeJS
**/node_modules
backend/src/Squidex/Assets/*.*
**/backend/src/Squidex/Assets
**/appsettings.Development.json
**/appsettings.Production.json
**/launchSettings.json
# Build
.drone.yml
build.ps1
build.sh

2
.gitignore

@ -8,6 +8,8 @@
.angular
.awCache
.git
.github
.idea
.vscode

17
Dockerfile

@ -1,6 +1,7 @@
#
# Stage 1, Build Backend
#
FROM mcr.microsoft.com/dotnet/sdk:7.0 as backend
ARG SQUIDEX__BUILD__VERSION=7.0.0
@ -42,29 +43,27 @@ RUN dotnet tool install --tool-path /tools dotnet-counters \
#
# Stage 2, Build Frontend
#
FROM buildkite/puppeteer:10.0.0 as frontend
FROM squidex/frontend-build:18.10 as frontend
WORKDIR /src
ENV CONTINUOUS_INTEGRATION=1
# Copy Node project files and patches
COPY frontend/package*.json /tmp/
COPY frontend/patches /tmp/patches
# Copy Node project files
COPY frontend/package*.json ./
# Install Node packages
RUN cd /tmp && npm set unsafe-perm true && npm install --loglevel=error
RUN npm install --loglevel=error --force
COPY frontend .
# Build Frontend
RUN cp -a /tmp/node_modules . \
&& npm run test:coverage \
RUN npm run test:coverage \
&& npm run build
RUN cp -a build /build/
#
# Stage 3, Build runtime
#
@ -99,4 +98,4 @@ ENV DIAGNOSTICS__TRACETOOL=/tools/dotnet-trace
ENTRYPOINT ["dotnet", "Squidex.dll"]
ENV EXPOSEDCONFIGURATION__VERSION=$SQUIDEX__RUNTIME__VERSION
ENV EXPOSEDCONFIGURATION__VERSION=$SQUIDEX__RUNTIME__VERSION

2
backend/src/Squidex.Infrastructure/Reflection/AssemblyTypeProvider.cs

@ -31,7 +31,7 @@ public sealed class AssemblyTypeProvider<T> : ITypeProvider where T : class
public void Map(TypeRegistry typeRegistry)
{
var baseType = typeof(T);
var baseType = typeof(T);
foreach (var derivedType in assembly.GetTypes())
{

18
dev/frontend-build/Dockerfile

@ -0,0 +1,18 @@
FROM node:18.10-slim
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /puppeteer
# Install puppeteer so it's available in the container.
RUN npm init -y \
&& npm install puppeteer

16
frontend/.browserslistrc

@ -1,16 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR

21
frontend/angular.json

@ -23,12 +23,13 @@
"outputPath": "build",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"allowedCommonJsDependencies": [
"@tweenjs/tween.js",
"angular2-chartjs",
"cropperjs",
"mousetrap",
"mersenne-twister",
@ -75,11 +76,11 @@
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"namedChunks": true,
"optimization": false,
"sourceMap": true,
"namedChunks": true
"vendorChunk": true
}
},
"defaultConfiguration": "production"
@ -105,12 +106,14 @@
"test": {
"builder": "@angular-builders/custom-webpack:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [

6166
frontend/package-lock.json

File diff suppressed because it is too large

45
frontend/package.json

@ -6,7 +6,6 @@
"lint": "eslint src/app/**/*.ts",
"lint:fix": "eslint src/app/**/*.ts --fix",
"ng": "ng",
"postinstall": "npx patch-package",
"start": "ng serve",
"test": "ng test",
"test:coverage": "ng test --no-watch --code-coverage --browsers=ChromeHeadlessNoSandbox",
@ -16,24 +15,23 @@
},
"private": true,
"dependencies": {
"@angular/animations": "14.2.6",
"@angular/cdk": "14.2.5",
"@angular/cdk-experimental": "14.2.5",
"@angular/common": "14.2.6",
"@angular/core": "14.2.6",
"@angular/forms": "14.2.6",
"@angular/localize": "14.2.6",
"@angular/platform-browser": "14.2.6",
"@angular/platform-browser-dynamic": "14.2.6",
"@angular/platform-server": "14.2.6",
"@angular/router": "14.2.6",
"@angular/animations": "15.0.4",
"@angular/cdk": "15.0.3",
"@angular/cdk-experimental": "15.0.3",
"@angular/common": "15.0.4",
"@angular/core": "15.0.4",
"@angular/forms": "15.0.4",
"@angular/localize": "15.0.4",
"@angular/platform-browser": "15.0.4",
"@angular/platform-browser-dynamic": "15.0.4",
"@angular/platform-server": "15.0.4",
"@angular/router": "15.0.4",
"@babel/runtime": "^7.19.4",
"@egjs/hammerjs": "2.0.17",
"@graphiql/toolkit": "^0.8.0",
"ace-builds": "1.12.0",
"angular-gridster2": "14.1.1",
"angular-gridster2": "15.0.0",
"angular-mentions": "1.5.0",
"angular2-chartjs": "0.5.1",
"babel-polyfill": "6.26.0",
"bootstrap": "5.2.3",
"core-js": "3.25.5",
@ -49,16 +47,17 @@
"leaflet-control-geocoder": "2.4.0",
"marked": "4.1.1",
"mersenne-twister": "1.1.0",
"moment": "^2.29.4",
"mousetrap": "1.6.5",
"ng2-charts": "^4.1.1",
"ngx-color-picker": "13.0.0",
"ngx-doc-viewer": "14.0.0",
"ngx-doc-viewer": "15.0.1",
"ngx-virtual-scroller": "^4.0.3",
"oidc-client": "1.11.5",
"pikaday": "1.8.2",
"progressbar.js": "1.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"resize-observer-polyfill": "1.5.1",
"rxjs": "7.5.7",
"simplemde": "1.11.2",
"slugify": "1.6.5",
@ -73,12 +72,12 @@
"zone.js": "0.11.8"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^14.0.1",
"@angular-devkit/build-angular": "^14.2.6",
"@angular/cli": "^14.2.6",
"@angular/compiler": "^14.2.6",
"@angular/compiler-cli": "^14.2.6",
"@angular/elements": "^14.2.6",
"@angular-builders/custom-webpack": "^15.0.0-beta.0",
"@angular-devkit/build-angular": "^15.0.4",
"@angular/cli": "^15.0.4",
"@angular/compiler": "^15.0.4",
"@angular/compiler-cli": "^15.0.4",
"@angular/elements": "^15.0.4",
"@babel/core": "^7.19.3",
"@compodoc/compodoc": "^1.1.19",
"@storybook/addon-actions": "^6.5.12",
@ -125,6 +124,6 @@
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-scss": "4.3.0",
"stylelint-webpack-plugin": "3.3.0",
"typescript": "4.7.2"
"typescript": "4.8.4"
}
}

19
frontend/patches/resize-observer-polyfill+1.5.1.patch

@ -1,19 +0,0 @@
diff --git a/node_modules/resize-observer-polyfill/src/index.d.ts b/node_modules/resize-observer-polyfill/src/index.d.ts
index 74aacc0..1b236d2 100644
--- a/node_modules/resize-observer-polyfill/src/index.d.ts
+++ b/node_modules/resize-observer-polyfill/src/index.d.ts
@@ -1,14 +1,3 @@
-interface DOMRectReadOnly {
- readonly x: number;
- readonly y: number;
- readonly width: number;
- readonly height: number;
- readonly top: number;
- readonly right: number;
- readonly bottom: number;
- readonly left: number;
-}
-
declare global {
interface ResizeObserverCallback {
(entries: ResizeObserverEntry[], observer: ResizeObserver): void

2
frontend/src/app/app.module.ts

@ -15,6 +15,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ActivatedRouteSnapshot, BaseRouteReuseStrategy, RouteReuseStrategy, RouterModule } from '@angular/router';
import { NgChartsModule } from 'ng2-charts';
import { environment } from './../environments/environment';
import { AppComponent } from './app.component';
import { routing } from './app.routes';
@ -96,6 +97,7 @@ export class AppRouteReuseStrategy extends BaseRouteReuseStrategy {
CommonModule,
FormsModule,
HttpClientModule,
NgChartsModule.forRoot(),
ReactiveFormsModule,
RouterModule,
SqxFrameworkModule.forRoot(),

4
frontend/src/app/features/dashboard/module.ts

@ -8,7 +8,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { GridsterModule } from 'angular-gridster2';
import { ChartModule } from 'angular2-chartjs';
import { NgChartsModule } from 'ng2-charts';
import { SqxFrameworkModule, SqxSharedModule } from '@app/shared';
import { ApiCardComponent, ContentSummaryCardComponent, DashboardConfigComponent, DashboardPageComponent, GithubCardComponent, HistoryCardComponent, SchemaCardComponent } from './declarations';
@ -21,8 +21,8 @@ const routes: Routes = [
@NgModule({
imports: [
ChartModule,
GridsterModule,
NgChartsModule,
RouterModule.forChild(routes),
SqxFrameworkModule,
SqxSharedModule,

12
frontend/src/app/features/dashboard/pages/dashboard-page.component.scss

@ -57,12 +57,6 @@ gridster-item {
}
:host ::ng-deep {
/* stylelint-disable */
chart {
@include absolute(0, 1rem, 1rem, 1rem);
}
/* stylelint-enable */
.subtext {
margin-bottom: 2rem;
}
@ -96,6 +90,12 @@ gridster-item {
position: relative;
}
&-chart {
.card-body {
padding: .25rem;
}
}
&-title {
margin-top: 1rem;
}

12
frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.scss

@ -57,12 +57,6 @@ gridster-item {
}
:host ::ng-deep {
/* stylelint-disable */
chart {
@include absolute(0, 1rem, 1rem, 1rem);
}
/* stylelint-enable */
.subtext {
margin-bottom: 2rem;
}
@ -96,6 +90,12 @@ gridster-item {
position: relative;
}
&-chart {
.card-body {
padding: .25rem;
}
}
&-title {
margin-top: 1rem;
}

2
frontend/src/app/framework/angular/forms/model.ts

@ -108,7 +108,7 @@ export class Form<T extends AbstractControl, TOut, TIn = TOut> {
}
}
public submitCompleted(options?: { newValue?: TOut; noReset?: boolean }) {
public submitCompleted(options?: { newValue?: TIn; noReset?: boolean }) {
this.updateSubmitState(null, false);
this.enable();

1
frontend/src/app/framework/services/resize.service.ts

@ -6,7 +6,6 @@
*/
import { Injectable, OnDestroy } from '@angular/core';
import ResizeObserver from 'resize-observer-polyfill';
export interface ResizeListener {
onResize(rect: DOMRect, element: Element): void;

10
frontend/src/app/framework/utils/markdown.ts

@ -43,11 +43,11 @@ export function renderMarkdown(input: string | undefined | null, inline: boolean
const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');
const escapeReplacements = {
'&' : '&amp;',
'<' : '&lt;',
'>' : '&gt;',
'"' : '&quot;',
'\'': '&#39;',
'&' : '&amp;',
'<' : '&lt;',
'>' : '&gt;',
'"' : '&quot;',
'\'': '&#39;',
};
const getEscapeReplacement = (ch: string) => escapeReplacements[ch];

4
frontend/src/app/shared/components/cards/api-calls-card.component.html

@ -1,4 +1,4 @@
<div class="card card-lg">
<div class="card card-lg card-chart">
<div class="card-header">
{{ 'dashboard.apiCallsCard' | sqxTranslate }}
@ -9,6 +9,6 @@
</div>
</div>
<div class="card-body">
<chart type="bar" [data]="chartData" [options]="chartOptions"></chart>
<canvas baseChart type="bar" [data]="chartData" [options]="chartOptions"></canvas>
</div>
</div>

4
frontend/src/app/shared/components/cards/api-performance-card.component.html

@ -1,4 +1,4 @@
<div class="card card-lg">
<div class="card card-lg card-chart">
<div class="card-header">
{{ 'dashboard.apiPerformanceCard' | sqxTranslate: { summary: chartSummary } }}
@ -13,6 +13,6 @@
</div>
</div>
<div class="card-body">
<chart type="bar" [data]="chartData" [options]="chartOptions"></chart>
<canvas baseChart type="bar" [data]="chartData" [options]="chartOptions"></canvas>
</div>
</div>

4
frontend/src/app/shared/components/cards/api-traffic-card.component.html

@ -1,4 +1,4 @@
<div class="card card-lg">
<div class="card card-lg card-chart">
<div class="card-header">
{{ 'dashboard.trafficHeader' | sqxTranslate }}: {{chartSummary | sqxFileSize}}
@ -13,6 +13,6 @@
</div>
</div>
<div class="card-body">
<chart type="bar" [data]="chartData" [options]="chartOptions"></chart>
<canvas baseChart type="bar" [data]="chartData" [options]="chartOptions"></canvas>
</div>
</div>

4
frontend/src/app/shared/components/cards/asset-uploads-count-card.component.html

@ -1,6 +1,6 @@
<div class="card card-lg">
<div class="card card-lg card-chart">
<div class="card-header">{{ 'dashboard.assetUploadsCard' | sqxTranslate }}</div>
<div class="card-body">
<chart type="line" [data]="chartData" [options]="chartOptions"></chart>
<canvas baseChart type="line" [data]="chartData" [options]="chartOptions"></canvas>
</div>
</div>

4
frontend/src/app/shared/components/cards/asset-uploads-size-card.component.html

@ -1,6 +1,6 @@
<div class="card card-lg">
<div class="card card-lg card-chart">
<div class="card-header">{{ 'dashboard.assetUploadsCard' | sqxTranslate }}</div>
<div class="card-body">
<chart type="line" [data]="chartData" [options]="chartOptions"></chart>
<canvas baseChart type="line" [data]="chartData" [options]="chartOptions"></canvas>
</div>
</div>

33
frontend/src/app/shared/components/cards/shared.ts

@ -5,6 +5,7 @@
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { ChartOptions as IChartOptions } from 'chart.js';
import { DateTime } from '@app/shared';
const ColorSchema: ReadonlyArray<string> = [
@ -44,37 +45,33 @@ export module ChartHelpers {
}
export module ChartOptions {
export const Default = {
export const Default: IChartOptions = {
responsive: true,
scales: {
xAxes: [{
x: {
display: true,
stacked: false,
}],
yAxes: [{
ticks: {
beginAtZero: true,
},
},
y: {
beginAtZero: true,
stacked: false,
}],
},
},
maintainAspectRatio: false,
};
} as any;
export const Stacked = {
export const Stacked: IChartOptions = {
responsive: true,
scales: {
xAxes: [{
x: {
display: true,
stacked: true,
}],
yAxes: [{
ticks: {
beginAtZero: true,
},
},
y: {
beginAtZero: true,
stacked: true,
}],
},
},
maintainAspectRatio: false,
};
} as any;
}

4
frontend/src/app/shared/module.ts

@ -10,16 +10,16 @@ import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { MentionModule } from 'angular-mentions';
import { ChartModule } from 'angular2-chartjs';
import { NgChartsModule } from 'ng2-charts';
import { NgxDocViewerModule } from 'ngx-doc-viewer';
import { SqxFrameworkModule } from '@app/framework';
import { ApiCallsCardComponent, ApiCallsSummaryCardComponent, ApiPerformanceCardComponent, ApiTrafficCardComponent, ApiTrafficSummaryCardComponent, AppFormComponent, AppLanguagesService, AppMustExistGuard, AppsService, AppsState, AssetComponent, AssetDialogComponent, AssetFolderComponent, AssetFolderDialogComponent, AssetFolderDropdownComponent, AssetFolderDropdownItemComponent, AssetHistoryComponent, AssetPathComponent, AssetPreviewUrlPipe, AssetScriptsState, AssetsListComponent, AssetSelectorComponent, AssetsService, AssetsState, AssetTextEditorComponent, AssetUploaderComponent, AssetUploaderState, AssetUploadsCountCardComponent, AssetUploadsSizeCardComponent, AssetUploadsSizeSummaryCardComponent, AssetUrlPipe, AuthInterceptor, AuthService, AutoSaveService, BackupsService, BackupsState, ClientsService, ClientsState, CommentComponent, CommentsComponent, CommentsService, ContentListCellDirective, ContentListCellResizeDirective, ContentListFieldComponent, ContentListHeaderComponent, ContentListWidthDirective, ContentMustExistGuard, ContentsColumnsPipe, ContentSelectorComponent, ContentSelectorItemComponent, ContentsService, ContentsState, ContentStatusComponent, ContentValueComponent, ContentValueEditorComponent, ContributorsService, ContributorsState, FileIconPipe, FilterComparisonComponent, FilterLogicalComponent, FilterNodeComponent, FilterOperatorPipe, GeolocationEditorComponent, HelpComponent, HelpMarkdownPipe, HelpService, HistoryComponent, HistoryListComponent, HistoryMessagePipe, HistoryService, IFrameCardComponent, ImageCropperComponent, ImageFocusPointComponent, LanguagesService, LanguagesState, LoadAppsGuard, LoadLanguagesGuard, LoadSchemasGuard, LoadTeamsGuard, MarkdownEditorComponent, MustBeAuthenticatedGuard, MustBeNotAuthenticatedGuard, NewsService, NotifoComponent, PlansService, PlansState, PreviewableType, QueryComponent, QueryListComponent, QueryPathComponent, RandomCatCardComponent, RandomDogCardComponent, ReferenceInputComponent, RichEditorComponent, RolesService, RolesState, RuleEventsState, RuleMustExistGuard, RuleSimulatorState, RulesService, RulesState, SavedQueriesComponent, SchemaCategoryComponent, SchemaMustExistGuard, SchemaMustExistPublishedGuard, SchemaMustNotBeSingletonGuard, SchemasService, SchemasState, SchemaTagSource, SearchFormComponent, SearchService, SortingComponent, StockPhotoService, SupportCardComponent, TableHeaderComponent, TeamFormComponent, TeamMustExistGuard, TeamsService, TeamsState, TemplatesService, TemplatesState, TranslationsService, TranslationStatusComponent, UIService, UIState, UnsetAppGuard, UnsetTeamGuard, UsagesService, UserDtoPicture, UserIdPicturePipe, UserNamePipe, UserNameRefPipe, UserPicturePipe, UserPictureRefPipe, UsersProviderService, UsersService, WatchingUsersComponent, WorkflowsService, WorkflowsState } from './declarations';
@NgModule({
imports: [
ChartModule,
DragDropModule,
MentionModule,
NgChartsModule,
NgxDocViewerModule,
RouterModule,
SqxFrameworkModule,

56
frontend/src/polyfills.ts

@ -1,56 +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 recent versions of Safari, Chrome (including
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
// Global for graphiql.
(window as any).global = window;
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (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__UNPATCHED_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
*/

26
frontend/src/test.ts

@ -1,26 +0,0 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
<T>(id: string): T;
keys(): string[];
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

3
frontend/tsconfig.app.json

@ -5,8 +5,7 @@
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
"src/main.ts"
],
"include": [
"src/**/*.d.ts"

9
frontend/tsconfig.json

@ -22,16 +22,17 @@
"strict": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es2020",
"target": "ES2022",
"lib": [
"es2020",
"dom"
],
"paths": {
"@app*": [
"src/app*"
]
"@app*": [
"src/app*"
]
},
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,

4
frontend/tsconfig.spec.json

@ -7,10 +7,6 @@
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"

Loading…
Cancel
Save