contentoh-components-library 21.3.12 → 21.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/fonts/{roboto → Roboto}/LICENSE.txt +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Black.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-BlackItalic.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Bold.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Italic.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Light.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-LightItalic.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-MediumItalic.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Regular.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-Thin.ttf +0 -0
- package/dist/assets/fonts/{roboto → Roboto}/Roboto-ThinItalic.ttf +0 -0
- package/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +3 -0
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +1 -0
- package/dist/assets/images/chatPopup/document.svg +1 -0
- package/dist/assets/images/chatPopup/iconChat.svg +19 -0
- package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
- package/dist/assets/images/chatPopup/pdf.svg +75 -0
- package/dist/assets/images/chatPopup/remove.svg +4 -0
- package/dist/assets/images/chatPopup/send.svg +3 -0
- package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
- package/dist/assets/images/chatPopup/upload_file.svg +3 -0
- package/dist/assets/images/chatPopup/xls.svg +53 -0
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/organisms/RangeCalendar/index.js +4 -3
- package/dist/components/pages/Dashboard/index.js +21 -13
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/global-files/utils.js +22 -2
- package/package.json +1 -1
- package/src/components/organisms/RangeCalendar/index.js +3 -3
- package/src/components/pages/Dashboard/index.js +37 -31
- package/src/global-files/utils.js +15 -0
|
@@ -0,0 +1,27 @@
|
|
|
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.Slider = 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, _templateObject2;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: 34px;\n width: 34px;\n background-color: transparent;\n border: 1px solid #f0f0f0;\n border-radius: 50px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n &:hover {\n background-color: #f0f0f0;\n }\n .icon-chat {\n margin: 0;\n width: 15px;\n height: 15px;\n }\n"])));
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
21
|
+
|
|
22
|
+
var Slider = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n -webkit-box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);\n box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);\n z-index: 200;\n width: 425px;\n height: 600px;\n border-radius: 10px;\n background: white;\n padding: 37px 16px 17px 20px;\n position: absolute;\n right: ", "%;\n top: 3%;\n transition: right 2s ease 0;\n .image {\n display: flex;\n justify-content: center;\n align-content: center;\n background-color: #f7f7f7;\n border-radius: 10px;\n #myList {\n list-style: none;\n img {\n width: 365px;\n border-radius: 10px;\n }\n }\n }\n .close {\n background-color: #e33aa9;\n border: 3px solid white;\n height: 35px;\n width: 35px;\n border-radius: 50%;\n position: absolute;\n top: -18px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n }\n .content-chat {\n height: 495px;\n max-height: 495px;\n overflow-y: auto;\n overflow-x: hidden;\n background-color: transparent;\n font-family: sans-serif;\n font-size: 12px;\n & + * {\n margin-top: 12px;\n }\n ::-webkit-scrollbar {\n width: 0;\n }\n .cargar-mas {\n border: none;\n border-radius: 10px;\n font: normal normal normal 11px/11px sans-serif;\n letter-spacing: 0.1px;\n color: #8a6caa;\n background-color: #f7f7fc;\n padding: 5px 17px;\n margin: 0 35%;\n display: flex;\n cursor: pointer;\n white-space: nowrap;\n &:hover {\n background-color: #f0f0f0;\n }\n img {\n margin-right: 7px;\n height: 13px;\n }\n }\n #myListChat {\n list-style: none;\n margin: 0;\n padding: 0;\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n gap: 3px;\n .group-date {\n display: flex;\n justify-content: center;\n align-items: center;\n hr {\n width: 120px;\n border: 0.3px solid #f0f0f0;\n }\n p {\n margin: 0 10px;\n color: #b3b3b3;\n }\n }\n li {\n width: 100%;\n padding: 5px 0;\n margin: 0;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n flex-wrap: nowrap;\n gap: 5px;\n align-items: center;\n .tooltip-userName {\n background-color: #f0f0f0;\n padding: 6px 10px;\n color: #000000;\n font-size: 11px;\n margin-bottom: 6px;\n .MuiTooltip-arrow {\n color: #f0f0f0;\n }\n }\n\n .profile {\n display: grid;\n place-items: center;\n align-self: start;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n overflow: hidden;\n img {\n width: 100%;\n height: 100%;\n border-radius: inherit;\n }\n }\n .img-file {\n margin: 0 10px;\n width: 165px;\n img {\n width: 100%;\n object-fit: contain;\n border-radius: 10px;\n }\n }\n .body-message {\n margin: 0 10px;\n border-radius: 10px;\n box-sizing: border-box;\n background-color: #f0f0f0;\n padding: 10px 10px 10px 12px;\n max-width: 280px;\n p {\n color: #262626;\n margin: 0;\n padding: 0;\n }\n a {\n text-decoration: none;\n }\n div {\n cursor: pointer;\n background-color: white;\n border-radius: 10px;\n padding: 7px 10px;\n display: flex;\n align-items: center;\n img {\n height: 20px;\n width: 20px;\n margin-right: 5px;\n }\n p {\n color: #262626 !important;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n }\n }\n .date {\n display: flex;\n align-items: center;\n white-space: nowrap;\n p {\n color: #d9d9d9;\n font-size: 9px;\n }\n }\n &.own-message {\n flex-direction: row;\n justify-content: flex-start;\n .body-message {\n background-color: #8386ee;\n p {\n margin: 0;\n padding: 0;\n color: #ffffff;\n }\n }\n }\n }\n }\n }\n .input-chat {\n display: flex;\n align-items: center;\n border-radius: 17px;\n background-color: #f7f7f7;\n padding: 10px 7px 10px 15px;\n .send-message {\n background-color: transparent;\n width: 157%;\n border: none;\n font-family: sans-serif;\n font-size: 13px;\n line-height: initial;\n color: #242424;\n ::placeholder {\n font: normal normal medium 12px/14px sans-serif;\n letter-spacing: 0.6px;\n color: #b3b3b3;\n }\n :focus {\n outline: none;\n }\n & + * {\n margin-left: 10px;\n }\n }\n .upload {\n border: none;\n background: transparent;\n cursor: pointer;\n & + * {\n margin-left: 7px;\n }\n }\n .add-picture-input {\n display: none;\n }\n .send {\n width: 35.4px;\n height: 20px;\n border: none;\n background-color: #e33aa9;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n cursor: pointer;\n align-items: center;\n img {\n width: 11px;\n height: 11px;\n }\n }\n }\n"])), function (_ref) {
|
|
23
|
+
var showMenu = _ref.showMenu;
|
|
24
|
+
return showMenu ? 2 : -50;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.Slider = Slider;
|
|
@@ -0,0 +1,182 @@
|
|
|
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.getBD = exports.createItemBD = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
15
|
+
|
|
16
|
+
var getBD = function getBD(id_article, version_article, get_type, item_date, tokenUser) {
|
|
17
|
+
return new Promise( /*#__PURE__*/function () {
|
|
18
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response, error) {
|
|
19
|
+
var URL, respHTTPjson, body;
|
|
20
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) {
|
|
22
|
+
switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
_context.prev = 0;
|
|
25
|
+
URL = "https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat"; // endpoint
|
|
26
|
+
|
|
27
|
+
URL += "?id_article=".concat(id_article);
|
|
28
|
+
URL += "&version_article=".concat(version_article);
|
|
29
|
+
URL += "&get_type=".concat(get_type);
|
|
30
|
+
URL += "&item_date=".concat(item_date);
|
|
31
|
+
_context.next = 8;
|
|
32
|
+
return _axios.default.get(URL, {
|
|
33
|
+
headers: {
|
|
34
|
+
// AQUI COLOCAR EL TOKEN DEL USUARIO CONECTADO
|
|
35
|
+
Authorization: tokenUser
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
case 8:
|
|
40
|
+
respHTTPjson = _context.sent;
|
|
41
|
+
|
|
42
|
+
if (!(respHTTPjson.status != 200)) {
|
|
43
|
+
_context.next = 12;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
response({
|
|
48
|
+
message: "No fue posible llevar a cabo la operacion",
|
|
49
|
+
errorDetails: respHTTPjson.statusText
|
|
50
|
+
});
|
|
51
|
+
return _context.abrupt("return");
|
|
52
|
+
|
|
53
|
+
case 12:
|
|
54
|
+
// obtener body backend
|
|
55
|
+
body = JSON.parse(respHTTPjson.data.body); //console.log( "resHTTP body:" , body );
|
|
56
|
+
// verificar si existe error desde el backend
|
|
57
|
+
|
|
58
|
+
if (!(respHTTPjson.data.statusCode != 200)) {
|
|
59
|
+
_context.next = 16;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
response({
|
|
64
|
+
message: body.message,
|
|
65
|
+
errorDetails: body.errorDetail
|
|
66
|
+
});
|
|
67
|
+
return _context.abrupt("return");
|
|
68
|
+
|
|
69
|
+
case 16:
|
|
70
|
+
// cuando se ejecuto bien el create ... tomar un posible message
|
|
71
|
+
response({
|
|
72
|
+
body: body
|
|
73
|
+
});
|
|
74
|
+
_context.next = 22;
|
|
75
|
+
break;
|
|
76
|
+
|
|
77
|
+
case 19:
|
|
78
|
+
_context.prev = 19;
|
|
79
|
+
_context.t0 = _context["catch"](0);
|
|
80
|
+
//console.log("error catch get items chat" , err);
|
|
81
|
+
response({
|
|
82
|
+
message: "Algo salio mal al obtener los items del chat",
|
|
83
|
+
errorDetails: _context.t0.message
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
case 22:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context.stop();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, _callee, null, [[0, 19]]);
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
return function (_x, _x2) {
|
|
95
|
+
return _ref.apply(this, arguments);
|
|
96
|
+
};
|
|
97
|
+
}());
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
exports.getBD = getBD;
|
|
101
|
+
|
|
102
|
+
var createItemBD = function createItemBD(id_article, version_article, value_type, value, tokenUser) {
|
|
103
|
+
return new Promise( /*#__PURE__*/function () {
|
|
104
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(response, error) {
|
|
105
|
+
var URL, bodyData, respHTTPjson, body;
|
|
106
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
107
|
+
while (1) {
|
|
108
|
+
switch (_context2.prev = _context2.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
_context2.prev = 0;
|
|
111
|
+
URL = "https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat";
|
|
112
|
+
bodyData = {
|
|
113
|
+
id_article: id_article,
|
|
114
|
+
version_article: version_article,
|
|
115
|
+
value_type: value_type,
|
|
116
|
+
value: value
|
|
117
|
+
};
|
|
118
|
+
_context2.next = 5;
|
|
119
|
+
return _axios.default.post(URL, bodyData, {
|
|
120
|
+
headers: {
|
|
121
|
+
Authorization: tokenUser
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
case 5:
|
|
126
|
+
respHTTPjson = _context2.sent;
|
|
127
|
+
|
|
128
|
+
if (!(respHTTPjson.status != 200)) {
|
|
129
|
+
_context2.next = 9;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
response({
|
|
134
|
+
message: "No fue posible llevar a cabo la operacion",
|
|
135
|
+
errorDetails: respHTTPjson.statusText
|
|
136
|
+
});
|
|
137
|
+
return _context2.abrupt("return");
|
|
138
|
+
|
|
139
|
+
case 9:
|
|
140
|
+
body = JSON.parse(respHTTPjson.data.body);
|
|
141
|
+
|
|
142
|
+
if (!(respHTTPjson.data.statusCode != 200)) {
|
|
143
|
+
_context2.next = 13;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
response({
|
|
148
|
+
message: body.message,
|
|
149
|
+
errorDetails: body.errorDetail
|
|
150
|
+
});
|
|
151
|
+
return _context2.abrupt("return");
|
|
152
|
+
|
|
153
|
+
case 13:
|
|
154
|
+
response({
|
|
155
|
+
body: true
|
|
156
|
+
});
|
|
157
|
+
_context2.next = 19;
|
|
158
|
+
break;
|
|
159
|
+
|
|
160
|
+
case 16:
|
|
161
|
+
_context2.prev = 16;
|
|
162
|
+
_context2.t0 = _context2["catch"](0);
|
|
163
|
+
response({
|
|
164
|
+
message: "Algo salio mal al agregar el item en el chat",
|
|
165
|
+
errorDetails: _context2.t0.message
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
case 19:
|
|
169
|
+
case "end":
|
|
170
|
+
return _context2.stop();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}, _callee2, null, [[0, 16]]);
|
|
174
|
+
}));
|
|
175
|
+
|
|
176
|
+
return function (_x3, _x4) {
|
|
177
|
+
return _ref2.apply(this, arguments);
|
|
178
|
+
};
|
|
179
|
+
}());
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.createItemBD = createItemBD;
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StatusTag = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var StatusTag = function StatusTag(_ref) {
|
|
13
|
+
var statusType = _ref.statusType,
|
|
14
|
+
ovalForm = _ref.ovalForm;
|
|
15
|
+
|
|
16
|
+
var getShortStatus = function getShortStatus(status) {
|
|
17
|
+
switch (status) {
|
|
18
|
+
case "COMPLETED":
|
|
19
|
+
return "C";
|
|
20
|
+
|
|
21
|
+
case "RECEPTION":
|
|
22
|
+
return "Pr";
|
|
23
|
+
|
|
24
|
+
case "NULL":
|
|
25
|
+
return "-";
|
|
26
|
+
|
|
27
|
+
case "RECEIVED":
|
|
28
|
+
return "Rc";
|
|
29
|
+
|
|
30
|
+
case "IN_PROGRESS":
|
|
31
|
+
return "P";
|
|
32
|
+
|
|
33
|
+
case "ASSIGNED":
|
|
34
|
+
return "As";
|
|
35
|
+
|
|
36
|
+
case "APPROVED":
|
|
37
|
+
return "Ap";
|
|
38
|
+
|
|
39
|
+
case "VALIDATING":
|
|
40
|
+
return "V";
|
|
41
|
+
|
|
42
|
+
case "PAID_OUT":
|
|
43
|
+
return "Po";
|
|
44
|
+
|
|
45
|
+
default:
|
|
46
|
+
return status;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
51
|
+
className: "status-".concat(getShortStatus(statusType), " ").concat(ovalForm && "oval-form"),
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
53
|
+
children: getShortStatus(statusType)
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.StatusTag = StatusTag;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 width: fit-content;\n padding: 0 10px;\n height: 20px;\n background-color: ", ";\n border-radius: 3px;\n\n p {\n text-align: center;\n color: ", ";\n font-family: ", ";\n font-size: 12px;\n line-height: 20px;\n }\n\n &.status-As,\n &.status-P,\n &.status-IN_PROGRESS,\n &.status-QF {\n background-color: ", ";\n }\n\n &.status-Pr,\n &.status-Rr,\n &.status-Rc {\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\n &.oval-form {\n border-radius: 10px;\n }\n"])), _variables.GlobalColors.s3, _variables.GlobalColors.white, _variables.FontFamily.Lato, _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);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -23,6 +23,8 @@ var _es = _interopRequireDefault(require("date-fns/locale/es"));
|
|
|
23
23
|
|
|
24
24
|
var _customHooks = require("../../../global-files/customHooks");
|
|
25
25
|
|
|
26
|
+
var _utils = require("../../../global-files/utils");
|
|
27
|
+
|
|
26
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
29
|
|
|
28
30
|
(0, _reactDatepicker.registerLocale)("es", _es.default);
|
|
@@ -54,7 +56,6 @@ var RangeCalendar = function RangeCalendar(_ref) {
|
|
|
54
56
|
|
|
55
57
|
(0, _react.useEffect)(function () {
|
|
56
58
|
if (currentDates) {
|
|
57
|
-
console.log(currentDates);
|
|
58
59
|
setStartDate(new Date(currentDates.start));
|
|
59
60
|
setEndDate(new Date(currentDates.end));
|
|
60
61
|
}
|
|
@@ -71,8 +72,8 @@ var RangeCalendar = function RangeCalendar(_ref) {
|
|
|
71
72
|
if (end) {
|
|
72
73
|
setParameterArray && setParameterArray(function (current) {
|
|
73
74
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, current), {}, {
|
|
74
|
-
estimatedStartDate:
|
|
75
|
-
estimatedDate:
|
|
75
|
+
estimatedStartDate: (0, _utils.getFormatedDate)(new Date(start), "-"),
|
|
76
|
+
estimatedDate: (0, _utils.getFormatedDate)(new Date(end), "-")
|
|
76
77
|
});
|
|
77
78
|
});
|
|
78
79
|
}
|
|
@@ -183,12 +183,12 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
183
183
|
|
|
184
184
|
var getRetailers = /*#__PURE__*/function () {
|
|
185
185
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
186
|
-
var
|
|
186
|
+
var isRetailer, retailersResponse, parsed, retailers, retailersValid;
|
|
187
187
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
188
188
|
while (1) {
|
|
189
189
|
switch (_context2.prev = _context2.next) {
|
|
190
190
|
case 0:
|
|
191
|
-
|
|
191
|
+
isRetailer = user.is_retailer && company.retailers;
|
|
192
192
|
_context2.next = 3;
|
|
193
193
|
return _axios.default.get("".concat(process.env.REACT_APP_RETAILER_ENDPOINT), {
|
|
194
194
|
headers: {
|
|
@@ -199,12 +199,20 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
199
199
|
case 3:
|
|
200
200
|
retailersResponse = _context2.sent;
|
|
201
201
|
parsed = JSON.parse(retailersResponse.data.body).data;
|
|
202
|
-
retailers =
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
retailers = Object.values(parsed);
|
|
203
|
+
|
|
204
|
+
if (isRetailer) {
|
|
205
|
+
retailersValid = company.retailers.map(function (e) {
|
|
206
|
+
return e.id;
|
|
207
|
+
});
|
|
208
|
+
retailers = retailers.filter(function (value) {
|
|
209
|
+
return retailersValid.includes(value.id);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
205
213
|
setRetailers(retailers);
|
|
206
214
|
|
|
207
|
-
case
|
|
215
|
+
case 8:
|
|
208
216
|
case "end":
|
|
209
217
|
return _context2.stop();
|
|
210
218
|
}
|
|
@@ -218,14 +226,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
218
226
|
}();
|
|
219
227
|
|
|
220
228
|
var loadProductsByStatus = /*#__PURE__*/function () {
|
|
221
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus
|
|
222
|
-
var
|
|
229
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus) {
|
|
230
|
+
var isRetailer, isProvider, isCollaborator, _ref5, ordersBydate, ordersByStatus, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$PA, PA, _ordersByStatus$Ex, Ex, _ordersByStatus$ACA, ACA, productsFinished, inProcess, metricsArray;
|
|
223
231
|
|
|
224
232
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
225
233
|
while (1) {
|
|
226
234
|
switch (_context3.prev = _context3.next) {
|
|
227
235
|
case 0:
|
|
228
|
-
|
|
236
|
+
isRetailer = user.is_retailer && company.retailers;
|
|
229
237
|
isProvider = !user.is_retailer && user.id_role === 0;
|
|
230
238
|
isCollaborator = user.id_role > 0;
|
|
231
239
|
_context3.next = 5;
|
|
@@ -247,7 +255,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
247
255
|
ordersByStatus = _ref5.ordersByStatus;
|
|
248
256
|
_ordersByStatus$total = ordersByStatus.total, total = _ordersByStatus$total === void 0 ? 0 : _ordersByStatus$total, _ordersByStatus$R = ordersByStatus.R, R = _ordersByStatus$R === void 0 ? 0 : _ordersByStatus$R, _ordersByStatus$PA = ordersByStatus.PA, PA = _ordersByStatus$PA === void 0 ? 0 : _ordersByStatus$PA, _ordersByStatus$Ex = ordersByStatus.Ex, Ex = _ordersByStatus$Ex === void 0 ? 0 : _ordersByStatus$Ex, _ordersByStatus$ACA = ordersByStatus.ACA, ACA = _ordersByStatus$ACA === void 0 ? 0 : _ordersByStatus$ACA;
|
|
249
257
|
productsFinished = 0;
|
|
250
|
-
if (
|
|
258
|
+
if (isRetailer) productsFinished = Ex;
|
|
251
259
|
if (isProvider) productsFinished = ACA;
|
|
252
260
|
if (isCollaborator) productsFinished = Ex + ACA;
|
|
253
261
|
inProcess = Object.keys(ordersByStatus).reduce(function (prev, curr) {
|
|
@@ -284,7 +292,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
284
292
|
}, _callee3);
|
|
285
293
|
}));
|
|
286
294
|
|
|
287
|
-
return function loadProductsByStatus(_x2
|
|
295
|
+
return function loadProductsByStatus(_x2) {
|
|
288
296
|
return _ref4.apply(this, arguments);
|
|
289
297
|
};
|
|
290
298
|
}();
|
|
@@ -447,7 +455,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
447
455
|
parameterArray: datesRange,
|
|
448
456
|
setParameterArray: setDatesRange,
|
|
449
457
|
isSingleSelect: true
|
|
450
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
458
|
+
}), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
451
459
|
showFilterString: true,
|
|
452
460
|
showSearchBar: true,
|
|
453
461
|
options: providers,
|
|
@@ -467,7 +475,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
467
475
|
parameterArray: categoryId,
|
|
468
476
|
setParameterArray: setCategoryId,
|
|
469
477
|
defaultOption: "Todas las categor\xEDas"
|
|
470
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
478
|
+
}), (retailers === null || retailers === void 0 ? void 0 : retailers.length) > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
471
479
|
showFilterString: true,
|
|
472
480
|
showSearchBar: true,
|
|
473
481
|
options: retailers,
|
package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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.RegistrationLoginFirstStepDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
|
|
15
|
+
|
|
16
|
+
var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
|
|
17
|
+
|
|
18
|
+
var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
title: "Components/pages/RegistrationLoginFirstStep",
|
|
24
|
+
component: _index.RegistrationLoginFirstStep
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
27
|
+
|
|
28
|
+
var Template = function Template(args) {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RegistrationLoginFirstStep, (0, _objectSpread2.default)({}, args));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var RegistrationLoginFirstStepDefault = Template.bind({});
|
|
33
|
+
exports.RegistrationLoginFirstStepDefault = RegistrationLoginFirstStepDefault;
|
|
34
|
+
RegistrationLoginFirstStepDefault.args = {
|
|
35
|
+
imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
|
|
36
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers"
|
|
37
|
+
};
|