uat defect 124, rep defect 11, questionnaire defect 26

This commit is contained in:
2025-01-13 18:21:40 +00:00
parent 59ae2db6c5
commit 665c4bbba5
8 changed files with 173 additions and 125 deletions
@@ -7,7 +7,7 @@ import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import Dropzone from "react-dropzone";
import "react-quill-new/dist/quill.snow.css";
import { Field } from "redux-form";
import { Field, change } from "redux-form";
import {
uploadSingleFile,
deleteBlob,
@@ -17,6 +17,7 @@ import {
} from "../../../actions";
const ReactQuill = dynamic(() => import("react-quill-new"), { ssr: false });
import { useDispatch } from "react-redux"; // Import the useDispatch hook
import {
addDays,
@@ -867,6 +868,8 @@ const rejectStyle = {
export const RenderFileUpload = (field) => {
const files = field.input.value;
const dispatch = useDispatch(); // Get dispatch using useDispatch hook
let { t } = useTranslation();
const style = useMemo(
@@ -929,9 +932,9 @@ export const RenderFileUpload = (field) => {
const filelistObj = field.fileList || {};
//let blobList = filelistObj;
let blobList = filelistObj;
let blobList = field.props.currentView.fileList;
//let blobList = field.props.currentView.fileList;
function removeNullObjects(arr) {
if (arr.length === 0) {
@@ -1063,6 +1066,7 @@ export const RenderFileUpload = (field) => {
[".xlsx"],
}}
onDrop={(filesToUpload, e) => {
setCompletedUploadFiles(false);
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
new File(
@@ -1150,9 +1154,13 @@ export const RenderFileUpload = (field) => {
))
).then((data) => {
data = data.value || {};
field.input.value == null;
field.input.value = "";
field.setFilesForRepresentations(data[0]);
setCompletedUploadFiles(true);
dispatch(
change("representationForm", field.name, null)
); // Set the field value to null
});
});
}}
@@ -1283,7 +1291,7 @@ export const RenderFileUpload = (field) => {
field.ticketnumber +
"/" +
field.filenamePrefix.representationForm
.values.repfile_name
?.values?.repfile_name
) +
"&blobname=" +
blob.name +