merge
This commit is contained in:
parent
8980d8d77d
commit
b5fe86821a
|
|
@ -129,9 +129,7 @@ export default function FormAccountReport() {
|
|||
const [isTextUploadFinish, setIsTextUploadFinish] = useState(false);
|
||||
const [isAudioUploadFinish, setIsAudioUploadFinish] = useState(false);
|
||||
const [voiceNoteLink, setVoiceNoteLink] = useState("");
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
|
||||
const [unitSelection, setUnitSelection] = useState({
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ type Option = {
|
|||
interface FileData {
|
||||
contentId: number;
|
||||
placement?: string[];
|
||||
[key: string]: any; // Extendable for additional properties
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface PlacementData {
|
||||
|
|
@ -173,11 +173,10 @@ export default function FormConvertSPIT() {
|
|||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
// Jika tombol rewrite diklik, pastikan field-nya tidak kosong
|
||||
if (isContentRewriteClicked) {
|
||||
return detail?.contentRewriteDescription?.trim().length > 0;
|
||||
}
|
||||
return true; // tidak diklik => tidak wajib
|
||||
return true;
|
||||
},
|
||||
{
|
||||
path: ["contentRewriteDescription"],
|
||||
|
|
@ -239,8 +238,8 @@ export default function FormConvertSPIT() {
|
|||
};
|
||||
|
||||
const handleDirectSave = () => {
|
||||
const values = form.getValues(); // ambil semua nilai tanpa validasi
|
||||
onSubmit(values); // langsung submit
|
||||
const values = form.getValues();
|
||||
onSubmit(values);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -287,8 +286,7 @@ export default function FormConvertSPIT() {
|
|||
);
|
||||
|
||||
if (findCategory) {
|
||||
// setValue("categoryId", findCategory.id);
|
||||
setSelectedCategoryId(findCategory.id); // Set the selected category
|
||||
setSelectedCategoryId(findCategory.id);
|
||||
const response = await getTagsBySubCategoryId(findCategory.id);
|
||||
setTags(response?.data?.data);
|
||||
}
|
||||
|
|
@ -391,8 +389,8 @@ export default function FormConvertSPIT() {
|
|||
return {
|
||||
...file,
|
||||
placement: isChecked
|
||||
? file.placement.filter((v: any) => v !== value) // Uncheck
|
||||
: [...(file.placement || []), value], // Check
|
||||
? file.placement.filter((v: any) => v !== value)
|
||||
: [...(file.placement || []), value],
|
||||
};
|
||||
}
|
||||
return file;
|
||||
|
|
@ -458,11 +456,10 @@ export default function FormConvertSPIT() {
|
|||
|
||||
const handleSelectAll = (category: string, isChecked: boolean) => {
|
||||
setFilePlacements((prev: string[][]) =>
|
||||
prev.map(
|
||||
(placement: string[]) =>
|
||||
isChecked
|
||||
? Array.from(new Set([...placement, category])) // Konversi Set ke array dengan Array.from()
|
||||
: placement.filter((item: string) => item !== category) // Hapus jika ada
|
||||
prev.map((placement: string[]) =>
|
||||
isChecked
|
||||
? Array.from(new Set([...placement, category]))
|
||||
: placement.filter((item: string) => item !== category)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,9 +57,7 @@ export default function FormEvent() {
|
|||
const [startTime, setStartTime] = useState("08:00");
|
||||
const [endTime, setEndTime] = useState("09:00");
|
||||
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const handleStartTime = (e: any) => {
|
||||
setStartTime(e.target.value);
|
||||
|
|
|
|||
|
|
@ -65,9 +65,7 @@ export function CalendarPolriAddDetail() {
|
|||
const [expandedPolda, setExpandedPolda] = React.useState([{}]);
|
||||
const [isLoading, setIsLoading] = React.useState(false);
|
||||
const [detail, setDetail] = React.useState<Detail>();
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2025, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
const [refresh, setRefresh] = React.useState(false);
|
||||
|
||||
const [unitSelection, setUnitSelection] = React.useState({
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ export function CalendarPolriAddUpdate() {
|
|||
>([]);
|
||||
const [detail, setDetail] = React.useState<Detail>();
|
||||
const [imageFiles, setImageFiles] = React.useState<FileWithPreview[]>([]);
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2025, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
const [refresh, setRefresh] = React.useState(false);
|
||||
|
||||
const [unitSelection, setUnitSelection] = React.useState({
|
||||
|
|
|
|||
|
|
@ -57,9 +57,7 @@ export default function FormLiveReport() {
|
|||
const [endTime, setEndTime] = useState("09:00");
|
||||
const [scheduleTypeId, setScheduleTypeId] = React.useState<string>("1");
|
||||
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const handleStartTime = (e: any) => {
|
||||
setStartTime(e.target.value);
|
||||
|
|
|
|||
|
|
@ -57,9 +57,7 @@ export default function FormPressRelease() {
|
|||
const [startTime, setStartTime] = useState("08:00");
|
||||
const [endTime, setEndTime] = useState("09:00");
|
||||
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const handleStartTime = (e: any) => {
|
||||
setStartTime(e.target.value);
|
||||
|
|
|
|||
|
|
@ -47,9 +47,7 @@ export default function FormPressConference() {
|
|||
const [startTime, setStartTime] = useState("08:00");
|
||||
const [endTime, setEndTime] = useState("09:00");
|
||||
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const handleStartTime = (e: any) => {
|
||||
setStartTime(e.target.value);
|
||||
|
|
|
|||
|
|
@ -70,9 +70,7 @@ export function TambahIklanModal() {
|
|||
FileUploaded[]
|
||||
>([]);
|
||||
const [imageFiles, setImageFiles] = React.useState<FileWithPreview[]>([]);
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2025, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [unitSelection, setUnitSelection] = React.useState({
|
||||
semua: false,
|
||||
|
|
|
|||
|
|
@ -147,9 +147,7 @@ export default function FormAcceptAssignment() {
|
|||
const [isTextUploadFinish, setIsTextUploadFinish] = useState(false);
|
||||
const [isAudioUploadFinish, setIsAudioUploadFinish] = useState(false);
|
||||
const [voiceNoteLink, setVoiceNoteLink] = useState("");
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
|
||||
const [unitSelection, setUnitSelection] = useState({
|
||||
|
|
|
|||
|
|
@ -154,9 +154,7 @@ export default function FormAskExpert() {
|
|||
const [isTextUploadFinish, setIsTextUploadFinish] = useState(false);
|
||||
const [isAudioUploadFinish, setIsAudioUploadFinish] = useState(false);
|
||||
const [voiceNoteLink, setVoiceNoteLink] = useState("");
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [links, setLinks] = useState<string[]>([""]);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,9 +147,7 @@ export default function FormDoItYourself() {
|
|||
const [isTextUploadFinish, setIsTextUploadFinish] = useState(false);
|
||||
const [isAudioUploadFinish, setIsAudioUploadFinish] = useState(false);
|
||||
const [voiceNoteLink, setVoiceNoteLink] = useState("");
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
|
||||
const [unitSelection, setUnitSelection] = useState({
|
||||
|
|
|
|||
|
|
@ -156,9 +156,7 @@ export default function FormTaskTa() {
|
|||
const [isTextUploadFinish, setIsTextUploadFinish] = useState(false);
|
||||
const [isAudioUploadFinish, setIsAudioUploadFinish] = useState(false);
|
||||
const [voiceNoteLink, setVoiceNoteLink] = useState("");
|
||||
const [date, setDate] = React.useState<DateRange | undefined>({
|
||||
from: new Date(2024, 0, 1),
|
||||
});
|
||||
const [date, setDate] = React.useState<DateRange | undefined>();
|
||||
|
||||
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
|
||||
const [unitSelection, setUnitSelection] = useState({
|
||||
|
|
|
|||
Loading…
Reference in New Issue