contentoh-components-library 21.1.59 → 21.1.62

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.
Files changed (32) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +0 -1
  2. package/dist/components/atoms/InputFormatter/index.js +3 -3
  3. package/dist/components/molecules/HeaderTop/index.js +4 -1
  4. package/dist/components/molecules/RetailerSelector/index.js +31 -0
  5. package/dist/components/molecules/StatusAsignationInfo/index.js +3 -2
  6. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  7. package/dist/components/organisms/FullTabsMenu/index.js +3 -1
  8. package/dist/components/organisms/ImageDataTable/index.js +3 -6
  9. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +115 -65
  10. package/dist/components/pages/ProviderProductEdition/index.js +333 -382
  11. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +63 -110
  12. package/dist/components/pages/RetailerProductEdition/index.js +217 -225
  13. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  14. package/dist/global-files/data.js +9 -10
  15. package/dist/index.js +13 -0
  16. package/package.json +1 -1
  17. package/src/components/atoms/GeneralInput/index.js +0 -1
  18. package/src/components/atoms/InputFormatter/index.js +6 -3
  19. package/src/components/molecules/HeaderTop/index.js +6 -1
  20. package/src/components/molecules/RetailerSelector/index.js +12 -0
  21. package/src/components/molecules/StatusAsignationInfo/index.js +3 -2
  22. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  23. package/src/components/organisms/FullTabsMenu/index.js +2 -0
  24. package/src/components/organisms/ImageDataTable/index.js +2 -5
  25. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +133 -71
  26. package/src/components/pages/ProviderProductEdition/index.js +208 -222
  27. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +59 -111
  28. package/src/components/pages/RetailerProductEdition/index.js +173 -148
  29. package/src/components/pages/RetailerProductEdition/styles.js +1 -1
  30. package/src/global-files/data.js +9 -10
  31. package/src/index.js +1 -0
  32. package/src/components/atoms/StatusTag/StatusTag.stories.js +0 -28
@@ -29,6 +29,7 @@ import { GenericModal } from "../../atoms/GenericModal";
29
29
  import { ScreenHeader } from "../../atoms/ScreenHeader";
30
30
  import { Loading } from "../../atoms/Loading";
31
31
  import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
32
+ import { getNewStatus } from "../../../global-files/data";
32
33
  import errorModal from "../../../assets/images/genericModal/errorModal.svg";
33
34
 
34
35
  const reducerImages = (state, action) => {
@@ -43,10 +44,10 @@ const reducerImages = (state, action) => {
43
44
  values[action.index][action.attribute] = action.value;
44
45
  return { ...state, values };
45
46
  case "changeAttrValue":
46
- action.retailersId.forEach((ret) => {
47
- attrForImgs[ret][action.index].name === action.name &&
48
- (attrForImgs[ret][action.index].value = action.value);
49
- });
47
+ const index = attrForImgs.general.findIndex((f) => (f.id = action.id));
48
+ if (index !== -1) {
49
+ attrForImgs.general[index].value = action.value;
50
+ }
50
51
 
51
52
  return { ...state, attrForImgs, values };
52
53
  case "deleteImage":
@@ -181,8 +182,11 @@ export const RetailerProductEdition = ({
181
182
  setServices(services);
182
183
  getServices();
183
184
 
184
- // setActiveRetailer(product?.retailers[0]);
185
- setImages({ action: "init", init: services[2] });
185
+ //setActiveRetailer(product?.retailers[0]);
186
+ setImages({
187
+ action: "init",
188
+ init: services[2],
189
+ });
186
190
  if (services[2]?.values?.length > 0) setActiveImage(0);
187
191
 
188
192
  getPercentage({ data: [product] }).then((res) => setPercentages(res));
@@ -200,22 +204,24 @@ export const RetailerProductEdition = ({
200
204
  );
201
205
  const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
202
206
 
203
- const retailers = product.retailers || product.retailersAvailable;
204
- const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
205
- const active = retailers?.find((retailer) =>
206
- retailerResponse.includes(retailer.id)
207
- );
207
+ let retailers = product.retailers || product.retailersAvailable;
208
+ let active = retailers?.filter((retailer) =>
209
+ parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
210
+ )[0];
208
211
  !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
209
212
  setServicesData(parsedResponse);
210
213
  };
211
214
 
212
215
  const translateConcept = (concept) => {
213
- const translation = {
214
- datasheet: "Ficha técnica",
215
- description: "Descripción",
216
- images: "Imágenes",
217
- };
218
- return translation[concept];
216
+ let translation = "";
217
+ if (concept === "datasheet") {
218
+ translation = "Ficha técnica";
219
+ } else if (concept === "description") {
220
+ translation = "Descripción";
221
+ } else if (concept === "images") {
222
+ translation = "Imágenes";
223
+ }
224
+ return translation;
219
225
  };
220
226
 
221
227
  const getComments = async (tab = "Descripción") => {
@@ -251,14 +257,14 @@ export const RetailerProductEdition = ({
251
257
  switch (user.id_role) {
252
258
  case 7:
253
259
  case 8:
254
- arr = ["CA", "RC", "RA"];
260
+ arr = ["IN_PROGRESS", "RF", "RA"];
255
261
  break;
256
262
  case 4:
257
263
  case 5:
258
- arr = ["RC", "AC", "AA", "AP", "ACA"];
264
+ arr = ["RF", "AF", "AA", "AP", "AC"];
259
265
  break;
260
266
  case 6:
261
- arr = ["RP", "RCA", "AC", "RA"];
267
+ arr = ["RP", "RC", "AF", "RA"];
262
268
  break;
263
269
  default:
264
270
  arr = [];
@@ -384,14 +390,13 @@ export const RetailerProductEdition = ({
384
390
  const saveDescriptions = async () => {
385
391
  setLoading(true);
386
392
  const productTemp = product;
387
- const articleId = product?.article?.id_article;
388
393
  const dataObject = {
389
- articleId,
394
+ articleId: product?.article?.id_article,
390
395
  articleData: updatedDescriptions,
391
396
  };
392
397
  if (product?.orderId) dataObject["orderId"] = product?.orderId;
393
398
  try {
394
- const res = await axios.put(
399
+ await axios.put(
395
400
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
396
401
  dataObject,
397
402
  {
@@ -400,16 +405,14 @@ export const RetailerProductEdition = ({
400
405
  },
401
406
  }
402
407
  );
403
- if (res.data.statusCode === 200) {
404
- const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
405
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
406
- if (newStatus) productTemp.description_status = newStatus;
408
+ if (productTemp.status === "ASSIGNED") {
409
+ productTemp.status = "IN_PROGRESS";
407
410
  setProduct(productTemp);
408
411
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
409
-
410
- setMessage("Descripciones guardadas con éxito");
411
- await loadData();
412
412
  }
413
+
414
+ setMessage("Descripciones guardadas con éxito");
415
+ loadData();
413
416
  } catch (error) {
414
417
  console.log(error);
415
418
  }
@@ -418,14 +421,13 @@ export const RetailerProductEdition = ({
418
421
  const saveDatasheets = async () => {
419
422
  setLoading(true);
420
423
  const productTemp = product;
421
- const articleId = product?.article?.id_article;
422
424
  const dataObject = {
423
- articleId,
425
+ articleId: product?.article?.id_article,
424
426
  articleData: updatedDatasheets,
425
427
  };
426
428
  if (product?.orderId) dataObject["orderId"] = product?.orderId;
427
429
  try {
428
- const res = await axios.put(
430
+ await axios.put(
429
431
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
430
432
  dataObject,
431
433
  {
@@ -434,16 +436,13 @@ export const RetailerProductEdition = ({
434
436
  },
435
437
  }
436
438
  );
437
- if (res.data.statusCode === 200) {
438
- const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
439
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
440
- if (newStatus) productTemp.datasheet_status = newStatus;
439
+ setMessage("Fichas técnicas guardadas");
440
+ if (productTemp.status === "ASSIGNED") {
441
+ productTemp.status = "IN_PROGRESS";
441
442
  setProduct(productTemp);
442
443
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
443
-
444
- setMessage("Fichas técnicas guardadas");
445
- await loadData();
446
444
  }
445
+ loadData();
447
446
  } catch (error) {
448
447
  console.log(error);
449
448
  }
@@ -470,13 +469,12 @@ export const RetailerProductEdition = ({
470
469
  return imagesListTemp[image?.image_id];
471
470
  });
472
471
 
473
- const attrForImgs = Object.values(images?.attrForImgs);
474
- attrForImgs.pop();
472
+ const attrForImgs = Object.values(images?.attrForImgs).pop();
475
473
  const data = {
476
474
  articleId: product?.article?.id_article,
477
475
  attrReqImgs: attrForImgs?.map((e) => ({
478
- attrId: e[0]?.id,
479
- value: e[0]?.value,
476
+ attrId: e.id,
477
+ value: e.value ?? "-",
480
478
  })),
481
479
  articleData: imagesList?.filter((e) => !e.id),
482
480
  updateImages: imagesList?.filter((e) => e.id),
@@ -527,6 +525,15 @@ export const RetailerProductEdition = ({
527
525
  } else {
528
526
  setImagesUploaded(true);
529
527
  }
528
+ let productTemp = product;
529
+ if (productTemp.status === "ASSIGNED") {
530
+ productTemp.status = "IN_PROGRESS";
531
+ setProduct(productTemp);
532
+ sessionStorage.setItem(
533
+ "productSelected",
534
+ JSON.stringify(productTemp)
535
+ );
536
+ }
530
537
  } catch (err) {
531
538
  console.log(err);
532
539
  // setMainLoading(false);
@@ -551,7 +558,7 @@ export const RetailerProductEdition = ({
551
558
  return e;
552
559
  });
553
560
  try {
554
- const res = await axios.put(
561
+ await axios.put(
555
562
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
556
563
  dataImages,
557
564
  {
@@ -560,21 +567,9 @@ export const RetailerProductEdition = ({
560
567
  },
561
568
  }
562
569
  );
563
- if (res.data.statusCode === 200) {
564
- let productTemp = product;
565
- const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
566
- if (newArticleStatus)
567
- productTemp.status = newArticleStatus[articleId];
568
- if (newStatus) productTemp.images_status = newStatus;
569
- setProduct(productTemp);
570
- sessionStorage.setItem(
571
- "productSelected",
572
- JSON.stringify(productTemp)
573
- );
574
- setMessage("Imágenes guardadas con éxito");
575
- sessionStorage.removeItem("imagesList");
576
- await loadData();
577
- }
570
+ setMessage("Imágenes guardadas con éxito");
571
+ sessionStorage.removeItem("imagesList");
572
+ loadData();
578
573
  } catch (error) {
579
574
  console.log(error);
580
575
  }
@@ -583,23 +578,24 @@ export const RetailerProductEdition = ({
583
578
 
584
579
  const evaluationFinished = (userId, tab, statusArray) => {
585
580
  const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
586
- const srvActive = srv
587
- .find((serv) => serv.id_retailer === activeRetailer?.id)
588
- ?.status?.replace(/.*\//, "");
589
- const currStatus = product[`${getConcept(tab)}_status`]?.replace(
590
- /.*\//,
591
- ""
581
+ const [srvActive] = srv.filter(
582
+ (serv) => serv.id_retailer === activeRetailer?.id
592
583
  );
593
- const unvalidated = ["IE", "CA"].includes(currStatus);
584
+ const unvalidated =
585
+ product[`${getConcept(tab)}_status`] === "QF" ||
586
+ product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
594
587
 
595
- const auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
588
+ const auditorUnvalidated = !["RA", "AA", "AC", "AP"].includes(
589
+ product[`${getConcept(tab)}_status`]
590
+ );
596
591
 
597
592
  switch (userId) {
598
593
  case 7:
599
594
  case 8:
600
595
  return (
601
- statusArray.includes(srvActive) &&
602
- (["RA", "RC"].includes(product?.status) ||
596
+ (["RA", "RF"].includes(product?.status) && //"IN_PROGRESS", "RF", "RA"
597
+ statusArray.includes(srvActive?.status)) ||
598
+ (statusArray.includes(product.status) &&
603
599
  srv.filter((serv) => statusArray.includes(serv.status)).length ===
604
600
  srv.length)
605
601
  );
@@ -607,16 +603,14 @@ export const RetailerProductEdition = ({
607
603
  case 5:
608
604
  return (
609
605
  unvalidated &&
610
- ["CA", "IE"].includes(product.status) && // "RC", "AC", "AA", "AP", "ACA"
606
+ ["IN_PROGRESS", "QF"].includes(product.status) && //"RF", "AF", "AA", "AP", "AC
611
607
  srv.filter((serv) => statusArray.includes(serv.status)).length ===
612
608
  srv.length
613
609
  );
614
610
  case 6:
615
611
  return (
616
- statusArray.includes(product.status) && // RP, RCA, AC, RA true
617
- srv.every((serv) =>
618
- ["RA", "AA", "AP", "ACA"].includes(serv.status)
619
- ) &&
612
+ statusArray.includes(product.status) && //RP, RC, AF, RA true
613
+ srv.every((serv) => ["RA", "AA", "AP", "AC"].includes(serv.status)) &&
620
614
  auditorUnvalidated
621
615
  );
622
616
  default:
@@ -638,20 +632,20 @@ export const RetailerProductEdition = ({
638
632
  const approveRejectButtons = (action) => {
639
633
  let concept = getConcept(action || activeTab);
640
634
 
641
- const retailerStatus = servicesData
642
- .find(
643
- (srv) =>
644
- srv.id_retailer === activeRetailer?.id && srv.service === concept
645
- )
646
- ?.status?.replace(/.*\//, "");
647
-
648
- //sessionStorage product
649
- const adminFacilitatorCanEvaluate =
650
- retailerStatus === "IE" && [1, 4, 5].includes(user.id_role);
651
- const adminAuditorCanEvaluate =
652
- ["AC", "RP", "RCA"].includes(retailerStatus) &&
653
- [1, 6].includes(user.id_role);
654
- return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
635
+ const [retailerStatus] = servicesData.filter(
636
+ (srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
637
+ );
638
+
639
+ return (
640
+ (retailerStatus?.status === "QF" &&
641
+ (user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
642
+ (retailerStatus?.status === "AF" && //sessionStorage product
643
+ (user.id_role === 1 || user.id_role === 6)) ||
644
+ (retailerStatus?.status === "RP" &&
645
+ (user.id_role === 1 || user.id_role === 6)) ||
646
+ (retailerStatus?.status === "RC" &&
647
+ (user.id_role === 1 || user.id_role === 6))
648
+ );
655
649
  };
656
650
 
657
651
  const getSectionIcon = () => {
@@ -675,57 +669,92 @@ export const RetailerProductEdition = ({
675
669
  try {
676
670
  let concept = getConcept(activeTab);
677
671
 
678
- const productTemp = { ...product };
679
- const evalStatus = retailerStatus;
680
- const articleId = product.article.id_article;
681
- const orderId = product.orderId;
682
-
683
- let data = {
684
- articleId,
685
- orderId,
686
- concept,
687
- evalStatus,
688
- retailerId: activeRetailer.id,
689
- };
690
- let res;
672
+ let productTemp = { ...product };
673
+ let evalStatus = product[`${concept}_status`];
674
+
675
+ let data = {};
691
676
  if (result) {
692
- data.result = result;
693
- res = await axios.put(
694
- `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
695
- data,
696
- {
697
- headers: {
698
- Authorization: token,
699
- },
700
- }
701
- );
677
+ data = {
678
+ articleId: product.article.id_article,
679
+ orderId: product.orderId,
680
+ concept: concept,
681
+ result: result,
682
+ evalStatus: evalStatus,
683
+ retailerId: activeRetailer.id,
684
+ };
685
+
686
+ await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
687
+ headers: {
688
+ Authorization: token,
689
+ },
690
+ });
702
691
  getServices();
703
692
  } else {
704
- const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
693
+ const specialistDone =
694
+ evalStatus === "RF" ||
695
+ evalStatus === "RA" ||
696
+ evalStatus === "IN_PROGRESS";
705
697
 
706
- let message;
707
698
  if (specialistDone) {
708
- message = `${activeTab} enviada a facilitador`;
699
+ setMessage(`${activeTab} enviada a facilitador`);
700
+ getSectionIcon();
701
+ } else if (evalStatus === "QF") {
702
+ setMessage("Evaluación enviada");
709
703
  getSectionIcon();
710
- } else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
711
- message = "Evaluación enviada";
704
+ } else if (evalStatus === "AF") {
705
+ setMessage("Evaluación enviada");
706
+ getSectionIcon();
707
+ } else if (evalStatus === "RP") {
708
+ setMessage("Evaluación enviada");
709
+ getSectionIcon();
710
+ } else if (evalStatus === "RC") {
711
+ setMessage("Evaluación enviada");
712
712
  getSectionIcon();
713
713
  }
714
- res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
714
+ let statusArr = [];
715
+ servicesData.forEach((srv) => {
716
+ srv.service === concept && statusArr.push(srv.status);
717
+ });
718
+
719
+ productTemp[`${concept}_status`] = getNewStatus(statusArr);
720
+
721
+ let newStatus = getNewStatus([
722
+ productTemp.datasheet_status,
723
+ productTemp.description_status,
724
+ productTemp.images_status,
725
+ ]);
726
+
727
+ productTemp.status = newStatus;
728
+
729
+ data = {
730
+ articleId: product.article.id_article,
731
+ orderId: product.orderId,
732
+ concept: concept,
733
+ evalStatus: evalStatus,
734
+ retailerId: activeRetailer.id,
735
+ };
736
+
737
+ switch (user.id_role) {
738
+ case 7:
739
+ case 8:
740
+ data.especialist = true;
741
+ break;
742
+ case 4:
743
+ case 5:
744
+ data.facilitator = true;
745
+ break;
746
+ default:
747
+ break;
748
+ }
749
+ await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
715
750
  headers: {
716
751
  Authorization: token,
717
752
  },
718
753
  });
719
754
  }
720
- if (res.data.statusCode === 200) {
721
- const { newStatus, newOrderStatus } = JSON.parse(res.data.body);
722
- if (newOrderStatus) productTemp.status = newOrderStatus[orderId];
723
- productTemp[`${concept}_status`] = newStatus;
724
- await loadData();
725
- if (message) setMessage(message);
726
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
727
- setProduct(productTemp);
728
- }
755
+ loadData();
756
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
757
+ setProduct(productTemp);
729
758
  } catch (error) {
730
759
  console.log(error);
731
760
  }
@@ -834,7 +863,7 @@ export const RetailerProductEdition = ({
834
863
  (input) =>
835
864
  input.required &&
836
865
  (!input.value ||
837
- input.value?.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
866
+ input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
838
867
  "") &&
839
868
  desInputsRequired++
840
869
  );
@@ -911,12 +940,12 @@ export const RetailerProductEdition = ({
911
940
  },
912
941
  ],
913
942
  concept: concept,
914
- userId: assignationId,
943
+ [`${assignationType}Id`]: assignationId,
915
944
  };
916
- await axios({
945
+ axios({
917
946
  method: "post",
918
947
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
919
- data,
948
+ data: data,
920
949
  headers: {
921
950
  Authorization: token,
922
951
  },
@@ -1105,7 +1134,7 @@ export const RetailerProductEdition = ({
1105
1134
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1106
1135
  setProduct(productTemp);
1107
1136
 
1108
- await loadData();
1137
+ loadData();
1109
1138
  } catch (error) {
1110
1139
  console.log(error);
1111
1140
  }
@@ -1183,7 +1212,7 @@ export const RetailerProductEdition = ({
1183
1212
  showApproveRejectAll={
1184
1213
  isAuditor &&
1185
1214
  servicesData.every((serv) =>
1186
- ["RA", "AA", "AP", "ACA", "AC"].includes(serv.status)
1215
+ ["RA", "AA", "AP", "AC", "AF"].includes(serv.status)
1187
1216
  ) &&
1188
1217
  approveRejectButtons() &&
1189
1218
  (auditorAssigned() || userAssigned())
@@ -1226,6 +1255,7 @@ export const RetailerProductEdition = ({
1226
1255
  }}
1227
1256
  />
1228
1257
  <FullTabsMenu
1258
+ canAssign={![7, 8].includes(user.id_role)}
1229
1259
  tabsSections={tabsSections}
1230
1260
  status={retailerStatus}
1231
1261
  activeTab={activeTab}
@@ -1376,21 +1406,16 @@ export const RetailerProductEdition = ({
1376
1406
  />
1377
1407
  </div>
1378
1408
  )}
1379
- {[7, 8].includes(user.id_role) && (
1380
- <Button
1381
- buttonType={
1382
- evaluationFinished(
1383
- user.id_role,
1384
- activeTab,
1385
- statusArray
1386
- ) && requiredNull[activeTab] === 0
1387
- ? "general-green-button"
1388
- : "general-button-disabled"
1389
- }
1390
- label={"Enviar evaluación"}
1391
- onClick={() => sendToFacilitator()}
1392
- />
1393
- )}
1409
+ <Button
1410
+ buttonType={
1411
+ evaluationFinished(user.id_role, activeTab, statusArray) &&
1412
+ requiredNull[activeTab] === 0
1413
+ ? "general-green-button"
1414
+ : "general-button-disabled"
1415
+ }
1416
+ label={"Enviar evaluación"}
1417
+ onClick={() => sendToFacilitator()}
1418
+ />
1394
1419
  </div>
1395
1420
  )}
1396
1421
  </div>
@@ -20,7 +20,7 @@ export const Container = styled.div`
20
20
  }
21
21
 
22
22
  .product-information {
23
- width: 100%;
23
+ width: calc(100% - 341px);
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
 
@@ -195,19 +195,18 @@ export const fetchUsers = async (auth) => {
195
195
  export const getNewStatus = (statusArray) => {
196
196
  let lookupString = "";
197
197
  statusArray.forEach((element) => (lookupString += element + "/"));
198
- if (lookupString.includes("RCA")) return "RCA";
199
- if (lookupString.includes("RC")) return "RC";
198
+ if (lookupString.includes("RF")) return "RF";
200
199
  if (lookupString.includes("RA")) return "RA";
201
200
  if (lookupString.includes("RP")) return "RP";
202
- if (lookupString.includes("ACA")) return "ACA";
203
- if (lookupString.includes("UNASSIGNED")) return "CA";
204
- if (lookupString.includes("CA")) return "CA";
205
- if (lookupString.includes("IE")) return "IE";
206
- if (lookupString.includes("AC")) return "AC";
201
+ if (lookupString.includes("RC")) return "RC";
202
+ if (lookupString.includes("UNASSIGNED")) return "IN_PROGRESS";
203
+ if (lookupString.includes("IN_PROGRESS")) return "IN_PROGRESS";
204
+ if (lookupString.includes("QF")) return "QF";
205
+ if (lookupString.includes("AF")) return "AF";
207
206
  if (lookupString.includes("AA")) return "AA";
208
207
  if (lookupString.includes("AP")) return "AP";
209
- if (lookupString.includes("R")) return "R";
208
+ if (lookupString.includes("AC")) return "AC";
209
+ if (lookupString.includes("RECEIVED")) return "RECEIVED";
210
210
  if (lookupString.includes("NA")) return "NA";
211
- console.log("Status not found");
212
- return "NA";
211
+ return new Error("Status not found");
213
212
  };
package/src/index.js CHANGED
@@ -65,6 +65,7 @@ export * from "./components/pages/CustomerLogin";
65
65
  export * from "./components/pages/CustomerType";
66
66
  export * from "./components/pages/EmailResetPassword";
67
67
  export * from "./components/pages/OnboardPlan";
68
+ export * from "./components/pages/RegistrationLoginFirstStep";
68
69
  export * from "./components/pages/RegistrationLoginSecondStep";
69
70
  export * from "./components/pages/RegistrationLoginThirdStep";
70
71
  export * from "./components/pages/RetailerProductEdition";
@@ -1,28 +0,0 @@
1
- import { StatusTag } from "./index";
2
- import { GlobalStatus } from "../../../global-files/variables";
3
-
4
- const status = GlobalStatus;
5
-
6
- export default {
7
- title: "Components/atoms/StatusTag",
8
- component: StatusTag,
9
- argTypes: {
10
- statusType: {
11
- options: status,
12
- control: { type: "select" },
13
- },
14
- ovalForm: {
15
- options: [true, false],
16
- control: { type: "boolean" },
17
- },
18
- },
19
- };
20
-
21
- const Template = (args) => <StatusTag {...args} />;
22
-
23
- export const StatusTagDefault = Template.bind({});
24
-
25
- StatusTagDefault.args = {
26
- statusType: "-",
27
- ovalForm: false,
28
- };