contentoh-components-library 21.1.14 → 21.1.15

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.
@@ -60,9 +60,18 @@ var GeneralInput = function GeneralInput(_ref) {
60
60
  value: validateInput(evt, position, inputsArray)
61
61
  });
62
62
  } else if (updatedDatasheets || updatedDescriptions || inputType === "textarea") {
63
- setTextValue({
64
- value: inputType === "checkbox" ? evt.target.checked : evt.target.value
65
- });
63
+ if ((optionList === null || optionList === void 0 ? void 0 : optionList.length) > 0) {
64
+ var index = evt.target.selectedIndex;
65
+ var valueSelected = evt.target.value;
66
+ setTextValue({
67
+ value: index > 0 ? valueSelected : undefined
68
+ });
69
+ } else {
70
+ setTextValue({
71
+ value: inputType === "checkbox" ? evt.target.checked : evt.target.value
72
+ });
73
+ }
74
+
66
75
  var dataSave = updatedDatasheets === null || updatedDatasheets === void 0 ? void 0 : updatedDatasheets.slice();
67
76
  if (dataSave.length === 0) dataSave.push({
68
77
  articleId: articleId,
@@ -109,7 +118,6 @@ var GeneralInput = function GeneralInput(_ref) {
109
118
  },
110
119
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
111
120
  value: "",
112
- disabled: true,
113
121
  children: description
114
122
  }), JSON.parse(optionList || "[]").map(function (element, index) {
115
123
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
@@ -37,64 +37,58 @@ RetailerProductEditionDefault.args = {
37
37
  version: 2,
38
38
  productSelected: {
39
39
  services: {
40
- datasheets: 0,
41
- descriptions: 0,
40
+ datasheets: 1,
41
+ descriptions: 1,
42
42
  images: 1
43
43
  },
44
- orderId: 69,
45
- status: "IN_PROGRESS",
46
- datasheet_status: null,
44
+ orderId: 83,
45
+ status: "ASSIGNED",
46
+ datasheet_status: "IN_PROGRESS",
47
47
  prio: "none",
48
- version: 12,
49
- description_status: null,
50
- images_status: null,
48
+ version: 2,
49
+ description_status: "IN_PROGRESS",
50
+ images_status: "IN_PROGRESS",
51
51
  article: {
52
- id_article: 55109,
53
- id_category: "2999",
54
- name: "Resize Ismael",
55
- upc: "ResizeIsmael",
56
- timestamp: "2022-06-18T03:32:56.000Z",
57
- id_user: 110,
52
+ id_article: 55150,
53
+ id_category: "697",
54
+ name: "Shampoo hidratante",
55
+ upc: "4116665",
56
+ timestamp: "2022-06-21T19:47:57.000Z",
57
+ id_user: 28,
58
58
  status: "NULL",
59
59
  active: 1,
60
- company_id: 834,
61
- company_name: "THD Resize Proveedor",
62
- country: null,
63
- id_order: 69,
64
- id_datasheet_especialist: null,
65
- id_datasheet_facilitator: null,
66
- id_description_especialist: null,
67
- id_description_facilitator: null,
68
- id_images_especialist: null,
69
- id_images_facilitator: null,
70
- id_auditor: null,
60
+ company_id: 1,
61
+ company_name: "COMPANY DEV",
62
+ country: "México",
63
+ id_order: 83,
64
+ id_datasheet_especialist: 54,
65
+ id_datasheet_facilitator: 52,
66
+ id_description_especialist: 54,
67
+ id_description_facilitator: 52,
68
+ id_images_especialist: 55,
69
+ id_images_facilitator: 53,
70
+ id_auditor: 30,
71
71
  id_recepcionist: null,
72
- category: "RESIZING|RESIZING|RESIZING",
73
- missingAttributes: null,
74
- missingDescriptions: null,
75
- missingImages: null
72
+ category: "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
73
+ missingAttributes: 31,
74
+ missingDescriptions: 6,
75
+ missingImages: 3
76
76
  },
77
77
  retailers: [{
78
- id: 58,
79
- name: "The Home Depot Golden",
80
- country: "México",
81
- id_region: 1,
82
- active: 1
83
- }, {
84
- id: 59,
85
- name: "The Home Depot Platinum",
78
+ id: 4,
79
+ name: "Walmart Super y Superama",
86
80
  country: "México",
87
81
  id_region: 1,
88
82
  active: 1
89
83
  }, {
90
- id: 60,
91
- name: "The Home Depot Resizing",
84
+ id: 26,
85
+ name: "Mercado Libre",
92
86
  country: "México",
93
87
  id_region: 1,
94
88
  active: 1
95
89
  }],
96
- country: null,
97
- upc: "ResizeIsmael"
90
+ country: "México",
91
+ upc: "4116665"
98
92
  },
99
93
  location: {
100
94
  product: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.14",
3
+ "version": "21.1.15",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -38,9 +38,16 @@ export const GeneralInput = ({
38
38
  updatedDescriptions ||
39
39
  inputType === "textarea"
40
40
  ) {
41
- setTextValue({
42
- value: inputType === "checkbox" ? evt.target.checked : evt.target.value,
43
- });
41
+ if (optionList?.length > 0) {
42
+ let index = evt.target.selectedIndex;
43
+ let valueSelected = evt.target.value;
44
+ setTextValue({ value: index > 0 ? valueSelected : undefined });
45
+ } else {
46
+ setTextValue({
47
+ value:
48
+ inputType === "checkbox" ? evt.target.checked : evt.target.value,
49
+ });
50
+ }
44
51
  let dataSave = updatedDatasheets?.slice();
45
52
  if (dataSave.length === 0)
46
53
  dataSave.push({
@@ -89,9 +96,7 @@ export const GeneralInput = ({
89
96
  //disabled={!enableInputs}
90
97
  onChange={(e) => onHandleChange(e)}
91
98
  >
92
- <option value="" disabled>
93
- {description}
94
- </option>
99
+ <option value="">{description}</option>
95
100
  {JSON.parse(optionList || "[]").map((element, index) => (
96
101
  <option
97
102
  key={element + "-" + index}
@@ -22,68 +22,62 @@ RetailerProductEditionDefault.args = {
22
22
  version: 2,
23
23
  productSelected: {
24
24
  services: {
25
- datasheets: 0,
26
- descriptions: 0,
25
+ datasheets: 1,
26
+ descriptions: 1,
27
27
  images: 1,
28
28
  },
29
- orderId: 69,
30
- status: "IN_PROGRESS",
31
- datasheet_status: null,
29
+ orderId: 83,
30
+ status: "ASSIGNED",
31
+ datasheet_status: "IN_PROGRESS",
32
32
  prio: "none",
33
- version: 12,
34
- description_status: null,
35
- images_status: null,
33
+ version: 2,
34
+ description_status: "IN_PROGRESS",
35
+ images_status: "IN_PROGRESS",
36
36
  article: {
37
- id_article: 55109,
38
- id_category: "2999",
39
- name: "Resize Ismael",
40
- upc: "ResizeIsmael",
41
- timestamp: "2022-06-18T03:32:56.000Z",
42
- id_user: 110,
37
+ id_article: 55150,
38
+ id_category: "697",
39
+ name: "Shampoo hidratante",
40
+ upc: "4116665",
41
+ timestamp: "2022-06-21T19:47:57.000Z",
42
+ id_user: 28,
43
43
  status: "NULL",
44
44
  active: 1,
45
- company_id: 834,
46
- company_name: "THD Resize Proveedor",
47
- country: null,
48
- id_order: 69,
49
- id_datasheet_especialist: null,
50
- id_datasheet_facilitator: null,
51
- id_description_especialist: null,
52
- id_description_facilitator: null,
53
- id_images_especialist: null,
54
- id_images_facilitator: null,
55
- id_auditor: null,
45
+ company_id: 1,
46
+ company_name: "COMPANY DEV",
47
+ country: "México",
48
+ id_order: 83,
49
+ id_datasheet_especialist: 54,
50
+ id_datasheet_facilitator: 52,
51
+ id_description_especialist: 54,
52
+ id_description_facilitator: 52,
53
+ id_images_especialist: 55,
54
+ id_images_facilitator: 53,
55
+ id_auditor: 30,
56
56
  id_recepcionist: null,
57
- category: "RESIZING|RESIZING|RESIZING",
58
- missingAttributes: null,
59
- missingDescriptions: null,
60
- missingImages: null,
57
+ category:
58
+ "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
59
+ missingAttributes: 31,
60
+ missingDescriptions: 6,
61
+ missingImages: 3,
61
62
  },
62
63
  retailers: [
63
64
  {
64
- id: 58,
65
- name: "The Home Depot Golden",
65
+ id: 4,
66
+ name: "Walmart Super y Superama",
66
67
  country: "México",
67
68
  id_region: 1,
68
69
  active: 1,
69
70
  },
70
71
  {
71
- id: 59,
72
- name: "The Home Depot Platinum",
73
- country: "México",
74
- id_region: 1,
75
- active: 1,
76
- },
77
- {
78
- id: 60,
79
- name: "The Home Depot Resizing",
72
+ id: 26,
73
+ name: "Mercado Libre",
80
74
  country: "México",
81
75
  id_region: 1,
82
76
  active: 1,
83
77
  },
84
78
  ],
85
- country: null,
86
- upc: "ResizeIsmael",
79
+ country: "México",
80
+ upc: "4116665",
87
81
  },
88
82
  location: {
89
83
  product: { articleId: 109485, versionId: 3 },