Update to Angular 9

This commit is contained in:
2026-03-22 08:43:45 +01:00
parent 3addbc1a4e
commit 3045419fe8
7 changed files with 7281 additions and 387 deletions
+7254 -362
View File
File diff suppressed because it is too large Load Diff
+16 -15
View File
@@ -50,23 +50,24 @@
"webpack-cli": "^3.3.12" "webpack-cli": "^3.3.12"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "^8.2.4", "@angular-devkit/build-angular": "^0.900.7",
"@angular/cdk": "^8.1.4", "@angular/animations": "^9.1.13",
"@angular/common": "^8.2.4", "@angular/cdk": "^9.2.4",
"@angular/compiler": "^8.2.4", "@angular/common": "^9.1.13",
"@angular/compiler-cli": "^8.2.4", "@angular/compiler": "^9.1.13",
"@angular/core": "^8.2.4", "@angular/compiler-cli": "^9.1.13",
"@angular/forms": "^8.2.4", "@angular/core": "^9.1.13",
"@angular/platform-browser": "^8.2.4", "@angular/forms": "^9.1.13",
"@angular/platform-browser-dynamic": "^8.2.4", "@angular/platform-browser": "^9.1.13",
"@angular/platform-browser-dynamic": "^9.1.13",
"@angular/platform-server": "^8.2.4", "@angular/platform-server": "^8.2.4",
"@angular/router": "^8.2.4", "@angular/router": "^9.1.13",
"@encharm/cws": "^4.0.2", "@encharm/cws": "^4.0.2",
"@fortawesome/angular-fontawesome": "^0.5.0", "@fortawesome/angular-fontawesome": "^0.5.0",
"@fortawesome/fontawesome-svg-core": "^1.2.22", "@fortawesome/fontawesome-svg-core": "^1.2.22",
"@fortawesome/free-brands-svg-icons": "^5.10.2", "@fortawesome/free-brands-svg-icons": "^5.10.2",
"@fortawesome/free-solid-svg-icons": "^5.10.2", "@fortawesome/free-solid-svg-icons": "^5.10.2",
"@ngtools/webpack": "^8.3.1", "@ngtools/webpack": "^9.1.15",
"@passport-next/passport-facebook": "^3.1.2", "@passport-next/passport-facebook": "^3.1.2",
"@passport-next/passport-google-oauth2": "^1.0.0", "@passport-next/passport-google-oauth2": "^1.0.0",
"@types/base64-js": "^1.2.5", "@types/base64-js": "^1.2.5",
@@ -188,7 +189,7 @@
"request": "^2.88.0", "request": "^2.88.0",
"request-promise": "^4.2.4", "request-promise": "^4.2.4",
"rollbar": "^2.12.2", "rollbar": "^2.12.2",
"rxjs": "^6.5.2", "rxjs": "^6.6.7",
"sass": "^1.58.3", "sass": "^1.58.3",
"sass-loader": "^13.3.3", "sass-loader": "^13.3.3",
"serve-favicon": "^2.5.0", "serve-favicon": "^2.5.0",
@@ -198,13 +199,13 @@
"timsort": "^0.3.0", "timsort": "^0.3.0",
"tracer": "^1.0.1", "tracer": "^1.0.1",
"transliteration": "1.6.6", "transliteration": "1.6.6",
"ts-loader": "^6.0.4", "ts-loader": "^6.2.2",
"ts-node": "^8.3.0", "ts-node": "^8.3.0",
"tsickle": "^0.37.0", "tsickle": "^0.37.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"tslint": "^5.19.0", "tslint": "^5.19.0",
"tsutils": "^3.17.1", "tsutils": "^3.17.1",
"typescript": "<3.6.0", "typescript": "^3.8.3",
"ua-parser-js": "^0.7.20", "ua-parser-js": "^0.7.20",
"uglifyjs-webpack-plugin": "^1.3.0", "uglifyjs-webpack-plugin": "^1.3.0",
"webgl-debug": "^2.0.1", "webgl-debug": "^2.0.1",
@@ -214,6 +215,6 @@
"workbox-cli": "^4.3.1", "workbox-cli": "^4.3.1",
"wrapper-webpack-plugin": "^2.1.0", "wrapper-webpack-plugin": "^2.1.0",
"yargs": "^14.0.0", "yargs": "^14.0.0",
"zone.js": "^0.10.2" "zone.js": "^0.10.3"
} }
} }
+1 -1
View File
@@ -24,7 +24,7 @@ function loadSpriteSheet(sheet: SpriteSheet, loadImage: LoadImage) {
sheet.srcA ? loadImage(sheet.srcA) : Promise.resolve(undefined) sheet.srcA ? loadImage(sheet.srcA) : Promise.resolve(undefined)
]) ])
.then(([img, imgA]) => { .then(([img, imgA]) => {
sheet.data = getImageData(img); sheet.data = getImageData(img!);
if (imgA) { if (imgA) {
const alpha = getImageData(imgA); const alpha = getImageData(imgA);
+1 -1
View File
@@ -12,7 +12,7 @@ export function getWebGLContext(canvas: HTMLCanvasElement): WebGLRenderingContex
let gl = canvas.getContext('webgl2', options) let gl = canvas.getContext('webgl2', options)
|| canvas.getContext('webgl', options) || canvas.getContext('webgl', options)
|| canvas.getContext('experimental-webgl', options); || canvas.getContext('experimental-webgl', options) as WebGLRenderingContext;
if (!gl) { if (!gl) {
throw new Error(WEBGL_CREATION_ERROR); throw new Error(WEBGL_CREATION_ERROR);
+2 -2
View File
@@ -238,8 +238,8 @@ export async function getAccountDetails(accountId: ID): Promise<AccountDetails>
merges: account.merges || [], merges: account.merges || [],
banLog: account.banLog || [], banLog: account.banLog || [],
supporterLog: account.supporterLog || [], supporterLog: account.supporterLog || [],
invitesReceived: invitesReceived.map(convertInvite), invitesReceived: invitesReceived!.map(convertInvite),
invitesSent: invitesSent.map(convertInvite), invitesSent: invitesSent!.map(convertInvite),
state: account.state || {}, state: account.state || {},
} : { } : {
merges: [], merges: [],
+4 -3
View File
@@ -119,11 +119,12 @@ async function merge(
const merges = mergeLists(account.merges, merge.merges, 20); const merges = mergeLists(account.merges, merge.merges, 20);
const state = mergeStates(account.state, merge.state); const state = mergeStates(account.state, merge.state);
const alert = account.alert || merge.alert; const alert = account.alert || merge.alert;
merges.push({ id: withId, name: merge.name, date: new Date(), reason, data }); merges.push({ id: withId, name: merge.name, date: new Date(), reason, data } as any);
const update: Partial<AccountBase<string>> = { const update: Partial<AccountBase<string>> = {
origins, ignores, emails, note, lastVisit, ban, shadow, mute, flags, counters, patreon, supporter, merges, origins, ignores, emails, note, lastVisit, ban, shadow, mute, flags,
createdAt, supporterLog, supporterTotal, banLog, state, alert, birthdate, counters, patreon, supporter, merges: merges as any, createdAt, supporterLog: supporterLog as any,
supporterTotal, banLog: banLog as any, state, alert, birthdate,
}; };
await Promise.all([ await Promise.all([
+3 -3
View File
@@ -2,7 +2,7 @@ import { uniq } from 'lodash';
import { Types } from 'mongoose'; import { Types } from 'mongoose';
import { Profile } from '../common/interfaces'; import { Profile } from '../common/interfaces';
import { arraysEqual } from '../common/utils'; import { arraysEqual } from '../common/utils';
import { IAccount, IAuth, Auth, findAuthByOpenId, updateAuth, UpdateAuth, Account } from './db'; import { IAccount, IAuth, Auth, findAuthByOpenId, updateAuth, UpdateAuth, Account, MongoUpdate } from './db';
import { system } from './logger'; import { system } from './logger';
import { UserError } from './userError'; import { UserError } from './userError';
import { CreateAccountOptions, connectOnlySocialError } from './accountUtils'; import { CreateAccountOptions, connectOnlySocialError } from './accountUtils';
@@ -48,7 +48,7 @@ export async function updateAuthInfo(
if (!auth) if (!auth)
return; return;
const changes: Partial<IAuth> = {}; const changes: MongoUpdate<IAuth> = {};
if (profile.url && auth.url !== profile.url) { if (profile.url && auth.url !== profile.url) {
changes.url = profile.url; changes.url = profile.url;
@@ -91,7 +91,7 @@ async function createAuth(profile: Profile, account: string | undefined) {
} }
async function verifyOrRestoreAuth(auth: IAuth, mergeAccount: string | undefined) { async function verifyOrRestoreAuth(auth: IAuth, mergeAccount: string | undefined) {
const changes: Partial<IAuth> = { lastUsed: new Date() }; const changes: MongoUpdate<IAuth> = { lastUsed: new Date() };
if (auth.disabled || auth.banned) { if (auth.disabled || auth.banned) {
if (!auth.banned && auth.account && !!mergeAccount) { if (!auth.banned && auth.account && !!mergeAccount) {