@things-factory/biz-ui 4.3.105-alpha.0 → 4.3.107
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/contact-point-list.js +11 -38
- package/package.json +10 -10
|
@@ -4,7 +4,6 @@ import _ from 'lodash'
|
|
|
4
4
|
|
|
5
5
|
import gql from 'graphql-tag'
|
|
6
6
|
import { css, html } from 'lit'
|
|
7
|
-
import isEmpty from 'lodash-es/isEmpty'
|
|
8
7
|
|
|
9
8
|
import { getCodeByName } from '@things-factory/code-base'
|
|
10
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -92,7 +91,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
92
91
|
await this._saveContactPoints(patches)
|
|
93
92
|
history.back()
|
|
94
93
|
} catch (e) {
|
|
95
|
-
this.showToast(e
|
|
94
|
+
this.showToast(e)
|
|
96
95
|
}
|
|
97
96
|
})
|
|
98
97
|
}
|
|
@@ -139,7 +138,6 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
139
138
|
]
|
|
140
139
|
|
|
141
140
|
this.config = {
|
|
142
|
-
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
143
141
|
rows: {
|
|
144
142
|
selectable: {
|
|
145
143
|
multiple: true
|
|
@@ -159,7 +157,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
159
157
|
width: 40,
|
|
160
158
|
type: 'string'
|
|
161
159
|
},
|
|
162
|
-
header:
|
|
160
|
+
header: i18next.t('field.contact_point_customer_name'),
|
|
163
161
|
width: 250
|
|
164
162
|
},
|
|
165
163
|
{
|
|
@@ -194,7 +192,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
194
192
|
name: 'companyName',
|
|
195
193
|
record: { editable: true },
|
|
196
194
|
imex: {
|
|
197
|
-
header: i18next.t('field.contact_point_other_company_name'),
|
|
195
|
+
header: '*' + i18next.t('field.contact_point_other_company_name'),
|
|
198
196
|
key: 'companyName',
|
|
199
197
|
width: 40,
|
|
200
198
|
type: 'string'
|
|
@@ -219,7 +217,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
219
217
|
type: 'string',
|
|
220
218
|
name: 'email',
|
|
221
219
|
record: { editable: true },
|
|
222
|
-
imex: { header: i18next.t('field.contact_point_email'), key: 'email', width: 40, type: 'string' },
|
|
220
|
+
imex: { header: '*' + i18next.t('field.contact_point_email'), key: 'email', width: 40, type: 'string' },
|
|
223
221
|
header: i18next.t('field.contact_point_email'),
|
|
224
222
|
width: 120
|
|
225
223
|
},
|
|
@@ -236,7 +234,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
236
234
|
name: 'phone',
|
|
237
235
|
record: { editable: true },
|
|
238
236
|
imex: { header: '*' + i18next.t('field.contact_point_phone'), key: 'phone', width: 40, type: 'string' },
|
|
239
|
-
header:
|
|
237
|
+
header: i18next.t('field.contact_point_phone'),
|
|
240
238
|
width: 120
|
|
241
239
|
},
|
|
242
240
|
{
|
|
@@ -244,7 +242,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
244
242
|
name: 'accountNo',
|
|
245
243
|
record: { editable: true },
|
|
246
244
|
imex: {
|
|
247
|
-
header: i18next.t('field.contact_point_account_no'),
|
|
245
|
+
header: '*' + i18next.t('field.contact_point_account_no'),
|
|
248
246
|
key: 'accountNo',
|
|
249
247
|
width: 40,
|
|
250
248
|
type: 'string'
|
|
@@ -256,8 +254,8 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
256
254
|
type: 'string',
|
|
257
255
|
name: 'address',
|
|
258
256
|
record: { editable: true },
|
|
259
|
-
imex: { header:
|
|
260
|
-
header:
|
|
257
|
+
imex: { header: i18next.t('field.contact_point_company_address'), key: 'address', width: 40, type: 'string' },
|
|
258
|
+
header: i18next.t('field.contact_point_company_address'),
|
|
261
259
|
width: 300
|
|
262
260
|
},
|
|
263
261
|
{
|
|
@@ -302,7 +300,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
302
300
|
name: 'billingAddress',
|
|
303
301
|
record: { editable: true },
|
|
304
302
|
imex: {
|
|
305
|
-
header: i18next.t('field.contact_point_billing_address'),
|
|
303
|
+
header: '*' + i18next.t('field.contact_point_billing_address'),
|
|
306
304
|
key: 'billingAddress',
|
|
307
305
|
width: 40,
|
|
308
306
|
type: 'string'
|
|
@@ -313,7 +311,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
313
311
|
{
|
|
314
312
|
name: 'type',
|
|
315
313
|
record: { editable: true },
|
|
316
|
-
header:
|
|
314
|
+
header: i18next.t('field.contact_point_type'),
|
|
317
315
|
type: 'code',
|
|
318
316
|
imex: {
|
|
319
317
|
header: '*' + i18next.t('field.contact_point_type'),
|
|
@@ -433,8 +431,6 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
433
431
|
return this.showToast(i18next.t('text.nothing_changed'))
|
|
434
432
|
}
|
|
435
433
|
|
|
436
|
-
this._validate()
|
|
437
|
-
|
|
438
434
|
const response = await client.mutate({
|
|
439
435
|
mutation: gql`
|
|
440
436
|
mutation updateMultipleContactPoint($patches: [ContactPointPatch!]!) {
|
|
@@ -452,30 +448,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
|
|
|
452
448
|
this.dataGrist.fetch()
|
|
453
449
|
}
|
|
454
450
|
} catch (error) {
|
|
455
|
-
this.showToast(error
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
_validate() {
|
|
460
|
-
let errors = []
|
|
461
|
-
|
|
462
|
-
let data = this.dataGrist._data.records.map(itm => {
|
|
463
|
-
itm.error = false
|
|
464
|
-
|
|
465
|
-
if (isEmpty(itm.name) || '') {
|
|
466
|
-
itm.error = true
|
|
467
|
-
if (!errors.find(err => err.type == 'customerName')) errors.push({ type: 'customerName', value: 'customer name is required' })
|
|
468
|
-
}
|
|
469
|
-
return itm
|
|
470
|
-
})
|
|
471
|
-
|
|
472
|
-
if (errors.length > 0) {
|
|
473
|
-
this._data = {
|
|
474
|
-
...this.dataGrist.dirtyData,
|
|
475
|
-
records: data
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
throw new Error(errors.map(itm => itm.value).join(', '))
|
|
451
|
+
this.showToast(error)
|
|
479
452
|
}
|
|
480
453
|
}
|
|
481
454
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/biz-ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.107",
|
|
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.
|
|
28
|
-
"@things-factory/code-base": "^4.3.
|
|
29
|
-
"@things-factory/form-ui": "^4.3.
|
|
30
|
-
"@things-factory/grist-ui": "^4.3.
|
|
31
|
-
"@things-factory/i18n-base": "^4.3.
|
|
32
|
-
"@things-factory/import-ui": "^4.3.
|
|
33
|
-
"@things-factory/layout-base": "^4.3.
|
|
34
|
-
"@things-factory/shell": "^4.3.
|
|
27
|
+
"@things-factory/biz-base": "^4.3.107",
|
|
28
|
+
"@things-factory/code-base": "^4.3.107",
|
|
29
|
+
"@things-factory/form-ui": "^4.3.107",
|
|
30
|
+
"@things-factory/grist-ui": "^4.3.107",
|
|
31
|
+
"@things-factory/i18n-base": "^4.3.107",
|
|
32
|
+
"@things-factory/import-ui": "^4.3.107",
|
|
33
|
+
"@things-factory/layout-base": "^4.3.107",
|
|
34
|
+
"@things-factory/shell": "^4.3.107"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "6f972d110c7b502f370d3887062bb6b38d1ddbc9"
|
|
37
37
|
}
|