diff --git a/angular.json b/angular.json index 690c7f2..9672c0f 100644 --- a/angular.json +++ b/angular.json @@ -48,10 +48,10 @@ "extractLicenses": false, "sourceMap": true, "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.development.ts" - } + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.development.ts" + } ] } }, diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 5e8ab64..9579269 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -17,7 +17,7 @@ export const routes: Routes = [ { path: 'recipe-upload', component: RecipeUploadPage, - canActivate: [authGuard] + canActivate: [authGuard], }, { path: 'recipes/:username/:slug', diff --git a/src/app/pages/recipe-upload-page/recipe-upload-trail/recipe-upload-trail.html b/src/app/pages/recipe-upload-page/recipe-upload-trail/recipe-upload-trail.html index 12f9e4c..ef3c04d 100644 --- a/src/app/pages/recipe-upload-page/recipe-upload-trail/recipe-upload-trail.html +++ b/src/app/pages/recipe-upload-page/recipe-upload-trail/recipe-upload-trail.html @@ -5,7 +5,7 @@ 'step-complete': step.completed, 'step-in-progress': step.inProgress, 'step-incomplete': !step.completed, - 'step-displayed': displayStep() === step.index + 'step-displayed': displayStep() === step.index, }" > @if (step.completed || step.inProgress) { diff --git a/src/app/pages/recipe-upload-page/steps/ai-or-manual/ai-or-manual.html b/src/app/pages/recipe-upload-page/steps/ai-or-manual/ai-or-manual.html index 3bff67e..7e49f62 100644 --- a/src/app/pages/recipe-upload-page/steps/ai-or-manual/ai-or-manual.html +++ b/src/app/pages/recipe-upload-page/steps/ai-or-manual/ai-or-manual.html @@ -5,7 +5,9 @@
- +
diff --git a/src/app/pages/recipe-upload-page/steps/enter-recipe-data/enter-recipe-data.html b/src/app/pages/recipe-upload-page/steps/enter-recipe-data/enter-recipe-data.html index fe876e8..d9608ad 100644 --- a/src/app/pages/recipe-upload-page/steps/enter-recipe-data/enter-recipe-data.html +++ b/src/app/pages/recipe-upload-page/steps/enter-recipe-data/enter-recipe-data.html @@ -2,11 +2,11 @@
Title - + Slug - + Recipe Text diff --git a/src/app/shared/components/nav/nav.html b/src/app/shared/components/nav/nav.html index c0efc5a..4d6e249 100644 --- a/src/app/shared/components/nav/nav.html +++ b/src/app/shared/components/nav/nav.html @@ -3,7 +3,9 @@ diff --git a/src/app/shared/components/nav/nav.ts b/src/app/shared/components/nav/nav.ts index a1016a6..0caf54b 100644 --- a/src/app/shared/components/nav/nav.ts +++ b/src/app/shared/components/nav/nav.ts @@ -10,7 +10,6 @@ import { NavLinkConfig } from './NavLinkConfig'; styleUrl: './nav.css', }) export class Nav { - private readonly authService = inject(AuthService); protected readonly links = computed(() => { @@ -26,9 +25,8 @@ export class Nav { { relativeUrl: '/recipe-upload', title: 'Upload Recipe', - disabled: this.authService.accessToken() === null - } + disabled: this.authService.accessToken() === null, + }, ]; }); - } diff --git a/src/app/shared/guards/auth-guard.spec.ts b/src/app/shared/guards/auth-guard.spec.ts index f0f7598..08c0707 100644 --- a/src/app/shared/guards/auth-guard.spec.ts +++ b/src/app/shared/guards/auth-guard.spec.ts @@ -4,14 +4,14 @@ import { CanActivateFn } from '@angular/router'; import { authGuard } from './auth-guard'; describe('authGuardGuard', () => { - const executeGuard: CanActivateFn = (...guardParameters) => - TestBed.runInInjectionContext(() => authGuard(...guardParameters)); + const executeGuard: CanActivateFn = (...guardParameters) => + TestBed.runInInjectionContext(() => authGuard(...guardParameters)); - beforeEach(() => { - TestBed.configureTestingModule({}); - }); + beforeEach(() => { + TestBed.configureTestingModule({}); + }); - it('should be created', () => { - expect(executeGuard).toBeTruthy(); - }); + it('should be created', () => { + expect(executeGuard).toBeTruthy(); + }); }); diff --git a/src/app/shared/services/RecipeService.ts b/src/app/shared/services/RecipeService.ts index db355ea..fee7ee5 100644 --- a/src/app/shared/services/RecipeService.ts +++ b/src/app/shared/services/RecipeService.ts @@ -19,21 +19,16 @@ export class RecipeService { public getRecipes(): Promise { return firstValueFrom( - this.http.get(this.endpointService.getUrl('recipes')) - .pipe(map((res) => res.content)) + this.http.get(this.endpointService.getUrl('recipes')).pipe(map((res) => res.content)), ); } public getRecipeView(username: string, slug: string): Promise { - return firstValueFrom(this.http.get( - this.endpointService.getUrl('recipes', [username, slug]) - )); + return firstValueFrom(this.http.get(this.endpointService.getUrl('recipes', [username, slug]))); } private getRecipeBaseUrl(recipeView: RecipeView): string { - return this.endpointService.getUrl( - 'recipes', [recipeView.recipe.owner.username, recipeView.recipe.slug] - ); + return this.endpointService.getUrl('recipes', [recipeView.recipe.owner.username, recipeView.recipe.slug]); } public async toggleStar(recipeView: RecipeView): Promise { @@ -61,10 +56,9 @@ export class RecipeService { public async addComment(username: string, slug: string, commentText: string): Promise { const comment = await firstValueFrom( - this.http.post( - this.endpointService.getUrl('recipes', [username, slug, 'comments']), - { text: commentText } - ) + this.http.post(this.endpointService.getUrl('recipes', [username, slug, 'comments']), { + text: commentText, + }), ); await this.queryClient.invalidateQueries({ queryKey: ['recipeComments', username, slug], diff --git a/src/app/shared/services/RecipeUploadService.ts b/src/app/shared/services/RecipeUploadService.ts index 29411de..09b1758 100644 --- a/src/app/shared/services/RecipeUploadService.ts +++ b/src/app/shared/services/RecipeUploadService.ts @@ -13,7 +13,7 @@ export class RecipeUploadService { public getRecipeUploadModel(draftId: number): Observable { return of({ inProgressStep: RecipeUploadStep.ENTER_DATA, - id: 42 + id: 42, }); } @@ -24,8 +24,7 @@ export class RecipeUploadService { inferredTitle: 'Some recipe', inferredSlug: 'some-recipe', inferredText: 'Some text.', - inferredIngredients: [] + inferredIngredients: [], }).pipe(delay(5_000)); } - } diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index 8baec25..ead79ee 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -1,3 +1,3 @@ export const environment = { - apiBaseUrl: 'http://localhost:8080' + apiBaseUrl: 'http://localhost:8080', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 8baec25..ead79ee 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,3 +1,3 @@ export const environment = { - apiBaseUrl: 'http://localhost:8080' + apiBaseUrl: 'http://localhost:8080', };