@things-factory/product-ui 4.3.425 → 4.3.443

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.
@@ -3,26 +3,15 @@ import '@things-factory/grist-ui'
3
3
  import './product-combinations-popup'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import {
7
- css,
8
- html,
9
- LitElement
10
- } from 'lit'
6
+ import { css, html, LitElement } from 'lit'
11
7
  import isEmpty from 'lodash-es/isEmpty'
12
8
  import isNaN from 'lodash-es/isNaN'
13
9
  import isNumber from 'lodash-es/isNumber'
14
10
 
15
11
  import { getCodeByName } from '@things-factory/code-base'
16
- import {
17
- i18next,
18
- localize
19
- } from '@things-factory/i18n-base'
12
+ import { i18next, localize } from '@things-factory/i18n-base'
20
13
  import { openPopup } from '@things-factory/layout-base'
21
- import {
22
- client,
23
- CustomAlert,
24
- gqlContext
25
- } from '@things-factory/shell'
14
+ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
26
15
  import { ScrollbarStyles } from '@things-factory/styles'
27
16
  import { isMobileDevice } from '@things-factory/utils'
28
17
 
@@ -677,24 +666,20 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
677
666
 
678
667
  let totalProductBarcodes = []
679
668
 
680
- this.dataGrist._data.records.map(itm => {
669
+ let data = this.dataGrist._data.records.map((itm, index) => {
670
+ itm.error = false
671
+
681
672
  if (itm.productBarcodes) {
682
673
  itm.productBarcodes.map(itm2 => totalProductBarcodes.push(itm2.gtin))
683
674
  } else {
675
+ itm.error = true
684
676
  errors.push({ type: 'gtin', value: 'Gtin is required' })
685
677
  }
686
- })
687
-
688
- let duplicateProductBarcode = totalProductBarcodes.find(
689
- (item, index) => totalProductBarcodes.indexOf(item) !== index
690
- )
691
678
 
692
- if (duplicateProductBarcode) {
693
- throw new Error('Gtin cannot be duplicated')
694
- }
695
-
696
- let data = this.dataGrist._data.records.map((itm, index) => {
697
- itm.error = false
679
+ // if (isEmpty(itm.refCode) || '') {
680
+ // itm.error = true
681
+ // if (!errors.find(err => err.type == 'refCode')) errors.push({ type: 'refCode', value: 'Ref code is required' })
682
+ // }
698
683
 
699
684
  if (isEmpty(itm.packingType) || '') {
700
685
  itm.error = true
@@ -716,6 +701,14 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
716
701
  return itm
717
702
  })
718
703
 
704
+ let duplicateProductBarcode = totalProductBarcodes.find(
705
+ (item, index) => totalProductBarcodes.indexOf(item) !== index
706
+ )
707
+
708
+ if (duplicateProductBarcode) {
709
+ throw new Error('Gtin cannot be duplicated')
710
+ }
711
+
719
712
  if (errors.length > 0) {
720
713
  this._data = {
721
714
  ...this.dataGrist.dirtyData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.3.425",
3
+ "version": "4.3.443",
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.381",
27
- "@things-factory/grist-ui": "^4.3.381",
28
- "@things-factory/i18n-base": "^4.3.381",
29
- "@things-factory/import-ui": "^4.3.381",
30
- "@things-factory/layout-base": "^4.3.381",
31
- "@things-factory/product-base": "^4.3.425",
32
- "@things-factory/shell": "^4.3.381"
26
+ "@things-factory/form-ui": "^4.3.434",
27
+ "@things-factory/grist-ui": "^4.3.434",
28
+ "@things-factory/i18n-base": "^4.3.434",
29
+ "@things-factory/import-ui": "^4.3.434",
30
+ "@things-factory/layout-base": "^4.3.434",
31
+ "@things-factory/product-base": "^4.3.443",
32
+ "@things-factory/shell": "^4.3.434"
33
33
  },
34
- "gitHead": "43a4d63f2d8411e2f7446c3627dbf8acafbd3c44"
34
+ "gitHead": "9756867524d3f488d74f22738ef3f2d2aec1da8c"
35
35
  }