@things-factory/product-ui 4.3.738 → 4.3.741
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/client/pages/product-list.js +45 -18
- package/package.json +9 -9
|
@@ -1086,35 +1086,62 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
1086
1086
|
patch.isRequireSerialNumberScanningOutbound?.toString().toLowerCase() === 'true'
|
|
1087
1087
|
patch.isInventoryDecimal = patch.isInventoryDecimal?.toString().toLowerCase() === 'true'
|
|
1088
1088
|
patch.allowStackingOption = patch.allowStackingOption?.toString().toLowerCase() === 'true'
|
|
1089
|
-
|
|
1089
|
+
|
|
1090
|
+
// Helper function to safely parse integers, handling empty strings
|
|
1091
|
+
const safeParseInt = val => {
|
|
1092
|
+
if (val === null || val === undefined || val === '') return undefined
|
|
1093
|
+
const parsed = parseInt(val)
|
|
1094
|
+
return isNaN(parsed) ? undefined : parsed
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// Helper function to safely parse floats, handling empty strings
|
|
1098
|
+
const safeParseFloat = val => {
|
|
1099
|
+
if (val === null || val === undefined || val === '') return undefined
|
|
1100
|
+
const parsed = parseFloat(val)
|
|
1101
|
+
return isNaN(parsed) ? undefined : parsed
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
const result = {
|
|
1090
1105
|
...patch,
|
|
1091
1106
|
costPrice: patch?.costPrice ? parseFloat(patch.costPrice) : undefined,
|
|
1092
|
-
uomValue: patch?.uomValue
|
|
1093
|
-
bufferQty: patch?.bufferQty
|
|
1094
|
-
minQty: patch?.minQty
|
|
1095
|
-
maxQty: patch?.maxQty
|
|
1096
|
-
packingSize: patch?.packingSize
|
|
1097
|
-
minInboundShelfLife: patch?.minInboundShelfLife
|
|
1098
|
-
minOutboundShelfLife: patch?.minOutboundShelfLife
|
|
1107
|
+
uomValue: safeParseFloat(patch?.uomValue),
|
|
1108
|
+
bufferQty: safeParseInt(patch?.bufferQty),
|
|
1109
|
+
minQty: safeParseInt(patch?.minQty),
|
|
1110
|
+
maxQty: safeParseInt(patch?.maxQty),
|
|
1111
|
+
packingSize: safeParseInt(patch?.packingSize),
|
|
1112
|
+
minInboundShelfLife: safeParseInt(patch?.minInboundShelfLife),
|
|
1113
|
+
minOutboundShelfLife: safeParseInt(patch?.minOutboundShelfLife),
|
|
1114
|
+
outboundAlert: safeParseInt(patch?.outboundAlert),
|
|
1099
1115
|
productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
|
|
1100
1116
|
pickingStrategy: patch?.pickingStrategy ? patch.pickingStrategy.toUpperCase() : undefined,
|
|
1101
1117
|
gtin: patch?.gtin ? patch.gtin : patch.sku,
|
|
1102
|
-
commissionFee: patch?.commissionFee
|
|
1103
|
-
platformFee: patch?.platformFee
|
|
1104
|
-
serviceFee: patch?.serviceFee
|
|
1105
|
-
transactionFee: patch?.transactionFee
|
|
1106
|
-
nettWeight: patch?.nettWeight
|
|
1107
|
-
width: patch?.width
|
|
1108
|
-
depth: patch?.depth
|
|
1109
|
-
height: patch?.height
|
|
1110
|
-
grossWeight: patch?.grossWeight
|
|
1111
|
-
volume: patch?.volume
|
|
1118
|
+
commissionFee: safeParseFloat(patch?.commissionFee),
|
|
1119
|
+
platformFee: safeParseFloat(patch?.platformFee),
|
|
1120
|
+
serviceFee: safeParseFloat(patch?.serviceFee),
|
|
1121
|
+
transactionFee: safeParseFloat(patch?.transactionFee),
|
|
1122
|
+
nettWeight: safeParseFloat(patch?.nettWeight),
|
|
1123
|
+
width: safeParseFloat(patch?.width),
|
|
1124
|
+
depth: safeParseFloat(patch?.depth),
|
|
1125
|
+
height: safeParseFloat(patch?.height),
|
|
1126
|
+
grossWeight: safeParseFloat(patch?.grossWeight),
|
|
1127
|
+
volume: safeParseFloat(patch?.volume),
|
|
1128
|
+
volumeSize: safeParseFloat(patch?.volumeSize),
|
|
1129
|
+
density: safeParseFloat(patch?.density),
|
|
1112
1130
|
isRequiredCheckExpiry: patch?.isRequiredCheckExpiry || false,
|
|
1113
1131
|
isRequireSerialNumberScanningInbound: patch?.isRequireSerialNumberScanningInbound || false,
|
|
1114
1132
|
isRequireSerialNumberScanningOutbound: patch?.isRequireSerialNumberScanningOutbound || false,
|
|
1115
1133
|
isInventoryDecimal: patch?.isInventoryDecimal || false,
|
|
1116
1134
|
allowStackingOption: patch?.allowStackingOption || false
|
|
1117
1135
|
}
|
|
1136
|
+
|
|
1137
|
+
// Remove any remaining empty strings from numeric fields to prevent GraphQL errors
|
|
1138
|
+
Object.keys(result).forEach(key => {
|
|
1139
|
+
if (result[key] === '') {
|
|
1140
|
+
delete result[key]
|
|
1141
|
+
}
|
|
1142
|
+
})
|
|
1143
|
+
|
|
1144
|
+
return result
|
|
1118
1145
|
})
|
|
1119
1146
|
|
|
1120
1147
|
this._validate(patches)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.741",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@things-factory/form-ui": "^4.3.
|
|
27
|
-
"@things-factory/grist-ui": "^4.3.
|
|
28
|
-
"@things-factory/i18n-base": "^4.3.
|
|
29
|
-
"@things-factory/import-ui": "^4.3.
|
|
30
|
-
"@things-factory/layout-base": "^4.3.
|
|
31
|
-
"@things-factory/product-base": "^4.3.
|
|
32
|
-
"@things-factory/shell": "^4.3.
|
|
26
|
+
"@things-factory/form-ui": "^4.3.740",
|
|
27
|
+
"@things-factory/grist-ui": "^4.3.740",
|
|
28
|
+
"@things-factory/i18n-base": "^4.3.740",
|
|
29
|
+
"@things-factory/import-ui": "^4.3.740",
|
|
30
|
+
"@things-factory/layout-base": "^4.3.740",
|
|
31
|
+
"@things-factory/product-base": "^4.3.740",
|
|
32
|
+
"@things-factory/shell": "^4.3.740"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "97de9f3e63d7acdb0e59eff61f5c170457582490"
|
|
35
35
|
}
|