contentoh-components-library 21.1.70 → 21.1.71

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 (42) hide show
  1. package/dist/components/atoms/AsignationOption/index.js +2 -2
  2. package/dist/components/atoms/ProductPercentCard/Percent.stories.js +1 -1
  3. package/dist/components/atoms/ProductPercentCard/styles.js +1 -1
  4. package/dist/components/atoms/Status/Status.stories.js +31 -0
  5. package/dist/components/atoms/Status/index.js +23 -0
  6. package/dist/components/atoms/Status/styles.js +20 -0
  7. package/dist/components/molecules/AssignedWork/AssignedWork.stories.js +1 -1
  8. package/dist/components/molecules/AssignedWork/styles.js +1 -1
  9. package/dist/components/molecules/ProductNameHeader/index.js +2 -2
  10. package/dist/components/molecules/StatusAsignationInfo/index.js +3 -3
  11. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +2 -6
  13. package/dist/components/pages/ProviderProductEdition/index.js +433 -433
  14. package/dist/components/pages/RetailerProductEdition/index.js +217 -200
  15. package/dist/global-files/data.js +8 -8
  16. package/dist/index.js +1 -1
  17. package/package.json +1 -1
  18. package/src/components/atoms/AsignationOption/index.js +2 -2
  19. package/src/components/atoms/ProductPercentCard/Percent.stories.js +11 -12
  20. package/src/components/atoms/ProductPercentCard/styles.js +9 -9
  21. package/src/components/atoms/Status/Status.stories.js +14 -0
  22. package/src/components/atoms/Status/index.js +9 -0
  23. package/src/components/atoms/{StatusTag → Status}/styles.js +7 -10
  24. package/src/components/molecules/AssignedWork/AssignedWork.stories.js +8 -8
  25. package/src/components/molecules/AssignedWork/styles.js +9 -10
  26. package/src/components/molecules/ProductNameHeader/index.js +2 -2
  27. package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
  28. package/src/components/organisms/FullProductNameHeader/index.js +2 -2
  29. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +2 -3
  30. package/src/components/pages/ProviderProductEdition/index.js +233 -250
  31. package/src/components/pages/RetailerProductEdition/index.js +149 -173
  32. package/src/global-files/data.js +8 -8
  33. package/src/index.js +1 -1
  34. package/dist/components/atoms/ProgressBar/styles.js +0 -22
  35. package/dist/components/atoms/StatusTag/StatusTag.stories.js +0 -48
  36. package/dist/components/atoms/StatusTag/index.js +0 -58
  37. package/dist/components/atoms/StatusTag/styles.js +0 -20
  38. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -37
  39. package/dist/components/pages/RegistrationLoginFirstStep/index.js +0 -269
  40. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +0 -20
  41. package/src/components/atoms/ProgressBar/styles.js +0 -69
  42. package/src/components/atoms/StatusTag/index.js +0 -37
@@ -29,7 +29,6 @@ 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";
33
32
  import errorModal from "../../../assets/images/genericModal/errorModal.svg";
34
33
  import { VersionSelector } from "../../organisms/VersionSelector";
35
34
  import { closeModals } from "../../../global-files/customHooks";
@@ -188,11 +187,8 @@ export const RetailerProductEdition = ({
188
187
  setServices(services);
189
188
  getServices();
190
189
 
191
- //setActiveRetailer(product?.retailers[0]);
192
- setImages({
193
- action: "init",
194
- init: services[2],
195
- });
190
+ // setActiveRetailer(product?.retailers[0]);
191
+ setImages({ action: "init", init: services[2] });
196
192
  if (services[2]?.values?.length > 0) setActiveImage(0);
197
193
 
198
194
  getPercentage({ data: [product] }).then((res) => setPercentages(res));
@@ -210,24 +206,22 @@ export const RetailerProductEdition = ({
210
206
  );
211
207
  const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
212
208
 
213
- let retailers = product.retailers || product.retailersAvailable;
214
- let active = retailers?.filter((retailer) =>
215
- parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
216
- )[0];
209
+ const retailers = product.retailers || product.retailersAvailable;
210
+ const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
211
+ const active = retailers?.find((retailer) =>
212
+ retailerResponse.includes(retailer.id)
213
+ );
217
214
  !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
218
215
  setServicesData(parsedResponse);
219
216
  };
220
217
 
221
218
  const translateConcept = (concept) => {
222
- let translation = "";
223
- if (concept === "datasheet") {
224
- translation = "Ficha técnica";
225
- } else if (concept === "description") {
226
- translation = "Descripción";
227
- } else if (concept === "images") {
228
- translation = "Imágenes";
229
- }
230
- return translation;
219
+ const translation = {
220
+ datasheet: "Ficha técnica",
221
+ description: "Descripción",
222
+ images: "Imágenes",
223
+ };
224
+ return translation[concept];
231
225
  };
232
226
 
233
227
  const getComments = async (tab = "Descripción") => {
@@ -264,14 +258,14 @@ export const RetailerProductEdition = ({
264
258
  switch (user.id_role) {
265
259
  case 7:
266
260
  case 8:
267
- arr = ["IN_PROGRESS", "RF", "RA"];
261
+ arr = ["CA", "RC", "RA"];
268
262
  break;
269
263
  case 4:
270
264
  case 5:
271
- arr = ["RF", "AF", "AA", "AP", "AC"];
265
+ arr = ["RC", "AC", "AA", "AP", "ACA"];
272
266
  break;
273
267
  case 6:
274
- arr = ["RP", "RC", "AF", "RA"];
268
+ arr = ["RP", "RCA", "AC", "RA"];
275
269
  break;
276
270
  default:
277
271
  arr = [];
@@ -397,13 +391,14 @@ export const RetailerProductEdition = ({
397
391
  const saveDescriptions = async () => {
398
392
  setLoading(true);
399
393
  const productTemp = product;
394
+ const articleId = product?.article?.id_article;
400
395
  const dataObject = {
401
- articleId: product?.article?.id_article,
396
+ articleId,
402
397
  articleData: updatedDescriptions,
403
398
  };
404
399
  if (product?.orderId) dataObject["orderId"] = product?.orderId;
405
400
  try {
406
- await axios.put(
401
+ const res = await axios.put(
407
402
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
408
403
  dataObject,
409
404
  {
@@ -412,14 +407,16 @@ export const RetailerProductEdition = ({
412
407
  },
413
408
  }
414
409
  );
415
- if (productTemp.status === "ASSIGNED") {
416
- productTemp.status = "IN_PROGRESS";
410
+ if (res.data.statusCode === 200) {
411
+ const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
412
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
413
+ if (newStatus) productTemp.description_status = newStatus;
417
414
  setProduct(productTemp);
418
415
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
419
- }
420
416
 
421
- setMessage("Descripciones guardadas con éxito");
422
- loadData();
417
+ setMessage("Descripciones guardadas con éxito");
418
+ await loadData();
419
+ }
423
420
  } catch (error) {
424
421
  console.log(error);
425
422
  }
@@ -428,13 +425,14 @@ export const RetailerProductEdition = ({
428
425
  const saveDatasheets = async () => {
429
426
  setLoading(true);
430
427
  const productTemp = product;
428
+ const articleId = product?.article?.id_article;
431
429
  const dataObject = {
432
- articleId: product?.article?.id_article,
430
+ articleId,
433
431
  articleData: updatedDatasheets,
434
432
  };
435
433
  if (product?.orderId) dataObject["orderId"] = product?.orderId;
436
434
  try {
437
- await axios.put(
435
+ const res = await axios.put(
438
436
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
439
437
  dataObject,
440
438
  {
@@ -443,13 +441,16 @@ export const RetailerProductEdition = ({
443
441
  },
444
442
  }
445
443
  );
446
- setMessage("Fichas técnicas guardadas");
447
- if (productTemp.status === "ASSIGNED") {
448
- productTemp.status = "IN_PROGRESS";
444
+ if (res.data.statusCode === 200) {
445
+ const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
446
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
447
+ if (newStatus) productTemp.datasheet_status = newStatus;
449
448
  setProduct(productTemp);
450
449
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
450
+
451
+ setMessage("Fichas técnicas guardadas");
452
+ await loadData();
451
453
  }
452
- loadData();
453
454
  } catch (error) {
454
455
  console.log(error);
455
456
  }
@@ -532,15 +533,6 @@ export const RetailerProductEdition = ({
532
533
  } else {
533
534
  setImagesUploaded(true);
534
535
  }
535
- let productTemp = product;
536
- if (productTemp.status === "ASSIGNED") {
537
- productTemp.status = "IN_PROGRESS";
538
- setProduct(productTemp);
539
- sessionStorage.setItem(
540
- "productSelected",
541
- JSON.stringify(productTemp)
542
- );
543
- }
544
536
  } catch (err) {
545
537
  console.log(err);
546
538
  // setMainLoading(false);
@@ -565,7 +557,7 @@ export const RetailerProductEdition = ({
565
557
  return e;
566
558
  });
567
559
  try {
568
- await axios.put(
560
+ const res = await axios.put(
569
561
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
570
562
  dataImages,
571
563
  {
@@ -574,9 +566,21 @@ export const RetailerProductEdition = ({
574
566
  },
575
567
  }
576
568
  );
577
- setMessage("Imágenes guardadas con éxito");
578
- sessionStorage.removeItem("imagesList");
579
- loadData();
569
+ if (res.data.statusCode === 200) {
570
+ let productTemp = product;
571
+ const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
572
+ if (newArticleStatus)
573
+ productTemp.status = newArticleStatus[articleId];
574
+ if (newStatus) productTemp.images_status = newStatus;
575
+ setProduct(productTemp);
576
+ sessionStorage.setItem(
577
+ "productSelected",
578
+ JSON.stringify(productTemp)
579
+ );
580
+ setMessage("Imágenes guardadas con éxito");
581
+ sessionStorage.removeItem("imagesList");
582
+ await loadData();
583
+ }
580
584
  } catch (error) {
581
585
  console.log(error);
582
586
  }
@@ -585,24 +589,23 @@ export const RetailerProductEdition = ({
585
589
 
586
590
  const evaluationFinished = (userId, tab, statusArray) => {
587
591
  const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
588
- const [srvActive] = srv.filter(
589
- (serv) => serv.id_retailer === activeRetailer?.id
592
+ const srvActive = srv
593
+ .find((serv) => serv.id_retailer === activeRetailer?.id)
594
+ ?.status?.replace(/.*\//, "");
595
+ const currStatus = product[`${getConcept(tab)}_status`]?.replace(
596
+ /.*\//,
597
+ ""
590
598
  );
591
- const unvalidated =
592
- product[`${getConcept(tab)}_status`] === "QF" ||
593
- product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
599
+ const unvalidated = ["IE", "CA"].includes(currStatus);
594
600
 
595
- const auditorUnvalidated = !["RA", "AA", "AC", "AP"].includes(
596
- product[`${getConcept(tab)}_status`]
597
- );
601
+ const auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
598
602
 
599
603
  switch (userId) {
600
604
  case 7:
601
605
  case 8:
602
606
  return (
603
- (["RA", "RF"].includes(product?.status) && //"IN_PROGRESS", "RF", "RA"
604
- statusArray.includes(srvActive?.status)) ||
605
- (statusArray.includes(product.status) &&
607
+ statusArray.includes(srvActive) &&
608
+ (["RA", "RC"].includes(product?.status) ||
606
609
  srv.filter((serv) => statusArray.includes(serv.status)).length ===
607
610
  srv.length)
608
611
  );
@@ -610,14 +613,16 @@ export const RetailerProductEdition = ({
610
613
  case 5:
611
614
  return (
612
615
  unvalidated &&
613
- ["IN_PROGRESS", "QF"].includes(product.status) && //"RF", "AF", "AA", "AP", "AC
616
+ ["CA", "IE"].includes(product.status) && // "RC", "AC", "AA", "AP", "ACA"
614
617
  srv.filter((serv) => statusArray.includes(serv.status)).length ===
615
618
  srv.length
616
619
  );
617
620
  case 6:
618
621
  return (
619
- statusArray.includes(product.status) && //RP, RC, AF, RA true
620
- srv.every((serv) => ["RA", "AA", "AP", "AC"].includes(serv.status)) &&
622
+ statusArray.includes(product.status) && // RP, RCA, AC, RA true
623
+ srv.every((serv) =>
624
+ ["RA", "AA", "AP", "ACA"].includes(serv.status)
625
+ ) &&
621
626
  auditorUnvalidated
622
627
  );
623
628
  default:
@@ -639,20 +644,20 @@ export const RetailerProductEdition = ({
639
644
  const approveRejectButtons = (action) => {
640
645
  let concept = getConcept(action || activeTab);
641
646
 
642
- const [retailerStatus] = servicesData.filter(
643
- (srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
644
- );
645
-
646
- return (
647
- (retailerStatus?.status === "QF" &&
648
- (user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
649
- (retailerStatus?.status === "AF" && //sessionStorage product
650
- (user.id_role === 1 || user.id_role === 6)) ||
651
- (retailerStatus?.status === "RP" &&
652
- (user.id_role === 1 || user.id_role === 6)) ||
653
- (retailerStatus?.status === "RC" &&
654
- (user.id_role === 1 || user.id_role === 6))
655
- );
647
+ const retailerStatus = servicesData
648
+ .find(
649
+ (srv) =>
650
+ srv.id_retailer === activeRetailer?.id && srv.service === concept
651
+ )
652
+ ?.status?.replace(/.*\//, "");
653
+
654
+ //sessionStorage product
655
+ const adminFacilitatorCanEvaluate =
656
+ retailerStatus === "IE" && [1, 4, 5].includes(user.id_role);
657
+ const adminAuditorCanEvaluate =
658
+ ["AC", "RP", "RCA"].includes(retailerStatus) &&
659
+ [1, 6].includes(user.id_role);
660
+ return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
656
661
  };
657
662
 
658
663
  const getSectionIcon = () => {
@@ -676,92 +681,57 @@ export const RetailerProductEdition = ({
676
681
  try {
677
682
  let concept = getConcept(activeTab);
678
683
 
679
- let productTemp = { ...product };
680
- let evalStatus = product[`${concept}_status`];
681
-
682
- let data = {};
684
+ const productTemp = { ...product };
685
+ const evalStatus = retailerStatus;
686
+ const articleId = product.article.id_article;
687
+ const orderId = product.orderId;
688
+
689
+ let data = {
690
+ articleId,
691
+ orderId,
692
+ concept,
693
+ evalStatus,
694
+ retailerId: activeRetailer.id,
695
+ };
696
+ let res;
697
+ let message;
683
698
  if (result) {
684
- data = {
685
- articleId: product.article.id_article,
686
- orderId: product.orderId,
687
- concept: concept,
688
- result: result,
689
- evalStatus: evalStatus,
690
- retailerId: activeRetailer.id,
691
- };
692
-
693
- await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
694
- headers: {
695
- Authorization: token,
696
- },
697
- });
699
+ data.result = result;
700
+ res = await axios.put(
701
+ `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
702
+ data,
703
+ {
704
+ headers: {
705
+ Authorization: token,
706
+ },
707
+ }
708
+ );
698
709
  getServices();
699
710
  } else {
700
- const specialistDone =
701
- evalStatus === "RF" ||
702
- evalStatus === "RA" ||
703
- evalStatus === "IN_PROGRESS";
711
+ const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
704
712
 
705
713
  if (specialistDone) {
706
- setMessage(`${activeTab} enviada a facilitador`);
714
+ message = `${activeTab} enviada a facilitador`;
707
715
  getSectionIcon();
708
- } else if (evalStatus === "QF") {
709
- setMessage("Evaluación enviada");
710
- getSectionIcon();
711
- } else if (evalStatus === "AF") {
712
- setMessage("Evaluación enviada");
713
- getSectionIcon();
714
- } else if (evalStatus === "RP") {
715
- setMessage("Evaluación enviada");
716
- getSectionIcon();
717
- } else if (evalStatus === "RC") {
718
- setMessage("Evaluación enviada");
716
+ } else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
717
+ message = "Evaluación enviada";
719
718
  getSectionIcon();
720
719
  }
721
- let statusArr = [];
722
- servicesData.forEach((srv) => {
723
- srv.service === concept && statusArr.push(srv.status);
724
- });
725
-
726
- productTemp[`${concept}_status`] = getNewStatus(statusArr);
727
-
728
- let newStatus = getNewStatus([
729
- productTemp.datasheet_status,
730
- productTemp.description_status,
731
- productTemp.images_status,
732
- ]);
733
-
734
- productTemp.status = newStatus;
735
-
736
- data = {
737
- articleId: product.article.id_article,
738
- orderId: product.orderId,
739
- concept: concept,
740
- evalStatus: evalStatus,
741
- retailerId: activeRetailer.id,
742
- };
743
-
744
- switch (user.id_role) {
745
- case 7:
746
- case 8:
747
- data.especialist = true;
748
- break;
749
- case 4:
750
- case 5:
751
- data.facilitator = true;
752
- break;
753
- default:
754
- break;
755
- }
756
- await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
720
+ res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
757
721
  headers: {
758
722
  Authorization: token,
759
723
  },
760
724
  });
761
725
  }
762
- loadData();
763
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
764
- setProduct(productTemp);
726
+ if (res.data.statusCode === 200) {
727
+ const { newStatus, newOrderStatus } = JSON.parse(res.data.body);
728
+ if (newOrderStatus) productTemp.status = newOrderStatus[orderId];
729
+ productTemp[`${concept}_status`] = newStatus;
730
+ await loadData();
731
+ if (message) setMessage(message);
732
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
733
+ setProduct(productTemp);
734
+ }
765
735
  } catch (error) {
766
736
  console.log(error);
767
737
  }
@@ -859,21 +829,23 @@ export const RetailerProductEdition = ({
859
829
 
860
830
  objetcTemp["Ficha técnica"] = dsInputsRequired.length;
861
831
 
832
+ const regex = /(<\/?p>)|(<\/?strong>)|(<br>)/gm;
862
833
  descriptionsServicesArray.forEach((description) => {
863
834
  const [requested] = servicesData.filter(
864
835
  (srv) =>
865
836
  srv.id_retailer === description.id &&
866
837
  srv.service === getConcept(activeTab)
867
838
  );
868
- requested &&
869
- description.inputs.forEach(
870
- (input) =>
839
+ if (requested) {
840
+ description.inputs.forEach((input) => {
841
+ if (
871
842
  input.required &&
872
- (!input.value ||
873
- input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
874
- "") &&
875
- desInputsRequired++
876
- );
843
+ (!input.value || input.value?.replace(regex, "") === "")
844
+ ) {
845
+ desInputsRequired++;
846
+ }
847
+ });
848
+ }
877
849
  });
878
850
 
879
851
  objetcTemp["Descripción"] = desInputsRequired;
@@ -947,12 +919,12 @@ export const RetailerProductEdition = ({
947
919
  },
948
920
  ],
949
921
  concept: concept,
950
- [`${assignationType}Id`]: assignationId,
922
+ userId: assignationId,
951
923
  };
952
- axios({
924
+ await axios({
953
925
  method: "post",
954
926
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
955
- data: data,
927
+ data,
956
928
  headers: {
957
929
  Authorization: token,
958
930
  },
@@ -1141,7 +1113,7 @@ export const RetailerProductEdition = ({
1141
1113
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1142
1114
  setProduct(productTemp);
1143
1115
 
1144
- loadData();
1116
+ await loadData();
1145
1117
  } catch (error) {
1146
1118
  console.log(error);
1147
1119
  }
@@ -1219,7 +1191,7 @@ export const RetailerProductEdition = ({
1219
1191
  showApproveRejectAll={
1220
1192
  isAuditor &&
1221
1193
  servicesData.every((serv) =>
1222
- ["RA", "AA", "AP", "AC", "AF"].includes(serv.status)
1194
+ ["RA", "AA", "AP", "ACA", "AC"].includes(serv.status)
1223
1195
  ) &&
1224
1196
  approveRejectButtons() &&
1225
1197
  (auditorAssigned() || userAssigned())
@@ -1262,7 +1234,6 @@ export const RetailerProductEdition = ({
1262
1234
  }}
1263
1235
  />
1264
1236
  <FullTabsMenu
1265
- canAssign={![7, 8].includes(user.id_role)}
1266
1237
  tabsSections={tabsSections}
1267
1238
  status={retailerStatus}
1268
1239
  activeTab={activeTab}
@@ -1415,16 +1386,21 @@ export const RetailerProductEdition = ({
1415
1386
  />
1416
1387
  </div>
1417
1388
  )}
1418
- <Button
1419
- buttonType={
1420
- evaluationFinished(user.id_role, activeTab, statusArray) &&
1421
- requiredNull[activeTab] === 0
1422
- ? "general-green-button"
1423
- : "general-button-disabled"
1424
- }
1425
- label={"Enviar evaluación"}
1426
- onClick={() => sendToFacilitator()}
1427
- />
1389
+ {[7, 8].includes(user.id_role) && (
1390
+ <Button
1391
+ buttonType={
1392
+ evaluationFinished(
1393
+ user.id_role,
1394
+ activeTab,
1395
+ statusArray
1396
+ ) && requiredNull[activeTab] === 0
1397
+ ? "general-green-button"
1398
+ : "general-button-disabled"
1399
+ }
1400
+ label={"Enviar evaluación"}
1401
+ onClick={() => sendToFacilitator()}
1402
+ />
1403
+ )}
1428
1404
  </div>
1429
1405
  )}
1430
1406
  </div>
@@ -195,18 +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("RF")) return "RF";
198
+ if (lookupString.includes("RCA")) return "RCA";
199
+ if (lookupString.includes("RC")) return "RC";
199
200
  if (lookupString.includes("RA")) return "RA";
200
201
  if (lookupString.includes("RP")) return "RP";
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";
202
+ if (lookupString.includes("ACA")) return "ACA";
203
+ if (lookupString.includes("PA")) return "PA";
204
+ if (lookupString.includes("CA")) return "CA";
205
+ if (lookupString.includes("IE")) return "IE";
206
+ if (lookupString.includes("AC")) return "AC";
206
207
  if (lookupString.includes("AA")) return "AA";
207
208
  if (lookupString.includes("AP")) return "AP";
208
- if (lookupString.includes("AC")) return "AC";
209
- if (lookupString.includes("RECEIVED")) return "RECEIVED";
209
+ if (lookupString.includes("R")) return "R";
210
210
  if (lookupString.includes("NA")) return "NA";
211
211
  return new Error("Status not found");
212
212
  };
package/src/index.js CHANGED
@@ -19,7 +19,7 @@ export * from "./components/atoms/ProgressBar/index";
19
19
  export * from "./components/atoms/ScreenHeader/index";
20
20
  export * from "./components/atoms/SideMenuButton/index";
21
21
  export * from "./components/atoms/SliderToolTip/index";
22
- export * from "./components/atoms/StatusTag/index";
22
+ export * from "./components/atoms/Status/index";
23
23
  export * from "./components/atoms/TabSection/index";
24
24
  export * from "./components/atoms/ValidationPanel/index";
25
25
 
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Container = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
-
12
- var _styledComponents = _interopRequireDefault(require("styled-components"));
13
-
14
- var _variables = require("../../../global-files/variables");
15
-
16
- var _templateObject;
17
-
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n width: fit-content;\n height: 27px;\n padding: 4px;\n border-radius: 15px;\n font-family: ", ";\n font-weight: 600;\n font-size: 14px;\n line-height: 19px;\n color: ", ";\n\n &.status-As,\n &.status-P {\n background-color: ", ";\n }\n\n &.status-Pr,\n &.status-Rr {\n background-color: ", ";\n }\n\n &.status-AA,\n &.status-AP,\n &.status-AC,\n &.status-AF {\n background-color: ", ";\n }\n\n &.status-RA,\n &.status-RF,\n &.status-RP,\n &.status-RC {\n background-color: ", ";\n }\n\n &.status-Dat,\n &.status-Dsc,\n &.status-Imgs {\n background-color: ", ";\n }\n\n &.status-Ex {\n background-color: ", ";\n }\n\n &.status-DDI {\n background-color: ", ";\n }\n\n &.status-GLD {\n background-color: ", ";\n }\n\n &.status-TAB {\n background-color: ", ";\n }\n\n &.status-Pt {\n background-color: ", ";\n color: ", ";\n }\n"])), _variables.GlobalColors.s3, _variables.FontFamily.AvenirNext, function (backgroundColor) {
19
- return backgroundColor === "s2" || backgroundColor === "s1" ? _variables.GlobalColors.s4 : _variables.GlobalColors.white;
20
- }, _variables.GlobalColors.in_progress, _variables.GlobalColors.reception, _variables.GlobalColors.finished, _variables.GlobalColors.rejected_status, _variables.GlobalColors.s4, _variables.GlobalColors.exported, _variables.GlobalColors.original_purpura, _variables.GlobalColors.in_progress, _variables.GlobalColors.deep_gray, _variables.GlobalColors.s2, _variables.GlobalColors.s4);
21
-
22
- exports.Container = Container;
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.StatusTagDefault = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _index = require("./index");
13
-
14
- var _variables = require("../../../global-files/variables");
15
-
16
- var _jsxRuntime = require("react/jsx-runtime");
17
-
18
- var status = _variables.GlobalStatus;
19
- var _default = {
20
- title: "Components/atoms/StatusTag",
21
- component: _index.StatusTag,
22
- argTypes: {
23
- statusType: {
24
- options: status,
25
- control: {
26
- type: "select"
27
- }
28
- },
29
- ovalForm: {
30
- options: [true, false],
31
- control: {
32
- type: "boolean"
33
- }
34
- }
35
- }
36
- };
37
- exports.default = _default;
38
-
39
- var Template = function Template(args) {
40
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StatusTag, (0, _objectSpread2.default)({}, args));
41
- };
42
-
43
- var StatusTagDefault = Template.bind({});
44
- exports.StatusTagDefault = StatusTagDefault;
45
- StatusTagDefault.args = {
46
- statusType: "-",
47
- ovalForm: false
48
- };