Update to Angular 18 (#3309)

This commit is contained in:
Joe Milazzo 2024-10-25 13:55:49 -07:00 committed by GitHub
parent eacf2b9a5a
commit d563ebf3d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 2220 additions and 8310 deletions

View File

@ -6,12 +6,12 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.1.0" /> <PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.29" /> <PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.29" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" /> <PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" />
<PackageReference Include="xunit" Version="2.9.1" /> <PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"> <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>

View File

@ -55,41 +55,41 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CsvHelper" Version="33.0.1" /> <PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="MailKit" Version="4.7.1.1" /> <PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="Docnet.Core" Version="2.6.0" /> <PackageReference Include="Docnet.Core" Version="2.6.0" />
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" /> <PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
<PackageReference Include="ExCSS" Version="4.2.5" /> <PackageReference Include="ExCSS" Version="4.3.0" />
<PackageReference Include="Flurl" Version="3.0.7" /> <PackageReference Include="Flurl" Version="3.0.7" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Hangfire" Version="1.8.14" /> <PackageReference Include="Hangfire" Version="1.8.15" />
<PackageReference Include="Hangfire.InMemory" Version="1.0.0" /> <PackageReference Include="Hangfire.InMemory" Version="1.0.0" />
<PackageReference Include="Hangfire.MaximumConcurrentExecutions" Version="1.1.0" /> <PackageReference Include="Hangfire.MaximumConcurrentExecutions" Version="1.1.0" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.4.2" /> <PackageReference Include="Hangfire.Storage.SQLite" Version="0.4.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.66" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.69" />
<PackageReference Include="MarkdownDeep.NET.Core" Version="1.5.0.4" /> <PackageReference Include="MarkdownDeep.NET.Core" Version="1.5.0.4" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" /> <PackageReference Include="Hangfire.AspNetCore" Version="1.8.15" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.8" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.8" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" /> <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="MimeTypeMapOfficial" Version="1.0.17" /> <PackageReference Include="MimeTypeMapOfficial" Version="1.0.17" />
<PackageReference Include="Nager.ArticleNumber" Version="1.0.7" /> <PackageReference Include="Nager.ArticleNumber" Version="1.0.7" />
<PackageReference Include="NetVips" Version="2.4.1" /> <PackageReference Include="NetVips" Version="2.4.2" />
<PackageReference Include="NetVips.Native" Version="8.15.3" /> <PackageReference Include="NetVips.Native" Version="8.15.3" />
<PackageReference Include="NReco.Logging.File" Version="1.2.1" /> <PackageReference Include="NReco.Logging.File" Version="1.2.1" />
<PackageReference Include="Serilog" Version="4.0.1" /> <PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" /> <PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.2" /> <PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Sinks.AspNetCore.SignalR" Version="0.4.0" /> <PackageReference Include="Serilog.Sinks.AspNetCore.SignalR" Version="0.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
@ -100,11 +100,11 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" /> <PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.0.2" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.2" />
<PackageReference Include="System.IO.Abstractions" Version="21.0.29" /> <PackageReference Include="System.IO.Abstractions" Version="21.0.29" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" /> <PackageReference Include="System.Drawing.Common" Version="8.0.10" />
<PackageReference Include="VersOne.Epub" Version="3.3.2" /> <PackageReference Include="VersOne.Epub" Version="3.3.2" />
</ItemGroup> </ItemGroup>

View File

@ -13,11 +13,11 @@
<PackageReference Include="DotNet.Glob" Version="3.1.3" /> <PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167"> <PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="xunit.assert" Version="2.9.1" /> <PackageReference Include="xunit.assert" Version="2.9.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -24,13 +24,14 @@
"prefix": "app", "prefix": "app",
"architect": { "architect": {
"build": { "build": {
"builder": "@angular-devkit/build-angular:application", "builder": "@angular/build:application",
"options": { "options": {
"outputPath": "dist", "outputPath": "dist",
"index": "src/index.html", "index": "src/index.html",
"browser": "src/main.ts", "browser": "src/main.ts",
"polyfills": [ "polyfills": [
"zone.js" "@angular/localize/init",
"zone.js"
], ],
"inlineStyleLanguage": "scss", "inlineStyleLanguage": "scss",
"tsConfig": "tsconfig.app.json", "tsConfig": "tsconfig.app.json",
@ -87,7 +88,7 @@
"defaultConfiguration": "" "defaultConfiguration": ""
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular/build:dev-server",
"options": { "options": {
"sslKey": "./ssl/server.key", "sslKey": "./ssl/server.key",
"sslCert": "./ssl/server.crt", "sslCert": "./ssl/server.crt",
@ -101,7 +102,7 @@
} }
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular/build:extract-i18n",
"options": { "options": {
"buildTarget": "kavita-webui:build" "buildTarget": "kavita-webui:build"
} }

10324
UI/Web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,70 +16,69 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^17.3.4", "@angular-slider/ngx-slider": "^18.0.0",
"@angular/cdk": "^17.3.4", "@angular/animations": "^18.2.9",
"@angular/common": "^17.3.4", "@angular/cdk": "^18.2.10",
"@angular/compiler": "^17.3.4", "@angular/common": "^18.2.9",
"@angular/core": "^17.3.4", "@angular/compiler": "^18.2.9",
"@angular/forms": "^17.3.4", "@angular/core": "^18.2.9",
"@angular/localize": "^17.3.4", "@angular/forms": "^18.2.9",
"@angular/platform-browser": "^17.3.4", "@angular/localize": "^18.2.9",
"@angular/platform-browser-dynamic": "^17.3.4", "@angular/platform-browser": "^18.2.9",
"@angular/router": "^17.3.4", "@angular/platform-browser-dynamic": "^18.2.9",
"@fortawesome/fontawesome-free": "^6.5.2", "@angular/router": "^18.2.9",
"@fortawesome/fontawesome-free": "^6.6.0",
"@iharbeck/ngx-virtual-scroller": "^17.0.2", "@iharbeck/ngx-virtual-scroller": "^17.0.2",
"@iplab/ngx-file-upload": "^17.1.0", "@iplab/ngx-file-upload": "^18.0.0",
"@jsverse/transloco": "^7.4.3", "@jsverse/transloco": "^7.5.0",
"@jsverse/transloco-locale": "^7.0.1", "@jsverse/transloco-locale": "^7.0.1",
"@jsverse/transloco-persist-lang": "^7.0.1", "@jsverse/transloco-persist-lang": "^7.0.2",
"@jsverse/transloco-persist-translations": "^7.0.1", "@jsverse/transloco-persist-translations": "^7.0.1",
"@jsverse/transloco-preload-langs": "^7.0.1", "@jsverse/transloco-preload-langs": "^7.0.1",
"@microsoft/signalr": "^7.0.14", "@microsoft/signalr": "^8.0.7",
"@ng-bootstrap/ng-bootstrap": "^16.0.0", "@ng-bootstrap/ng-bootstrap": "^17.0.1",
"@popperjs/core": "^2.11.7", "@popperjs/core": "^2.11.7",
"@swimlane/ngx-charts": "^20.5.0", "@swimlane/ngx-charts": "^20.5.0",
"@tweenjs/tween.js": "^23.1.1", "@tweenjs/tween.js": "^23.1.3",
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"charts.css": "^1.1.0", "charts.css": "^1.1.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"luxon": "^3.4.4", "luxon": "^3.5.0",
"ng-circle-progress": "^1.7.1", "ng-circle-progress": "^1.7.1",
"ng-lazyload-image": "^9.1.3", "ng-lazyload-image": "^9.1.3",
"ng-select2-component": "^14.0.1", "ng-select2-component": "^14.0.1",
"ngx-color-picker": "^16.0.0", "ngx-color-picker": "^17.0.0",
"ngx-extended-pdf-viewer": "^18.1.9", "ngx-extended-pdf-viewer": "^21.4.6",
"ngx-file-drop": "^16.0.0", "ngx-file-drop": "^16.0.0",
"ngx-slider-v2": "^17.0.0",
"ngx-stars": "^1.6.5", "ngx-stars": "^1.6.5",
"ngx-toaster": "^1.0.1", "ngx-toastr": "^19.0.0",
"ngx-toastr": "^18.0.0",
"nosleep.js": "^0.12.0", "nosleep.js": "^0.12.0",
"rxjs": "^7.8.0", "rxjs": "^7.8.0",
"screenfull": "^6.0.2", "screenfull": "^6.0.2",
"swiper": "^8.4.6", "swiper": "^8.4.6",
"tslib": "^2.6.2", "tslib": "^2.8.0",
"zone.js": "^0.14.3" "zone.js": "^0.14.10"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^17.3.4", "@angular-eslint/builder": "^18.4.0",
"@angular-eslint/builder": "^17.3.0", "@angular-eslint/eslint-plugin": "^18.4.0",
"@angular-eslint/eslint-plugin": "^17.3.0", "@angular-eslint/eslint-plugin-template": "^18.4.0",
"@angular-eslint/eslint-plugin-template": "^17.3.0", "@angular-eslint/schematics": "^18.4.0",
"@angular-eslint/schematics": "^17.3.0", "@angular-eslint/template-parser": "^18.4.0",
"@angular-eslint/template-parser": "^17.3.0", "@angular/build": "^18.2.10",
"@angular/cli": "^17.3.4", "@angular/cli": "^18.2.10",
"@angular/compiler-cli": "^17.3.4", "@angular/compiler-cli": "^18.2.9",
"@types/d3": "^7.4.3", "@types/d3": "^7.4.3",
"@types/file-saver": "^2.0.7", "@types/file-saver": "^2.0.7",
"@types/luxon": "^3.4.0", "@types/luxon": "^3.4.0",
"@types/node": "^20.10.0", "@types/node": "^22.8.0",
"@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^7.2.0", "@typescript-eslint/parser": "^8.11.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"jsonminify": "^0.4.2", "jsonminify": "^0.4.2",
"karma-coverage": "~2.2.0", "karma-coverage": "~2.2.0",
"ts-node": "~10.9.1", "ts-node": "~10.9.1",
"typescript": "^5.2.2", "typescript": "^5.5.4",
"webpack-bundle-analyzer": "^4.10.2" "webpack-bundle-analyzer": "^4.10.2"
} }
} }

View File

@ -1,10 +1,5 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import { import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import { Observable, throwError } from 'rxjs'; import { Observable, throwError } from 'rxjs';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';

View File

@ -1,10 +1,5 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import { import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import {Observable, switchMap} from 'rxjs'; import {Observable, switchMap} from 'rxjs';
import { AccountService } from '../_services/account.service'; import { AccountService } from '../_services/account.service';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {Chapter} from "../_models/chapter"; import {Chapter} from "../_models/chapter";
import {TextResonse} from "../_types/text-response"; import {TextResonse} from "../_types/text-response";

View File

@ -1,4 +1,4 @@
import {HttpClient} from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {environment} from 'src/environments/environment'; import {environment} from 'src/environments/environment';
import {UserCollection} from '../_models/collection-tag'; import {UserCollection} from '../_models/collection-tag';

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {TextResonse} from "../_types/text-response"; import {TextResonse} from "../_types/text-response";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {DashboardStream} from "../_models/dashboard/dashboard-stream"; import {DashboardStream} from "../_models/dashboard/dashboard-stream";

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {ExternalSource} from "../_models/sidenav/external-source"; import {ExternalSource} from "../_models/sidenav/external-source";
import {TextResonse} from "../_types/text-response"; import {TextResonse} from "../_types/text-response";
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";

View File

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {SeriesFilterV2} from "../_models/metadata/v2/series-filter-v2"; import {SeriesFilterV2} from "../_models/metadata/v2/series-filter-v2";
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {JumpKey} from "../_models/jumpbar/jump-key"; import {JumpKey} from "../_models/jumpbar/jump-key";
import {SmartFilter} from "../_models/metadata/v2/smart-filter"; import {SmartFilter} from "../_models/metadata/v2/smart-filter";

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {Language} from "../_models/metadata/language"; import {Language} from "../_models/metadata/language";
@Injectable({ @Injectable({

View File

@ -1,4 +1,4 @@
import {HttpClient} from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {tap} from 'rxjs/operators'; import {tap} from 'rxjs/operators';
import {of} from 'rxjs'; import {of} from 'rxjs';

View File

@ -1,7 +1,7 @@
import {DOCUMENT} from '@angular/common'; import {DOCUMENT} from '@angular/common';
import {DestroyRef, inject, Inject, Injectable, Renderer2, RendererFactory2, RendererStyleFlags2} from '@angular/core'; import {DestroyRef, inject, Inject, Injectable, Renderer2, RendererFactory2, RendererStyleFlags2} from '@angular/core';
import {distinctUntilChanged, filter, ReplaySubject, take} from 'rxjs'; import {distinctUntilChanged, filter, ReplaySubject, take} from 'rxjs';
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {SideNavStream} from "../_models/sidenav/sidenav-stream"; import {SideNavStream} from "../_models/sidenav/sidenav-stream";
import {TextResonse} from "../_types/text-response"; import {TextResonse} from "../_types/text-response";

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {HttpClient, HttpParams} from "@angular/common/http"; import { HttpClient, HttpParams } from "@angular/common/http";
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {Person, PersonRole} from "../_models/metadata/person"; import {Person, PersonRole} from "../_models/metadata/person";
import {SeriesFilterV2} from "../_models/metadata/v2/series-filter-v2"; import {SeriesFilterV2} from "../_models/metadata/v2/series-filter-v2";

View File

@ -1,4 +1,4 @@
import {HttpClient, HttpParams} from '@angular/common/http'; import { HttpClient, HttpParams } from '@angular/common/http';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';

View File

@ -1,5 +1,5 @@
import {DOCUMENT} from '@angular/common'; import {DOCUMENT} from '@angular/common';
import {HttpClient} from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { import {
DestroyRef, DestroyRef,
inject, inject,

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from "../../environments/environment"; import {environment} from "../../environments/environment";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {Volume} from "../_models/volume"; import {Volume} from "../_models/volume";
import {TextResonse} from "../_types/text-response"; import {TextResonse} from "../_types/text-response";

View File

@ -121,18 +121,18 @@ export class AppComponent implements OnInit {
this.libraryService.getLibraryNames().pipe(take(1), shareReplay({refCount: true, bufferSize: 1})).subscribe(); this.libraryService.getLibraryNames().pipe(take(1), shareReplay({refCount: true, bufferSize: 1})).subscribe();
// Get the server version, compare vs localStorage, and if different bust locale cache // Get the server version, compare vs localStorage, and if different bust locale cache
const versionKey = 'kavita--version';
this.serverService.getVersion(user.apiKey).subscribe(version => { this.serverService.getVersion(user.apiKey).subscribe(version => {
const cachedVersion = localStorage.getItem('kavita--version'); const cachedVersion = localStorage.getItem(versionKey);
console.log('Kavita version: ', version, ' Running version: ', cachedVersion);
if (cachedVersion == null || cachedVersion != version) { if (cachedVersion == null || cachedVersion != version) {
// Bust locale cache // Bust locale cache
localStorage.removeItem('@transloco/translations/timestamp'); this.bustLocaleCache();
localStorage.removeItem('@transloco/translations'); localStorage.setItem(versionKey, version);
(this.translocoService as any).cache.delete(localStorage.getItem('kavita-locale') || 'en');
(this.translocoService as any).cache.clear();
localStorage.setItem('kavita--version', version);
location.reload(); location.reload();
} }
localStorage.setItem('kavita--version', version); localStorage.setItem(versionKey, version);
}); });
// Every hour, have the UI check for an update. People seriously stay out of date // Every hour, have the UI check for an update. People seriously stay out of date
@ -153,4 +153,12 @@ export class AppComponent implements OnInit {
) )
.subscribe(); .subscribe();
} }
private bustLocaleCache() {
localStorage.removeItem('@transloco/translations/timestamp');
localStorage.removeItem('@transloco/translations');
localStorage.removeItem('translocoLang');
(this.translocoService as any).cache.delete(localStorage.getItem('kavita-locale') || 'en');
(this.translocoService as any).cache.clear();
}
} }

View File

@ -30,7 +30,7 @@ import {
take, take,
tap tap
} from 'rxjs'; } from 'rxjs';
import {ChangeContext, LabelType, NgxSliderModule, Options} from 'ngx-slider-v2'; import {ChangeContext, LabelType, NgxSliderModule, Options} from '@angular-slider/ngx-slider';
import {animate, state, style, transition, trigger} from '@angular/animations'; import {animate, state, style, transition, trigger} from '@angular/animations';
import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms'; import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';
import {NgbModal, NgbProgressbar} from '@ng-bootstrap/ng-bootstrap'; import {NgbModal, NgbProgressbar} from '@ng-bootstrap/ng-bootstrap';

View File

@ -21,7 +21,6 @@
height="100vh" height="100vh"
[(page)]="currentPage" [(page)]="currentPage"
[textLayer]="true" [textLayer]="true"
[useBrowserLocale]="true"
[showHandToolButton]="true" [showHandToolButton]="true"
[showOpenFileButton]="false" [showOpenFileButton]="false"
[showPrintButton]="false" [showPrintButton]="false"

View File

@ -1,10 +1,4 @@
import { import { HttpEvent, HttpEventType, HttpHeaders, HttpProgressEvent, HttpResponse } from "@angular/common/http";
HttpEvent,
HttpEventType,
HttpHeaders,
HttpProgressEvent,
HttpResponse
} from "@angular/common/http";
import { Observable } from "rxjs"; import { Observable } from "rxjs";
import { scan } from "rxjs/operators"; import { scan } from "rxjs/operators";

View File

@ -7,7 +7,7 @@ import {FilterStatement} from "../../_models/metadata/v2/filter-statement";
import {FilterCombination} from "../../_models/metadata/v2/filter-combination"; import {FilterCombination} from "../../_models/metadata/v2/filter-combination";
import {FilterField} from "../../_models/metadata/v2/filter-field"; import {FilterField} from "../../_models/metadata/v2/filter-field";
import {FilterComparison} from "../../_models/metadata/v2/filter-comparison"; import {FilterComparison} from "../../_models/metadata/v2/filter-comparison";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {TextResonse} from "../../_types/text-response"; import {TextResonse} from "../../_types/text-response";
import {environment} from "../../../environments/environment"; import {environment} from "../../../environments/environment";
import {map, tap} from "rxjs/operators"; import {map, tap} from "rxjs/operators";

View File

@ -1,5 +1,5 @@
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import {Translation, TranslocoLoader} from "@jsverse/transloco"; import {Translation, TranslocoLoader} from "@jsverse/transloco";
import cacheBusting from 'i18n-cache-busting.json'; // allowSyntheticDefaultImports must be true import cacheBusting from 'i18n-cache-busting.json'; // allowSyntheticDefaultImports must be true

View File

@ -12,7 +12,7 @@ import { AppRoutingModule } from './app/app-routing.module';
import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser';
import { JwtInterceptor } from './app/_interceptors/jwt.interceptor'; import { JwtInterceptor } from './app/_interceptors/jwt.interceptor';
import { ErrorInterceptor } from './app/_interceptors/error.interceptor'; import { ErrorInterceptor } from './app/_interceptors/error.interceptor';
import {HTTP_INTERCEPTORS, withInterceptorsFromDi, provideHttpClient} from '@angular/common/http'; import { HTTP_INTERCEPTORS, withInterceptorsFromDi, provideHttpClient } from '@angular/common/http';
import { import {
provideTransloco, TranslocoConfig, provideTransloco, TranslocoConfig,
TranslocoService TranslocoService

View File

@ -6,20 +6,19 @@
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"removeComments": true, "removeComments": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"strict": true, "strict": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"sourceMap": true, "sourceMap": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"declaration": false, "declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"moduleResolution": "node", "moduleResolution": "node",
"importHelpers": true, "importHelpers": true,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "ES2022",
"useDefineForClassFields": false, "useDefineForClassFields": false,
"allowSyntheticDefaultImports": true,
"lib": [ "lib": [
"ES2022", "ES2022",
"dom" "dom"