@things-factory/product-ui 4.3.398 → 4.3.419

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.
@@ -94,53 +94,68 @@ class ProductList extends localize(i18next)(PageView) {
94
94
  record.transactionFee =
95
95
  record.transactionFee == null ? '0.00' : parseFloat(record.transactionFee).toFixed(2)
96
96
  })
97
+
98
+ const columns = this.productGristConfig.columns
99
+ .filter(column => column.imex !== undefined)
100
+ .map(column => ({ ...column }))
101
+
102
+ const subBrandIndex = columns.findIndex(column => column.name === 'subBrand')
103
+ columns.splice(subBrandIndex + 1, 0, {
104
+ type: 'string',
105
+ name: 'gtin',
106
+ record: { editable: true, align: 'left' },
107
+ header: i18next.t('field.gtin'),
108
+ width: 80
109
+ })
110
+
111
+ columns.push(
112
+ {
113
+ type: 'string',
114
+ name: 'childGtin',
115
+ record: { editable: true, align: 'left' },
116
+ header: i18next.t('field.child_gtin'),
117
+ width: 80
118
+ },
119
+ {
120
+ type: 'float',
121
+ name: 'packingSize',
122
+ record: { editable: true, align: 'left' },
123
+ header: i18next.t('field.packing_size'),
124
+ width: 80
125
+ },
126
+ {
127
+ type: 'float',
128
+ name: 'commissionFee',
129
+ record: { editable: true, align: 'left' },
130
+ header: i18next.t('field.commission_fee'),
131
+ width: 80
132
+ },
133
+ {
134
+ type: 'float',
135
+ name: 'platformFee',
136
+ record: { editable: true, align: 'left' },
137
+ header: i18next.t('field.platform_fee'),
138
+ width: 80
139
+ },
140
+ {
141
+ type: 'float',
142
+ name: 'serviceFee',
143
+ record: { editable: true, align: 'left' },
144
+ header: i18next.t('field.service_fee'),
145
+ width: 80
146
+ },
147
+ {
148
+ type: 'float',
149
+ name: 'transactionFee',
150
+ record: { editable: true, align: 'left' },
151
+ header: i18next.t('field.transaction_fee'),
152
+ width: 80
153
+ }
154
+ )
155
+
97
156
  const config = {
98
157
  rows: this.productGristConfig.rows,
99
- columns: [
100
- ...this.productGristConfig.columns.filter(column => column.imex !== undefined),
101
- {
102
- type: 'string',
103
- name: 'childGtin',
104
- record: { editable: true, align: 'left' },
105
- header: i18next.t('field.child_gtin'),
106
- width: 80
107
- },
108
- {
109
- type: 'float',
110
- name: 'packingSize',
111
- record: { editable: true, align: 'left' },
112
- header: i18next.t('field.packing_size'),
113
- width: 80
114
- },
115
- {
116
- type: 'float',
117
- name: 'commissionFee',
118
- record: { editable: true, align: 'left' },
119
- header: i18next.t('field.commission_fee'),
120
- width: 80
121
- },
122
- {
123
- type: 'float',
124
- name: 'platformFee',
125
- record: { editable: true, align: 'left' },
126
- header: i18next.t('field.platform_fee'),
127
- width: 80
128
- },
129
- {
130
- type: 'float',
131
- name: 'serviceFee',
132
- record: { editable: true, align: 'left' },
133
- header: i18next.t('field.service_fee'),
134
- width: 80
135
- },
136
- {
137
- type: 'float',
138
- name: 'transactionFee',
139
- record: { editable: true, align: 'left' },
140
- header: i18next.t('field.transaction_fee'),
141
- width: 80
142
- }
143
- ]
158
+ columns
144
159
  }
145
160
  openImportPopUp(records, config, async patches => {
146
161
  await this._importProducts(patches)
@@ -806,7 +821,6 @@ class ProductList extends localize(i18next)(PageView) {
806
821
  name
807
822
  description
808
823
  }
809
-
810
824
  refCode
811
825
  bundleQty
812
826
  packingType
@@ -1208,6 +1222,14 @@ class ProductList extends localize(i18next)(PageView) {
1208
1222
  return column.imex
1209
1223
  })
1210
1224
 
1225
+ const subBrandIndex = headerSetting.findIndex(column => column.key === 'subBrand')
1226
+ headerSetting.splice(subBrandIndex + 1, 0, {
1227
+ header: i18next.t('field.gtin'),
1228
+ key: 'gtin',
1229
+ width: 20,
1230
+ type: 'string'
1231
+ })
1232
+
1211
1233
  headerSetting.push({ header: `${i18next.t('field.child_gtin')}`, key: 'childGtin', width: 20, type: 'string' })
1212
1234
  headerSetting.push({ header: `${i18next.t('field.packing_size')}`, key: 'packingSize', width: 20, type: 'float' })
1213
1235
  headerSetting.push({
@@ -1360,16 +1382,13 @@ class ProductList extends localize(i18next)(PageView) {
1360
1382
  const flattenedList = []
1361
1383
  for (let product of exportData) {
1362
1384
  const pds = product.productDetails.map(pd => {
1385
+ const gtin = pd.productBarcodes.map(pb => pb.gtin).join(', ')
1363
1386
  return {
1364
1387
  ...product,
1365
1388
  packingType: pd.packingType,
1366
1389
  uom: pd.uom,
1367
1390
  uomValue: pd.uomValue,
1368
- gtin: pd.productBarcodes
1369
- .map(pb => {
1370
- return pb.gtin
1371
- })
1372
- .reduce((acc, cur) => acc + ',' + cur)
1391
+ gtin: gtin
1373
1392
  }
1374
1393
  })
1375
1394
  flattenedList.push(...pds)
@@ -1382,6 +1401,7 @@ class ProductList extends localize(i18next)(PageView) {
1382
1401
  platformFee: item.platformFee,
1383
1402
  serviceFee: item.serviceFee,
1384
1403
  transactionFee: item.transactionFee,
1404
+ gtin: item.gtin,
1385
1405
  ...this.productGristConfig.columns
1386
1406
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
1387
1407
  .reduce((record, column) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.3.398",
3
+ "version": "4.3.419",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -28,8 +28,8 @@
28
28
  "@things-factory/i18n-base": "^4.3.381",
29
29
  "@things-factory/import-ui": "^4.3.381",
30
30
  "@things-factory/layout-base": "^4.3.381",
31
- "@things-factory/product-base": "^4.3.398",
31
+ "@things-factory/product-base": "^4.3.419",
32
32
  "@things-factory/shell": "^4.3.381"
33
33
  },
34
- "gitHead": "ccc4a07675eba5fec19a27fded4d0c56291e62e2"
34
+ "gitHead": "0deb9f2fde83fd1b0b912eaaeb8694a2fdec270f"
35
35
  }