Merge branch 'dev-sabda-v2' of https://gitlab.com/hanifsalafi/mediahub_redesign
This commit is contained in:
commit
3c5e644668
|
|
@ -102,6 +102,11 @@ export default function FormDetailLiveReport() {
|
||||||
const [status, setStatus] = useState("");
|
const [status, setStatus] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [modalOpen, setModalOpen] = useState(false);
|
const [modalOpen, setModalOpen] = useState(false);
|
||||||
|
const [uploaderLevelNumber, setUploaderLevelNumber] = useState<number | null>(
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
|
||||||
|
const isScheduleFromSatker = uploaderLevelNumber === 3;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
|
|
@ -134,6 +139,11 @@ export default function FormDetailLiveReport() {
|
||||||
const details = response?.data?.data;
|
const details = response?.data?.data;
|
||||||
|
|
||||||
setDetail(details);
|
setDetail(details);
|
||||||
|
|
||||||
|
if (details?.uploaderLevelNumber !== undefined) {
|
||||||
|
setUploaderLevelNumber(details.uploaderLevelNumber);
|
||||||
|
}
|
||||||
|
|
||||||
if (details) {
|
if (details) {
|
||||||
setDate({
|
setDate({
|
||||||
from: parseISO(details.startDate),
|
from: parseISO(details.startDate),
|
||||||
|
|
@ -177,7 +187,10 @@ export default function FormDetailLiveReport() {
|
||||||
statusId: Number(status),
|
statusId: Number(status),
|
||||||
message: description,
|
message: description,
|
||||||
isPublish: status === "2",
|
isPublish: status === "2",
|
||||||
placements: schedulePlacements?.filter((val) => val !== "all")?.join(","),
|
// placements: schedulePlacements?.filter((val) => val !== "all")?.join(","),
|
||||||
|
placements: isScheduleFromSatker
|
||||||
|
? "satker"
|
||||||
|
: schedulePlacements?.filter((val) => val !== "all")?.join(","),
|
||||||
};
|
};
|
||||||
|
|
||||||
loading();
|
loading();
|
||||||
|
|
@ -212,7 +225,7 @@ export default function FormDetailLiveReport() {
|
||||||
confirmButtonText: "OK",
|
confirmButtonText: "OK",
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
router.push("/contributor/schedule/live-report");
|
router.push("/contributor/schedule/live-report");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -645,7 +658,8 @@ export default function FormDetailLiveReport() {
|
||||||
: "Ditolak"}
|
: "Ditolak"}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
{status === "2" && (
|
{/* {status === "2" && ( */}
|
||||||
|
{status === "2" && !isScheduleFromSatker && (
|
||||||
<div className="flex flex-row gap-2">
|
<div className="flex flex-row gap-2">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|
@ -720,9 +734,15 @@ export default function FormDetailLiveReport() {
|
||||||
type="button"
|
type="button"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => submit()}
|
onClick={() => submit()}
|
||||||
|
// disabled={
|
||||||
|
// description.length < 1 ||
|
||||||
|
// (schedulePlacements.length < 1 && status === "2")
|
||||||
|
// }
|
||||||
disabled={
|
disabled={
|
||||||
description.length < 1 ||
|
description.length < 1 ||
|
||||||
(schedulePlacements.length < 1 && status === "2")
|
(!isScheduleFromSatker &&
|
||||||
|
schedulePlacements.length < 1 &&
|
||||||
|
status === "2")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t("submit", { defaultValue: "Submit" })}
|
{t("submit", { defaultValue: "Submit" })}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue