@things-factory/biz-ui 4.3.105-alpha.0 → 4.3.108

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.
@@ -88,7 +88,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
88
88
 
89
89
  return patch
90
90
  })
91
- this._validateImport(patches)
91
+ await this._validateImport(patches)
92
92
  await this._saveContactPoints(patches)
93
93
  history.back()
94
94
  } catch (e) {
@@ -256,7 +256,12 @@ export class ContactPointList extends localize(i18next)(PageView) {
256
256
  type: 'string',
257
257
  name: 'address',
258
258
  record: { editable: true },
259
- imex: { header: '*' + i18next.t('field.contact_point_company_address'), key: 'address', width: 40, type: 'string' },
259
+ imex: {
260
+ header: '*' + i18next.t('field.contact_point_company_address'),
261
+ key: 'address',
262
+ width: 40,
263
+ type: 'string'
264
+ },
260
265
  header: '*' + i18next.t('field.contact_point_company_address'),
261
266
  width: 300
262
267
  },
@@ -461,10 +466,12 @@ export class ContactPointList extends localize(i18next)(PageView) {
461
466
 
462
467
  let data = this.dataGrist._data.records.map(itm => {
463
468
  itm.error = false
469
+ z
464
470
 
465
471
  if (isEmpty(itm.name) || '') {
466
472
  itm.error = true
467
- if (!errors.find(err => err.type == 'customerName')) errors.push({ type: 'customerName', value: 'customer name is required' })
473
+ if (!errors.find(err => err.type == 'customerName'))
474
+ errors.push({ type: 'customerName', value: 'customer name is required' })
468
475
  }
469
476
  return itm
470
477
  })
@@ -516,7 +523,8 @@ export class ContactPointList extends localize(i18next)(PageView) {
516
523
  }
517
524
  }
518
525
 
519
- _validateImport(data) {
526
+ async _validateImport(data) {
527
+ const contactTypes = await getCodeByName('CONTACT_TYPES')
520
528
  let errors = []
521
529
 
522
530
  data = data.map(item => {
@@ -550,6 +558,11 @@ export class ContactPointList extends localize(i18next)(PageView) {
550
558
  }
551
559
  }
552
560
 
561
+ let foundContactTypes = contactTypes.find(exist => exist.name == item.type)
562
+ if (!foundContactTypes) {
563
+ throw new Error(i18next.t('text.contact_type_does_not_exist'))
564
+ }
565
+
553
566
  return item
554
567
  })
555
568
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/biz-ui",
3
- "version": "4.3.105-alpha.0",
3
+ "version": "4.3.108",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,14 +24,14 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/biz-base": "^4.3.105-alpha.0",
28
- "@things-factory/code-base": "^4.3.105-alpha.0",
29
- "@things-factory/form-ui": "^4.3.105-alpha.0",
30
- "@things-factory/grist-ui": "^4.3.105-alpha.0",
31
- "@things-factory/i18n-base": "^4.3.105-alpha.0",
32
- "@things-factory/import-ui": "^4.3.105-alpha.0",
33
- "@things-factory/layout-base": "^4.3.105-alpha.0",
34
- "@things-factory/shell": "^4.3.105-alpha.0"
27
+ "@things-factory/biz-base": "^4.3.108",
28
+ "@things-factory/code-base": "^4.3.108",
29
+ "@things-factory/form-ui": "^4.3.108",
30
+ "@things-factory/grist-ui": "^4.3.108",
31
+ "@things-factory/i18n-base": "^4.3.108",
32
+ "@things-factory/import-ui": "^4.3.108",
33
+ "@things-factory/layout-base": "^4.3.108",
34
+ "@things-factory/shell": "^4.3.108"
35
35
  },
36
- "gitHead": "3bf9a95c5f77324220346e5109880a171ee2a13d"
36
+ "gitHead": "8aa8811dd0ebb1f4c1d9bc50fc221766d855c553"
37
37
  }