@omniumretail/component-library 1.1.91 → 1.1.93

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.91",
3
+ "version": "1.1.93",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -14,7 +14,16 @@ const Template: Story<any> = (args) => {
14
14
  const categoryResponseRef = useRef(null);
15
15
  const [hasNext, setHasNext] = useState(true);
16
16
  const [hasPrevious, setHasPrevious] = useState(false);
17
- const [fileLists, setFileLists] = useState<Record<string, UploadFile[]>>({});
17
+ const [fileLists, setFileLists] = useState<Record<string, UploadFile[]>>({
18
+ "CATEGORYID1_65562A64-A24B-425A-A345-560238CA2468": [
19
+ {
20
+ "uid": "iv919l10io",
21
+ "name": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omnium-retail_icon.png",
22
+ "status": "done",
23
+ "url": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omnium-retail_icon.png"
24
+ }
25
+ ]
26
+ });
18
27
 
19
28
  const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
20
29
  setHasNext(hasNext);
@@ -58,6 +67,7 @@ const Template: Story<any> = (args) => {
58
67
  fileList={setFileLists}
59
68
  addAction={handleAddAction}
60
69
  openAction={handleOpenAction}
70
+ initialFileList={fileLists}
61
71
  >
62
72
  </CategoryResponse>
63
73
  </div>
@@ -108,7 +118,7 @@ Primary.args = {
108
118
  "Grade": "0",
109
119
  "Note": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
110
120
  "Answer": null,
111
- "ImagesList": ["https://omnium-user-images.s3.eu-west-1.amazonaws.com/blank-profile-picture-973460_1280.png"],
121
+ "ImagesList": [],
112
122
  "Actions": [
113
123
  {
114
124
  "Id": "05D49F7B-C293-48AD-980F-D6ED5B3C0DAB",
@@ -96,12 +96,17 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
96
96
  // Setting first set of questions as default open
97
97
  const [selectedCategory, setSelectedCategory] = useState<any>(data.CategoryAnswers[0]);
98
98
  const [initialValues, setInitialValues] = useState<any>(data.CategoryAnswers[0].Data);
99
- // const [fileLists, setFileLists] = useState<Record<string, UploadFile[]>>(props.initialFileList || []);
100
99
  const [fileLists, setFileLists] = useState<Record<string, UploadFile[]>>(props.initialFileList || []);
101
100
  const [dataValue, setDataValue] = useState<any>();
102
101
  const [isNoteVisible, setIsNoteVisible] = useState<{ categoryIndex: number; questionIndex: number } | null>(null);
103
102
  const [form] = useForm();
104
103
 
104
+ useEffect(() => {
105
+ if (props.initialFileList) {
106
+ setFileLists(props.initialFileList);
107
+ }
108
+ },[props.initialFileList]);
109
+
105
110
  const updateInitialValues = (data: any) => {
106
111
  const {
107
112
  Questions,