@omniumretail/component-library 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -101,14 +101,11 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
101
101
|
const [isNoteVisible, setIsNoteVisible] = useState<{ categoryIndex: number; questionIndex: number } | null>(null);
|
|
102
102
|
const [form] = useForm();
|
|
103
103
|
|
|
104
|
-
console.log(initialValues, "initialValues");
|
|
105
|
-
console.log(data, "data");
|
|
106
|
-
|
|
107
104
|
useEffect(() => {
|
|
108
105
|
if (props.initialFileList) {
|
|
109
106
|
setFileLists(props.initialFileList);
|
|
110
107
|
}
|
|
111
|
-
},[props.initialFileList]);
|
|
108
|
+
}, [props.initialFileList]);
|
|
112
109
|
|
|
113
110
|
const updateInitialValues = (data: any) => {
|
|
114
111
|
const {
|
|
@@ -117,11 +114,19 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
117
114
|
IsYesOrNo
|
|
118
115
|
} = data;
|
|
119
116
|
|
|
120
|
-
const initial = {
|
|
117
|
+
const initial = {
|
|
121
118
|
Questions: Questions.map((question: any) => ({
|
|
122
119
|
Subject: question.Subject,
|
|
123
120
|
Description: question.Description,
|
|
124
|
-
Answer: props.addButtons
|
|
121
|
+
Answer: props.addButtons
|
|
122
|
+
? !question.Disabled
|
|
123
|
+
? (question.IsDate
|
|
124
|
+
? (question?.Answer?.length > 0
|
|
125
|
+
? dayjs.unix(Number(question?.Answer?.[0]))
|
|
126
|
+
: null)
|
|
127
|
+
: question.Answer)
|
|
128
|
+
: question.Answer
|
|
129
|
+
: data.StartDate,
|
|
125
130
|
Note: question.Note || "",
|
|
126
131
|
IsMultipleChoise: question.IsMultipleChoise || false,
|
|
127
132
|
IsDate: question.IsDate || false,
|