@things-factory/product-ui 3.7.14 → 3.8.6
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-bundle-link-popup.js +35 -32
- package/client/pages/product-bundle-list.js +3 -3
- package/client/pages/product-combination-settings-popup.js +32 -28
- package/client/pages/product-combinations-popup.js +5 -2
- package/client/pages/product-details-popup.js +2 -2
- package/client/pages/product-list.js +6 -6
- package/package.json +8 -8
- package/translations/en.json +13 -12
|
@@ -262,20 +262,24 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
|
|
|
262
262
|
|
|
263
263
|
const response = await client.query({
|
|
264
264
|
query: gql`
|
|
265
|
-
query productBundleSets($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
265
|
+
query productBundleSets($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
266
266
|
productBundleSets(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
267
267
|
items {
|
|
268
268
|
id
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
269
|
+
product {
|
|
270
|
+
id
|
|
271
|
+
name
|
|
272
|
+
sku
|
|
273
|
+
description
|
|
274
|
+
type
|
|
275
|
+
}
|
|
276
|
+
productDetail {
|
|
277
|
+
id
|
|
278
|
+
packingType
|
|
279
|
+
packingSize
|
|
280
|
+
gtin
|
|
281
|
+
}
|
|
274
282
|
bundleQty
|
|
275
|
-
productDetailId
|
|
276
|
-
gtin
|
|
277
|
-
packingType
|
|
278
|
-
packingSize
|
|
279
283
|
}
|
|
280
284
|
total
|
|
281
285
|
}
|
|
@@ -288,10 +292,24 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
|
|
|
288
292
|
},
|
|
289
293
|
context: gqlContext()
|
|
290
294
|
})
|
|
291
|
-
|
|
295
|
+
const items = response.data.productBundleSets.items
|
|
292
296
|
if (!response.errors) {
|
|
293
297
|
return {
|
|
294
|
-
records:
|
|
298
|
+
records:
|
|
299
|
+
items.map(itm => {
|
|
300
|
+
return {
|
|
301
|
+
productSku: itm.product.sku,
|
|
302
|
+
productName: itm.product.name,
|
|
303
|
+
productDescription: itm.product.description,
|
|
304
|
+
productType: itm.product.type,
|
|
305
|
+
gtin: itm.productDetail.gtin,
|
|
306
|
+
packingType: itm.productDetail.packingType,
|
|
307
|
+
packingSize: itm.productDetail.packingSize,
|
|
308
|
+
product: itm.product,
|
|
309
|
+
productDetail: itm.productDetail,
|
|
310
|
+
bundleQty: itm.bundleQty
|
|
311
|
+
}
|
|
312
|
+
}) || [],
|
|
295
313
|
total: response.data.productBundleSets.total || 0
|
|
296
314
|
}
|
|
297
315
|
}
|
|
@@ -300,7 +318,7 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
|
|
|
300
318
|
addProductLink(record) {
|
|
301
319
|
if (
|
|
302
320
|
this.productBundleData.records.findIndex(
|
|
303
|
-
x => x.
|
|
321
|
+
x => x.product.id === record.product.id && x.productDetail.id === record.productDetail.id
|
|
304
322
|
) < 0
|
|
305
323
|
) {
|
|
306
324
|
// set bundle qty to null because it is new item to be linked
|
|
@@ -334,8 +352,8 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
|
|
|
334
352
|
return {
|
|
335
353
|
// only existing product bundle will have id
|
|
336
354
|
id: record.id || '',
|
|
337
|
-
product: { id: record.
|
|
338
|
-
productDetail: { id: record.
|
|
355
|
+
product: { id: record.product.id } || {},
|
|
356
|
+
productDetail: { id: record.productDetail.id } || {},
|
|
339
357
|
bundleQty
|
|
340
358
|
}
|
|
341
359
|
})
|
|
@@ -345,23 +363,8 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
|
|
|
345
363
|
if (productBundleId && patches) {
|
|
346
364
|
const response = await client.query({
|
|
347
365
|
query: gql`
|
|
348
|
-
mutation linkProductBundle($productBundleId: String!, $patches: [ProductBundleSettingPatch]!) {
|
|
349
|
-
linkProductBundle(productBundleId: $productBundleId, patches: $patches)
|
|
350
|
-
id
|
|
351
|
-
productId
|
|
352
|
-
productSku
|
|
353
|
-
productName
|
|
354
|
-
productDescription
|
|
355
|
-
productType
|
|
356
|
-
bundleSku
|
|
357
|
-
bundleName
|
|
358
|
-
bundleDescription
|
|
359
|
-
bundleQty
|
|
360
|
-
productDetailId
|
|
361
|
-
gtin
|
|
362
|
-
packingType
|
|
363
|
-
packingSize
|
|
364
|
-
}
|
|
366
|
+
mutation linkProductBundle($productBundleId: String!, $patches: [ProductBundleSettingPatch!]!) {
|
|
367
|
+
linkProductBundle(productBundleId: $productBundleId, patches: $patches)
|
|
365
368
|
}
|
|
366
369
|
`,
|
|
367
370
|
variables: {
|
|
@@ -215,7 +215,7 @@ class ProductBundleList extends localize(i18next)(PageView) {
|
|
|
215
215
|
|
|
216
216
|
const response = await client.query({
|
|
217
217
|
query: gql`
|
|
218
|
-
query myBizplaceProductBundles($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
218
|
+
query myBizplaceProductBundles($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
219
219
|
myBizplaceProductBundles(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
220
220
|
items {
|
|
221
221
|
id
|
|
@@ -277,7 +277,7 @@ class ProductBundleList extends localize(i18next)(PageView) {
|
|
|
277
277
|
if (patches && patches.length) {
|
|
278
278
|
const response = await client.mutate({
|
|
279
279
|
mutation: gql`
|
|
280
|
-
mutation updateMultipleProductBundle($patches: [ProductBundlePatch]!) {
|
|
280
|
+
mutation updateMultipleProductBundle($patches: [ProductBundlePatch!]!) {
|
|
281
281
|
updateMultipleProductBundle(patches: $patches) {
|
|
282
282
|
sku
|
|
283
283
|
refCode
|
|
@@ -326,7 +326,7 @@ class ProductBundleList extends localize(i18next)(PageView) {
|
|
|
326
326
|
|
|
327
327
|
const response = await client.mutate({
|
|
328
328
|
mutation: gql`
|
|
329
|
-
mutation deleteProductBundles($ids: [String]!) {
|
|
329
|
+
mutation deleteProductBundles($ids: [String!]!) {
|
|
330
330
|
deleteProductBundles(ids: $ids)
|
|
331
331
|
}
|
|
332
332
|
`,
|
|
@@ -256,20 +256,24 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
256
256
|
})
|
|
257
257
|
const response = await client.query({
|
|
258
258
|
query: gql`
|
|
259
|
-
query productCombinationSets($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
259
|
+
query productCombinationSets($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
260
260
|
productCombinationSets(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
261
261
|
items {
|
|
262
262
|
id
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
product {
|
|
264
|
+
id
|
|
265
|
+
name
|
|
266
|
+
sku
|
|
267
|
+
description
|
|
268
|
+
type
|
|
269
|
+
}
|
|
270
|
+
productDetail {
|
|
271
|
+
id
|
|
272
|
+
gtin
|
|
273
|
+
packingType
|
|
274
|
+
packingSize
|
|
275
|
+
}
|
|
268
276
|
qty
|
|
269
|
-
productDetailId
|
|
270
|
-
gtin
|
|
271
|
-
packingType
|
|
272
|
-
packingSize
|
|
273
277
|
}
|
|
274
278
|
total
|
|
275
279
|
}
|
|
@@ -282,9 +286,21 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
282
286
|
},
|
|
283
287
|
context: gqlContext()
|
|
284
288
|
})
|
|
289
|
+
const items = response.data.productCombinationSets.items
|
|
285
290
|
if (!response.errors) {
|
|
286
291
|
return {
|
|
287
|
-
records:
|
|
292
|
+
records:
|
|
293
|
+
items.map(itm => {
|
|
294
|
+
return {
|
|
295
|
+
productSku: itm.product.sku,
|
|
296
|
+
gtin: itm.productDetail.gtin,
|
|
297
|
+
productName: itm.product.name,
|
|
298
|
+
packingType: itm.productDetail.packingType,
|
|
299
|
+
product: itm.product,
|
|
300
|
+
productDetail: itm.productDetail,
|
|
301
|
+
qty: itm.qty
|
|
302
|
+
}
|
|
303
|
+
}) || [],
|
|
288
304
|
total: response.data.productCombinationSets.total || 0
|
|
289
305
|
}
|
|
290
306
|
}
|
|
@@ -293,7 +309,7 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
293
309
|
addProductLink(record) {
|
|
294
310
|
if (
|
|
295
311
|
this.productCombinationSettingData.records.findIndex(
|
|
296
|
-
x => x.
|
|
312
|
+
x => x.product.id === record.product.id && x.productDetail.id === record.productDetail.id
|
|
297
313
|
) < 0
|
|
298
314
|
) {
|
|
299
315
|
// set qty to null because it is new item to be linked
|
|
@@ -326,8 +342,8 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
326
342
|
return {
|
|
327
343
|
// only existing product combination will have id
|
|
328
344
|
id: record.id || '',
|
|
329
|
-
product: { id: record.
|
|
330
|
-
productDetail: { id: record.
|
|
345
|
+
product: { id: record.product.id } || {},
|
|
346
|
+
productDetail: { id: record.productDetail.id } || {},
|
|
331
347
|
qty
|
|
332
348
|
}
|
|
333
349
|
})
|
|
@@ -337,21 +353,9 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
337
353
|
query: gql`
|
|
338
354
|
mutation linkProductCombination(
|
|
339
355
|
$productCombinationId: String!
|
|
340
|
-
$patches: [ProductCombinationSettingPatch]!
|
|
356
|
+
$patches: [ProductCombinationSettingPatch!]!
|
|
341
357
|
) {
|
|
342
|
-
linkProductCombination(productCombinationId: $productCombinationId, patches: $patches)
|
|
343
|
-
id
|
|
344
|
-
productId
|
|
345
|
-
productSku
|
|
346
|
-
productName
|
|
347
|
-
productDescription
|
|
348
|
-
productType
|
|
349
|
-
qty
|
|
350
|
-
productDetailId
|
|
351
|
-
gtin
|
|
352
|
-
packingType
|
|
353
|
-
packingSize
|
|
354
|
-
}
|
|
358
|
+
linkProductCombination(productCombinationId: $productCombinationId, patches: $patches)
|
|
355
359
|
}
|
|
356
360
|
`,
|
|
357
361
|
variables: {
|
|
@@ -235,7 +235,7 @@ class ProductCombinationsPopup extends localize(i18next)(LitElement) {
|
|
|
235
235
|
|
|
236
236
|
const response = await client.query({
|
|
237
237
|
query: gql`
|
|
238
|
-
query productCombinations($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
238
|
+
query productCombinations($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
239
239
|
productCombinations(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
240
240
|
items {
|
|
241
241
|
id
|
|
@@ -322,7 +322,10 @@ class ProductCombinationsPopup extends localize(i18next)(LitElement) {
|
|
|
322
322
|
if (patches) {
|
|
323
323
|
const response = await client.query({
|
|
324
324
|
query: gql`
|
|
325
|
-
mutation updateMultipleProductCombination(
|
|
325
|
+
mutation updateMultipleProductCombination(
|
|
326
|
+
$productDetailId: String!
|
|
327
|
+
$patches: [ProductCombinationPatch!]!
|
|
328
|
+
) {
|
|
326
329
|
updateMultipleProductCombination(productDetailId: $productDetailId, patches: $patches) {
|
|
327
330
|
id
|
|
328
331
|
name
|
|
@@ -389,7 +389,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
389
389
|
|
|
390
390
|
const response = await client.query({
|
|
391
391
|
query: gql`
|
|
392
|
-
query productDetails($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
392
|
+
query productDetails($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
393
393
|
productDetails(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
394
394
|
items {
|
|
395
395
|
id
|
|
@@ -528,7 +528,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
528
528
|
if (productId && patches) {
|
|
529
529
|
const response = await client.mutate({
|
|
530
530
|
mutation: gql`
|
|
531
|
-
mutation updateMultipleProductDetail($productId: String!, $patches: [ProductDetailPatch]!) {
|
|
531
|
+
mutation updateMultipleProductDetail($productId: String!, $patches: [ProductDetailPatch!]!) {
|
|
532
532
|
updateMultipleProductDetail(productId: $productId, patches: $patches) {
|
|
533
533
|
name
|
|
534
534
|
}
|
|
@@ -669,7 +669,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
669
669
|
|
|
670
670
|
const response = await client.query({
|
|
671
671
|
query: gql`
|
|
672
|
-
query myBizplaceProducts($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
672
|
+
query myBizplaceProducts($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
673
673
|
myBizplaceProducts(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
674
674
|
items {
|
|
675
675
|
sku
|
|
@@ -837,7 +837,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
837
837
|
|
|
838
838
|
const response = await client.mutate({
|
|
839
839
|
mutation: gql`
|
|
840
|
-
mutation updateMultipleProduct($patches: [ProductPatch]!) {
|
|
840
|
+
mutation updateMultipleProduct($patches: [ProductPatch!]!) {
|
|
841
841
|
updateMultipleProduct(patches: $patches) {
|
|
842
842
|
name
|
|
843
843
|
}
|
|
@@ -874,7 +874,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
874
874
|
|
|
875
875
|
const response = await client.mutate({
|
|
876
876
|
mutation: gql`
|
|
877
|
-
mutation importMultipleProduct($patches: [ProductPatch]!) {
|
|
877
|
+
mutation importMultipleProduct($patches: [ProductPatch!]!) {
|
|
878
878
|
importMultipleProduct(patches: $patches) {
|
|
879
879
|
name
|
|
880
880
|
}
|
|
@@ -912,7 +912,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
912
912
|
if (_.isEmpty(itm.uom) || '') {
|
|
913
913
|
if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
|
|
914
914
|
}
|
|
915
|
-
if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '' || itm?.uomValue
|
|
915
|
+
if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '' || itm?.uomValue <= 0) {
|
|
916
916
|
if (!errors.find(err => err.type == 'uomValue'))
|
|
917
917
|
errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
918
918
|
}
|
|
@@ -943,7 +943,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
943
943
|
|
|
944
944
|
const response = await client.mutate({
|
|
945
945
|
mutation: gql`
|
|
946
|
-
mutation deleteProducts($ids: [String]!) {
|
|
946
|
+
mutation deleteProducts($ids: [String!]!) {
|
|
947
947
|
deleteProducts(ids: $ids)
|
|
948
948
|
}
|
|
949
949
|
`,
|
|
@@ -981,7 +981,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
981
981
|
|
|
982
982
|
const response = await client.mutate({
|
|
983
983
|
mutation: gql`
|
|
984
|
-
mutation undeleteProducts($ids: [String]!) {
|
|
984
|
+
mutation undeleteProducts($ids: [String!]!) {
|
|
985
985
|
undeleteProducts(ids: $ids)
|
|
986
986
|
}
|
|
987
987
|
`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.6",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/form-ui": "^3.
|
|
27
|
+
"@things-factory/form-ui": "^3.8.0",
|
|
28
28
|
"@things-factory/grist-ui": "^3.7.5",
|
|
29
|
-
"@things-factory/i18n-base": "^3.
|
|
30
|
-
"@things-factory/import-ui": "^3.
|
|
31
|
-
"@things-factory/layout-base": "^3.
|
|
32
|
-
"@things-factory/product-base": "^3.
|
|
33
|
-
"@things-factory/shell": "^3.
|
|
29
|
+
"@things-factory/i18n-base": "^3.8.0",
|
|
30
|
+
"@things-factory/import-ui": "^3.8.0",
|
|
31
|
+
"@things-factory/layout-base": "^3.8.0",
|
|
32
|
+
"@things-factory/product-base": "^3.8.3",
|
|
33
|
+
"@things-factory/shell": "^3.8.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "e7722293298bd414b6ce78996a4e09df5f1e5ad8"
|
|
36
36
|
}
|
package/translations/en.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"field.require_serial_number_scanning": "require serial number scanning",
|
|
3
|
-
"field.packing_size": "packing size",
|
|
4
|
-
"field.deleted": "deleted",
|
|
5
|
-
"button.restore": "restore",
|
|
6
|
-
"text.there_is_nothing_to_restore": "there is nothing to restore",
|
|
7
|
-
"text.data_restore_successfully": "data restore successfully",
|
|
8
|
-
"text.invalid_bundle_qty_for_item_number": "invalid bundle qty for item number",
|
|
9
|
-
"text.invalid_qty_for_item_number": "invalid qty for item number",
|
|
10
2
|
"button.add_new_product": "add new product",
|
|
11
3
|
"button.back": "back",
|
|
12
4
|
"button.cancel": "cancel",
|
|
13
5
|
"button.delete": "delete",
|
|
14
6
|
"button.link_product": "link product",
|
|
7
|
+
"button.restore": "restore",
|
|
15
8
|
"button.save": "save",
|
|
16
9
|
"button.sync_data": "sync data",
|
|
17
10
|
"field.aux_unit": "aux unit",
|
|
@@ -30,12 +23,12 @@
|
|
|
30
23
|
"field.child_qty": "child qty",
|
|
31
24
|
"field.cogs_account_code": "COGS account code",
|
|
32
25
|
"field.combination": "combination",
|
|
26
|
+
"field.deleted": "deleted",
|
|
33
27
|
"field.density": "density",
|
|
34
28
|
"field.depth": "depth",
|
|
35
29
|
"field.description": "description",
|
|
36
30
|
"field.expiration_period": "expiration Period",
|
|
37
31
|
"field.gross_weight": "gross weight",
|
|
38
|
-
"field.nett_weight": "nett weight",
|
|
39
32
|
"field.gtin": "GTIN",
|
|
40
33
|
"field.height": "height",
|
|
41
34
|
"field.inventory_account_code": "inventory account code",
|
|
@@ -44,11 +37,14 @@
|
|
|
44
37
|
"field.min_qty": "min qty",
|
|
45
38
|
"field.movement": "movement",
|
|
46
39
|
"field.name": "name",
|
|
40
|
+
"field.nett_weight": "nett weight",
|
|
41
|
+
"field.packing_size": "packing size",
|
|
47
42
|
"field.packing_type": "packing type",
|
|
48
43
|
"field.product_info": "product info",
|
|
49
44
|
"field.product_ref": "product ref",
|
|
50
45
|
"field.product_set_info": "product set info",
|
|
51
46
|
"field.ref_code": "ref code",
|
|
47
|
+
"field.require_serial_number_scanning": "require serial number scanning",
|
|
52
48
|
"field.required_checking_expiry": "required checking expiry",
|
|
53
49
|
"field.sku": "SKU",
|
|
54
50
|
"field.sub_brand": "sub brand",
|
|
@@ -62,11 +58,16 @@
|
|
|
62
58
|
"field.weight_unit": "weight unit",
|
|
63
59
|
"field.weight": "weight",
|
|
64
60
|
"field.width": "width",
|
|
61
|
+
"text.data_import_successfully": "data import successfully",
|
|
62
|
+
"text.data_restore_successfully": "data restore successfully",
|
|
63
|
+
"text.invalid_bundle_qty_for_item_number": "invalid bundle qty for item number",
|
|
64
|
+
"text.invalid_qty_for_item_number": "invalid qty for item number",
|
|
65
|
+
"text.there_is_nothing_to_restore": "there is nothing to restore",
|
|
66
|
+
"title.combination_sets": "combination sets",
|
|
67
|
+
"title.combination": "combination",
|
|
65
68
|
"title.linked_products": "linked products",
|
|
66
69
|
"title.product_bundle_setting": "product bundle setting",
|
|
67
70
|
"title.product_bundle": "product bundle",
|
|
68
71
|
"title.product_set": "product set",
|
|
69
|
-
"title.product": "product"
|
|
70
|
-
"title.combination": "combination",
|
|
71
|
-
"title.combination_sets": "combination sets"
|
|
72
|
+
"title.product": "product"
|
|
72
73
|
}
|