contentoh-components-library 21.1.64 → 21.1.67

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.
@@ -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>
@@ -28,7 +28,7 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
28
28
  case "version-options":
29
29
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.VersionOptions, {
30
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
31
- src: createVersion,
31
+ src: _createVersion.default,
32
32
  alt: "create version icon"
33
33
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
34
34
  fontFamily: _variables.FontFamily.Raleway_500,
@@ -146,9 +146,21 @@ var CreateVersion = function CreateVersion(_ref) {
146
146
  setSelectedVersions((0, _objectSpread3.default)((0, _objectSpread3.default)({}, selectedVersions), {}, (0, _defineProperty2.default)({}, e.target.name, parseInt(e.target.value.slice(-1)))));
147
147
  };
148
148
 
149
- (0, _react.useEffect)(function () {
150
- getVersions();
151
- }, []);
149
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
150
+ return _regenerator.default.wrap(function _callee3$(_context3) {
151
+ while (1) {
152
+ switch (_context3.prev = _context3.next) {
153
+ case 0:
154
+ _context3.next = 2;
155
+ return getVersions();
156
+
157
+ case 2:
158
+ case "end":
159
+ return _context3.stop();
160
+ }
161
+ }
162
+ }, _callee3);
163
+ })), []);
152
164
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
153
165
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
154
166
  className: "modal-container",
@@ -84,9 +84,21 @@ var VersionSelector = function VersionSelector(_ref) {
84
84
  };
85
85
  }();
86
86
 
87
- (0, _react.useEffect)(function () {
88
- loadProductVersions(articleId);
89
- }, []);
87
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
88
+ return _regenerator.default.wrap(function _callee2$(_context2) {
89
+ while (1) {
90
+ switch (_context2.prev = _context2.next) {
91
+ case 0:
92
+ _context2.next = 2;
93
+ return loadProductVersions(articleId);
94
+
95
+ case 2:
96
+ case "end":
97
+ return _context2.stop();
98
+ }
99
+ }
100
+ }, _callee2);
101
+ })), []);
90
102
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
91
103
  id: modalId,
92
104
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -120,7 +132,7 @@ var VersionSelector = function VersionSelector(_ref) {
120
132
  currentVersion: item.version === currentVersion,
121
133
  productOwner: companyName,
122
134
  setVersion: setVersion
123
- });
135
+ }, item.version);
124
136
  })
125
137
  })]
126
138
  });
@@ -99,6 +99,8 @@ var _VersionSelector = require("../../organisms/VersionSelector");
99
99
 
100
100
  var _customHooks = require("../../../global-files/customHooks");
101
101
 
102
+ var _CreateVersion = require("../../organisms/CreateVersion");
103
+
102
104
  var _jsxRuntime = require("react/jsx-runtime");
103
105
 
104
106
  var reducerImages = function reducerImages(state, action) {
@@ -478,6 +480,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
478
480
  saving = _useState82[0],
479
481
  setSaving = _useState82[1];
480
482
 
483
+ var _useState83 = (0, _react.useState)(false),
484
+ _useState84 = (0, _slicedToArray2.default)(_useState83, 2),
485
+ showCreateVersion = _useState84[0],
486
+ setShowCreateVersion = _useState84[1];
487
+
481
488
  var _closeModals = (0, _customHooks.closeModals)("version-selector"),
482
489
  _closeModals2 = (0, _slicedToArray2.default)(_closeModals, 2),
483
490
  showVersionSelector = _closeModals2[0],
@@ -1981,7 +1988,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1981
1988
  articleId: product.id_article,
1982
1989
  setVersion: setVersion,
1983
1990
  companyName: company.company_name,
1984
- currentVersion: version
1991
+ currentVersion: version,
1992
+ setShowCreateVersion: setShowCreateVersion
1993
+ }), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
1994
+ idArticle: product.id_article,
1995
+ version: version,
1996
+ setShowCreateVersion: setShowCreateVersion
1985
1997
  })]
1986
1998
  });
1987
1999
  };
@@ -389,16 +389,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
389
389
 
390
390
  var isAuditor = user.id_role === 6;
391
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
392
  var _useState71 = (0, _react.useState)(false),
398
393
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
399
394
  showCreateVersion = _useState72[0],
400
395
  setShowCreateVersion = _useState72[1];
401
396
 
397
+ var _closeModals = (0, _customHooks.closeModals)("version-selector"),
398
+ _closeModals2 = (0, _slicedToArray2.default)(_closeModals, 2),
399
+ showVersionSelector = _closeModals2[0],
400
+ setShowVersionSelector = _closeModals2[1];
401
+
402
402
  (0, _react.useEffect)(function () {
403
403
  checkAll && setSelectedImages(images.values);
404
404
  }, [checkAll]);
@@ -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.64",
3
+ "version": "21.1.67",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "scripts": {
36
36
  "start": "start-storybook -p 6006",
37
- "build": "cross-env BABEL_ENV=production babel src -d dist",
37
+ "build": "cross-env BABEL_ENV=production babel src -d dist && cp -a src/assets dist/ && cp -a src/global-files/*.css dist/global-files",
38
38
  "chromatic": "npx chromatic --project-token=d7bb0c8ba831",
39
39
  "release": "auto shipit --base-branch=main"
40
40
  },
@@ -2,7 +2,7 @@ import { GlobalColors, FontFamily } from "../../../global-files/variables";
2
2
  import { Button } from "../../atoms/GeneralButton";
3
3
  import { ScreenHeader } from "../../atoms/ScreenHeader";
4
4
  import { VersionOptions, EmptyVersion, CreateVersion } from "./styles";
5
- import createVersion from "../../../assets/images/versionSelector/createVersion.svg";
5
+ import createVersionImg from "../../../assets/images/versionSelector/createVersion.svg";
6
6
  import genericModalWarning from "../../../assets/images/genericModal/genericModalWarning.svg";
7
7
  import { VersionSelect } from "../../atoms/Select/VersionSelect";
8
8
 
@@ -18,7 +18,7 @@ export const Children = (
18
18
  case "version-options":
19
19
  return (
20
20
  <VersionOptions>
21
- <img src={createVersion} alt="create version icon" />
21
+ <img src={createVersionImg} alt="create version icon" />
22
22
  <ScreenHeader
23
23
  fontFamily={FontFamily.Raleway_500}
24
24
  headerType={"product-name-header"}
@@ -33,7 +33,7 @@ export const CreateVersion = ({ idArticle, version, setShowCreateVersion }) => {
33
33
  try {
34
34
  let data = {
35
35
  articleId: idArticle,
36
- isEmpty
36
+ isEmpty,
37
37
  };
38
38
 
39
39
  isEmpty && (data["version"] = selectedVersions);
@@ -59,8 +59,8 @@ export const CreateVersion = ({ idArticle, version, setShowCreateVersion }) => {
59
59
  });
60
60
  };
61
61
 
62
- useEffect(() => {
63
- getVersions();
62
+ useEffect(async () => {
63
+ await getVersions();
64
64
  }, []);
65
65
 
66
66
  return (
@@ -32,8 +32,8 @@ export const VersionSelector = ({
32
32
  }
33
33
  };
34
34
 
35
- useEffect(() => {
36
- loadProductVersions(articleId);
35
+ useEffect(async () => {
36
+ await loadProductVersions(articleId);
37
37
  }, []);
38
38
 
39
39
  return (
@@ -62,6 +62,7 @@ export const VersionSelector = ({
62
62
  <div className="versions-container">
63
63
  {versions?.map((item) => (
64
64
  <VersionItem
65
+ key={item.version}
65
66
  version={item.version}
66
67
  articleStatus={item.article_status}
67
68
  currentVersion={item.version === currentVersion}
@@ -42,6 +42,7 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
42
42
  import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
43
43
  import { VersionSelector } from "../../organisms/VersionSelector";
44
44
  import { closeModals } from "../../../global-files/customHooks";
45
+ import { CreateVersion } from "../../organisms/CreateVersion";
45
46
 
46
47
  const reducerImages = (state, action) => {
47
48
  let { values, attrForImgs } = state;
@@ -211,6 +212,7 @@ export const ProviderProductEdition = ({
211
212
  const [modalViewTextArea, setModalViewTextArea] = useState(false);
212
213
  const [socketType, setSocketType] = useState(null);
213
214
  const [saving, setSaving] = useState(loading);
215
+ const [showCreateVersion, setShowCreateVersion] = useState(false);
214
216
  const [showVersionSelector, setShowVersionSelector] =
215
217
  closeModals("version-selector");
216
218
 
@@ -1454,6 +1456,14 @@ export const ProviderProductEdition = ({
1454
1456
  setVersion={setVersion}
1455
1457
  companyName={company.company_name}
1456
1458
  currentVersion={version}
1459
+ setShowCreateVersion={setShowCreateVersion}
1460
+ />
1461
+ )}
1462
+ {showCreateVersion && (
1463
+ <CreateVersion
1464
+ idArticle={product.id_article}
1465
+ version={version}
1466
+ setShowCreateVersion={setShowCreateVersion}
1457
1467
  />
1458
1468
  )}
1459
1469
  </Container>
@@ -168,9 +168,9 @@ export const RetailerProductEdition = ({
168
168
  const [servicesStatus, setServicesStatus] = useState([]);
169
169
  const [saving, setSaving] = useState(loading);
170
170
  const isAuditor = user.id_role === 6;
171
+ const [showCreateVersion, setShowCreateVersion] = useState(false);
171
172
  const [showVersionSelector, setShowVersionSelector] =
172
173
  closeModals("version-selector");
173
- const [showCreateVersion, setShowCreateVersion] = useState(false);
174
174
 
175
175
  useEffect(() => {
176
176
  checkAll && setSelectedImages(images.values);