fix: update fixing task ta
This commit is contained in:
parent
ccc1fb3336
commit
cacaaefb3b
|
|
@ -1454,6 +1454,24 @@ export default function FormTaskTaDetail() {
|
|||
)}
|
||||
{isRecording && <p>Recording... {timer} seconds remaining</p>}{" "}
|
||||
{/* Display remaining time */}
|
||||
<div className="mt-4">
|
||||
<Label>Link Url</Label>
|
||||
{urlInputs.map((url: any, index: any) => (
|
||||
<Link
|
||||
key={index}
|
||||
href={url}
|
||||
target="_blank"
|
||||
className="flex items-center gap-2 mt-2"
|
||||
>
|
||||
<input
|
||||
type="url"
|
||||
className="border rounded p-2 w-full cursor-pointer"
|
||||
value={url}
|
||||
placeholder={`Masukkan link berita ${index + 1}`}
|
||||
/>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -588,7 +588,9 @@ export default function FormTaskTaEdit() {
|
|||
narration: data.naration,
|
||||
expertCompetencies: Array.from(selectedCompetencies).join(","),
|
||||
title: data.title,
|
||||
attachmentUrl: links,
|
||||
attachmentUrl: urlInputs
|
||||
.map((url: any) => url.attachmentUrl || "")
|
||||
.filter((url: string) => url.trim() !== ""),
|
||||
};
|
||||
|
||||
const response = await createTaskTa(requestData);
|
||||
|
|
@ -802,7 +804,7 @@ export default function FormTaskTaEdit() {
|
|||
isAudioUploadFinish &&
|
||||
isTextUploadFinish
|
||||
) {
|
||||
successSubmit("/in/contributor/task");
|
||||
successSubmit("/in/contributor/task-ta");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -841,9 +843,11 @@ export default function FormTaskTaEdit() {
|
|||
};
|
||||
|
||||
const handleLinkChange = (index: number, value: string) => {
|
||||
const updatedLinks = [...links];
|
||||
updatedLinks[index] = value;
|
||||
setLinks(updatedLinks);
|
||||
setUrlInputs((prev: any) =>
|
||||
prev.map((url: any, idx: any) =>
|
||||
idx === index ? { ...url, attachmentUrl: value } : url
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const handleAddLink = () => {
|
||||
|
|
@ -1188,7 +1192,9 @@ export default function FormTaskTaEdit() {
|
|||
{isRecording && <p>Recording... {timer} seconds remaining</p>}{" "}
|
||||
{/* Display remaining time */}
|
||||
<div className="mt-4 space-y-2">
|
||||
<h2 className="text-lg font-bold">{t("news-links", { defaultValue: "News Links" })}</h2>
|
||||
<h2 className="text-lg font-bold">
|
||||
{t("news-links", { defaultValue: "News Links" })}
|
||||
</h2>
|
||||
{urlInputs.map((url: any, index: any) => (
|
||||
<div
|
||||
key={url.id}
|
||||
|
|
@ -1205,42 +1211,13 @@ export default function FormTaskTaEdit() {
|
|||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className="mt-4 space-y-2">
|
||||
<Label className="">{t("news-links", { defaultValue: "News Links" })}</Label>
|
||||
{links.map((link, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex items-center gap-2 mt-2"
|
||||
>
|
||||
<Input
|
||||
type="url"
|
||||
className="border rounded p-2 w-full"
|
||||
placeholder={`Masukkan link berita ${index + 1}`}
|
||||
value={link}
|
||||
onChange={(e) =>
|
||||
handleLinkChange(index, e.target.value)
|
||||
}
|
||||
/>
|
||||
{links.length > 1 && (
|
||||
<button
|
||||
type="button"
|
||||
className="bg-red-500 text-white px-3 py-1 rounded"
|
||||
onClick={() => handleRemoveRow(index)}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
<Button
|
||||
type="button"
|
||||
className="mt-2 bg-blue-500 text-white px-4 py-2 rounded"
|
||||
onClick={handleAddRow}
|
||||
size="sm"
|
||||
>
|
||||
{t("add-links", { defaultValue: "Add Links" })}
|
||||
</Button>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="mt-4 bg-green-500 text-white px-4 py-2 rounded"
|
||||
onClick={handleAddLink}
|
||||
>
|
||||
{t("add-links", { defaultValue: "Add Links" })}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ export default function FormTaskTa() {
|
|||
narration: string;
|
||||
assignmentType: string;
|
||||
expertCompetencies: string;
|
||||
// attachmentUrl: string[];
|
||||
attachmentUrl: string[];
|
||||
} = {
|
||||
...data,
|
||||
assignedToUsers: handleExpertChange(),
|
||||
|
|
@ -278,7 +278,7 @@ export default function FormTaskTa() {
|
|||
narration: data.narration,
|
||||
expertCompetencies: Array.from(selectedCompetencies).join(","),
|
||||
title: data.title,
|
||||
// attachmentUrl: links,
|
||||
attachmentUrl: links,
|
||||
};
|
||||
|
||||
const response = await createTaskTa(requestData);
|
||||
|
|
|
|||
|
|
@ -331,10 +331,10 @@ export default function FormTaskTaNew() {
|
|||
htmlDescription: finalDescription,
|
||||
fileTypeId: fileTypeId,
|
||||
categoryId: "235",
|
||||
subCategoryId: selectedCategory,
|
||||
subCategoryId: "171",
|
||||
uploadedBy: "2b7c8d83-d298-4b19-9f74-b07924506b58",
|
||||
statusId: "1",
|
||||
publishedFor: publishedFor.join(","),
|
||||
publishedFor: "7",
|
||||
creatorName: "Penugasan-Ta",
|
||||
tags: "penugasan-Ta",
|
||||
isYoutube: false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue