contentoh-components-library 21.0.4 → 21.0.7
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/CharCounter/CharCounter.stories.js +31 -0
- package/dist/components/atoms/CharCounter/index.js +22 -0
- package/dist/components/atoms/CharCounter/styles.js +20 -0
- package/dist/components/atoms/GeneralInput/index.js +78 -49
- package/dist/components/atoms/GeneralInput/styles.js +4 -1
- package/dist/components/atoms/GradientPanel/styles.js +2 -2
- package/dist/components/atoms/InputFormatter/index.js +132 -66
- package/dist/components/atoms/InputFormatter/styles.js +2 -2
- package/dist/components/atoms/ProgressBar/styles.js +1 -1
- package/dist/components/atoms/Select/index.js +4 -2
- package/dist/components/atoms/Select/style.js +1 -1
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +37 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +94 -0
- package/dist/components/molecules/CarouselImagesLogin/styles.js +21 -0
- package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +28 -0
- package/dist/components/molecules/LoginPasswordStrength/index.js +131 -0
- package/dist/components/molecules/LoginPasswordStrength/styles.js +78 -0
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/organisms/InputGroup/index.js +13 -11
- package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +38 -0
- package/dist/components/pages/ChangePasswordLogin/index.js +131 -0
- package/dist/components/pages/ChangePasswordLogin/styles.js +18 -0
- package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +37 -0
- package/dist/components/pages/EmailResetPassword/index.js +130 -0
- package/dist/components/pages/EmailResetPassword/styles.js +20 -0
- 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/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +38 -0
- package/dist/components/pages/RegistrationLoginSecondStep/index.js +176 -0
- package/dist/components/pages/RegistrationLoginSecondStep/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginThirdStep/index.js +178 -0
- package/dist/components/pages/RegistrationLoginThirdStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -28
- package/dist/components/pages/RetailerProductEdition/index.js +105 -66
- package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +37 -0
- package/dist/components/pages/VerificationCodeResetPassword/index.js +121 -0
- package/dist/components/pages/VerificationCodeResetPassword/styles.js +20 -0
- package/dist/components/pages/VerificationCodeResetPassword/utils.js +69 -0
- package/package.json +2 -2
- package/src/assets/images/carouselImagesLogin/login2.svg +117 -0
- package/src/assets/images/carouselImagesLogin/login3.svg +147 -0
- package/src/assets/images/carouselImagesLogin/loginImage.svg +301 -0
- package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
- package/src/components/atoms/CharCounter/index.js +13 -0
- package/src/components/atoms/CharCounter/styles.js +10 -0
- package/src/components/atoms/GeneralInput/index.js +74 -50
- package/src/components/atoms/GeneralInput/styles.js +9 -0
- package/src/components/atoms/GradientPanel/styles.js +7 -1
- package/src/components/atoms/InputFormatter/index.js +109 -46
- package/src/components/atoms/InputFormatter/styles.js +6 -0
- package/src/components/atoms/ProgressBar/styles.js +2 -1
- package/src/components/atoms/Select/index.js +3 -1
- package/src/components/atoms/Select/style.js +1 -2
- package/src/components/atoms/StatusTag/styles.js +2 -1
- package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +68 -0
- package/src/components/molecules/CarouselImagesLogin/styles.js +60 -0
- package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +89 -0
- package/src/components/molecules/LoginPasswordStrength/styles.js +87 -0
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/organisms/InputGroup/index.js +25 -8
- package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -0
- package/src/components/pages/ChangePasswordLogin/index.js +78 -0
- package/src/components/pages/ChangePasswordLogin/styles.js +20 -0
- package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -0
- package/src/components/pages/EmailResetPassword/index.js +77 -0
- package/src/components/pages/EmailResetPassword/styles.js +27 -0
- package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginFirstStep/index.js +160 -0
- package/src/components/pages/RegistrationLoginFirstStep/styles.js +85 -0
- package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -0
- package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -0
- package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -0
- package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginThirdStep/index.js +106 -0
- package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -29
- package/src/components/pages/RetailerProductEdition/index.js +84 -22
- package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -0
- package/src/components/pages/VerificationCodeResetPassword/index.js +92 -0
- package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -0
- package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RegistrationLoginThirdStep } from "./index";
|
|
2
|
+
import LoginImage from "../../../assets/images/carouselImagesLogin/loginImage.svg";
|
|
3
|
+
import Login2 from "../../../assets/images/carouselImagesLogin/login2.svg";
|
|
4
|
+
import Login3 from "../../../assets/images/carouselImagesLogin/login3.svg";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/pages/RegistrationLoginThirdStep",
|
|
8
|
+
component: RegistrationLoginThirdStep,
|
|
9
|
+
};
|
|
10
|
+
const Template = (args) => <RegistrationLoginThirdStep {...args} />;
|
|
11
|
+
|
|
12
|
+
export const RegistrationLoginThirdStepDefault = Template.bind({});
|
|
13
|
+
|
|
14
|
+
RegistrationLoginThirdStepDefault.args = {
|
|
15
|
+
imageArrayCarousel: [LoginImage, Login2, Login3],
|
|
16
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers",
|
|
17
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { GradientPanel } from "../../atoms/GradientPanel";
|
|
3
|
+
import { CarouselImagesLogin } from "../../molecules/CarouselImagesLogin";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { LogoImage } from "../../atoms/LogoImage";
|
|
6
|
+
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
7
|
+
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
8
|
+
import { TagAndInput } from "../../molecules/TagAndInput";
|
|
9
|
+
import { Button } from "../../atoms/GeneralButton";
|
|
10
|
+
|
|
11
|
+
export const RegistrationLoginThirdStep = ({
|
|
12
|
+
imageArrayCarousel = [],
|
|
13
|
+
textCarousel,
|
|
14
|
+
backogroundColorCarousel,
|
|
15
|
+
}) => {
|
|
16
|
+
const [emptyCommercialName, setEmptyCommercialName] = useState(false);
|
|
17
|
+
const [emptyBussinesName, setEmptyBussinesName] = useState(false);
|
|
18
|
+
const [emptyRFC, setEmptyRFC] = useState(false);
|
|
19
|
+
const [emptyFiscalAddress, setEmptyFiscalAddress] = useState(false);
|
|
20
|
+
const validate = async (e) => {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
const commercialName = document.querySelector("#commercialNameInput").value;
|
|
23
|
+
const bussinesName = document.querySelector("#bussinesNameInput").value;
|
|
24
|
+
const RFC = document.querySelector("#rfcInput").value;
|
|
25
|
+
const FiscalAddress = document.querySelector("#fiscalAddressInput").value;
|
|
26
|
+
commercialName === "" ? setEmptyCommercialName(true) : setEmptyCommercialName(false);
|
|
27
|
+
bussinesName === "" ? setEmptyBussinesName(true) : setEmptyBussinesName(false);
|
|
28
|
+
RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
|
|
29
|
+
FiscalAddress === "" ? setEmptyFiscalAddress(true) : setEmptyFiscalAddress(false);
|
|
30
|
+
};
|
|
31
|
+
const loginRight = [
|
|
32
|
+
<LogoImage key="1" />,
|
|
33
|
+
<div className="credenciales" key={"2"}>
|
|
34
|
+
<ScreenHeader
|
|
35
|
+
fontFamily={FontFamily.AvenirNext}
|
|
36
|
+
color={GlobalColors.s5}
|
|
37
|
+
text={"Ingresa tus credenciales"}
|
|
38
|
+
/>
|
|
39
|
+
</div>,
|
|
40
|
+
<div className="user" key="3">
|
|
41
|
+
<TagAndInput
|
|
42
|
+
inputType={"text"}
|
|
43
|
+
inputId={"commercialNameInput"}
|
|
44
|
+
label={"Nombre comercial"}
|
|
45
|
+
inputPlaceHolder={"Nombre comercial"}
|
|
46
|
+
/>
|
|
47
|
+
{emptyCommercialName && <label>Ingrese el nombre comercial de la empresa</label>}
|
|
48
|
+
<TagAndInput
|
|
49
|
+
inputType={"text"}
|
|
50
|
+
inputId={"bussinesNameInput"}
|
|
51
|
+
label={"Razón social"}
|
|
52
|
+
inputPlaceHolder={"Razón social"}
|
|
53
|
+
/>
|
|
54
|
+
{emptyBussinesName && <label>Ingrese la razón social de la empresa</label>}
|
|
55
|
+
<TagAndInput
|
|
56
|
+
inputType={"text"}
|
|
57
|
+
inputId={"rfcInput"}
|
|
58
|
+
label={"RFC"}
|
|
59
|
+
inputPlaceHolder={"RFC"}
|
|
60
|
+
/>
|
|
61
|
+
{emptyRFC && <label>El RFC es requerido</label>}
|
|
62
|
+
<TagAndInput
|
|
63
|
+
inputType={"text"}
|
|
64
|
+
inputId={"fiscalAddressInput"}
|
|
65
|
+
label={"Direccion fiscal"}
|
|
66
|
+
inputPlaceHolder={"Dirección fiscal"}
|
|
67
|
+
/>
|
|
68
|
+
{emptyFiscalAddress && <label>Ingrese la direccion fiscal de la empresa</label>}
|
|
69
|
+
</div>,
|
|
70
|
+
<div className="button-end" key="4">
|
|
71
|
+
<Button
|
|
72
|
+
buttonType={"general-default-button"}
|
|
73
|
+
label={"Enviar"}
|
|
74
|
+
onClick={(e) => validate(e)}
|
|
75
|
+
/>
|
|
76
|
+
</div>,
|
|
77
|
+
<div className="progress-bar" key="5">
|
|
78
|
+
<div className="progress-bar-step-check"></div>
|
|
79
|
+
<div className="progress-bar-registration"></div>
|
|
80
|
+
</div>,
|
|
81
|
+
<ScreenHeader text={"Paso 3"} headerType={"date-header"} color={GlobalColors.s4} key="6"/>,
|
|
82
|
+
<div className="new-login" key="7">
|
|
83
|
+
<p className="pre-registro">
|
|
84
|
+
¿Ya tienes una cuenta?<span> Inicia Sesión</span>
|
|
85
|
+
</p>
|
|
86
|
+
</div>,
|
|
87
|
+
];
|
|
88
|
+
return (
|
|
89
|
+
<Container>
|
|
90
|
+
<div className="home-retailer">
|
|
91
|
+
<CarouselImagesLogin
|
|
92
|
+
panelImg={imageArrayCarousel}
|
|
93
|
+
panelText={textCarousel}
|
|
94
|
+
panelColor={backogroundColorCarousel}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="home-login-retailer">
|
|
98
|
+
<GradientPanel
|
|
99
|
+
componentsArray={loginRight}
|
|
100
|
+
panelType={"home-login"}
|
|
101
|
+
panelColor={GlobalColors.white}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</Container>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
.user {
|
|
9
|
+
.input-name-header {
|
|
10
|
+
margin-top: 10px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
.button-end {
|
|
14
|
+
text-align: end;
|
|
15
|
+
.general-default-button {
|
|
16
|
+
width: 160px;
|
|
17
|
+
}
|
|
18
|
+
& + * {
|
|
19
|
+
margin-top: 10px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.home-login-retailer,
|
|
23
|
+
.home-retailer {
|
|
24
|
+
width: 50%;
|
|
25
|
+
}
|
|
26
|
+
.progress-bar {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 8px;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
.progress-bar-step-check {
|
|
32
|
+
width: 66.66%;
|
|
33
|
+
background-color: ${GlobalColors.exported};
|
|
34
|
+
}
|
|
35
|
+
.progress-bar-registration {
|
|
36
|
+
background-color: rgb(196, 196, 196);
|
|
37
|
+
width: 33.33%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.date-header {
|
|
41
|
+
margin-left: 66.66%;
|
|
42
|
+
.new-login {
|
|
43
|
+
& + * {
|
|
44
|
+
margin-top: 20px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
@@ -54,36 +54,35 @@ RetailerProductEditionDefault.args = {
|
|
|
54
54
|
descriptions: 1,
|
|
55
55
|
images: 1,
|
|
56
56
|
},
|
|
57
|
-
orderId:
|
|
58
|
-
status: "
|
|
59
|
-
datasheet_status: "
|
|
57
|
+
orderId: 123,
|
|
58
|
+
status: "IN_PROGRESS",
|
|
59
|
+
datasheet_status: "IN_PROGRESS",
|
|
60
60
|
prio: "none",
|
|
61
61
|
version: 2,
|
|
62
|
-
description_status: "
|
|
63
|
-
images_status:
|
|
62
|
+
description_status: "IN_PROGRESS",
|
|
63
|
+
images_status: null,
|
|
64
64
|
article: {
|
|
65
|
-
id_article:
|
|
66
|
-
id_category: "
|
|
67
|
-
name: "
|
|
68
|
-
upc: "
|
|
69
|
-
timestamp: "2022-
|
|
65
|
+
id_article: 109481,
|
|
66
|
+
id_category: "9",
|
|
67
|
+
name: "Barrita de nuez",
|
|
68
|
+
upc: "168489",
|
|
69
|
+
timestamp: "2022-04-27T15:06:59.000Z",
|
|
70
70
|
id_user: 28,
|
|
71
71
|
status: "NULL",
|
|
72
72
|
active: 1,
|
|
73
73
|
company_id: 1,
|
|
74
74
|
company_name: "COMPANY DEV",
|
|
75
75
|
country: "Colombia",
|
|
76
|
-
id_order:
|
|
77
|
-
id_datasheet_especialist:
|
|
76
|
+
id_order: 123,
|
|
77
|
+
id_datasheet_especialist: 54,
|
|
78
78
|
id_datasheet_facilitator: 52,
|
|
79
|
-
id_description_especialist:
|
|
79
|
+
id_description_especialist: 54,
|
|
80
80
|
id_description_facilitator: 52,
|
|
81
|
-
id_images_especialist:
|
|
82
|
-
id_images_facilitator:
|
|
81
|
+
id_images_especialist: null,
|
|
82
|
+
id_images_facilitator: null,
|
|
83
83
|
id_auditor: 30,
|
|
84
84
|
id_recepcionist: null,
|
|
85
|
-
category:
|
|
86
|
-
"SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
|
|
85
|
+
category: "ABARROTES|ABARROTES SECOS|CEREALES Y BARRAS",
|
|
87
86
|
missingAttributes: null,
|
|
88
87
|
missingDescriptions: null,
|
|
89
88
|
missingImages: null,
|
|
@@ -105,17 +104,7 @@ RetailerProductEditionDefault.args = {
|
|
|
105
104
|
},
|
|
106
105
|
],
|
|
107
106
|
country: "Colombia",
|
|
108
|
-
|
|
109
|
-
modalCadenas: false,
|
|
110
|
-
totalCadenas: false,
|
|
111
|
-
modalAsig1: false,
|
|
112
|
-
modalFD: false,
|
|
113
|
-
modalAsig2: false,
|
|
114
|
-
modalAsig3: false,
|
|
115
|
-
modalAsig4: false,
|
|
116
|
-
modalAsig5: false,
|
|
117
|
-
modalFI: false,
|
|
118
|
-
modalQA: false,
|
|
107
|
+
upc: "168489",
|
|
119
108
|
},
|
|
120
109
|
user: {
|
|
121
110
|
id_user: 30,
|
|
@@ -147,6 +136,6 @@ RetailerProductEditionDefault.args = {
|
|
|
147
136
|
products_limit: "3",
|
|
148
137
|
type: "PyMES",
|
|
149
138
|
},
|
|
150
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?
|
|
139
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1649896700986",
|
|
151
140
|
},
|
|
152
141
|
};
|
|
@@ -120,7 +120,9 @@ export const RetailerProductEdition = ({
|
|
|
120
120
|
new Array(productSelected?.retailers?.length).fill({ percentage: 0 })
|
|
121
121
|
);
|
|
122
122
|
const [activePercentage, setActivePercentage] = useState(0);
|
|
123
|
-
const [activeRetailer, setActiveRetailer] = useState(
|
|
123
|
+
const [activeRetailer, setActiveRetailer] = useState(
|
|
124
|
+
productSelected?.retailers[0]
|
|
125
|
+
);
|
|
124
126
|
const [services, setServices] = useState([]);
|
|
125
127
|
const [servicesData, setServicesData] = useState([]);
|
|
126
128
|
const [message, setMessage] = useState("");
|
|
@@ -129,7 +131,11 @@ export const RetailerProductEdition = ({
|
|
|
129
131
|
const [version, setVersion] = useState(productSelected?.version);
|
|
130
132
|
const [comments, setComments] = useState({});
|
|
131
133
|
const [comment, setComment] = useState("");
|
|
132
|
-
const [requiredNull, setRequiredNull] = useState(
|
|
134
|
+
const [requiredNull, setRequiredNull] = useState({
|
|
135
|
+
"Ficha técnica": 0,
|
|
136
|
+
Descripción: 0,
|
|
137
|
+
Imágenes: 0,
|
|
138
|
+
});
|
|
133
139
|
const [crossComment, setCrossComment] = useState(false);
|
|
134
140
|
const [userGroups, setUserGroups] = useState([]);
|
|
135
141
|
const [assig, setAssig] = useState({});
|
|
@@ -151,13 +157,17 @@ export const RetailerProductEdition = ({
|
|
|
151
157
|
|
|
152
158
|
//Converts the data inside the datasheets object to array
|
|
153
159
|
setServices(services);
|
|
154
|
-
|
|
160
|
+
getRequired(services);
|
|
161
|
+
//setActiveRetailer(productSelected?.retailers[0]);
|
|
155
162
|
setImages({
|
|
156
163
|
action: "init",
|
|
157
164
|
init: services[2],
|
|
158
165
|
});
|
|
159
166
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
160
167
|
setProduct(productSelected);
|
|
168
|
+
getPercentage({ data: [productSelected] }).then((res) =>
|
|
169
|
+
setPercentages(res)
|
|
170
|
+
);
|
|
161
171
|
setLoading(false);
|
|
162
172
|
};
|
|
163
173
|
|
|
@@ -221,9 +231,9 @@ export const RetailerProductEdition = ({
|
|
|
221
231
|
|
|
222
232
|
useEffect(async () => {
|
|
223
233
|
loadData();
|
|
224
|
-
getPercentage({ data: [productSelected] }).then((res) =>
|
|
225
|
-
|
|
226
|
-
);
|
|
234
|
+
// getPercentage({ data: [productSelected] }).then((res) =>
|
|
235
|
+
// setPercentages(res)
|
|
236
|
+
// );
|
|
227
237
|
getServices();
|
|
228
238
|
getComments();
|
|
229
239
|
setUserGroups(await fetchUsers(token));
|
|
@@ -296,7 +306,6 @@ export const RetailerProductEdition = ({
|
|
|
296
306
|
}, [percentages]);
|
|
297
307
|
|
|
298
308
|
useEffect(() => {
|
|
299
|
-
const required = {};
|
|
300
309
|
if (services.length > 0) {
|
|
301
310
|
if (services[0][activeRetailer.id])
|
|
302
311
|
services[0][activeRetailer.id].data = Object.values(
|
|
@@ -308,7 +317,6 @@ export const RetailerProductEdition = ({
|
|
|
308
317
|
const descriptions = services[1]?.filter(
|
|
309
318
|
(service) => service?.id === activeRetailer?.id
|
|
310
319
|
);
|
|
311
|
-
setRequiredNull(required);
|
|
312
320
|
setDatasheets([datagroups, inputs]);
|
|
313
321
|
setDescriptions(descriptions);
|
|
314
322
|
}
|
|
@@ -318,6 +326,7 @@ export const RetailerProductEdition = ({
|
|
|
318
326
|
const imageInputs = images?.inputs?.map((e) => ({
|
|
319
327
|
value: e?.id,
|
|
320
328
|
name: e?.name,
|
|
329
|
+
required: e?.required,
|
|
321
330
|
}));
|
|
322
331
|
const imageType = images?.imageType?.map((e) => ({
|
|
323
332
|
value: e?.id,
|
|
@@ -522,11 +531,11 @@ export const RetailerProductEdition = ({
|
|
|
522
531
|
concept = action ? action : concept;
|
|
523
532
|
return (
|
|
524
533
|
(productSelected[`${concept}_status`] === "QF" &&
|
|
525
|
-
(user
|
|
534
|
+
(user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
|
|
526
535
|
(productSelected[`${concept}_status`] === "AF" &&
|
|
527
|
-
(user
|
|
536
|
+
(user.id_role === 1 || user.id_role === 6)) ||
|
|
528
537
|
(productSelected[`${concept}_status`] === "RP" &&
|
|
529
|
-
(user
|
|
538
|
+
(user.id_role === 1 || user.id_role === 6))
|
|
530
539
|
);
|
|
531
540
|
};
|
|
532
541
|
|
|
@@ -626,7 +635,7 @@ export const RetailerProductEdition = ({
|
|
|
626
635
|
break;
|
|
627
636
|
}
|
|
628
637
|
let evalStatus = "";
|
|
629
|
-
let productTemp =
|
|
638
|
+
let productTemp = productSelected;
|
|
630
639
|
evalStatus = productSelected[`${concept}_status`];
|
|
631
640
|
const specialistDone =
|
|
632
641
|
evalStatus === "RF" ||
|
|
@@ -637,18 +646,22 @@ export const RetailerProductEdition = ({
|
|
|
637
646
|
setMessage(`${activeTab} enviada a facilitador`);
|
|
638
647
|
getSectionIcon();
|
|
639
648
|
productTemp[`${concept}_status`] = "QF";
|
|
649
|
+
evalStatus = "QF";
|
|
640
650
|
} else if (evalStatus === "QF") {
|
|
641
651
|
setMessage("Evaluación enviada");
|
|
642
652
|
getSectionIcon();
|
|
643
653
|
productTemp[`${concept}_status`] = "AF";
|
|
654
|
+
evalStatus = "AF";
|
|
644
655
|
} else if (evalStatus === "AF") {
|
|
645
656
|
setMessage("Evaluación enviada");
|
|
646
657
|
getSectionIcon();
|
|
647
658
|
productTemp[`${concept}_status`] = "AA";
|
|
659
|
+
evalStatus = "AA";
|
|
648
660
|
} else if (evalStatus === "RP") {
|
|
649
661
|
setMessage("Evaluación enviada");
|
|
650
662
|
getSectionIcon();
|
|
651
663
|
productTemp[`${concept}_status`] = "AA";
|
|
664
|
+
evalStatus = "AA";
|
|
652
665
|
}
|
|
653
666
|
let data = {};
|
|
654
667
|
if (result) {
|
|
@@ -697,7 +710,7 @@ export const RetailerProductEdition = ({
|
|
|
697
710
|
},
|
|
698
711
|
});
|
|
699
712
|
setProduct(productTemp);
|
|
700
|
-
setModalSent(true);
|
|
713
|
+
//setModalSent(true);
|
|
701
714
|
}
|
|
702
715
|
};
|
|
703
716
|
|
|
@@ -759,7 +772,52 @@ export const RetailerProductEdition = ({
|
|
|
759
772
|
await getComments(tab);
|
|
760
773
|
};
|
|
761
774
|
|
|
762
|
-
|
|
775
|
+
const getRequired = (services) => {
|
|
776
|
+
const objetcTemp = {};
|
|
777
|
+
const datasheetServicesArray = Object.values(services[0]);
|
|
778
|
+
const dsInputs = datasheetServicesArray.pop();
|
|
779
|
+
const descriptionsServicesArray = services[1];
|
|
780
|
+
|
|
781
|
+
let dsInputsRequired = [];
|
|
782
|
+
let desInputsRequired = 0;
|
|
783
|
+
datasheetServicesArray.forEach((datasheet) =>
|
|
784
|
+
Object.values(datasheet?.data).forEach((dataGroup) =>
|
|
785
|
+
dsInputsRequired.push(
|
|
786
|
+
...dataGroup.inputs.filter(
|
|
787
|
+
(input) =>
|
|
788
|
+
dsInputs[input].required &&
|
|
789
|
+
(dsInputs[input].value === undefined || !dsInputs[input].value)
|
|
790
|
+
)
|
|
791
|
+
)
|
|
792
|
+
)
|
|
793
|
+
);
|
|
794
|
+
|
|
795
|
+
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
796
|
+
|
|
797
|
+
descriptionsServicesArray.forEach((description) =>
|
|
798
|
+
description.inputs.forEach(
|
|
799
|
+
(input) =>
|
|
800
|
+
input.required &&
|
|
801
|
+
(!input.value ||
|
|
802
|
+
input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
|
|
803
|
+
"") &&
|
|
804
|
+
desInputsRequired++
|
|
805
|
+
)
|
|
806
|
+
);
|
|
807
|
+
|
|
808
|
+
objetcTemp["Descripción"] = desInputsRequired;
|
|
809
|
+
const requiredImages = services[2]?.inputs?.filter((e) => e.required);
|
|
810
|
+
let requiredCounter = 0;
|
|
811
|
+
requiredImages.forEach(
|
|
812
|
+
(req) =>
|
|
813
|
+
services[2].values.filter((img) => img.image_id === req.id).length ===
|
|
814
|
+
0 && requiredCounter++
|
|
815
|
+
);
|
|
816
|
+
objetcTemp["Imágenes"] = requiredCounter;
|
|
817
|
+
setRequiredNull(objetcTemp);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
useEffect(() => {
|
|
763
821
|
setComment(comments[activeTab]);
|
|
764
822
|
}, [activeTab]);
|
|
765
823
|
|
|
@@ -940,6 +998,10 @@ export const RetailerProductEdition = ({
|
|
|
940
998
|
}
|
|
941
999
|
};
|
|
942
1000
|
|
|
1001
|
+
useEffect(() => {
|
|
1002
|
+
console.log(requiredNull[activeTab], evaluationComplete(activeTab));
|
|
1003
|
+
}, [activeTab]);
|
|
1004
|
+
|
|
943
1005
|
return (
|
|
944
1006
|
<Container headerTop={headerTop}>
|
|
945
1007
|
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
@@ -974,7 +1036,7 @@ export const RetailerProductEdition = ({
|
|
|
974
1036
|
approveRejectButtons={approveRejectButtons}
|
|
975
1037
|
sendToFacilitator={sendToFacilitator}
|
|
976
1038
|
auditorAssigned={auditorAssigned}
|
|
977
|
-
userAssigned={userAssigned(activeTab, "facilitator")}
|
|
1039
|
+
userAssigned={() => userAssigned(activeTab, "facilitator")}
|
|
978
1040
|
/>
|
|
979
1041
|
<FullTabsMenu
|
|
980
1042
|
tabsSections={tabsSections}
|
|
@@ -1128,11 +1190,11 @@ export const RetailerProductEdition = ({
|
|
|
1128
1190
|
)}
|
|
1129
1191
|
<Button
|
|
1130
1192
|
buttonType={
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
? "general-button
|
|
1135
|
-
: "general-
|
|
1193
|
+
approveRejectButtons() ||
|
|
1194
|
+
requiredNull[activeTab] === 0 ||
|
|
1195
|
+
evaluationComplete(activeTab)
|
|
1196
|
+
? "general-green-button"
|
|
1197
|
+
: "general-button-disabled"
|
|
1136
1198
|
}
|
|
1137
1199
|
label={"Enviar evaluación"}
|
|
1138
1200
|
onClick={() => sendToFacilitator()}
|
|
@@ -1156,9 +1218,9 @@ export const RetailerProductEdition = ({
|
|
|
1156
1218
|
componentsArray.length > 0
|
|
1157
1219
|
? componentsArray
|
|
1158
1220
|
: [
|
|
1159
|
-
<img src={succes} alt="success icon" />,
|
|
1221
|
+
<img key="1" src={succes} alt="success icon" />,
|
|
1160
1222
|
<ScreenHeader
|
|
1161
|
-
key="
|
|
1223
|
+
key="2"
|
|
1162
1224
|
headerType={"retailer-name-header"}
|
|
1163
1225
|
text={message}
|
|
1164
1226
|
color={"white"}
|
package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VerificationCodeResetPassword } from "./index";
|
|
2
|
+
import LoginImage from "../../../assets/images/carouselImagesLogin/loginImage.svg";
|
|
3
|
+
import Login2 from "../../../assets/images/carouselImagesLogin/login2.svg";
|
|
4
|
+
import Login3 from "../../../assets/images/carouselImagesLogin/login3.svg";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/pages/VerificationCodeResetPassword",
|
|
8
|
+
component: VerificationCodeResetPassword,
|
|
9
|
+
};
|
|
10
|
+
const Template = (args) => <VerificationCodeResetPassword {...args} />;
|
|
11
|
+
|
|
12
|
+
export const VerificationCodeResetPasswordDefault = Template.bind({});
|
|
13
|
+
|
|
14
|
+
VerificationCodeResetPasswordDefault.args = {
|
|
15
|
+
imageArrayCarousel: [LoginImage, Login2, Login3],
|
|
16
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers",
|
|
17
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { GradientPanel } from "../../atoms/GradientPanel";
|
|
3
|
+
import { CarouselImagesLogin } from "../../molecules/CarouselImagesLogin";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { LogoImage } from "../../atoms/LogoImage";
|
|
6
|
+
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
7
|
+
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
8
|
+
import { GeneralInput } from "../../atoms/GeneralInput";
|
|
9
|
+
import { Button } from "../../atoms/GeneralButton";
|
|
10
|
+
import { validateInput, validate } from "./utils";
|
|
11
|
+
|
|
12
|
+
export const VerificationCodeResetPassword = ({
|
|
13
|
+
imageArrayCarousel = [],
|
|
14
|
+
textCarousel,
|
|
15
|
+
backogroundColorCarousel,
|
|
16
|
+
}) => {
|
|
17
|
+
const [emptyVerificationCode, setEmptyVerificationCode] = useState(false);
|
|
18
|
+
const [inputCodeVerificationAll, setInputCodeVerificationAll] = useState();
|
|
19
|
+
const inputPositions = [1, 2, 3, 4, 5, 6];
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setInputCodeVerificationAll(
|
|
23
|
+
document.querySelectorAll("[id^='verificationCodeInput']")
|
|
24
|
+
);
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
const loginRight = [
|
|
28
|
+
<LogoImage key="1" />,
|
|
29
|
+
<div className="credenciales" key={"2"}>
|
|
30
|
+
<ScreenHeader
|
|
31
|
+
fontFamily={FontFamily.AvenirNext}
|
|
32
|
+
color={GlobalColors.s5}
|
|
33
|
+
text={"Ingresa tus credenciales"}
|
|
34
|
+
/>
|
|
35
|
+
</div>,
|
|
36
|
+
<div className="user" key="3">
|
|
37
|
+
<ScreenHeader
|
|
38
|
+
text={"Ingresa el código de verificación enviado a:"}
|
|
39
|
+
headerType={"input-name-header"}
|
|
40
|
+
/>
|
|
41
|
+
<div className="verification-code">
|
|
42
|
+
{inputPositions.map((position) => (
|
|
43
|
+
<GeneralInput
|
|
44
|
+
inputId={`verificationCodeInput${position}`}
|
|
45
|
+
inputType={"text"}
|
|
46
|
+
inputPlaceholder={"X"}
|
|
47
|
+
validateInput={validateInput}
|
|
48
|
+
inputsArray={inputCodeVerificationAll}
|
|
49
|
+
position={position}
|
|
50
|
+
maxLength="1"
|
|
51
|
+
/>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
{emptyVerificationCode && (
|
|
55
|
+
<label>Ingrese su código de verificación</label>
|
|
56
|
+
)}
|
|
57
|
+
</div>,
|
|
58
|
+
<div className="resend-code" key="4">
|
|
59
|
+
<p>Reenviar código de verificación</p>
|
|
60
|
+
</div>,
|
|
61
|
+
<div className="button-center" key="5">
|
|
62
|
+
<Button
|
|
63
|
+
buttonType={"general-default-button"}
|
|
64
|
+
label={"Enviar"}
|
|
65
|
+
onClick={(e) =>
|
|
66
|
+
validate(inputCodeVerificationAll, setEmptyVerificationCode)
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
</div>,
|
|
70
|
+
<div className="reset-password" key="6">
|
|
71
|
+
<p>Regresar...</p>
|
|
72
|
+
</div>,
|
|
73
|
+
];
|
|
74
|
+
return (
|
|
75
|
+
<Container>
|
|
76
|
+
<div className="home-retailer">
|
|
77
|
+
<CarouselImagesLogin
|
|
78
|
+
panelImg={imageArrayCarousel}
|
|
79
|
+
panelText={textCarousel}
|
|
80
|
+
panelColor={backogroundColorCarousel}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="home-login-retailer">
|
|
84
|
+
<GradientPanel
|
|
85
|
+
componentsArray={loginRight}
|
|
86
|
+
panelType={"home-login"}
|
|
87
|
+
panelColor={GlobalColors.white}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</Container>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
.button-center {
|
|
9
|
+
text-align: center;
|
|
10
|
+
.general-default-button {
|
|
11
|
+
width: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
.reset-password {
|
|
15
|
+
text-align: center;
|
|
16
|
+
margin: 15px !important;
|
|
17
|
+
color: ${GlobalColors.secondary_magenta};
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
font-family: ${FontFamily.Raleway};
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
}
|
|
23
|
+
.resend-code {
|
|
24
|
+
margin-top: 8px !important;
|
|
25
|
+
color: ${GlobalColors.magenta_s2};
|
|
26
|
+
font-family: ${FontFamily.AvenirNext};
|
|
27
|
+
font-size: 11px;
|
|
28
|
+
text-decoration: underline rgb(228, 81, 172);
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
& + * {
|
|
31
|
+
margin-top: 30px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.verification-code {
|
|
35
|
+
display: flex;
|
|
36
|
+
text-align: center;
|
|
37
|
+
margin: auto;
|
|
38
|
+
margin-top: 10px;
|
|
39
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
40
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
41
|
+
-webkit-appearance: none;
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
input {
|
|
45
|
+
|
|
46
|
+
width: 70%;
|
|
47
|
+
text-align: center;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.home-login-retailer,
|
|
51
|
+
.home-retailer {
|
|
52
|
+
width: 50%;
|
|
53
|
+
}
|
|
54
|
+
`;
|