@things-factory/product-ui 4.2.3 → 4.3.0-alpha.0
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/components/product-combination-selection-popup.js +1 -1
- package/client/pages/product-bundle-link-popup.js +1 -1
- package/client/pages/product-bundle-list.js +1 -1
- package/client/pages/product-combination-settings-popup.js +2 -2
- package/client/pages/product-combinations-popup.js +1 -1
- package/client/pages/product-details-popup.js +11 -10
- package/client/pages/product-list.js +7 -22
- package/client/pages/product-set-link-popup.js +1 -1
- package/client/pages/product-set-list.js +1 -1
- package/package.json +9 -9
|
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement } from 'lit
|
|
5
|
+
import { css, html, LitElement } from 'lit'
|
|
6
6
|
|
|
7
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
8
8
|
import { client, gqlContext } from '@things-factory/shell'
|
|
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement } from 'lit
|
|
5
|
+
import { css, html, LitElement } from 'lit'
|
|
6
6
|
|
|
7
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
8
8
|
import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
@@ -3,7 +3,7 @@ import '@things-factory/form-ui'
|
|
|
3
3
|
import '@things-factory/grist-ui'
|
|
4
4
|
|
|
5
5
|
import gql from 'graphql-tag'
|
|
6
|
-
import { css, html } from 'lit
|
|
6
|
+
import { css, html } from 'lit'
|
|
7
7
|
|
|
8
8
|
import { getCodeByName } from '@things-factory/code-base'
|
|
9
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement } from 'lit
|
|
5
|
+
import { css, html, LitElement } from 'lit'
|
|
6
6
|
|
|
7
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
8
8
|
import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
@@ -337,7 +337,7 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
|
|
|
337
337
|
let patches = this.productCombinationSettingGrist.dirtyData.records.map(record => {
|
|
338
338
|
const qty = record.qty
|
|
339
339
|
if (!qty || qty <= 0 || !Number.isSafeInteger(qty)) {
|
|
340
|
-
throw new Error(i18next.t('text.invalid_qty_for_item_number_x', { state: {x: record.__seq__} }))
|
|
340
|
+
throw new Error(i18next.t('text.invalid_qty_for_item_number_x', { state: { x: record.__seq__ } }))
|
|
341
341
|
}
|
|
342
342
|
return {
|
|
343
343
|
// only existing product combination will have id
|
|
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
|
|
|
3
3
|
import './product-combination-settings-popup'
|
|
4
4
|
|
|
5
5
|
import gql from 'graphql-tag'
|
|
6
|
-
import { css, html, LitElement } from 'lit
|
|
6
|
+
import { css, html, LitElement } from 'lit'
|
|
7
7
|
|
|
8
8
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
9
|
import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
@@ -3,7 +3,10 @@ import '@things-factory/grist-ui'
|
|
|
3
3
|
import './product-combinations-popup'
|
|
4
4
|
|
|
5
5
|
import gql from 'graphql-tag'
|
|
6
|
-
import { css, html, LitElement } from 'lit
|
|
6
|
+
import { css, html, LitElement } from 'lit'
|
|
7
|
+
import isEmpty from 'lodash-es/isEmpty'
|
|
8
|
+
import isNaN from 'lodash-es/isNaN'
|
|
9
|
+
import isNumber from 'lodash-es/isNumber'
|
|
7
10
|
|
|
8
11
|
import { getCodeByName } from '@things-factory/code-base'
|
|
9
12
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -12,8 +15,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
|
12
15
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
13
16
|
import { isMobileDevice } from '@things-factory/utils'
|
|
14
17
|
|
|
15
|
-
const _ = require('lodash')
|
|
16
|
-
|
|
17
18
|
export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
18
19
|
static get styles() {
|
|
19
20
|
return [
|
|
@@ -568,20 +569,20 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
568
569
|
let data = this.dataGrist._data.records.map(itm => {
|
|
569
570
|
itm.error = false
|
|
570
571
|
|
|
571
|
-
if (
|
|
572
|
+
if (isEmpty(itm.gtin) || '') {
|
|
572
573
|
itm.error = true
|
|
573
574
|
if (!errors.find(err => err.type == 'gtin')) errors.push({ type: 'gtin', value: 'GTIN is required' })
|
|
574
575
|
}
|
|
575
|
-
if (
|
|
576
|
+
if (isEmpty(itm.packingType) || '') {
|
|
576
577
|
itm.error = true
|
|
577
578
|
if (!errors.find(err => err.type == 'packingType'))
|
|
578
579
|
errors.push({ type: 'packingType', value: 'Packing type is required' })
|
|
579
580
|
}
|
|
580
|
-
if (
|
|
581
|
+
if (isEmpty(itm.uom) || '') {
|
|
581
582
|
itm.error = true
|
|
582
583
|
if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
|
|
583
584
|
}
|
|
584
|
-
if (!
|
|
585
|
+
if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '') {
|
|
585
586
|
itm.error = true
|
|
586
587
|
if (!errors.find(err => err.type == 'uomValue'))
|
|
587
588
|
errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
@@ -639,7 +640,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
639
640
|
...this.dataGrist._data,
|
|
640
641
|
records: this._updateRowOption(
|
|
641
642
|
this.dataGrist._data.records.map((record, idx) => {
|
|
642
|
-
if (!
|
|
643
|
+
if (!isEmpty(record.childProductDetail) && record.childProductDetail == before) {
|
|
643
644
|
record.childProductDetail = after
|
|
644
645
|
}
|
|
645
646
|
return record
|
|
@@ -649,7 +650,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
649
650
|
|
|
650
651
|
break
|
|
651
652
|
case 'uomValue':
|
|
652
|
-
if (
|
|
653
|
+
if (isNaN(after)) {
|
|
653
654
|
updatedRecords.records[row].uomValue = 1
|
|
654
655
|
}
|
|
655
656
|
break
|
|
@@ -704,7 +705,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
704
705
|
value: ''
|
|
705
706
|
},
|
|
706
707
|
...data
|
|
707
|
-
.filter(child => child.gtin != itm.gtin && !
|
|
708
|
+
.filter(child => child.gtin != itm.gtin && !isEmpty(child.gtin))
|
|
708
709
|
.map(x => {
|
|
709
710
|
const rowOption = {
|
|
710
711
|
display: x.gtin,
|
|
@@ -2,32 +2,17 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
import './product-details-popup'
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from 'lit-element'
|
|
5
|
+
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
6
|
+
import { CustomAlert, PageView, client, gqlContext } from '@things-factory/shell'
|
|
7
|
+
import { css, html } from 'lit'
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
9
|
|
|
10
|
+
import { PICKING_STRATEGIES } from './constants/picking-strategy'
|
|
11
11
|
import { getCodeByName } from '@things-factory/code-base'
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
localize
|
|
15
|
-
} from '@things-factory/i18n-base'
|
|
12
|
+
import gql from 'graphql-tag'
|
|
13
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
16
14
|
import { openImportPopUp } from '@things-factory/import-ui'
|
|
17
15
|
import { openPopup } from '@things-factory/layout-base'
|
|
18
|
-
import {
|
|
19
|
-
client,
|
|
20
|
-
CustomAlert,
|
|
21
|
-
gqlContext,
|
|
22
|
-
PageView
|
|
23
|
-
} from '@things-factory/shell'
|
|
24
|
-
import {
|
|
25
|
-
CommonButtonStyles,
|
|
26
|
-
ScrollbarStyles
|
|
27
|
-
} from '@things-factory/styles'
|
|
28
|
-
import { isMobileDevice } from '@things-factory/utils'
|
|
29
|
-
|
|
30
|
-
import { PICKING_STRATEGIES } from './constants/picking-strategy'
|
|
31
16
|
|
|
32
17
|
class ProductList extends localize(i18next)(PageView) {
|
|
33
18
|
static get properties() {
|
|
@@ -6,7 +6,7 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
|
6
6
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
7
|
import { isMobileDevice } from '@things-factory/utils'
|
|
8
8
|
import gql from 'graphql-tag'
|
|
9
|
-
import { css, html, LitElement } from 'lit
|
|
9
|
+
import { css, html, LitElement } from 'lit'
|
|
10
10
|
|
|
11
11
|
export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
|
|
12
12
|
static get styles() {
|
|
@@ -8,7 +8,7 @@ import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell
|
|
|
8
8
|
import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
|
|
9
9
|
import { isMobileDevice } from '@things-factory/utils'
|
|
10
10
|
import gql from 'graphql-tag'
|
|
11
|
-
import { css, html } from 'lit
|
|
11
|
+
import { css, html } from 'lit'
|
|
12
12
|
import './product-set-link-popup'
|
|
13
13
|
|
|
14
14
|
class ProductSetList extends localize(i18next)(PageView) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-alpha.0",
|
|
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.
|
|
28
|
-
"@things-factory/grist-ui": "^4.
|
|
29
|
-
"@things-factory/i18n-base": "^4.
|
|
30
|
-
"@things-factory/import-ui": "^4.
|
|
31
|
-
"@things-factory/layout-base": "^4.
|
|
32
|
-
"@things-factory/product-base": "^4.
|
|
33
|
-
"@things-factory/shell": "^4.
|
|
27
|
+
"@things-factory/form-ui": "^4.3.0-alpha.0",
|
|
28
|
+
"@things-factory/grist-ui": "^4.3.0-alpha.0",
|
|
29
|
+
"@things-factory/i18n-base": "^4.3.0-alpha.0",
|
|
30
|
+
"@things-factory/import-ui": "^4.3.0-alpha.0",
|
|
31
|
+
"@things-factory/layout-base": "^4.3.0-alpha.0",
|
|
32
|
+
"@things-factory/product-base": "^4.3.0-alpha.0",
|
|
33
|
+
"@things-factory/shell": "^4.3.0-alpha.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6467d1b2a5b2f8abb1bc3982e4651a5742ad4043"
|
|
36
36
|
}
|