mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 04:51:34 +00:00
Revert tag input and text editor; Adjust work editor form field controls
Reverted tag input and text editor, and added type assertion to `form.control` and disabled text editor if `readOnly` or `isLoading` in `work-editor.tsx`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: bddfbb2b-6d6b-457b-b18c-05792cdaa035 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/39b5c689-6e8a-4d5a-9792-69cc81a56534/471b78ae-f1c4-48c0-b482-9e0163e9a44a.jpg
This commit is contained in:
parent
47743e62cc
commit
9bc163b285
@ -202,7 +202,8 @@ export function WorkEditor({
|
|||||||
authorId: data.authorId,
|
authorId: data.authorId,
|
||||||
subtitle: data.subtitle,
|
subtitle: data.subtitle,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
publicationYear: data.publicationYear,
|
// Convert publication year to number if available
|
||||||
|
publicationYear: data.publicationYear ? Number(data.publicationYear) : undefined,
|
||||||
content: data.content,
|
content: data.content,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
genres: selectedGenres.map(tag => tag.value),
|
genres: selectedGenres.map(tag => tag.value),
|
||||||
@ -315,7 +316,7 @@ export function WorkEditor({
|
|||||||
<CardContent className="space-y-4">
|
<CardContent className="space-y-4">
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="title"
|
name="title"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -334,7 +335,7 @@ export function WorkEditor({
|
|||||||
|
|
||||||
{/* Subtitle */}
|
{/* Subtitle */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="subtitle"
|
name="subtitle"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -353,7 +354,7 @@ export function WorkEditor({
|
|||||||
|
|
||||||
{/* Author */}
|
{/* Author */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="authorId"
|
name="authorId"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -387,7 +388,7 @@ export function WorkEditor({
|
|||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
{/* Language */}
|
{/* Language */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="language"
|
name="language"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -420,7 +421,7 @@ export function WorkEditor({
|
|||||||
|
|
||||||
{/* Publication Year */}
|
{/* Publication Year */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="publicationYear"
|
name="publicationYear"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -440,7 +441,7 @@ export function WorkEditor({
|
|||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control as any}
|
||||||
name="description"
|
name="description"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@ -606,7 +607,7 @@ export function WorkEditor({
|
|||||||
value={workContent}
|
value={workContent}
|
||||||
onChange={setWorkContent}
|
onChange={setWorkContent}
|
||||||
placeholder="Enter your work content here..."
|
placeholder="Enter your work content here..."
|
||||||
readOnly={readOnly || isLoading}
|
disabled={readOnly || isLoading}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user