mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: update to node 22
This commit is contained in:
@@ -21,7 +21,7 @@ import {ModalController, Platform} from '@ionic/angular/standalone';
|
||||
|
||||
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';
|
||||
@@ -158,7 +158,6 @@ export function createTranslateLoader(http: HttpClient) {
|
||||
JobModule,
|
||||
FavoritesModule,
|
||||
LibraryModule,
|
||||
HttpClientModule,
|
||||
ProfilePageModule,
|
||||
FeedbackModule,
|
||||
MapModule,
|
||||
@@ -220,6 +219,7 @@ export function createTranslateLoader(http: HttpClient) {
|
||||
multi: true,
|
||||
},
|
||||
provideIonicAngular(),
|
||||
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);
|
||||
|
||||
@@ -37,8 +37,5 @@
|
||||
{{ 'dashboard.jobs.noJobs' | translate }}
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/jobs']">
|
||||
<ion-icon slot="icon-only" name="search" [size]="24"></ion-icon>
|
||||
</ion-button>
|
||||
}
|
||||
</stapps-section>
|
||||
|
||||
@@ -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 {
|
||||
@@ -224,12 +224,33 @@ import {IonIconDirective} from 'src/app/util/ion-icon/ion-icon.directive';
|
||||
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,
|
||||
MarkdownModule.forRoot(),
|
||||
MenuModule,
|
||||
IonIconDirective,
|
||||
@@ -301,28 +322,7 @@ import {IonIconDirective} from 'src/app/util/ion-icon/ion-icon.directive';
|
||||
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 {TranslateModule} from '@ngx-translate/core';
|
||||
@@ -72,7 +72,6 @@ import {IonIconDirective} from 'src/app/util/ion-icon/ion-icon.directive';
|
||||
FormsModule,
|
||||
HebisRoutingModule,
|
||||
IonIconDirective,
|
||||
HttpClientModule,
|
||||
MarkdownModule.forRoot(),
|
||||
MenuModule,
|
||||
MomentModule.forRoot({
|
||||
@@ -103,6 +102,11 @@ import {IonIconDirective} from 'src/app/util/ion-icon/ion-icon.directive';
|
||||
IonItem,
|
||||
IonThumbnail,
|
||||
],
|
||||
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