mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 22:42:54 +00:00
refactor: base migration to Angular v18
This commit is contained in:
@@ -51,13 +51,13 @@
|
||||
"test:integration": "sh integration-test.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "17.3.0",
|
||||
"@angular/cdk": "17.3.0",
|
||||
"@angular/common": "17.3.0",
|
||||
"@angular/core": "17.3.0",
|
||||
"@angular/forms": "17.3.0",
|
||||
"@angular/platform-browser": "17.3.0",
|
||||
"@angular/router": "17.3.0",
|
||||
"@angular/animations": "18.0.1",
|
||||
"@angular/cdk": "18.0.1",
|
||||
"@angular/common": "18.0.1",
|
||||
"@angular/core": "18.0.1",
|
||||
"@angular/forms": "18.0.1",
|
||||
"@angular/platform-browser": "18.0.1",
|
||||
"@angular/router": "18.0.1",
|
||||
"@awesome-cordova-plugins/calendar": "6.6.0",
|
||||
"@awesome-cordova-plugins/core": "6.6.0",
|
||||
"@capacitor/app": "5.0.7",
|
||||
@@ -111,21 +111,21 @@
|
||||
"zone.js": "0.14.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/architect": "0.1703.0",
|
||||
"@angular-devkit/build-angular": "17.3.0",
|
||||
"@angular-devkit/core": "17.3.0",
|
||||
"@angular-devkit/schematics": "17.3.0",
|
||||
"@angular-eslint/builder": "17.3.0",
|
||||
"@angular-eslint/eslint-plugin": "17.3.0",
|
||||
"@angular-eslint/eslint-plugin-template": "17.3.0",
|
||||
"@angular-eslint/schematics": "17.3.0",
|
||||
"@angular-eslint/template-parser": "17.3.0",
|
||||
"@angular/cli": "17.3.0",
|
||||
"@angular/compiler": "17.3.0",
|
||||
"@angular/compiler-cli": "17.3.0",
|
||||
"@angular-devkit/architect": "0.1800.2",
|
||||
"@angular-devkit/build-angular": "18.0.2",
|
||||
"@angular-devkit/core": "18.0.2",
|
||||
"@angular-devkit/schematics": "18.0.2",
|
||||
"@angular-eslint/builder": "18.0.1",
|
||||
"@angular-eslint/eslint-plugin": "18.0.1",
|
||||
"@angular-eslint/eslint-plugin-template": "18.0.1",
|
||||
"@angular-eslint/schematics": "18.0.1",
|
||||
"@angular-eslint/template-parser": "18.0.1",
|
||||
"@angular/cli": "18.0.2",
|
||||
"@angular/compiler": "18.0.1",
|
||||
"@angular/compiler-cli": "18.0.1",
|
||||
"@angular/language-server": "17.3.0",
|
||||
"@angular/language-service": "17.3.0",
|
||||
"@angular/platform-browser-dynamic": "17.3.0",
|
||||
"@angular/language-service": "18.0.1",
|
||||
"@angular/platform-browser-dynamic": "18.0.1",
|
||||
"@capacitor/android": "5.7.3",
|
||||
"@capacitor/assets": "3.0.4",
|
||||
"@capacitor/cli": "5.7.3",
|
||||
|
||||
@@ -21,7 +21,7 @@ import {ModalController, Platform} from '@ionic/angular';
|
||||
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {ThingTranslateService} from './translation/thing-translate.service';
|
||||
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||
import {provideHttpClientTesting} from '@angular/common/http/testing';
|
||||
import {AppComponent} from './app.component';
|
||||
import {AuthModule} from './modules/auth/auth.module';
|
||||
import {ConfigProvider} from './modules/config/config.provider';
|
||||
@@ -32,6 +32,7 @@ import {ScheduleSyncService} from './modules/background/schedule/schedule-sync.s
|
||||
import {sampleAuthConfiguration} from './_helpers/data/sample-configuration';
|
||||
import {StorageProvider} from './modules/storage/storage.provider';
|
||||
import {SimpleBrowser} from './util/browser.factory';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
let platformReadySpy: any;
|
||||
@@ -75,8 +76,9 @@ describe('AppComponent', () => {
|
||||
modalController = jasmine.createSpyObj('ModalController', ['create', 'dismiss', 'getTop']);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [RouterTestingModule.withRoutes([]), HttpClientTestingModule, AuthModule],
|
||||
declarations: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
imports: [RouterTestingModule.withRoutes([]), AuthModule],
|
||||
providers: [
|
||||
{provide: Platform, useValue: platformSpy},
|
||||
{provide: TranslateService, useValue: translateServiceSpy},
|
||||
@@ -88,8 +90,9 @@ describe('AppComponent', () => {
|
||||
{provide: StorageProvider, useValue: storageProvider},
|
||||
{provide: SimpleBrowser, useValue: simpleBrowser},
|
||||
{provide: ModalController, useValue: modalController},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {CommonModule, LocationStrategy, PathLocationStrategy, registerLocaleData} from '@angular/common';
|
||||
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http';
|
||||
import {HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import localeDe from '@angular/common/locales/de';
|
||||
import {APP_INITIALIZER, NgModule} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
@@ -161,7 +161,6 @@ export function createTranslateLoader(http: HttpClient) {
|
||||
JobModule,
|
||||
FavoritesModule,
|
||||
LibraryModule,
|
||||
HttpClientModule,
|
||||
ProfilePageModule,
|
||||
FeedbackModule,
|
||||
MapModule,
|
||||
@@ -221,6 +220,7 @@ export function createTranslateLoader(http: HttpClient) {
|
||||
useClass: ServiceHandlerInterceptor,
|
||||
multi: true,
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
})
|
||||
export class AppModule {
|
||||
|
||||
@@ -22,7 +22,7 @@ import {Requestor, StorageBackend} from '@openid/appauth';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {PAIAAuthService} from './paia/paia-auth.service';
|
||||
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {SimpleBrowser} from '../../util/browser.factory';
|
||||
import {LoggerTestingModule} from 'ngx-logger/testing';
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('AuthHelperService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule, LoggerTestingModule],
|
||||
imports: [LoggerTestingModule],
|
||||
providers: [
|
||||
StAppsWebHttpClient,
|
||||
{
|
||||
@@ -88,6 +88,7 @@ describe('AuthHelperService', () => {
|
||||
provide: SimpleBrowser,
|
||||
useValue: simpleBrowserMock,
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
});
|
||||
authHelperService = TestBed.inject(AuthHelperService);
|
||||
|
||||
@@ -20,7 +20,7 @@ import {Browser} from 'ionic-appauth';
|
||||
import {nowInSeconds, Requestor, StorageBackend} from '@openid/appauth';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {IonicStorage} from 'ionic-appauth/lib';
|
||||
import {RouterModule} from '@angular/router';
|
||||
import {LoggerTestingModule} from 'ngx-logger/testing';
|
||||
@@ -35,7 +35,7 @@ describe('AuthService', () => {
|
||||
storageBackendSpy = jasmine.createSpyObj('StorageBackend', ['getItem']);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule, LoggerTestingModule, RouterModule.forRoot([])],
|
||||
imports: [LoggerTestingModule, RouterModule.forRoot([])],
|
||||
providers: [
|
||||
StAppsWebHttpClient,
|
||||
{
|
||||
@@ -54,6 +54,7 @@ describe('AuthService', () => {
|
||||
useValue: storageBackendSpy,
|
||||
},
|
||||
Requestor,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
});
|
||||
defaultAuthService = TestBed.inject(DefaultAuthService);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import {ScrollingModule} from '@angular/cdk/scrolling';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {IonicModule, Platform} from '@ionic/angular';
|
||||
@@ -181,12 +181,33 @@ import {ShareButtonComponent} from './elements/share-button.component';
|
||||
PeriodicalDetailContentComponent,
|
||||
ShareButtonComponent,
|
||||
],
|
||||
exports: [
|
||||
DataDetailComponent,
|
||||
DataDetailContentComponent,
|
||||
DataIconPipe,
|
||||
DataListComponent,
|
||||
DataListItemComponent,
|
||||
DateSeriesListItemComponent,
|
||||
PlaceListItemComponent,
|
||||
SimpleCardComponent,
|
||||
SkeletonListItemComponent,
|
||||
SkeletonSimpleCardComponent,
|
||||
SearchPageComponent,
|
||||
SimpleDataListComponent,
|
||||
OriginDetailComponent,
|
||||
FavoriteButtonComponent,
|
||||
TreeListComponent,
|
||||
ExternalLinkComponent,
|
||||
ArticleDetailContentComponent,
|
||||
BookDetailContentComponent,
|
||||
PeriodicalDetailContentComponent,
|
||||
TitleCardComponent,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
DataRoutingModule,
|
||||
FormsModule,
|
||||
MapWidgetComponent,
|
||||
HttpClientModule,
|
||||
IonicModule.forRoot(),
|
||||
MarkdownModule.forRoot(),
|
||||
MenuModule,
|
||||
@@ -218,28 +239,7 @@ import {ShareButtonComponent} from './elements/share-button.component';
|
||||
useFactory: browserFactory,
|
||||
deps: [Platform],
|
||||
},
|
||||
],
|
||||
exports: [
|
||||
DataDetailComponent,
|
||||
DataDetailContentComponent,
|
||||
DataIconPipe,
|
||||
DataListComponent,
|
||||
DataListItemComponent,
|
||||
DateSeriesListItemComponent,
|
||||
PlaceListItemComponent,
|
||||
SimpleCardComponent,
|
||||
SkeletonListItemComponent,
|
||||
SkeletonSimpleCardComponent,
|
||||
SearchPageComponent,
|
||||
SimpleDataListComponent,
|
||||
OriginDetailComponent,
|
||||
FavoriteButtonComponent,
|
||||
TreeListComponent,
|
||||
ExternalLinkComponent,
|
||||
ArticleDetailContentComponent,
|
||||
BookDetailContentComponent,
|
||||
PeriodicalDetailContentComponent,
|
||||
TitleCardComponent,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
})
|
||||
export class DataModule {}
|
||||
|
||||
@@ -21,7 +21,7 @@ import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
|
||||
import {StorageProvider} from '../storage/storage.provider';
|
||||
import {LoggerTestingModule} from 'ngx-logger/testing';
|
||||
import {MapModule} from '../map/map.module';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {StorageModule} from '../storage/storage.module';
|
||||
import {DaiaHolding, DaiaService} from './protocol/response';
|
||||
import {Observable, of} from 'rxjs';
|
||||
@@ -47,7 +47,6 @@ describe('DaiaDataProvider', () => {
|
||||
imports: [
|
||||
HebisModule,
|
||||
MapModule,
|
||||
HttpClientModule,
|
||||
StorageModule,
|
||||
LoggerTestingModule,
|
||||
TranslateModule.forRoot({
|
||||
@@ -62,6 +61,7 @@ describe('DaiaDataProvider', () => {
|
||||
StAppsWebHttpClient,
|
||||
StorageProvider,
|
||||
DaiaDataProvider,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
});
|
||||
daiaDataProvider = TestBed.inject(DaiaDataProvider);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import {ScrollingModule} from '@angular/cdk/scrolling';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {IonicModule} from '@ionic/angular';
|
||||
@@ -54,7 +54,6 @@ import {DaiaHoldingComponent} from './daia-availability/daia-holding.component';
|
||||
FormsModule,
|
||||
HebisRoutingModule,
|
||||
IonIconModule,
|
||||
HttpClientModule,
|
||||
IonicModule.forRoot(),
|
||||
MarkdownModule.forRoot(),
|
||||
MenuModule,
|
||||
@@ -69,6 +68,11 @@ import {DaiaHoldingComponent} from './daia-availability/daia-holding.component';
|
||||
ThingTranslateModule.forChild(),
|
||||
UtilModule,
|
||||
],
|
||||
providers: [HebisDataProvider, DaiaDataProvider, StAppsWebHttpClient],
|
||||
providers: [
|
||||
HebisDataProvider,
|
||||
DaiaDataProvider,
|
||||
StAppsWebHttpClient,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
})
|
||||
export class HebisModule {}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {MapModule} from './map.module';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
import {StorageModule} from '../storage/storage.module';
|
||||
import {MapPosition, PositionService} from './position.service';
|
||||
import {ConfigProvider} from '../config/config.provider';
|
||||
@@ -39,12 +39,13 @@ describe('PositionService', () => {
|
||||
},
|
||||
});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MapModule, HttpClientModule, StorageModule, LoggerTestingModule],
|
||||
imports: [MapModule, StorageModule, LoggerTestingModule],
|
||||
providers: [
|
||||
{
|
||||
provider: ConfigProvider,
|
||||
useValue: configProviderMock,
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
});
|
||||
positionService = TestBed.inject(PositionService);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||
import {provideHttpClientTesting} from '@angular/common/http/testing';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
import {AuthModule} from '../../auth/auth.module';
|
||||
import {ProfilePageComponent} from './profile-page.component';
|
||||
@@ -27,6 +27,7 @@ import {ScheduleProvider} from '../../calendar/schedule.provider';
|
||||
import {DataProvider} from '../../data/data.provider';
|
||||
import {StAppsWebHttpClient} from '../../data/stapps-web-http-client.provider';
|
||||
import {SimpleBrowser} from '../../../util/browser.factory';
|
||||
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||
|
||||
describe('ProfilePage', () => {
|
||||
let component: ProfilePageComponent;
|
||||
@@ -47,7 +48,8 @@ describe('ProfilePage', () => {
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ProfilePageComponent],
|
||||
imports: [HttpClientTestingModule, RouterTestingModule, AuthModule, TranslateModule.forRoot()],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
imports: [RouterTestingModule, AuthModule, TranslateModule.forRoot()],
|
||||
providers: [
|
||||
{provide: ConfigProvider, useValue: configProvider},
|
||||
{provide: StorageProvider, useValue: storageProvider},
|
||||
@@ -55,8 +57,9 @@ describe('ProfilePage', () => {
|
||||
{provide: SimpleBrowser, useValue: simpleBrowser},
|
||||
ScheduleProvider,
|
||||
DataProvider,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user