fix: adjust the dev-sabda branch code with the prod branch
This commit is contained in:
parent
8f494739c6
commit
f9417b63ae
|
|
@ -552,8 +552,8 @@ export default function FormTaskTa() {
|
|||
>
|
||||
<RadioGroupItem value="atensi-khusus" id="khusus" />
|
||||
<Label htmlFor="atensi-khusus">Atensi Khusus</Label>
|
||||
{/* <RadioGroupItem value="tugas-harian" id="harian" />
|
||||
<Label htmlFor="tugas-harian">Tugas Harian</Label> */}
|
||||
<RadioGroupItem value="tugas-harian" id="harian" />
|
||||
<Label htmlFor="tugas-harian">Tugas Harian</Label>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<div className="flex flex-col space-y-2 mt-5">
|
||||
|
|
@ -772,7 +772,7 @@ export default function FormTaskTa() {
|
|||
echoCancellation: true,
|
||||
}}
|
||||
downloadOnSavePress={true}
|
||||
downloadFileExtension="webm"
|
||||
downloadFileExtension="mp3"
|
||||
/>
|
||||
<FileUploader
|
||||
accept={{
|
||||
|
|
|
|||
|
|
@ -816,7 +816,7 @@ export default function FormTaskTaNew() {
|
|||
</Button>
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Link href={"/contributor/content/image"}>
|
||||
<Link href={"/contributor/task-ta"}>
|
||||
<Button type="submit" color="primary" variant="outline">
|
||||
{t("cancel", { defaultValue: "Cancel" })}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -811,12 +811,27 @@ export default function FormTaskDetail() {
|
|||
// getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel
|
||||
};
|
||||
|
||||
const getViewerUrl = (url: string) => {
|
||||
const ext = url.split(".").pop()?.toLowerCase();
|
||||
|
||||
if (ext === "pdf") {
|
||||
return url; // langsung tampilkan PDF
|
||||
}
|
||||
|
||||
// doc / docx → pakai Google Viewer, lebih compatible
|
||||
return `https://docs.google.com/viewer?url=${encodeURIComponent(
|
||||
url
|
||||
)}&embedded=true`;
|
||||
};
|
||||
|
||||
return (
|
||||
<Card>
|
||||
{detail !== undefined ? (
|
||||
<div className="px-6 py-6">
|
||||
<div className="flex flex-col sm:flex-row lg:flex-row justify-between">
|
||||
<p className="text-lg font-semibold mb-3">{t("detail-task", { defaultValue: "Detail Task" })}</p>
|
||||
<p className="text-lg font-semibold mb-3">
|
||||
{t("detail-task", { defaultValue: "Detail Task" })}
|
||||
</p>
|
||||
<div
|
||||
className="flex gap-3"
|
||||
style={
|
||||
|
|
@ -834,7 +849,8 @@ export default function FormTaskDetail() {
|
|||
color="primary"
|
||||
onClick={() => setModalType("terkirim")}
|
||||
>
|
||||
{sentAcceptance?.length} {t("sent", { defaultValue: "Sent" })}
|
||||
{sentAcceptance?.length}{" "}
|
||||
{t("sent", { defaultValue: "Sent" })}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
|
||||
|
|
@ -844,14 +860,17 @@ export default function FormTaskDetail() {
|
|||
onClick={() => setModalType("diterima")}
|
||||
className="ml-3"
|
||||
>
|
||||
{acceptAcceptance?.length} {t("accepted", { defaultValue: "Accepted" })}
|
||||
{acceptAcceptance?.length}{" "}
|
||||
{t("accepted", { defaultValue: "Accepted" })}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent className="sm:max-w-[425px] md:max-w-[500px] lg:max-w-[1500px] overflow-y-auto max-h-[500px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
{t("assignment-status-details", { defaultValue: "Assignment Status Details" })}
|
||||
{t("assignment-status-details", {
|
||||
defaultValue: "Assignment Status Details",
|
||||
})}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
|
|
@ -866,7 +885,9 @@ export default function FormTaskDetail() {
|
|||
<form>
|
||||
<div className="gap-5 mb-5">
|
||||
<div className="space-y-2">
|
||||
<Label>{t("unique-code", { defaultValue: "Unique Code" })}</Label>
|
||||
<Label>
|
||||
{t("unique-code", { defaultValue: "Unique Code" })}
|
||||
</Label>
|
||||
<Controller
|
||||
control={control}
|
||||
name="uniqueCode"
|
||||
|
|
@ -903,7 +924,11 @@ export default function FormTaskDetail() {
|
|||
</div>
|
||||
<div className="flex flex-col sm:flex-row lg:flex-row sm:items-center lg:items-center">
|
||||
<div className="mt-6 space-y-2">
|
||||
<Label>{t("assignment-selection", { defaultValue: "Assignment Selection" })}</Label>
|
||||
<Label>
|
||||
{t("assignment-selection", {
|
||||
defaultValue: "Assignment Selection",
|
||||
})}
|
||||
</Label>
|
||||
<Select
|
||||
onValueChange={setSelectedTarget}
|
||||
value={detail.assignedToRole}
|
||||
|
|
@ -1040,7 +1065,9 @@ export default function FormTaskDetail() {
|
|||
</RadioGroup>
|
||||
</div>
|
||||
<div className="mt-6 space-y-2">
|
||||
<Label>{t("assigment-type", { defaultValue: "Assigment Type" })} </Label>
|
||||
<Label>
|
||||
{t("assigment-type", { defaultValue: "Assigment Type" })}{" "}
|
||||
</Label>
|
||||
<RadioGroup
|
||||
value={detail.taskType.toString()}
|
||||
onValueChange={(value) => setTaskType(String(value))}
|
||||
|
|
@ -1054,7 +1081,9 @@ export default function FormTaskDetail() {
|
|||
</div>
|
||||
{/* RadioGroup Assignment Category */}
|
||||
<div className="mt-6 space-y-2">
|
||||
<Label>{t("type-of-task", { defaultValue: "Type Of Task" })}</Label>
|
||||
<Label>
|
||||
{t("type-of-task", { defaultValue: "Type Of Task" })}
|
||||
</Label>
|
||||
<RadioGroup
|
||||
value={detail.assignmentType.id.toString()}
|
||||
onValueChange={(value) => setType(value)}
|
||||
|
|
@ -1075,7 +1104,9 @@ export default function FormTaskDetail() {
|
|||
</RadioGroup>
|
||||
</div>
|
||||
<div className="mt-6 space-y-2">
|
||||
<Label>{t("output-task", { defaultValue: "Output Task" })}</Label>
|
||||
<Label>
|
||||
{t("output-task", { defaultValue: "Output Task" })}
|
||||
</Label>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
{Object.keys(taskOutput).map((key) => (
|
||||
<div className="flex items-center gap-2" key={key}>
|
||||
|
|
@ -1096,7 +1127,9 @@ export default function FormTaskDetail() {
|
|||
</div>
|
||||
|
||||
<div className="mt-6 space-y-2">
|
||||
<Label>{t("description", { defaultValue: "Description" })}</Label>
|
||||
<Label>
|
||||
{t("description", { defaultValue: "Description" })}
|
||||
</Label>
|
||||
<Controller
|
||||
control={control}
|
||||
name="naration"
|
||||
|
|
@ -1111,11 +1144,15 @@ export default function FormTaskDetail() {
|
|||
)} */}
|
||||
</div>
|
||||
<div className=" mt-5 space-y-2">
|
||||
<Label htmlFor="attachment">{t("attachment", { defaultValue: "Attachment" })}</Label>
|
||||
<Label htmlFor="attachment">
|
||||
{t("attachment", { defaultValue: "Attachment" })}
|
||||
</Label>
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
{videoUploadedFiles?.length > 0 && (
|
||||
<Label>{t("audio-visual", { defaultValue: "Audio Visual" })}</Label>
|
||||
<Label>
|
||||
{t("audio-visual", { defaultValue: "Audio Visual" })}
|
||||
</Label>
|
||||
)}
|
||||
<div>
|
||||
{selectedVideo && (
|
||||
|
|
@ -1216,12 +1253,16 @@ export default function FormTaskDetail() {
|
|||
<div>
|
||||
{selectedText && (
|
||||
<Card className="mt-2">
|
||||
<iframe
|
||||
{/* <iframe
|
||||
className="w-full h-96 rounded-md"
|
||||
src={`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(
|
||||
selectedText
|
||||
)}`}
|
||||
title={"Document"}
|
||||
/> */}
|
||||
<iframe
|
||||
className="w-full h-96"
|
||||
src={getViewerUrl(selectedText)}
|
||||
/>
|
||||
</Card>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue