Skip to content

Expand recipe form with metadata fields and wire up submit - #1201

Draft
dgee2 wants to merge 3 commits into
issue-1118-recipe-detail-pagefrom
issue-1119-recipe-form-metadata
Draft

Expand recipe form with metadata fields and wire up submit#1201
dgee2 wants to merge 3 commits into
issue-1118-recipe-detail-pagefrom
issue-1119-recipe-form-metadata

Conversation

@dgee2

@dgee2 dgee2 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

The recipe creation form (new-recipe-form.vue) previously rendered only a name field with no submit handling at all. This PR:

  • Adds Summary, Yield, Servings, Prep/Cook/Total time fields to the form.
  • Requires a non-blank recipe title before submit is allowed.
  • Validates the numeric time/servings fields as non-negative whole numbers.
  • Wires the form up to the existing useCreateRecipe() mutation and navigates to the new recipe's detail page (added in Add authenticated recipe detail page #1118) on success.
  • Surfaces mutation failures as an inline banner instead of letting them become an unhandled promise rejection.

Ingredients/steps are submitted as empty arrays for now (validated as acceptable by the backend's UpsertRecipeValidator from #1116) — row editors for those come in #1120/#1121. accessScope is hardcoded to "Private" until the visibility selector lands in #1122.

Test plan

  • pnpm build (type-check + production build)
  • pnpm lint
  • pnpm test:storybook — 20 files / 44 tests passing, including new stories for empty-title validation, valid-title submit, negative/non-integer servings validation, and submit-failure error banner
  • Manually verified in the Storybook dev server: empty-title blocks submit with a visible error, a valid title clears validation and triggers the mutation, and a failed mutation shows the error banner without crashing

Part of #1100.

Closes #1119.

@dgee2 dgee2 changed the title issue 1119 recipe form metadata Expand recipe form with metadata fields and wire up submit Aug 2, 2026
@dgee2
dgee2 force-pushed the issue-1119-recipe-form-metadata branch from f903273 to d353eb2 Compare August 3, 2026 08:16
@dgee2
dgee2 force-pushed the issue-1119-recipe-form-metadata branch from d353eb2 to 34fe6f2 Compare August 3, 2026 20:09
dgee2 added 3 commits August 4, 2026 08:01
Introduces a reusable numeric input atom (number-field.vue) for the
recipe form's metadata fields, and extends text-field.vue with
optional `rules`/`type` props so form fields can opt into Quasar
validation and textarea rendering.
The recipe name field previously accepted empty submissions; the
create/update form now blocks submit on an empty or whitespace-only
title.
new-recipe-form.vue previously rendered only a name field with no
submit handling. It now exposes the recipe's metadata fields
(summary, yield, servings, prep/cook/total time), validates numeric
fields as non-negative whole numbers, and submits via the existing
useCreateRecipe() mutation, navigating to the new recipe's detail
page on success. Mutation failures are caught and surfaced as an
inline banner instead of becoming an unhandled promise rejection.

Ingredients/steps are submitted as empty arrays for now; editors for
those are added in later PRs in this stack (#1120, #1121), as is the
visibility selector (#1122) — accessScope is hardcoded to "Private"
here in the interim.

Part of #1100. Closes #1119.
@dgee2
dgee2 force-pushed the issue-1119-recipe-form-metadata branch from 34fe6f2 to 0d8d02e Compare August 4, 2026 07:05
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand recipe form with metadata fields

1 participant