contentoh-components-library 21.0.81 → 21.0.84

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.
@@ -27,8 +27,8 @@ RetailerProductEditionDefault.args = {
27
27
  images: 1,
28
28
  },
29
29
  orderId: 233,
30
- status: "IN_PROGRESS",
31
- datasheet_status: "IN_PROGRESS",
30
+ status: "QF",
31
+ datasheet_status: "QF",
32
32
  prio: "none",
33
33
  version: 2,
34
34
  description_status: "QF",
@@ -67,6 +67,7 @@ RetailerProductEditionDefault.args = {
67
67
  country: "México",
68
68
  id_region: 1,
69
69
  active: 1,
70
+ percentage: 100,
70
71
  },
71
72
  {
72
73
  id: 26,
@@ -74,6 +75,7 @@ RetailerProductEditionDefault.args = {
74
75
  country: "México",
75
76
  id_region: 1,
76
77
  active: 1,
78
+ percentage: 100,
77
79
  },
78
80
  ],
79
81
  country: "México",
@@ -83,22 +85,22 @@ RetailerProductEditionDefault.args = {
83
85
  product: { articleId: 109485, versionId: 3 },
84
86
  },
85
87
  user: {
86
- id_user: 54,
87
- name: "ESPECIALISTA TXTS PRUEBA",
88
+ id_user: 53,
89
+ name: "FACILITADOR ED PRUEBA",
88
90
  last_name: "",
89
- email: "rlegorreta@contentoh.com",
91
+ email: "arojas@contentoh.com",
90
92
  position: null,
91
93
  telephone: null,
92
94
  country: null,
93
95
  id_company: 2,
94
- id_cognito: "ca1d24ab-e992-4c19-b4e1-2fe6f720c16b",
96
+ id_cognito: "c106e141-e221-49e8-a382-ce99385c6d88",
95
97
  birth_Date: null,
96
98
  about_me: null,
97
99
  zip_code: null,
98
100
  address: null,
99
101
  job: null,
100
102
  id_stripe: null,
101
- id_role: 7,
103
+ id_role: 5,
102
104
  active: 1,
103
105
  is_retailer: 0,
104
106
  membership: {
@@ -112,6 +114,6 @@ RetailerProductEditionDefault.args = {
112
114
  products_limit: "3",
113
115
  type: "PyMES",
114
116
  },
115
- src: "https://content-management-profile.s3.amazonaws.com/id-54/54.png?1653425316222",
117
+ src: "https://content-management-profile.s3.amazonaws.com/id-53/53.png?1655161876316",
116
118
  },
117
119
  };
@@ -150,6 +150,7 @@ export const RetailerProductEdition = ({
150
150
  const [loading, setLoading] = useState(true);
151
151
  const [retailerStatus, setRetailerStatus] = useState("-");
152
152
  const [statusArray, setStatusArray] = useState([]);
153
+ const [socketType, setSocketType] = useState(null);
153
154
 
154
155
  useEffect(() => {
155
156
  checkAll && setSelectedImages(images.values);
@@ -339,11 +340,7 @@ export const RetailerProductEdition = ({
339
340
  }, [activeRetailer, services]);
340
341
 
341
342
  const thumbs = () => {
342
- const imageInputs = images?.inputs?.map((e) => ({
343
- value: e?.id,
344
- name: e?.name,
345
- required: e?.required,
346
- }));
343
+ const imageInputs = socketType.slice();
347
344
  const imageType = images?.imageType?.map((e) => ({
348
345
  value: e?.id,
349
346
  name: e?.name,
@@ -364,6 +361,7 @@ export const RetailerProductEdition = ({
364
361
  imageType={imageType}
365
362
  imagePackagingType={imagePackagingType}
366
363
  imageInputs={imageInputs}
364
+ setSocketType={setSocketType}
367
365
  changeImage={setImages}
368
366
  selectedImages={selectedImages}
369
367
  setSelectedImages={setSelectedImages}
@@ -432,6 +430,16 @@ export const RetailerProductEdition = ({
432
430
  }
433
431
  };
434
432
 
433
+ useEffect(() => {
434
+ const imageInputs = images?.inputs?.map((e) => ({
435
+ value: e?.id,
436
+ name: e?.name,
437
+ required: e?.required,
438
+ active: images?.values.some((value) => value?.image_id === e?.id),
439
+ }));
440
+ setSocketType(imageInputs);
441
+ }, [images]);
442
+
435
443
  const updateImages = useCallback(async () => {
436
444
  const imagesList = images?.values?.slice();
437
445
  const imagesListTemp = imagesList?.reduce((acc, image) => {
@@ -591,8 +599,7 @@ export const RetailerProductEdition = ({
591
599
  };
592
600
 
593
601
  const approveRejectButtons = (action) => {
594
- let concept = getConcept(activeTab);
595
- concept = action ? action : concept;
602
+ let concept = getConcept(action || activeTab);
596
603
 
597
604
  const [retailerStatus] = servicesData.filter(
598
605
  (srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
@@ -725,22 +732,10 @@ export const RetailerProductEdition = ({
725
732
  };
726
733
 
727
734
  const userAssigned = (tab, rol) => {
728
- let concept = "";
729
- switch (tab) {
730
- case "Ficha técnica":
731
- concept = "datasheet";
732
- break;
733
- case "Imágenes":
734
- concept = "images";
735
- break;
736
-
737
- default:
738
- concept = "description";
739
- break;
740
- }
735
+ let concept = getConcept(activeTab);
741
736
 
742
737
  const allowedRoles = [1, 4, 5, 6, 7, 8];
743
- const validUser = allowedRoles.indexOf(user?.id_role) !== -1;
738
+ const validUser = allowedRoles.includes(user?.id_role);
744
739
 
745
740
  if (!rol) {
746
741
  switch (user.id_role) {
package/src/index.js CHANGED
@@ -47,6 +47,7 @@ export * from "./components/molecules/TableRow/index";
47
47
  export * from "./components/molecules/TabsMenu/index";
48
48
  export * from "./components/molecules/TagAndInput/index";
49
49
  export * from "./components/molecules/VerificationCodeResetPasswordLogin/index";
50
+ export * from "./components/molecules/RetailerSelector/index";
50
51
 
51
52
  //organisms
52
53
  export * from "./components/organisms/ChangePassword/index";