You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
+++
|
|
title = "Implement Submit page (/submit) — quote creation form, display returned auth_code on success"
|
|
priority = 5
|
|
status = "done"
|
|
ticket_type = "task"
|
|
dependencies = ["04f865", "1e6a09", "fc2f51", "0fbdd5"]
|
|
+++
|
|
|
|
<context>
|
|
The `quotesdb` UI is a Yew (Rust → Wasm) single-page app compiled by Trunk and hosted on Cloudflare Pages. It communicates with the backend API via `fetch` calls. Source lives in `src/bin/ui/`. Run with `trunk serve` for local development.
|
|
|
|
The Submit page (`/submit`) provides a form for creating a new quote. On success, it displays the returned auth code prominently so the user can save it.
|
|
</context>
|
|
|
|
<goal>
|
|
Implement the Submit page component (`src/bin/ui/pages/submit.rs`):
|
|
1. Render a form with fields: text (textarea), author, source (optional), date (optional), tags (comma-separated input), auth code (optional)
|
|
2. On submit, call `PUT /api/quotes` via the API client
|
|
3. On 201 success: show a success message and display the returned auth code in a copyable box
|
|
4. On error: render `ErrorDisplay` with the error message
|
|
</goal>
|
|
|
|
<constraints>
|
|
- The auth code returned must be displayed clearly — it cannot be recovered after the user leaves this page.
|
|
- Validate client-side: text and author are required (non-empty) before submitting.
|
|
- Parse the tags input by splitting on commas and trimming whitespace.
|
|
</constraints>
|
|
|
|
<validation>
|
|
From the `quotesdb/` directory:
|
|
|
|
```sh
|
|
trunk build
|
|
```
|
|
</validation>
|
|
|
|
<commit>
|
|
`feat(quotesdb): implement Submit page — new quote form with auth code display`
|
|
</commit>
|