contentoh-components-library 21.2.37 → 21.2.38
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/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
- package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
- package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
- package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
- package/dist/components/atoms/MenuProductImage/index.js +88 -0
- package/dist/components/atoms/MenuProductImage/styles.js +20 -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/atoms/VerticalSideMenuMainPage/styles.js +10 -22
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
- package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
- package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +8 -19
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/CustomSelect/index.js +3 -28
- package/dist/components/molecules/CustomSelect/styles.js +1 -3
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
- package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
- package/dist/components/organisms/DashboardMetric/index.js +10 -36
- package/dist/components/organisms/DashboardMetric/styles.js +1 -1
- package/dist/components/pages/Dashboard/index.js +3 -5
- 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/index.js +0 -13
- package/package.json +1 -1
- package/src/components/atoms/Graphic/index.js +1 -0
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +6 -7
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +7 -16
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/CustomSelect/index.js +2 -22
- package/src/components/molecules/CustomSelect/styles.js +1 -4
- package/src/components/organisms/DashboardMetric/index.js +8 -32
- package/src/components/organisms/DashboardMetric/styles.js +1 -1
- package/src/components/pages/Dashboard/index.js +1 -3
- package/src/index.js +0 -3
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +0 -147
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +0 -105
|
@@ -30,36 +30,25 @@ CustomSelectDefault.args = {
|
|
|
30
30
|
defaultOption: "Todos los departamentos",
|
|
31
31
|
options: [{
|
|
32
32
|
id: 1,
|
|
33
|
-
|
|
33
|
+
value: "Decoración",
|
|
34
34
|
subOptions: [{
|
|
35
35
|
id: 1,
|
|
36
|
-
|
|
37
|
-
isSelected: true
|
|
36
|
+
value: "Espejos"
|
|
38
37
|
}, {
|
|
39
38
|
id: 2,
|
|
40
|
-
|
|
39
|
+
value: "Persianas"
|
|
41
40
|
}]
|
|
42
41
|
}, {
|
|
43
42
|
id: 2,
|
|
44
|
-
|
|
45
|
-
isSelected: true
|
|
43
|
+
value: "Eléctrico"
|
|
46
44
|
}, {
|
|
47
45
|
id: 3,
|
|
48
|
-
|
|
46
|
+
value: "Ferretería"
|
|
49
47
|
}, {
|
|
50
48
|
id: 4,
|
|
51
|
-
|
|
49
|
+
value: "Herramientas"
|
|
52
50
|
}, {
|
|
53
51
|
id: 5,
|
|
54
|
-
|
|
55
|
-
}]
|
|
56
|
-
onClickItem: function onClickItem(v, id) {
|
|
57
|
-
if (v) {
|
|
58
|
-
console.log("Agregar a la lista", id);
|
|
59
|
-
} else {
|
|
60
|
-
console.log("Eliminar a la lista", id);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
icon: "",
|
|
64
|
-
showSearchBar: true
|
|
52
|
+
value: "Iluminación"
|
|
53
|
+
}]
|
|
65
54
|
};
|
|
@@ -26,8 +26,7 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
26
26
|
customSelectId = _ref.customSelectId,
|
|
27
27
|
setParameterArray = _ref.setParameterArray,
|
|
28
28
|
activeFilters = _ref.activeFilters,
|
|
29
|
-
setActiveFilters = _ref.setActiveFilters
|
|
30
|
-
onClickItem = _ref.onClickItem;
|
|
29
|
+
setActiveFilters = _ref.setActiveFilters;
|
|
31
30
|
|
|
32
31
|
var _useState = (0, _react.useState)(false),
|
|
33
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -47,10 +46,6 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
47
46
|
id: "main-item-" + option.id,
|
|
48
47
|
label: option.name,
|
|
49
48
|
onChange: function onChange(e) {
|
|
50
|
-
if (onClickItem) {
|
|
51
|
-
onClickItem(e.target.checked, option.id);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
49
|
var subOptions = option.subOptions;
|
|
55
50
|
var filtersCopy = (0, _objectSpread2.default)({}, activeFilters);
|
|
56
51
|
|
|
@@ -113,10 +108,6 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
113
108
|
label: sub.name,
|
|
114
109
|
defaultChecked: activeFilters[option.name] && activeFilters[option.name][sub.name],
|
|
115
110
|
onChange: function onChange(e) {
|
|
116
|
-
if (onClickItem) {
|
|
117
|
-
onClickItem(e.target.checked, sub.id);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
111
|
if (e.target.checked) {
|
|
121
112
|
setParameterArray(function (current) {
|
|
122
113
|
return [].concat((0, _toConsumableArray2.default)(current), [sub.id]).sort(function (a, b) {
|
|
@@ -35,9 +35,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
35
35
|
_ref$customSelectId = _ref.customSelectId,
|
|
36
36
|
customSelectId = _ref$customSelectId === void 0 ? "defaultSelectId" : _ref$customSelectId,
|
|
37
37
|
defaultOption = _ref.defaultOption,
|
|
38
|
-
setParameterArray = _ref.setParameterArray
|
|
39
|
-
onClickItem = _ref.onClickItem,
|
|
40
|
-
icon = _ref.icon;
|
|
38
|
+
setParameterArray = _ref.setParameterArray;
|
|
41
39
|
|
|
42
40
|
var _useState = (0, _react.useState)(options || []),
|
|
43
41
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -85,23 +83,6 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
85
83
|
var end = new Date();
|
|
86
84
|
setStartDate(start);
|
|
87
85
|
setEndDate(end);
|
|
88
|
-
var obj = {};
|
|
89
|
-
options.forEach(function (o) {
|
|
90
|
-
var name = o.name,
|
|
91
|
-
isSelected = o.isSelected,
|
|
92
|
-
subOptions = o.subOptions;
|
|
93
|
-
if (isSelected) obj[name] = {};
|
|
94
|
-
subOptions === null || subOptions === void 0 ? void 0 : subOptions.forEach(function (so) {
|
|
95
|
-
var nameSO = so.name,
|
|
96
|
-
isSelectedSO = so.isSelected;
|
|
97
|
-
|
|
98
|
-
if (isSelectedSO) {
|
|
99
|
-
if (!obj[name]) obj[name] = {};
|
|
100
|
-
obj[name][nameSO] = true;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
setActiveFilters(obj);
|
|
105
86
|
}, []);
|
|
106
87
|
|
|
107
88
|
var onChangeDatePicker = function onChangeDatePicker(dates) {
|
|
@@ -132,7 +113,6 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
132
113
|
}, [text]);
|
|
133
114
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
134
115
|
id: customSelectId,
|
|
135
|
-
selectLabel: selectLabel,
|
|
136
116
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
137
117
|
className: "button-list",
|
|
138
118
|
onClick: function onClick() {
|
|
@@ -140,11 +120,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
140
120
|
},
|
|
141
121
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
142
122
|
children: selectLabel
|
|
143
|
-
}),
|
|
144
|
-
src: icon,
|
|
145
|
-
alt: "Favorite",
|
|
146
|
-
width: "20px"
|
|
147
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
148
124
|
className: "arrow-item",
|
|
149
125
|
children: "\u25C0"
|
|
150
126
|
})]
|
|
@@ -187,8 +163,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
187
163
|
customSelectId: customSelectId,
|
|
188
164
|
setParameterArray: setParameterArray,
|
|
189
165
|
activeFilters: activeFilters,
|
|
190
|
-
setActiveFilters: setActiveFilters
|
|
191
|
-
onClickItem: onClickItem
|
|
166
|
+
setActiveFilters: setActiveFilters
|
|
192
167
|
}, customSelectId + option.id);
|
|
193
168
|
})
|
|
194
169
|
})]
|
|
@@ -15,8 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n position: relative;\n\n .button-list {\n font-family: ", ";\n font-size: 13px;\n display: flex;\n padding:
|
|
19
|
-
return props.selectLabel !== "" ? "10px 15px" : "5px 5px";
|
|
20
|
-
});
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n position: relative;\n\n .button-list {\n font-family: ", ";\n font-size: 13px;\n display: flex;\n padding: 10px 15px;\n justify-content: space-between;\n border-radius: 50px;\n background-color: #fff;\n border: 1px solid #f0f0f0;\n cursor: pointer;\n\n .arrow-item {\n transform: rotate(-90deg);\n cursor: pointer;\n font-size: 10px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n\n .select-container {\n box-shadow: 0px 2px 4px #00000040;\n border-radius: 5px;\n background-color: #fff;\n padding-bottom: 10px;\n position: absolute;\n z-index: 10;\n .search-bar-filter {\n display: flex;\n align-items: center;\n border: 1px solid #f0f0f0;\n padding-left: 10px;\n\n img {\n width: 15px;\n height: 15px;\n }\n\n input {\n background-color: transparent;\n padding: 10px 10px;\n outline: none;\n border: none;\n }\n }\n .default-option {\n padding-top: 5px;\n cursor: pointer;\n padding: 5px 10px;\n color: #817393;\n font-family: Avenir Next;\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n &:hover {\n background-color: #f0f0f0;\n }\n }\n .filters-container {\n overflow: auto;\n max-height: 500px;\n .option-container,\n .default-option {\n cursor: pointer;\n padding: 5px 10px;\n .main-item {\n display: flex;\n justify-content: space-between;\n\n .arrow-item {\n transform: rotate(-90deg);\n cursor: pointer;\n font-size: 10px;\n }\n }\n .sub-menu {\n padding-left: 20px;\n .sub-filter {\n & + * {\n margin-top: 10px;\n }\n }\n }\n\n &:hover {\n background-color: #f0f0f0;\n }\n label {\n white-space: nowrap;\n }\n }\n\n .dates-select-item {\n cursor: pointer;\n padding: 5px 10px;\n color: #817393;\n font-family: Avenir Next;\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n &:hover {\n background-color: #f0f0f0;\n }\n }\n }\n }\n"])), _variables.FontFamily.Raleway);
|
|
21
19
|
|
|
22
20
|
exports.Container = Container;
|
|
@@ -0,0 +1,28 @@
|
|
|
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.SignInLoginCreationAppDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/molecules/SignInLoginCreationApp",
|
|
18
|
+
component: _index.SignInLoginCreationApp
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.SignInLoginCreationApp, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var SignInLoginCreationAppDefault = Template.bind({});
|
|
27
|
+
exports.SignInLoginCreationAppDefault = SignInLoginCreationAppDefault;
|
|
28
|
+
SignInLoginCreationAppDefault.args = {};
|
|
@@ -0,0 +1,270 @@
|
|
|
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.SignInLoginCreationApp = 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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _index = require("../../atoms/LogoImage/index");
|
|
19
|
+
|
|
20
|
+
var _index2 = require("../../atoms/ScreenHeader/index");
|
|
21
|
+
|
|
22
|
+
var _index3 = require("../../atoms/GeneralButton/index");
|
|
23
|
+
|
|
24
|
+
var _index4 = require("../../atoms/CheckBox/index");
|
|
25
|
+
|
|
26
|
+
var _TagAndInput = require("../TagAndInput");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _react = require("react");
|
|
31
|
+
|
|
32
|
+
var _Loading = require("../../atoms/Loading");
|
|
33
|
+
|
|
34
|
+
var _reactRouterDom = require("react-router-dom");
|
|
35
|
+
|
|
36
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
37
|
+
|
|
38
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
|
+
|
|
40
|
+
var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
41
|
+
var _useState = (0, _react.useState)(false),
|
|
42
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
43
|
+
emptyEmail = _useState2[0],
|
|
44
|
+
setEmptyEmail = _useState2[1];
|
|
45
|
+
|
|
46
|
+
var _useState3 = (0, _react.useState)(false),
|
|
47
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
48
|
+
invalidEmail = _useState4[0],
|
|
49
|
+
setInvalidEmail = _useState4[1];
|
|
50
|
+
|
|
51
|
+
var _useState5 = (0, _react.useState)(false),
|
|
52
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
53
|
+
emptyPassword = _useState6[0],
|
|
54
|
+
setEmptyPassword = _useState6[1];
|
|
55
|
+
|
|
56
|
+
var _useState7 = (0, _react.useState)(true),
|
|
57
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
58
|
+
showErrors = _useState8[0],
|
|
59
|
+
setShowErrors = _useState8[1];
|
|
60
|
+
|
|
61
|
+
var _useState9 = (0, _react.useState)(""),
|
|
62
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
63
|
+
signInError = _useState10[0],
|
|
64
|
+
setSignInError = _useState10[1];
|
|
65
|
+
|
|
66
|
+
var _useState11 = (0, _react.useState)(false),
|
|
67
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
68
|
+
loading = _useState12[0],
|
|
69
|
+
setLoading = _useState12[1];
|
|
70
|
+
|
|
71
|
+
var _useState13 = (0, _react.useState)(false),
|
|
72
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
73
|
+
upgradePlanRedirect = _useState14[0],
|
|
74
|
+
setUpgradePlanRedirect = _useState14[1];
|
|
75
|
+
|
|
76
|
+
var validate = /*#__PURE__*/function () {
|
|
77
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
78
|
+
var valid, email, password, session, userGroup, response, userGroupValue, user, company;
|
|
79
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
80
|
+
while (1) {
|
|
81
|
+
switch (_context.prev = _context.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
setSignInError("");
|
|
85
|
+
setShowErrors(true);
|
|
86
|
+
valid = true;
|
|
87
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
88
|
+
password = document.querySelector("#passwordInput").value;
|
|
89
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
90
|
+
|
|
91
|
+
if (email === "") {
|
|
92
|
+
valid = false;
|
|
93
|
+
setEmptyEmail(true);
|
|
94
|
+
} else {
|
|
95
|
+
setEmptyEmail(false);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (password === "") {
|
|
99
|
+
valid = false;
|
|
100
|
+
setEmptyPassword(true);
|
|
101
|
+
} else {
|
|
102
|
+
setEmptyPassword(false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!valid) {
|
|
106
|
+
_context.next = 35;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_context.prev = 10;
|
|
111
|
+
setLoading(true);
|
|
112
|
+
_context.next = 14;
|
|
113
|
+
return props.Auth.signIn(email, password);
|
|
114
|
+
|
|
115
|
+
case 14:
|
|
116
|
+
session = _context.sent;
|
|
117
|
+
|
|
118
|
+
if (!(session.challengeName === "NEW_PASSWORD_REQUIRED")) {
|
|
119
|
+
_context.next = 20;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
props.setUser(session);
|
|
124
|
+
props.setPaso(8);
|
|
125
|
+
_context.next = 28;
|
|
126
|
+
break;
|
|
127
|
+
|
|
128
|
+
case 20:
|
|
129
|
+
userGroup = session.signInUserSession.accessToken.payload["cognito:groups"];
|
|
130
|
+
_context.next = 23;
|
|
131
|
+
return _axios.default.get(process.env.REACT_APP_USER_ENDPOINT, {
|
|
132
|
+
headers: {
|
|
133
|
+
Authorization: session.signInUserSession.idToken.jwtToken
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
case 23:
|
|
138
|
+
response = _context.sent;
|
|
139
|
+
console.log(userGroup);
|
|
140
|
+
console.log(userGroup[0]);
|
|
141
|
+
userGroupValue = typeof userGroup === "string" ? userGroup : userGroup[0];
|
|
142
|
+
|
|
143
|
+
if (userGroupValue === "colaboradores_contentoh") {
|
|
144
|
+
sessionStorage.setItem("auth", true);
|
|
145
|
+
sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
|
|
146
|
+
user = JSON.parse(response.data.body).data[0];
|
|
147
|
+
company = JSON.parse(response.data.body).data[1];
|
|
148
|
+
caches.keys().then(function (names) {
|
|
149
|
+
names.forEach(function (name) {
|
|
150
|
+
caches.delete(name);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
user.src = "https://".concat(process.env.REACT_APP_IMAGES_PROFILE_BUCKET, ".s3.amazonaws.com/id-").concat(user.id_user, "/").concat(user.id_user, ".png?").concat(new Date().getTime());
|
|
154
|
+
sessionStorage.setItem("user", JSON.stringify(user));
|
|
155
|
+
sessionStorage.setItem("company", JSON.stringify(company));
|
|
156
|
+
setUpgradePlanRedirect(true);
|
|
157
|
+
} else {
|
|
158
|
+
setSignInError("NotAuthorizedException");
|
|
159
|
+
setLoading(false);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
case 28:
|
|
163
|
+
_context.next = 35;
|
|
164
|
+
break;
|
|
165
|
+
|
|
166
|
+
case 30:
|
|
167
|
+
_context.prev = 30;
|
|
168
|
+
_context.t0 = _context["catch"](10);
|
|
169
|
+
console.log(_context.t0);
|
|
170
|
+
setLoading(false);
|
|
171
|
+
|
|
172
|
+
if (_context.t0.code === "NotAuthorizedException") {
|
|
173
|
+
setSignInError("NotAuthorizedException");
|
|
174
|
+
} else if (_context.t0.code === "UserNotConfirmedException") {
|
|
175
|
+
sessionStorage.setItem("email", JSON.stringify(document.querySelector("#usernameInput").value));
|
|
176
|
+
props.setPaso(5);
|
|
177
|
+
} else {
|
|
178
|
+
setSignInError("Error");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
case 35:
|
|
182
|
+
case "end":
|
|
183
|
+
return _context.stop();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, _callee, null, [[10, 30]]);
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
return function validate(_x) {
|
|
190
|
+
return _ref.apply(this, arguments);
|
|
191
|
+
};
|
|
192
|
+
}();
|
|
193
|
+
|
|
194
|
+
(0, _react.useEffect)(function () {
|
|
195
|
+
sessionStorage.getItem("resetPasswordProcess") && sessionStorage.removeItem("resetPasswordProcess");
|
|
196
|
+
}, []);
|
|
197
|
+
(0, _react.useEffect)(function () {
|
|
198
|
+
if (upgradePlanRedirect) setLoading(false);
|
|
199
|
+
}, [upgradePlanRedirect]);
|
|
200
|
+
return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
201
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
202
|
+
className: "home-login",
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
204
|
+
className: "main-container",
|
|
205
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LogoImage, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
206
|
+
className: "credenciales",
|
|
207
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ScreenHeader, {
|
|
208
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
209
|
+
color: _variables.GlobalColors.s5,
|
|
210
|
+
text: "Ingresa tus credenciales"
|
|
211
|
+
})
|
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
|
+
className: "user",
|
|
214
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
215
|
+
inputType: "text",
|
|
216
|
+
label: "Nombre de usuario",
|
|
217
|
+
inputPlaceHolder: "username@contentoh.com",
|
|
218
|
+
inputId: "emailInput"
|
|
219
|
+
})
|
|
220
|
+
}), showErrors && emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
221
|
+
children: "Ingrese su correo"
|
|
222
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
223
|
+
children: "Ingrese un correo v\xE1lido"
|
|
224
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
225
|
+
className: "password",
|
|
226
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
227
|
+
inputType: "password",
|
|
228
|
+
label: "Contraseña",
|
|
229
|
+
inputPlaceHolder: "Escribe tu contraseña",
|
|
230
|
+
inputId: "passwordInput"
|
|
231
|
+
})
|
|
232
|
+
}), showErrors && emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
233
|
+
children: "Ingrese su contrase\xF1a"
|
|
234
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
235
|
+
className: "select",
|
|
236
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.CheckBox, {
|
|
237
|
+
label: "Mantener sesión activada",
|
|
238
|
+
id: "chk-default",
|
|
239
|
+
className: "active-left"
|
|
240
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
return props.setPaso(10);
|
|
243
|
+
},
|
|
244
|
+
className: "active-right",
|
|
245
|
+
children: "Olvide mi contrase\xF1a"
|
|
246
|
+
})]
|
|
247
|
+
}), showErrors && signInError === "NotAuthorizedException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
248
|
+
children: "Correo o contrase\xF1a incorrectos"
|
|
249
|
+
}), showErrors && signInError === "Error" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
250
|
+
children: "Ha habido un problema al iniciar sesi\xF3n"
|
|
251
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
252
|
+
className: "button-right",
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Button, {
|
|
254
|
+
buttonType: "general-default-button",
|
|
255
|
+
label: "Iniciar sesión",
|
|
256
|
+
onClick: function onClick(e) {
|
|
257
|
+
return validate(e);
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
}), upgradePlanRedirect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Redirect, {
|
|
263
|
+
to: {
|
|
264
|
+
pathname: "/dashboard"
|
|
265
|
+
}
|
|
266
|
+
})]
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
exports.SignInLoginCreationApp = SignInLoginCreationApp;
|
|
@@ -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 background: \"white\";\n display: flex;\n height: 100vh;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n cursor: pointer;\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -13,8 +13,6 @@ var _styles = require("./styles");
|
|
|
13
13
|
|
|
14
14
|
var _Graphic = require("../../atoms/Graphic");
|
|
15
15
|
|
|
16
|
-
var _dashboardMetricUtils = require("./dashboardMetricUtils");
|
|
17
|
-
|
|
18
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
17
|
|
|
20
18
|
var DashboardMetric = function DashboardMetric(_ref) {
|
|
@@ -33,24 +31,17 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
33
31
|
_ref$displayScale = _ref.displayScale,
|
|
34
32
|
displayScale = _ref$displayScale === void 0 ? false : _ref$displayScale,
|
|
35
33
|
_ref$displayLegend = _ref.displayLegend,
|
|
36
|
-
displayLegend = _ref$displayLegend === void 0 ? false : _ref$displayLegend
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return (0, _dashboardMetricUtils.getFullStatus)(key);
|
|
42
|
-
}) : Object.keys(dataObject);
|
|
43
|
-
var newObject = type === "doughnut" ? (0, _dashboardMetricUtils.removeOldStatus)(dataObject) : dataObject;
|
|
44
|
-
var values = Object.values(newObject);
|
|
45
|
-
var colorsArray = Object.keys(newObject).map(function (key) {
|
|
46
|
-
return (0, _dashboardMetricUtils.getStatusColor)(key);
|
|
34
|
+
displayLegend = _ref$displayLegend === void 0 ? false : _ref$displayLegend;
|
|
35
|
+
var labels = Object.keys(dataObject);
|
|
36
|
+
var values = Object.values(dataObject);
|
|
37
|
+
var colorsArray = values.map(function () {
|
|
38
|
+
return "#".concat(Math.floor(Math.random() * 16777215).toString(16));
|
|
47
39
|
});
|
|
48
40
|
var data = {
|
|
49
41
|
labels: labels,
|
|
50
42
|
datasets: [{
|
|
51
43
|
data: values,
|
|
52
|
-
backgroundColor: colorsArray
|
|
53
|
-
borderColor: borderColor
|
|
44
|
+
backgroundColor: colorsArray
|
|
54
45
|
}]
|
|
55
46
|
};
|
|
56
47
|
var options = {
|
|
@@ -64,29 +55,12 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
64
55
|
maintainAspectRatio: false,
|
|
65
56
|
aspectRatio: 1,
|
|
66
57
|
plugins: {
|
|
67
|
-
tooltip: {
|
|
68
|
-
callbacks: {
|
|
69
|
-
label: function label(_ref2) {
|
|
70
|
-
var _dataset$data;
|
|
71
|
-
|
|
72
|
-
var dataset = _ref2.dataset,
|
|
73
|
-
element = _ref2.element;
|
|
74
|
-
var sum = dataset === null || dataset === void 0 ? void 0 : (_dataset$data = dataset.data) === null || _dataset$data === void 0 ? void 0 : _dataset$data.reduce(function (accumulator, value) {
|
|
75
|
-
return accumulator + value;
|
|
76
|
-
}, 0);
|
|
77
|
-
var raw = element.$context.raw;
|
|
78
|
-
var percent = Math.round(100 * (raw / sum)) + "%";
|
|
79
|
-
return showPercent ? percent : raw;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
58
|
legend: {
|
|
84
59
|
position: "right",
|
|
85
|
-
display: displayLegend
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
60
|
+
display: displayLegend
|
|
61
|
+
},
|
|
62
|
+
title: {
|
|
63
|
+
display: false
|
|
90
64
|
}
|
|
91
65
|
},
|
|
92
66
|
scales: (0, _defineProperty2.default)({}, scale, {
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 5px;\n padding: 24px;\n\n .text-container {\n p {\n font-family: ", ";\n color: ", ";\n font-size: 17px;\n\n &:last-of-type {\n font-size: 12px;\n color: ", ";\n }\n\n & + * {\n margin-top: 5px;\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n }\n\n .select-container {\n display: flex;\n\n .select {\n flex: 0.1 1 30%;\n\n select {\n width: 100%;\n }\n\n & + * {\n margin-left: 10px;\n }\n }\n\n & + * {\n margin-top: 10px;\n }\n }\n\n .graphic-cotainer {\n height:
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 5px;\n padding: 24px;\n\n .text-container {\n p {\n font-family: ", ";\n color: ", ";\n font-size: 17px;\n\n &:last-of-type {\n font-size: 12px;\n color: ", ";\n }\n\n & + * {\n margin-top: 5px;\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n }\n\n .select-container {\n display: flex;\n\n .select {\n flex: 0.1 1 30%;\n\n select {\n width: 100%;\n }\n\n & + * {\n margin-left: 10px;\n }\n }\n\n & + * {\n margin-top: 10px;\n }\n }\n\n .graphic-cotainer {\n height: 300px;\n border: 1px solid ", ";\n padding: 10px;\n border-radius: 5px;\n\n div {\n height: fill-available;\n }\n }\n"])), _variables.GlobalColors.s3, _variables.FontFamily.Raleway, _variables.GlobalColors.s5, _variables.GlobalColors.s4, _variables.GlobalColors.s3);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -350,7 +350,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
350
350
|
}
|
|
351
351
|
}, {
|
|
352
352
|
id: 7,
|
|
353
|
-
name: "
|
|
353
|
+
name: "Este mes",
|
|
354
354
|
function: function _function() {
|
|
355
355
|
return setDatesRange({
|
|
356
356
|
startDate: new Date("".concat(today.getFullYear(), "-").concat(today.getMonth(), "-01")),
|
|
@@ -498,8 +498,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
498
498
|
setOrderByStatus(evt);
|
|
499
499
|
},
|
|
500
500
|
type: "doughnut",
|
|
501
|
-
displayLegend: true
|
|
502
|
-
showPercent: true
|
|
501
|
+
displayLegend: true
|
|
503
502
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DashboardMetric.DashboardMetric, {
|
|
504
503
|
label: "Productos solicitados",
|
|
505
504
|
description: "Filtra los productos solicitados por fecha y alcance para revisar rápidamente el flujo de trabajo.",
|
|
@@ -513,8 +512,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
513
512
|
setQueryObject: function setQueryObject(evt) {
|
|
514
513
|
loadRequiredProducts(evt);
|
|
515
514
|
setOrderByRequired(evt);
|
|
516
|
-
}
|
|
517
|
-
borderColor: "#3B1366"
|
|
515
|
+
}
|
|
518
516
|
})]
|
|
519
517
|
})]
|
|
520
518
|
});
|
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
|
+
};
|