@things-factory/product-ui 4.0.11 → 4.0.12

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.
@@ -266,16 +266,20 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
266
266
  productBundleSets(filters: $filters, pagination: $pagination, sortings: $sortings) {
267
267
  items {
268
268
  id
269
- productId
270
- productName
271
- productSku
272
- productDescription
273
- productType
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: response.data.productBundleSets.items || [],
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.productId === record.productId && x.productDetailId === record.productDetailId
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.productId } || {},
338
- productDetail: { id: record.productDetailId } || {},
355
+ product: { id: record.product.id } || {},
356
+ productDetail: { id: record.productDetail.id } || {},
339
357
  bundleQty
340
358
  }
341
359
  })
@@ -346,22 +364,7 @@ class ProductBundleLinkPopup extends localize(i18next)(LitElement) {
346
364
  const response = await client.query({
347
365
  query: gql`
348
366
  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
- }
367
+ linkProductBundle(productBundleId: $productBundleId, patches: $patches)
365
368
  }
366
369
  `,
367
370
  variables: {
@@ -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
- productId
264
- productName
265
- productSku
266
- productDescription
267
- productType
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: response.data.productCombinationSets.items || [],
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.productId === record.productId && x.productDetailId === record.productDetailId
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.productId } || {},
330
- productDetail: { id: record.productDetailId } || {},
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($productDetailId: String!, $patches: [ProductCombinationPatch]!) {
325
+ mutation updateMultipleProductCombination(
326
+ $productDetailId: String!
327
+ $patches: [ProductCombinationPatch!]!
328
+ ) {
326
329
  updateMultipleProductCombination(productDetailId: $productDetailId, patches: $patches) {
327
330
  id
328
331
  name
@@ -362,6 +362,14 @@ class ProductList extends localize(i18next)(PageView) {
362
362
  sortable: true,
363
363
  width: 120
364
364
  },
365
+ {
366
+ type: 'boolean',
367
+ name: 'isRequireSerialNumberScanning',
368
+ header: i18next.t('field.require_serial_number_scanning'),
369
+ record: { editable: true, align: 'center' },
370
+ sortable: true,
371
+ width: 120
372
+ },
365
373
  {
366
374
  type: 'object',
367
375
  name: 'productRef',
@@ -686,6 +694,7 @@ class ProductList extends localize(i18next)(PageView) {
686
694
  cogsAccountCode
687
695
  expirationPeriod
688
696
  isRequiredCheckExpiry
697
+ isRequireSerialNumberScanning
689
698
  weightUnit
690
699
  nettWeight
691
700
  grossWeight
@@ -1,14 +1,12 @@
1
+ import { getCodeByName } from '@things-factory/code-base'
1
2
  import '@things-factory/form-ui'
2
3
  import '@things-factory/grist-ui'
3
-
4
- import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit-element'
6
-
7
- import { getCodeByName } from '@things-factory/code-base'
8
4
  import { i18next, localize } from '@things-factory/i18n-base'
9
5
  import { client, CustomAlert, gqlContext } from '@things-factory/shell'
10
- import { ScrollbarStyles } from '@things-factory/styles'
11
- import { isMobileDevice } from '@things-factory/utils'
6
+ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
7
+ import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
8
+ import gql from 'graphql-tag'
9
+ import { css, html, LitElement } from 'lit-element'
12
10
 
13
11
  export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
14
12
  static get styles() {
@@ -526,7 +524,7 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
526
524
 
527
525
  const response = await client.query({
528
526
  query: gql`
529
- query myBizplaceProducts($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
527
+ query myBizplaceProducts($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
530
528
  myBizplaceProducts(filters: $filters, pagination: $pagination, sortings: $sortings) {
531
529
  items {
532
530
  sku
@@ -639,7 +637,7 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
639
637
  if (this.productSetId && patches) {
640
638
  const response = await client.query({
641
639
  query: gql`
642
- mutation($productSetId: String!, $patches: [ProductPatch!]!) {
640
+ mutation($productSetId: String!, $patches: [ProductPatch]!) {
643
641
  linkProduct(productSetId: $productSetId, patches: $patches)
644
642
  }
645
643
  `,
@@ -688,7 +686,7 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
688
686
 
689
687
  const response = await client.mutate({
690
688
  mutation: gql`
691
- mutation updateMultipleProduct($patches: [ProductPatch!]!) {
689
+ mutation updateMultipleProduct($patches: [ProductPatch]!) {
692
690
  updateMultipleProduct(patches: $patches) {
693
691
  name
694
692
  }
@@ -1,17 +1,15 @@
1
+ import { getCodeByName } from '@things-factory/code-base'
1
2
  import '@things-factory/form-ui'
2
3
  import '@things-factory/grist-ui'
3
- import './product-set-link-popup'
4
-
5
- import gql from 'graphql-tag'
6
- import { css, html } from 'lit-element'
7
-
8
- import { getCodeByName } from '@things-factory/code-base'
9
4
  import { i18next, localize } from '@things-factory/i18n-base'
10
5
  import { openImportPopUp } from '@things-factory/import-ui'
11
6
  import { openPopup } from '@things-factory/layout-base'
12
7
  import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell'
13
- import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
8
+ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
14
9
  import { isMobileDevice } from '@things-factory/utils'
10
+ import gql from 'graphql-tag'
11
+ import { css, html } from 'lit-element'
12
+ import './product-set-link-popup'
15
13
 
16
14
  class ProductSetList extends localize(i18next)(PageView) {
17
15
  static get properties() {
@@ -217,7 +215,7 @@ class ProductSetList extends localize(i18next)(PageView) {
217
215
 
218
216
  const response = await client.query({
219
217
  query: gql`
220
- query myBizplaceProductSets($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
218
+ query myBizplaceProductSets($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
221
219
  myBizplaceProductSets(filters: $filters, pagination: $pagination, sortings: $sortings) {
222
220
  items {
223
221
  id
@@ -262,7 +260,7 @@ class ProductSetList extends localize(i18next)(PageView) {
262
260
 
263
261
  const response = await client.mutate({
264
262
  mutation: gql`
265
- mutation updateMultipleProductSet($patches: [ProductSetPatch!]!) {
263
+ mutation updateMultipleProductSet($patches: [ProductSetPatch]!) {
266
264
  updateMultipleProductSet(patches: $patches) {
267
265
  name
268
266
  }
@@ -297,7 +295,7 @@ class ProductSetList extends localize(i18next)(PageView) {
297
295
 
298
296
  const response = await client.mutate({
299
297
  mutation: gql`
300
- mutation deleteProductSets($ids: [String!]!) {
298
+ mutation deleteProductSets($ids: [String]!) {
301
299
  deleteProductSets(ids: $ids)
302
300
  }
303
301
  `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.0.11",
3
+ "version": "4.0.12",
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": "^4.0.11",
28
- "@things-factory/grist-ui": "^4.0.11",
29
- "@things-factory/i18n-base": "^4.0.11",
30
- "@things-factory/import-ui": "^4.0.11",
31
- "@things-factory/layout-base": "^4.0.11",
32
- "@things-factory/product-base": "^4.0.11",
33
- "@things-factory/shell": "^4.0.11"
27
+ "@things-factory/form-ui": "^4.0.12",
28
+ "@things-factory/grist-ui": "^4.0.12",
29
+ "@things-factory/i18n-base": "^4.0.12",
30
+ "@things-factory/import-ui": "^4.0.12",
31
+ "@things-factory/layout-base": "^4.0.12",
32
+ "@things-factory/product-base": "^4.0.12",
33
+ "@things-factory/shell": "^4.0.12"
34
34
  },
35
- "gitHead": "47745d8cdbe99f11d8d69bbcab3901c9771525a0"
35
+ "gitHead": "29d59ff95fcb473cb43c6f798cd04f3ec3a779a0"
36
36
  }
@@ -1,16 +1,10 @@
1
1
  {
2
- "field.packing_size": "packing size",
3
- "field.deleted": "deleted",
4
- "button.restore": "restore",
5
- "text.there_is_nothing_to_restore": "there is nothing to restore",
6
- "text.data_restore_successfully": "data restore successfully",
7
- "text.invalid_bundle_qty_for_item_number": "invalid bundle qty for item number",
8
- "text.invalid_qty_for_item_number": "invalid qty for item number",
9
2
  "button.add_new_product": "add new product",
10
3
  "button.back": "back",
11
4
  "button.cancel": "cancel",
12
5
  "button.delete": "delete",
13
6
  "button.link_product": "link product",
7
+ "button.restore": "restore",
14
8
  "button.save": "save",
15
9
  "button.sync_data": "sync data",
16
10
  "field.aux_unit": "aux unit",
@@ -29,12 +23,12 @@
29
23
  "field.child_qty": "child qty",
30
24
  "field.cogs_account_code": "COGS account code",
31
25
  "field.combination": "combination",
26
+ "field.deleted": "deleted",
32
27
  "field.density": "density",
33
28
  "field.depth": "depth",
34
29
  "field.description": "description",
35
30
  "field.expiration_period": "expiration Period",
36
31
  "field.gross_weight": "gross weight",
37
- "field.nett_weight": "nett weight",
38
32
  "field.gtin": "GTIN",
39
33
  "field.height": "height",
40
34
  "field.inventory_account_code": "inventory account code",
@@ -43,11 +37,14 @@
43
37
  "field.min_qty": "min qty",
44
38
  "field.movement": "movement",
45
39
  "field.name": "name",
40
+ "field.nett_weight": "nett weight",
41
+ "field.packing_size": "packing size",
46
42
  "field.packing_type": "packing type",
47
43
  "field.product_info": "product info",
48
44
  "field.product_ref": "product ref",
49
45
  "field.product_set_info": "product set info",
50
46
  "field.ref_code": "ref code",
47
+ "field.require_serial_number_scanning": "require serial number scanning",
51
48
  "field.required_checking_expiry": "required checking expiry",
52
49
  "field.sku": "SKU",
53
50
  "field.sub_brand": "sub brand",
@@ -61,9 +58,16 @@
61
58
  "field.weight_unit": "weight unit",
62
59
  "field.weight": "weight",
63
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",
68
+ "title.linked_products": "linked products",
64
69
  "title.product_bundle_setting": "product bundle setting",
65
70
  "title.product_bundle": "product bundle",
66
71
  "title.product_set": "product set",
67
- "title.product": "product",
68
- "title.combination": "combination"
72
+ "title.product": "product"
69
73
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "field.require_serial_number_scanning": "[ko]require serial number scanning",
2
3
  "field.packing_size": "[ko]packing size",
3
4
  "field.deleted": "[ko]deleted",
4
5
  "button.restore": "[ko]restore",
@@ -61,9 +62,11 @@
61
62
  "field.weight_unit": "[ko]weight unit",
62
63
  "field.weight": "[ko]weight",
63
64
  "field.width": "[ko]width",
65
+ "title.linked_products": "[ko] linked products",
64
66
  "title.product_bundle_setting": "[ko]product bundle setting",
65
67
  "title.product_bundle": "[ko]product bundle",
66
68
  "title.product_set": "[ko]product set",
67
69
  "title.product": "[ko]product",
68
- "title.combination": "[ko] combination"
70
+ "title.combination": "[ko] combination",
71
+ "title.combination_sets": "[ko] combination sets"
69
72
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "field.require_serial_number_scanning": "[ms]require serial number scanning",
2
3
  "field.packing_size": "[ms]packing size",
3
4
  "field.deleted": "[ms]deleted",
4
5
  "button.restore": "[ms]restore",
@@ -61,9 +62,11 @@
61
62
  "field.weight_unit": "[ms]weight unit",
62
63
  "field.weight": "[ms]weight",
63
64
  "field.width": "[ms]width",
65
+ "title.linked_products": "[ms] linked products",
64
66
  "title.product_bundle_setting": "[ms]product bundle setting",
65
67
  "title.product_bundle": "[ms]product bundle",
66
68
  "title.product_set": "[ms]product set",
67
69
  "title.product": "[ms]product",
68
- "title.combination": "[ms] combination"
70
+ "title.combination": "[ms] combination",
71
+ "title.combination_sets": "[ms] combination sets"
69
72
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "field.require_serial_number_scanning": "[zh]require serial number scanning",
2
3
  "button.restore": "[zh]restore",
3
4
  "text.there_is_nothing_to_restore": "[zh]there is nothing to restore",
4
5
  "text.data_restore_successfully": "[zh]data restore successfully",
@@ -63,9 +64,11 @@
63
64
  "field.weight_unit": "[zh]weight unit",
64
65
  "field.weight": "[zh]weight",
65
66
  "field.width": "[zh]width",
67
+ "title.linked_products": "[zh] linked products",
66
68
  "title.product_bundle_setting": "[zh]product bundle setting",
67
69
  "title.product_bundle": "[zh]product bundle",
68
70
  "title.product_set": "[zh]product set",
69
71
  "title.product": "[zh]product",
70
- "title.combination": "[zh] combination"
72
+ "title.combination": "[zh] combination",
73
+ "title.combination_sets": "[zh] combination sets"
71
74
  }