contentoh-components-library 21.1.62 → 21.1.65

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 (63) hide show
  1. package/.env.development +1 -0
  2. package/.env.production +1 -0
  3. package/dist/assets/images/versionSelector/acceptIcon.svg +3 -0
  4. package/dist/assets/images/versionSelector/addVersion.svg +5 -0
  5. package/dist/assets/images/versionSelector/closeVersionSelector.svg +4 -0
  6. package/dist/assets/images/versionSelector/createVersion.svg +3 -0
  7. package/dist/assets/images/versionSelector/nullIcon.svg +3 -0
  8. package/dist/assets/images/versionSelector/versionSelected.svg +3 -0
  9. package/dist/components/atoms/GeneralButton/index.js +3 -1
  10. package/dist/components/atoms/GeneralButton/styles.js +2 -2
  11. package/dist/components/atoms/Select/VersionSelect.js +37 -0
  12. package/dist/components/atoms/Select/index.js +4 -3
  13. package/dist/components/atoms/Select/style.js +10 -4
  14. package/dist/components/atoms/SliderToolTip/styles.js +2 -2
  15. package/dist/components/molecules/StatusAsignationInfo/index.js +9 -1
  16. package/dist/components/molecules/VersionItem/VersionItem.stories.js +28 -0
  17. package/dist/components/molecules/VersionItem/index.js +64 -0
  18. package/dist/components/molecules/VersionItem/styles.js +20 -0
  19. package/dist/components/organisms/CreateVersion/CreateVersion.stories.js +31 -0
  20. package/dist/components/organisms/CreateVersion/RenderChilds.js +157 -0
  21. package/dist/components/organisms/CreateVersion/index.js +170 -0
  22. package/dist/components/organisms/CreateVersion/styles.js +28 -0
  23. package/dist/components/organisms/FullTabsMenu/index.js +6 -2
  24. package/dist/components/organisms/VersionSelector/VersionSelector.stories.js +32 -0
  25. package/dist/components/organisms/VersionSelector/index.js +129 -0
  26. package/dist/components/organisms/VersionSelector/styles.js +20 -0
  27. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +78 -104
  28. package/dist/components/pages/ProviderProductEdition/index.js +35 -16
  29. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +49 -56
  30. package/dist/components/pages/RetailerProductEdition/index.js +46 -15
  31. package/dist/global-files/customHooks.js +35 -0
  32. package/dist/global-files/global-styles.css +1 -0
  33. package/package.json +1 -1
  34. package/src/assets/images/versionSelector/acceptIcon.svg +3 -0
  35. package/src/assets/images/versionSelector/addVersion.svg +5 -0
  36. package/src/assets/images/versionSelector/closeVersionSelector.svg +4 -0
  37. package/src/assets/images/versionSelector/createVersion.svg +3 -0
  38. package/src/assets/images/versionSelector/nullIcon.svg +3 -0
  39. package/src/assets/images/versionSelector/versionSelected.svg +3 -0
  40. package/src/components/atoms/GeneralButton/index.js +2 -0
  41. package/src/components/atoms/GeneralButton/styles.js +18 -0
  42. package/src/components/atoms/Select/VersionSelect.js +25 -0
  43. package/src/components/atoms/Select/index.js +1 -1
  44. package/src/components/atoms/Select/style.js +19 -0
  45. package/src/components/atoms/SliderToolTip/styles.js +18 -14
  46. package/src/components/molecules/StatusAsignationInfo/index.js +10 -1
  47. package/src/components/molecules/VersionItem/VersionItem.stories.js +14 -0
  48. package/src/components/molecules/VersionItem/index.js +47 -0
  49. package/src/components/molecules/VersionItem/styles.js +32 -0
  50. package/src/components/organisms/CreateVersion/CreateVersion.stories.js +14 -0
  51. package/src/components/organisms/CreateVersion/RenderChilds.js +137 -0
  52. package/src/components/organisms/CreateVersion/index.js +88 -0
  53. package/src/components/organisms/CreateVersion/styles.js +79 -0
  54. package/src/components/organisms/FullTabsMenu/index.js +5 -1
  55. package/src/components/organisms/VersionSelector/VersionSelector.stories.js +15 -0
  56. package/src/components/organisms/VersionSelector/index.js +75 -0
  57. package/src/components/organisms/VersionSelector/styles.js +28 -0
  58. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +97 -134
  59. package/src/components/pages/ProviderProductEdition/index.js +19 -2
  60. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +49 -56
  61. package/src/components/pages/RetailerProductEdition/index.js +28 -2
  62. package/src/global-files/customHooks.js +26 -0
  63. package/src/global-files/global-styles.css +1 -0
@@ -95,6 +95,10 @@ var _slide4 = _interopRequireDefault(require("../../../assets/images/sliderToolT
95
95
 
96
96
  var _slide5 = _interopRequireDefault(require("../../../assets/images/sliderToolTip/slide5.svg"));
97
97
 
98
+ var _VersionSelector = require("../../organisms/VersionSelector");
99
+
100
+ var _customHooks = require("../../../global-files/customHooks");
101
+
98
102
  var _jsxRuntime = require("react/jsx-runtime");
99
103
 
100
104
  var reducerImages = function reducerImages(state, action) {
@@ -167,7 +171,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
167
171
  _ref$revision = _ref.revision,
168
172
  revision = _ref$revision === void 0 ? false : _ref$revision,
169
173
  setShowContentohRequestModal = _ref.setShowContentohRequestModal,
170
- showSurvey = _ref.showSurvey;
174
+ showSurvey = _ref.showSurvey,
175
+ company = _ref.company;
171
176
 
172
177
  var _useState = (0, _react.useState)("Descripción"),
173
178
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -473,6 +478,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
473
478
  saving = _useState82[0],
474
479
  setSaving = _useState82[1];
475
480
 
481
+ var _closeModals = (0, _customHooks.closeModals)("version-selector"),
482
+ _closeModals2 = (0, _slicedToArray2.default)(_closeModals, 2),
483
+ showVersionSelector = _closeModals2[0],
484
+ setShowVersionSelector = _closeModals2[1];
485
+
476
486
  (0, _react.useEffect)(function () {
477
487
  checkAll && setSelectedImages(images.values);
478
488
  }, [checkAll]);
@@ -487,7 +497,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
487
497
  switch (_context2.prev = _context2.next) {
488
498
  case 0:
489
499
  _context2.next = 2;
490
- return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article), (product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), product === null || product === void 0 ? void 0 : product.version);
500
+ return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article), (product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), version);
491
501
 
492
502
  case 2:
493
503
  services = _context2.sent;
@@ -635,47 +645,48 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
635
645
  while (1) {
636
646
  switch (_context5.prev = _context5.next) {
637
647
  case 0:
648
+ setLoading(true);
638
649
  sessionStorage.setItem("user", JSON.stringify(user));
639
650
  loadData();
640
651
  getCart();
641
652
  _context5.t0 = setUserGroups;
642
- _context5.next = 6;
653
+ _context5.next = 7;
643
654
  return (0, _data2.fetchUsers)(token);
644
655
 
645
- case 6:
656
+ case 7:
646
657
  _context5.t1 = _context5.sent;
647
658
  (0, _context5.t0)(_context5.t1);
648
659
  arr = [];
649
660
  _context5.t2 = user.id_role;
650
- _context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
661
+ _context5.next = _context5.t2 === 7 ? 13 : _context5.t2 === 8 ? 13 : _context5.t2 === 4 ? 15 : _context5.t2 === 5 ? 15 : _context5.t2 === 6 ? 17 : 19;
651
662
  break;
652
663
 
653
- case 12:
664
+ case 13:
654
665
  arr = ["IN_PROGRESS", "RF", "RA"];
655
- return _context5.abrupt("break", 20);
666
+ return _context5.abrupt("break", 21);
656
667
 
657
- case 14:
668
+ case 15:
658
669
  arr = ["RF", "AF", "AA", "AP", "AC"];
659
- return _context5.abrupt("break", 20);
670
+ return _context5.abrupt("break", 21);
660
671
 
661
- case 16:
672
+ case 17:
662
673
  arr = ["RP", "RC", "AF"];
663
- return _context5.abrupt("break", 20);
674
+ return _context5.abrupt("break", 21);
664
675
 
665
- case 18:
676
+ case 19:
666
677
  arr = [];
667
- return _context5.abrupt("break", 20);
678
+ return _context5.abrupt("break", 21);
668
679
 
669
- case 20:
680
+ case 21:
670
681
  setStatusArray(arr);
671
682
 
672
- case 21:
683
+ case 22:
673
684
  case "end":
674
685
  return _context5.stop();
675
686
  }
676
687
  }
677
688
  }, _callee5);
678
- })), [product]);
689
+ })), [product, version]);
679
690
 
680
691
  var loadAssignations = function loadAssignations(currentProduct) {
681
692
  setAssig(product === null || product === void 0 ? void 0 : product.asignations);
@@ -1749,6 +1760,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1749
1760
  setAssignation: setAssignation,
1750
1761
  isRetailer: isRetailer,
1751
1762
  showSaveButton: enableActions(product.version_status),
1763
+ version: version,
1764
+ setShowVersionSelector: setShowVersionSelector,
1752
1765
  onClickSave: function onClickSave() {
1753
1766
  switch (activeTab) {
1754
1767
  case "Descripción":
@@ -1963,6 +1976,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1963
1976
  },
1964
1977
  img: _defaultProfileImage.default,
1965
1978
  textArea: false
1979
+ }), showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1980
+ modalId: "version-selector",
1981
+ articleId: product.id_article,
1982
+ setVersion: setVersion,
1983
+ companyName: company.company_name,
1984
+ currentVersion: version
1966
1985
  })]
1967
1986
  });
1968
1987
  };
@@ -31,59 +31,52 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJE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-9sPcE4s8RXRxw2cSX3Lt4pdJqi8sOG_DNu3BvxmML3Ckv23aK82zWzskXQb_gNdTM2mqi7SvxvE87yb4X_5cfvP6QtA6hEh1jezbHWdzPDxKkme0ZdVOpqEb3c1JMSIP06EQ9NfnXVt0S19hz6kfppC2laFEwrK2M8tO8EH06k2qlSk3Hp5b6Ga3BACvKAWnfOnC1A",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
38
38
  descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 2012,
42
- status: "QF",
43
- datasheet_status: "QF",
41
+ orderId: 131,
42
+ status: "AA",
43
+ datasheet_status: "AA",
44
44
  prio: "none",
45
45
  version: 2,
46
- description_status: "QF",
47
- images_status: "AF",
46
+ description_status: "AA",
47
+ images_status: "AA",
48
48
  article: {
49
- id_article: 76958,
50
- id_category: "2627",
51
- name: "COLGANTE MAGIC NAVIDAD",
52
- upc: "163963",
53
- timestamp: "2022-07-07T17:01:17.000Z",
54
- id_user: 1195,
49
+ id_article: 76201,
50
+ id_category: "632",
51
+ name: "DEMO SB BAA PLAY CR SM FP PANDAS",
52
+ upc: "7501816169170",
53
+ timestamp: "2022-07-25T20:42:40.000Z",
54
+ id_user: 119,
55
55
  status: "NULL",
56
56
  active: 1,
57
- company_id: 657,
58
- SKU: null,
59
- Descripcion: null,
60
- Proveedor: null,
61
- id_proveedor: 0,
62
- company_name: "",
63
- country: null,
64
- id_order: 2012,
65
- id_datasheet_especialist: 1248,
66
- id_datasheet_facilitator: 1252,
67
- id_description_especialist: 334,
68
- id_description_facilitator: 1252,
69
- id_images_especialist: 1251,
70
- id_images_facilitator: 1286,
71
- id_auditor: 1254,
57
+ company_id: 841,
58
+ company_name: "Financiado Bodega",
59
+ country: "México",
60
+ id_order: 131,
61
+ id_datasheet_especialist: 54,
62
+ id_datasheet_facilitator: 52,
63
+ id_description_especialist: 54,
64
+ id_description_facilitator: 52,
65
+ id_images_especialist: 55,
66
+ id_images_facilitator: 53,
67
+ id_auditor: 30,
72
68
  id_recepcionist: null,
73
- category: "Navidad|Esferas y Colgantes|Colgantes",
74
- missingAttributes: 3,
69
+ category: "Ropa, Accesorios, Fragancias y Joyería|Ropa Bebés|Bebé Niña",
70
+ missingAttributes: 0,
75
71
  missingDescriptions: 0,
76
72
  missingImages: 0
77
73
  },
78
74
  retailers: [{
79
- id: 58,
80
- name: "The Home Depot Golden",
81
- country: "México",
82
- id_region: 1,
83
- active: 1
75
+ id: 13,
76
+ name: "Soriana"
84
77
  }],
85
- country: null,
86
- upc: "163963"
78
+ country: "México",
79
+ upc: "7501816169170"
87
80
  },
88
81
  location: {
89
82
  product: {
@@ -92,16 +85,16 @@ RetailerProductEditionDefault.args = {
92
85
  }
93
86
  },
94
87
  user: {
95
- id_user: 460,
96
- name: "Ismael",
97
- last_name: "López",
98
- email: "ilopez@contentoh.com",
99
- position: "Desarrollador",
88
+ id_user: 51,
89
+ name: "ADMIN PRUEBA",
90
+ last_name: "",
91
+ email: "etc@contentoh.com",
92
+ position: null,
100
93
  telephone: null,
101
- country: "México",
102
- id_company: 254,
103
- id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
104
- birth_Date: "1997-08-15T00:00:00.000Z",
94
+ country: null,
95
+ id_company: 2,
96
+ id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
97
+ birth_Date: null,
105
98
  about_me: null,
106
99
  zip_code: null,
107
100
  address: null,
@@ -110,18 +103,18 @@ RetailerProductEditionDefault.args = {
110
103
  id_role: 1,
111
104
  active: 1,
112
105
  is_retailer: 0,
113
- email_notify: null,
106
+ email_notify: 0,
114
107
  membership: {
115
- id: 750,
116
- start_date: "2022-01-07T21:32:54.000Z",
117
- end_date: "2023-01-07T21:32:54.000Z",
118
- planID: 6,
119
- plan: "prod_KvGd6YSTJyR3AP",
120
- name: "Plan Small",
121
- user_limit: "10",
122
- products_limit: "1000",
123
- type: "Enterprise"
108
+ id: 2,
109
+ start_date: "2021-11-05T02:35:12.000Z",
110
+ end_date: "2022-11-05T02:34:49.000Z",
111
+ planID: 1,
112
+ plan: "prod_KtkvuFFLpOdP6e",
113
+ name: "Plan Free",
114
+ user_limit: "1",
115
+ products_limit: "3",
116
+ type: "PyMES"
124
117
  },
125
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1658943295529"
118
+ src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1658991766462"
126
119
  }
127
120
  };
@@ -75,6 +75,12 @@ var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/
75
75
 
76
76
  var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
77
77
 
78
+ var _VersionSelector = require("../../organisms/VersionSelector");
79
+
80
+ var _customHooks = require("../../../global-files/customHooks");
81
+
82
+ var _CreateVersion = require("../../organisms/CreateVersion");
83
+
78
84
  var _jsxRuntime = require("react/jsx-runtime");
79
85
 
80
86
  var reducerImages = function reducerImages(state, action) {
@@ -382,6 +388,17 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
382
388
  setSaving = _useState70[1];
383
389
 
384
390
  var isAuditor = user.id_role === 6;
391
+
392
+ var _closeModals = (0, _customHooks.closeModals)("version-selector"),
393
+ _closeModals2 = (0, _slicedToArray2.default)(_closeModals, 2),
394
+ showVersionSelector = _closeModals2[0],
395
+ setShowVersionSelector = _closeModals2[1];
396
+
397
+ var _useState71 = (0, _react.useState)(false),
398
+ _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
399
+ showCreateVersion = _useState72[0],
400
+ setShowCreateVersion = _useState72[1];
401
+
385
402
  (0, _react.useEffect)(function () {
386
403
  checkAll && setSelectedImages(images.values);
387
404
  }, [checkAll]);
@@ -396,7 +413,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
396
413
  case 0:
397
414
  _context.prev = 0;
398
415
  _context.next = 3;
399
- return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), product === null || product === void 0 ? void 0 : product.version);
416
+ return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), version);
400
417
 
401
418
  case 3:
402
419
  _services = _context.sent;
@@ -533,46 +550,47 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
533
550
  while (1) {
534
551
  switch (_context4.prev = _context4.next) {
535
552
  case 0:
553
+ setLoading(true);
536
554
  loadData();
537
555
  getComments();
538
556
  _context4.t0 = setUserGroups;
539
- _context4.next = 5;
557
+ _context4.next = 6;
540
558
  return (0, _data2.fetchUsers)(token);
541
559
 
542
- case 5:
560
+ case 6:
543
561
  _context4.t1 = _context4.sent;
544
562
  (0, _context4.t0)(_context4.t1);
545
563
  arr = [];
546
564
  _context4.t2 = user.id_role;
547
- _context4.next = _context4.t2 === 7 ? 11 : _context4.t2 === 8 ? 11 : _context4.t2 === 4 ? 13 : _context4.t2 === 5 ? 13 : _context4.t2 === 6 ? 15 : 17;
565
+ _context4.next = _context4.t2 === 7 ? 12 : _context4.t2 === 8 ? 12 : _context4.t2 === 4 ? 14 : _context4.t2 === 5 ? 14 : _context4.t2 === 6 ? 16 : 18;
548
566
  break;
549
567
 
550
- case 11:
568
+ case 12:
551
569
  arr = ["IN_PROGRESS", "RF", "RA"];
552
- return _context4.abrupt("break", 19);
570
+ return _context4.abrupt("break", 20);
553
571
 
554
- case 13:
572
+ case 14:
555
573
  arr = ["RF", "AF", "AA", "AP", "AC"];
556
- return _context4.abrupt("break", 19);
574
+ return _context4.abrupt("break", 20);
557
575
 
558
- case 15:
576
+ case 16:
559
577
  arr = ["RP", "RC", "AF", "RA"];
560
- return _context4.abrupt("break", 19);
578
+ return _context4.abrupt("break", 20);
561
579
 
562
- case 17:
580
+ case 18:
563
581
  arr = [];
564
- return _context4.abrupt("break", 19);
582
+ return _context4.abrupt("break", 20);
565
583
 
566
- case 19:
584
+ case 20:
567
585
  setStatusArray(arr);
568
586
 
569
- case 20:
587
+ case 21:
570
588
  case "end":
571
589
  return _context4.stop();
572
590
  }
573
591
  }
574
592
  }, _callee4);
575
- })), [product]);
593
+ })), [product, version]);
576
594
 
577
595
  var loadAssignations = function loadAssignations(currentProduct) {
578
596
  var _currentProduct$artic, _currentProduct$artic2, _currentProduct$artic3, _currentProduct$artic4, _currentProduct$artic5, _currentProduct$artic6;
@@ -1737,6 +1755,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1737
1755
  setAssignation: setAssignation,
1738
1756
  isRetailer: isRetailer,
1739
1757
  showSaveButton: auditorAssigned() || userAssigned(),
1758
+ version: version,
1759
+ setShowVersionSelector: setShowVersionSelector,
1740
1760
  onClickSave: function onClickSave() {
1741
1761
  switch (activeTab) {
1742
1762
  case "Descripción":
@@ -1871,6 +1891,17 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1871
1891
  onClick: function onClick() {
1872
1892
  return setMessage("");
1873
1893
  }
1894
+ }), showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1895
+ modalId: "version-selector",
1896
+ articleId: product.article.id_article,
1897
+ setVersion: setVersion,
1898
+ companyName: product.article.company_name,
1899
+ currentVersion: version,
1900
+ setShowCreateVersion: setShowCreateVersion
1901
+ }), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
1902
+ idArticle: product.article.id_article,
1903
+ version: version,
1904
+ setShowCreateVersion: setShowCreateVersion
1874
1905
  })]
1875
1906
  });
1876
1907
  };
@@ -0,0 +1,35 @@
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.closeModals = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
12
+ var _react = require("react");
13
+
14
+ var closeModals = function closeModals(id) {
15
+ var _useState = (0, _react.useState)(false),
16
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
17
+ showModal = _useState2[0],
18
+ setShowModal = _useState2[1];
19
+
20
+ var closeModal = function closeModal(e) {
21
+ if ((!e.target.closest("#".concat(id)) || e.target.closest("#close-button") || e.target.closest("#add-version")) && showModal) {
22
+ document.removeEventListener("click", closeModal);
23
+ setShowModal(false);
24
+ }
25
+ };
26
+
27
+ (0, _react.useEffect)(function () {
28
+ if (showModal) {
29
+ document.addEventListener("click", closeModal);
30
+ }
31
+ }, [showModal]);
32
+ return [showModal, setShowModal];
33
+ };
34
+
35
+ exports.closeModals = closeModals;
@@ -12,6 +12,7 @@ body.sb-main-padded.sb-show-main {
12
12
  padding: 0;
13
13
  height: 100vh;
14
14
  overflow: hidden;
15
+ position: relative;
15
16
  }
16
17
 
17
18
  .sb-main-padded.sb-show-main #root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.62",
3
+ "version": "21.1.65",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0 10C0 4.48578 4.48578 0 10 0C15.5142 0 20 4.48578 20 10C20 15.5142 15.5142 20 10 20C4.48578 20 0 15.5142 0 10ZM9.65054 13.2973L15.0673 7.88074C15.393 7.55481 15.393 7.02823 15.0673 6.70245C14.7413 6.37653 14.2148 6.37653 13.889 6.70245L9.0614 11.5299L6.94226 9.41074C6.61633 9.08481 6.08975 9.08481 5.76398 9.41074C5.43805 9.73651 5.43805 10.2632 5.76398 10.589L8.47226 13.2973C8.63477 13.4598 8.84808 13.5416 9.0614 13.5416C9.27472 13.5416 9.48804 13.4598 9.65054 13.2973Z" fill="#71DE56"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <line x1="6.72461" y1="10" x2="14.7246" y2="10" stroke="#E33AA9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <line x1="10.7246" y1="6" x2="10.7246" y2="14" stroke="#E33AA9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <rect x="1.22461" y="0.5" width="19.2749" height="19" rx="9.5" stroke="#D4D1D7"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <line x1="0.707107" y1="1" x2="16" y2="16.2929" stroke="#E33AA9" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <line x1="16" y1="1.70711" x2="1.70711" y2="16" stroke="#E33AA9" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="73" height="73" viewBox="0 0 73 73" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.1666 18.2497H6.08325V60.833C6.08325 64.1788 8.82075 66.9163 12.1666 66.9163H54.7499V60.833H12.1666V18.2497ZM60.8332 6.08301H24.3333C20.9874 6.08301 18.2499 8.82051 18.2499 12.1663V48.6663C18.2499 52.0122 20.9874 54.7497 24.3333 54.7497H60.8332C64.1791 54.7497 66.9166 52.0122 66.9166 48.6663V12.1663C66.9166 8.82051 64.1791 6.08301 60.8332 6.08301ZM57.7916 33.458H45.6249V45.6247H39.5416V33.458H27.3749V27.3747H39.5416V15.208H45.6249V27.3747H57.7916V33.458Z" fill="#817393"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM15 11H5V9H15V11Z" fill="#817393"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="22" height="15" viewBox="0 0 22 15" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11 0C6 0 1.73 3.11 0 7.5C1.73 11.89 6 15 11 15C16 15 20.27 11.89 22 7.5C20.27 3.11 16 0 11 0ZM11 12.5C8.24 12.5 6 10.26 6 7.5C6 4.74 8.24 2.5 11 2.5C13.76 2.5 16 4.74 16 7.5C16 10.26 13.76 12.5 11 12.5ZM11 4.5C9.34 4.5 8 5.84 8 7.5C8 9.16 9.34 10.5 11 10.5C12.66 10.5 14 9.16 14 7.5C14 5.84 12.66 4.5 11 4.5Z" fill="#D4D1D7"/>
3
+ </svg>
@@ -2,6 +2,7 @@ import { Container } from "./styles";
2
2
  import React from "react";
3
3
 
4
4
  export const Button = ({
5
+ id,
5
6
  buttonType,
6
7
  label,
7
8
  image,
@@ -11,6 +12,7 @@ export const Button = ({
11
12
  }) => {
12
13
  return (
13
14
  <Container
15
+ id={id}
14
16
  className={buttonType}
15
17
  buttonFont={buttonFont}
16
18
  onClick={onClick}
@@ -57,6 +57,7 @@ export const Container = styled.button`
57
57
  background-color: transparent;
58
58
  background-repeat: no-repeat;
59
59
  background-position: center;
60
+
60
61
  &.accept-button {
61
62
  background-image: url(${acceptIcon});
62
63
  }
@@ -106,6 +107,23 @@ export const Container = styled.button`
106
107
  border: 1px solid ${GlobalColors.magenta_s2};
107
108
  }
108
109
  }
110
+
111
+ &.disabled {
112
+ opacity: 0.5;
113
+ }
114
+
115
+ img {
116
+ width: 100%;
117
+ }
118
+
119
+ &.version-button {
120
+ color: ${GlobalColors.s3};
121
+ border: 1px solid ${GlobalColors.s3};
122
+ border-radius: 15px;
123
+ font-size: 12px;
124
+ line-height: 25px;
125
+ text-align: center;
126
+ }
109
127
  }
110
128
 
111
129
  &.general-arrow-button {
@@ -0,0 +1,25 @@
1
+ import { VrsnSelect } from "./style";
2
+
3
+ export const VersionSelect = ({
4
+ id,
5
+ selectedVersions,
6
+ onChange,
7
+ label,
8
+ versions = [],
9
+ }) => {
10
+ return (
11
+ <VrsnSelect>
12
+ <label htmlFor={id}>{label}</label>
13
+ <select
14
+ id={id}
15
+ name={id}
16
+ value={`Version ${selectedVersions[id]}`}
17
+ onChange={onChange}
18
+ >
19
+ {versions.map((item, index) => (
20
+ <option key={`${id}-${index}`}>Version {item.version}</option>
21
+ ))}
22
+ </select>
23
+ </VrsnSelect>
24
+ );
25
+ };
@@ -8,6 +8,7 @@ export default function Select(props) {
8
8
  width={props.width}
9
9
  onChange={props.onChange}
10
10
  defaultValue={props.valueSelected ? props.valueSelected : ""}
11
+ className={props.className}
11
12
  >
12
13
  <option value="" disabled>
13
14
  {props.placeholder}
@@ -29,7 +30,6 @@ export default function Select(props) {
29
30
  </option>
30
31
  ))}
31
32
  </SelectCustom>
32
- <BackgroundEnd />
33
33
  </Container>
34
34
  );
35
35
  }
@@ -1,4 +1,5 @@
1
1
  import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
2
3
 
3
4
  export const Container = styled.div`
4
5
  position: relative;
@@ -73,4 +74,22 @@ export const SelectCustom = styled.select`
73
74
  color: gray;
74
75
  }
75
76
  }
77
+
78
+ &.version-selector {
79
+ }
80
+ `;
81
+
82
+ export const VrsnSelect = styled.div`
83
+ background-color: ${GlobalColors.deep_gray};
84
+
85
+ select {
86
+ border: 1px solid ${GlobalColors.s3} !important;
87
+ background-color: transparent;
88
+ color: ${GlobalColors.white};
89
+ width: 100%;
90
+ text-align: center;
91
+ padding: 5px;
92
+ border-radius: 15px;
93
+ text-decoration: none;
94
+ }
76
95
  `;