MME-34 Remove @tanstack/angular dependency.
This commit is contained in:
parent
4a271ecd10
commit
7887295c34
@ -32,7 +32,6 @@
|
||||
"@angular/router": "^21.0.0",
|
||||
"@fortawesome/angular-fontawesome": "^4.0.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
||||
"@tanstack/angular-query-experimental": "^5.90.16",
|
||||
"ngx-toastr": "^20.0.5",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0"
|
||||
|
||||
@ -3,8 +3,6 @@ import { provideRouter } from '@angular/router';
|
||||
import { routes } from './app.routes';
|
||||
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
||||
import { authInterceptor } from './shared/interceptors/auth.interceptor';
|
||||
import { provideTanStackQuery, QueryClient } from '@tanstack/angular-query-experimental';
|
||||
import { withDevtools } from '@tanstack/angular-query-experimental/devtools';
|
||||
import { provideToastr } from 'ngx-toastr';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
@ -12,16 +10,6 @@ export const appConfig: ApplicationConfig = {
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideRouter(routes),
|
||||
provideHttpClient(withInterceptors([authInterceptor])),
|
||||
provideTanStackQuery(
|
||||
new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
experimental_prefetchInRender: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
withDevtools(),
|
||||
),
|
||||
provideToastr(),
|
||||
],
|
||||
};
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { EnterRecipeData } from './enter-recipe-data';
|
||||
import { provideQueryClient, QueryClient } from '@tanstack/angular-query-experimental';
|
||||
import { inputBinding } from '@angular/core';
|
||||
import { RecipeDraftViewModel } from '../../../../shared/models/RecipeDraftView.model';
|
||||
|
||||
@ -9,17 +8,9 @@ describe('EnterRecipeData', () => {
|
||||
let fixture: ComponentFixture<EnterRecipeData>;
|
||||
|
||||
beforeEach(async () => {
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [EnterRecipeData],
|
||||
providers: [provideQueryClient(queryClient)],
|
||||
providers: [],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EnterRecipeData, {
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RecipeEditForm } from './recipe-edit-form';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { inputBinding } from '@angular/core';
|
||||
import { UserInfoView } from '../../models/UserInfoView.model';
|
||||
import { RecipeDraftViewModel } from '../../models/RecipeDraftView.model';
|
||||
import { provideQueryClient, QueryClient } from '@tanstack/angular-query-experimental';
|
||||
import { ImageService } from '../../services/ImageService';
|
||||
import { of } from 'rxjs';
|
||||
import { SliceView, SliceViewMeta } from '../../models/SliceView.model';
|
||||
@ -16,14 +14,6 @@ describe('RecipeEditForm', () => {
|
||||
let fixture: ComponentFixture<RecipeEditForm>;
|
||||
|
||||
beforeEach(async () => {
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const imageServiceMock = {
|
||||
getOwnedImagesCount: vi.fn(() => of(0)),
|
||||
getOwnedImageViewsWithBlobUrls: vi.fn(() =>
|
||||
@ -38,7 +28,6 @@ describe('RecipeEditForm', () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [RecipeEditForm],
|
||||
providers: [
|
||||
provideQueryClient(queryClient),
|
||||
{
|
||||
provide: ImageService,
|
||||
useValue: imageServiceMock,
|
||||
|
||||
@ -2,7 +2,6 @@ import { inject, Injectable, Signal, signal } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { LoginView } from '../models/LoginView.model';
|
||||
import { firstValueFrom, Observable, tap } from 'rxjs';
|
||||
import { QueryClient } from '@tanstack/angular-query-experimental';
|
||||
import { Router } from '@angular/router';
|
||||
import { EndpointService } from './EndpointService';
|
||||
|
||||
@ -17,7 +16,6 @@ export class AuthService {
|
||||
public readonly username: Signal<string | null> = this._username;
|
||||
|
||||
private readonly http = inject(HttpClient);
|
||||
private readonly queryClient = inject(QueryClient);
|
||||
private readonly router = inject(Router);
|
||||
private readonly endpointService = inject(EndpointService);
|
||||
|
||||
@ -33,7 +31,6 @@ export class AuthService {
|
||||
);
|
||||
this._accessToken.set(loginView.accessToken);
|
||||
this._username.set(loginView.username);
|
||||
await this.queryClient.invalidateQueries();
|
||||
return loginView;
|
||||
}
|
||||
|
||||
@ -42,7 +39,6 @@ export class AuthService {
|
||||
this._username.set(null);
|
||||
this._accessToken.set(null);
|
||||
await this.router.navigate(['/']);
|
||||
await this.queryClient.invalidateQueries();
|
||||
}
|
||||
|
||||
public refresh(): Observable<LoginView> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user