Prettier.

This commit is contained in:
Jesse Brault 2026-01-26 13:14:55 -06:00
parent 13a282f71f
commit 6e6bf04541
12 changed files with 34 additions and 39 deletions

View File

@ -17,7 +17,7 @@ export const routes: Routes = [
{
path: 'recipe-upload',
component: RecipeUploadPage,
canActivate: [authGuard]
canActivate: [authGuard],
},
{
path: 'recipes/:username/:slug',

View File

@ -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) {

View File

@ -5,7 +5,9 @@
<app-file-upload [files]="sourceFilesArray()" (fileChange)="onFileChange($event)"></app-file-upload>
<div id="ai-or-manual-buttons">
<button matButton="outlined" type="button" (click)="onFormSubmit('manual')">Enter Manually</button>
<button matButton="filled" type="button" [disabled]="!sourceFile()" (click)="onFormSubmit('ai-assist')">Use AI Assist</button>
<button matButton="filled" type="button" [disabled]="!sourceFile()" (click)="onFormSubmit('ai-assist')">
Use AI Assist
</button>
</div>
</form>
</section>

View File

@ -2,11 +2,11 @@
<form [formGroup]="recipeFormGroup">
<mat-form-field>
<mat-label>Title</mat-label>
<input matInput [formControl]="recipeFormGroup.controls.title">
<input matInput [formControl]="recipeFormGroup.controls.title" />
</mat-form-field>
<mat-form-field>
<mat-label>Slug</mat-label>
<input matInput [formControl]="recipeFormGroup.controls.slug">
<input matInput [formControl]="recipeFormGroup.controls.slug" />
</mat-form-field>
<mat-form-field>
<mat-label>Recipe Text</mat-label>

View File

@ -3,7 +3,9 @@
<ul>
@for (link of links(); track link.relativeUrl) {
@if (!link.disabled) {
<li><a [routerLink]="link.relativeUrl">{{ link.title }}</a></li>
<li>
<a [routerLink]="link.relativeUrl">{{ link.title }}</a>
</li>
}
}
</ul>

View File

@ -10,7 +10,6 @@ import { NavLinkConfig } from './NavLinkConfig';
styleUrl: './nav.css',
})
export class Nav {
private readonly authService = inject(AuthService);
protected readonly links = computed<NavLinkConfig[]>(() => {
@ -26,9 +25,8 @@ export class Nav {
{
relativeUrl: '/recipe-upload',
title: 'Upload Recipe',
disabled: this.authService.accessToken() === null
}
disabled: this.authService.accessToken() === null,
},
];
});
}

View File

@ -19,21 +19,16 @@ export class RecipeService {
public getRecipes(): Promise<Recipe[]> {
return firstValueFrom(
this.http.get<RecipeInfoViews>(this.endpointService.getUrl('recipes'))
.pipe(map((res) => res.content))
this.http.get<RecipeInfoViews>(this.endpointService.getUrl('recipes')).pipe(map((res) => res.content)),
);
}
public getRecipeView(username: string, slug: string): Promise<RecipeView> {
return firstValueFrom(this.http.get<RecipeView>(
this.endpointService.getUrl('recipes', [username, slug])
));
return firstValueFrom(this.http.get<RecipeView>(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<void> {
@ -61,10 +56,9 @@ export class RecipeService {
public async addComment(username: string, slug: string, commentText: string): Promise<RecipeComment> {
const comment = await firstValueFrom(
this.http.post<RecipeComment>(
this.endpointService.getUrl('recipes', [username, slug, 'comments']),
{ text: commentText }
)
this.http.post<RecipeComment>(this.endpointService.getUrl('recipes', [username, slug, 'comments']), {
text: commentText,
}),
);
await this.queryClient.invalidateQueries({
queryKey: ['recipeComments', username, slug],

View File

@ -13,7 +13,7 @@ export class RecipeUploadService {
public getRecipeUploadModel(draftId: number): Observable<RecipeUploadModel> {
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));
}
}

View File

@ -1,3 +1,3 @@
export const environment = {
apiBaseUrl: 'http://localhost:8080'
apiBaseUrl: 'http://localhost:8080',
};

View File

@ -1,3 +1,3 @@
export const environment = {
apiBaseUrl: 'http://localhost:8080'
apiBaseUrl: 'http://localhost:8080',
};