@things-factory/operato-mms 4.0.0-alpha.7 → 4.0.0-beta.1
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/Dockerfile +2 -1
- package/client/bootstrap.js +32 -16
- package/client/components/marketplace-order-max-weight.js +158 -0
- package/client/components/mms-home-cards.js +1 -1
- package/client/components/stock-allocation-ratio.js +17 -23
- package/client/pages/catalogue/products.js +2 -1
- package/client/pages/catalogue/warehouse-products.js +2 -1
- package/client/pages/catalogue-variation/product-variations.js +72 -15
- package/client/pages/inventory/inventory-by-product.js +3 -2
- package/client/pages/order/logistics/batch-init-popup.js +566 -0
- package/client/pages/order/logistics/lazada-order-init-batch-popup.js +233 -21
- package/client/pages/order/logistics/order-shipping-items.js +47 -16
- package/client/pages/order/logistics/order-shipping.js +7 -4
- package/client/pages/order/logistics/request-ro-popup.js +104 -17
- package/client/pages/order/logistics/shopee-order-init-batch-popup.js +431 -129
- package/client/pages/order/order-by-store.js +176 -149
- package/client/pages/setting/marketplace-setting.js +12 -0
- package/dist-server/graphql/index.js +1 -1
- package/dist-server/graphql/resolvers/index.js +1 -1
- package/dist-server/graphql/resolvers/interface-with-hub/add-release-order.js +74 -13
- package/dist-server/graphql/resolvers/interface-with-hub/add-release-order.js.map +1 -1
- package/dist-server/graphql/resolvers/interface-with-hub/auto-add-release-order.js +74 -13
- package/dist-server/graphql/resolvers/interface-with-hub/auto-add-release-order.js.map +1 -1
- package/dist-server/graphql/resolvers/interface-with-hub/generate-replenishment-order.js +1 -1
- package/dist-server/graphql/resolvers/interface-with-hub/generate-replenishment-order.js.map +1 -1
- package/dist-server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.js +53 -36
- package/dist-server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.js.map +1 -1
- package/dist-server/graphql/resolvers/warehouse-product/auto-link-warehouse-marketplace-product-variations.js +5 -5
- package/dist-server/graphql/resolvers/warehouse-product/auto-link-warehouse-marketplace-product-variations.js.map +1 -1
- package/dist-server/graphql/types/index.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/new-stock-replenishment.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/new-stock-replenishment.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/replenishment-order-product.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/replenishment-order-product.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/stock-replenishment-list.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/stock-replenishment-list.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/stock-replenishment.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/stock-replenishment.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-inventory.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-inventory.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product-list.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product-list.js.map +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product.js +1 -1
- package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product.js.map +1 -1
- package/dist-server/graphql/types/warehouse-product/warehouse-product.js +1 -1
- package/dist-server/graphql/types/warehouse-product/warehouse-product.js.map +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/migrations/1599732967233-SeedCommonCode.js +5 -5
- package/dist-server/migrations/1599732967233-SeedCommonCode.js.map +1 -1
- package/dist-server/migrations/1608009991075-SeedUser.js +4 -4
- package/dist-server/migrations/1608009991075-SeedUser.js.map +1 -1
- package/dist-server/routers/etrax-router.js +7 -6
- package/dist-server/routers/etrax-router.js.map +1 -1
- package/dist-server/routers/shopify-pos-public-router.js +10 -10
- package/dist-server/routers/shopify-pos-public-router.js.map +1 -1
- package/dist-server/util/interface-helper.js +2 -2
- package/dist-server/util/interface-helper.js.map +1 -1
- package/dist-server/util/no-generator.js +2 -2
- package/dist-server/util/no-generator.js.map +1 -1
- package/package.json +65 -63
- package/server/graphql/resolvers/interface-with-hub/add-release-order.ts +83 -14
- package/server/graphql/resolvers/interface-with-hub/auto-add-release-order.ts +79 -11
- package/server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.ts +50 -33
- package/server/routers/etrax-router.ts +6 -4
- package/translations/en.json +16 -0
- package/translations/ko.json +14 -0
- package/translations/ms.json +14 -0
- package/translations/zh.json +14 -0
- package/views/auth-page.html +1 -1
- package/views/public/home.html +1 -1
- package/config.development.js +0 -54
package/Dockerfile
CHANGED
|
@@ -18,11 +18,12 @@ RUN apt-get install -y --no-install-recommends apt-utils
|
|
|
18
18
|
RUN apt-get install -y chromium
|
|
19
19
|
RUN apt-get install -y libcups2-dev
|
|
20
20
|
RUN apt-get install -y libavahi-compat-libdnssd-dev
|
|
21
|
-
RUN apt-get install -y gconf-service libasound2 libatk1.0-0 libcairo2 libcups2 libfontconfig1 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libxss1 fonts-liberation
|
|
21
|
+
RUN apt-get install -y gconf-service libasound2 libatk1.0-0 libcairo2 libcups2 libfontconfig1 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libxss1 fonts-liberation libnss3 lsb-release xdg-utils libaio1
|
|
22
22
|
|
|
23
23
|
RUN apt update
|
|
24
24
|
RUN apt-get install -y ghostscript
|
|
25
25
|
RUN apt-get install -y curl
|
|
26
|
+
RUN apt-get install -y git
|
|
26
27
|
|
|
27
28
|
# install chrome
|
|
28
29
|
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
package/client/bootstrap.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import '@things-factory/auth-ui' /* for domain-switch */
|
|
2
|
+
import '@things-factory/notification'
|
|
3
|
+
import './menu'
|
|
4
|
+
import './viewparts/user-circle'
|
|
5
|
+
|
|
6
|
+
import { html } from 'lit-element'
|
|
7
|
+
|
|
1
8
|
import { APPEND_APP_TOOL } from '@things-factory/apptool-base'
|
|
9
|
+
import { auth } from '@things-factory/auth-base'
|
|
10
|
+
import { setAuthManagementMenus } from '@things-factory/auth-ui'
|
|
2
11
|
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@things-factory/layout-base'
|
|
3
12
|
import { setupMenuPart } from '@things-factory/lite-menu'
|
|
4
13
|
import { ADD_MORENDA } from '@things-factory/more-base'
|
|
5
|
-
import { auth } from '@things-factory/auth-base'
|
|
6
|
-
import '@things-factory/auth-ui' /* for domain-switch */
|
|
7
|
-
import { setAuthManagementMenus } from '@things-factory/auth-ui'
|
|
8
|
-
import '@things-factory/notification'
|
|
9
14
|
import { ADD_SETTING } from '@things-factory/setting-base'
|
|
10
15
|
import { navigate, store } from '@things-factory/shell'
|
|
11
16
|
import { isMobileDevice } from '@things-factory/utils'
|
|
12
|
-
import { html } from 'lit-element'
|
|
13
|
-
import mms from './reducers/mms'
|
|
14
17
|
|
|
15
|
-
import './menu'
|
|
16
|
-
import './viewparts/user-circle'
|
|
17
18
|
import { fetchMmsStatus } from './actions/mms'
|
|
19
|
+
import mms from './reducers/mms'
|
|
18
20
|
|
|
19
21
|
console.log(
|
|
20
22
|
`%c
|
|
@@ -92,6 +94,28 @@ export default function bootstrap() {
|
|
|
92
94
|
position: VIEWPART_POSITION.ASIDEBAR
|
|
93
95
|
})
|
|
94
96
|
|
|
97
|
+
store.dispatch({
|
|
98
|
+
type: ADD_MORENDA,
|
|
99
|
+
morenda: {
|
|
100
|
+
icon: html` <mwc-icon>device_hub</mwc-icon> `,
|
|
101
|
+
name: html` <i18n-msg msgid="text.connection"></i18n-msg> `,
|
|
102
|
+
action: () => {
|
|
103
|
+
navigate('connection')
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
store.dispatch({
|
|
109
|
+
type: ADD_MORENDA,
|
|
110
|
+
morenda: {
|
|
111
|
+
icon: html` <mwc-icon>format_list_numbered</mwc-icon> `,
|
|
112
|
+
name: html` <i18n-msg msgid="text.scenario"></i18n-msg> `,
|
|
113
|
+
action: () => {
|
|
114
|
+
navigate('scenario')
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
|
|
95
119
|
store.dispatch({
|
|
96
120
|
type: ADD_SETTING,
|
|
97
121
|
setting: {
|
|
@@ -99,12 +123,4 @@ export default function bootstrap() {
|
|
|
99
123
|
template: html` <notification-setting-let></notification-setting-let> `
|
|
100
124
|
}
|
|
101
125
|
})
|
|
102
|
-
|
|
103
|
-
// store.dispatch({
|
|
104
|
-
// type: APPEND_APP_TOOL,
|
|
105
|
-
// tool: {
|
|
106
|
-
// template: html` <user-circle> </user-circle> `,
|
|
107
|
-
// position: TOOL_POSITION.REAR
|
|
108
|
-
// }
|
|
109
|
-
// })
|
|
110
126
|
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
2
|
+
import { client, CustomAlert } from '@things-factory/shell'
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
import { css, html, LitElement } from 'lit-element'
|
|
5
|
+
|
|
6
|
+
class MarketplaceOrderMaxWeight extends localize(i18next)(LitElement) {
|
|
7
|
+
static get styles() {
|
|
8
|
+
return css`
|
|
9
|
+
[field-2column] {
|
|
10
|
+
background-color: var(--theme-white-color);
|
|
11
|
+
margin: var(--margin-wide) 0;
|
|
12
|
+
padding: var(--padding-wide);
|
|
13
|
+
border-radius: var(--border-radius);
|
|
14
|
+
box-shadow: var(--box-shadow);
|
|
15
|
+
max-width: var(--input-container-max-width);
|
|
16
|
+
}
|
|
17
|
+
[field-2column] mwc-button {
|
|
18
|
+
margin: var(--input-margin);
|
|
19
|
+
}
|
|
20
|
+
[field] {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
padding-bottom: var(--padding-default);
|
|
24
|
+
}
|
|
25
|
+
[grid-span] {
|
|
26
|
+
grid-column: span 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input {
|
|
30
|
+
border: var(--border-dark-color);
|
|
31
|
+
border-radius: var(--border-radius);
|
|
32
|
+
margin: var(--input-margin);
|
|
33
|
+
padding: var(--input-padding);
|
|
34
|
+
min-width: 250px;
|
|
35
|
+
font: var(--input-font);
|
|
36
|
+
}
|
|
37
|
+
label {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
|
|
41
|
+
font: var(--label-font);
|
|
42
|
+
color: var(--label-color);
|
|
43
|
+
text-transform: var(--label-text-transform);
|
|
44
|
+
}
|
|
45
|
+
mwc-button {
|
|
46
|
+
margin: var(--input-margin);
|
|
47
|
+
}
|
|
48
|
+
@media screen and (max-width: 480px) {
|
|
49
|
+
div {
|
|
50
|
+
display: grid;
|
|
51
|
+
}
|
|
52
|
+
[field] {
|
|
53
|
+
grid-column: span 2;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static get properties() {
|
|
60
|
+
return {
|
|
61
|
+
maxWeightSettings: Array
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
render() {
|
|
66
|
+
const maxWeightSettings = this.maxWeightSettings || []
|
|
67
|
+
return html`
|
|
68
|
+
<div field-2column>
|
|
69
|
+
<label>${i18next.t('label.order_max_weight')} </label>
|
|
70
|
+
<input name="maxWeight" value="" type="number" max="100" required />
|
|
71
|
+
|
|
72
|
+
<mwc-button
|
|
73
|
+
@click=${this.onUpdateMaxWeight.bind(this)}
|
|
74
|
+
outlined
|
|
75
|
+
label="${i18next.t('button.update')}"
|
|
76
|
+
></mwc-button>
|
|
77
|
+
|
|
78
|
+
<div>
|
|
79
|
+
${this.maxWeightSettings?.length
|
|
80
|
+
? this.maxWeightSettings.map(
|
|
81
|
+
setting => html` <label>${setting?.marketplaceStore.storeName}: ${setting.value}</label> `
|
|
82
|
+
)
|
|
83
|
+
: ''}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
`
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get maxWeightInput() {
|
|
90
|
+
return this.shadowRoot.querySelector('input[name=maxWeight]')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async onUpdateMaxWeight() {
|
|
94
|
+
try {
|
|
95
|
+
const marketplaceSettingPatch = this.maxWeightSettings.map(item => {
|
|
96
|
+
return {
|
|
97
|
+
id: item.id,
|
|
98
|
+
name: item.name,
|
|
99
|
+
marketplaceStore: { id: item.marketplaceStore.id },
|
|
100
|
+
category: item.category,
|
|
101
|
+
value: this.maxWeightInput.value
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
const result = await CustomAlert({
|
|
106
|
+
title: i18next.t('text.are_you_sure'),
|
|
107
|
+
text: i18next.t('text.do_you_want_to_update_x', { x: i18next.t('label.order_max_weight') }),
|
|
108
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
109
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
if (!result.value) return
|
|
113
|
+
|
|
114
|
+
const response = await client.mutate({
|
|
115
|
+
mutation: gql`
|
|
116
|
+
mutation updateMarketplaceSetting($marketplaceSettingPatch: [MarketplaceSettingPatch]!) {
|
|
117
|
+
updateMarketplaceSetting(marketplaceSettingPatch: $marketplaceSettingPatch)
|
|
118
|
+
}
|
|
119
|
+
`,
|
|
120
|
+
variables: { marketplaceSettingPatch }
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
if (!response.errors) {
|
|
124
|
+
await this.dispatchEvent(new CustomEvent('fetch-settings'))
|
|
125
|
+
|
|
126
|
+
await CustomAlert({
|
|
127
|
+
type: 'success',
|
|
128
|
+
title: i18next.t('text.completed'),
|
|
129
|
+
text: i18next.t('text.data_updated_successfully'),
|
|
130
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
} catch (e) {
|
|
134
|
+
this.showToast(e)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
validateInput(marketplaceSettingPatch) {
|
|
139
|
+
marketplaceSettingPatch.map(setting => {
|
|
140
|
+
const percentage = parseInt(setting.value)
|
|
141
|
+
if (isNaN(percentage) || percentage > 100 || percentage < 1)
|
|
142
|
+
throw new Error(i18next.t('text.max_weight_should_be_between_1_to_100'))
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
showToast({ type, message }) {
|
|
147
|
+
document.dispatchEvent(
|
|
148
|
+
new CustomEvent('notify', {
|
|
149
|
+
detail: {
|
|
150
|
+
type,
|
|
151
|
+
message
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
window.customElements.define('marketplace-order-max-weight', MarketplaceOrderMaxWeight)
|
|
@@ -99,7 +99,7 @@ class MmsHomeCards extends LitElement {
|
|
|
99
99
|
<li>
|
|
100
100
|
<a href=${`${mmsUrl}/${marketplaceStore.id}`}>
|
|
101
101
|
<mwc-icon>${'widgets'}</mwc-icon>
|
|
102
|
-
<strong>${marketplaceStore.
|
|
102
|
+
<strong>${marketplaceStore.storeName}</strong>
|
|
103
103
|
<span>${marketplaceStore.platform}</span>
|
|
104
104
|
</a>
|
|
105
105
|
</li>
|
|
@@ -12,12 +12,11 @@ class StockAllocationRatio extends localize(i18next)(LitElement) {
|
|
|
12
12
|
padding: var(--padding-wide);
|
|
13
13
|
border-radius: var(--border-radius);
|
|
14
14
|
box-shadow: var(--box-shadow);
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: 1fr 1fr;
|
|
17
|
-
gap: 5px 15px;
|
|
18
|
-
clear: both;
|
|
19
15
|
max-width: var(--input-container-max-width);
|
|
20
16
|
}
|
|
17
|
+
[field-2column] mwc-button {
|
|
18
|
+
margin: var(--input-margin);
|
|
19
|
+
}
|
|
21
20
|
[field] {
|
|
22
21
|
display: flex;
|
|
23
22
|
flex-direction: column;
|
|
@@ -71,29 +70,23 @@ class StockAllocationRatio extends localize(i18next)(LitElement) {
|
|
|
71
70
|
? ratioSettings.map(
|
|
72
71
|
setting =>
|
|
73
72
|
html`
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
required
|
|
83
|
-
/>
|
|
84
|
-
</label>
|
|
85
|
-
</div>
|
|
73
|
+
<label>${setting?.marketplaceStore.storeName} </label>
|
|
74
|
+
<input
|
|
75
|
+
name="${setting?.marketplaceStore.id}"
|
|
76
|
+
value="${parseInt(setting.value)}"
|
|
77
|
+
type="number"
|
|
78
|
+
max="100"
|
|
79
|
+
required
|
|
80
|
+
/>
|
|
86
81
|
`
|
|
87
82
|
)
|
|
88
83
|
: ''}
|
|
89
84
|
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
></mwc-button>
|
|
96
|
-
</div>
|
|
85
|
+
<mwc-button
|
|
86
|
+
@click=${this.onUpdateAllocationRatio.bind(this)}
|
|
87
|
+
outlined
|
|
88
|
+
label="${i18next.t('button.update')}"
|
|
89
|
+
></mwc-button>
|
|
97
90
|
</div>
|
|
98
91
|
`
|
|
99
92
|
}
|
|
@@ -107,6 +100,7 @@ class StockAllocationRatio extends localize(i18next)(LitElement) {
|
|
|
107
100
|
const marketplaceSettingPatch = Array.from(this.percentageInput).map(input => {
|
|
108
101
|
return {
|
|
109
102
|
marketplaceStore: { id: input.name },
|
|
103
|
+
category: this.category,
|
|
110
104
|
value: input.value
|
|
111
105
|
}
|
|
112
106
|
})
|
|
@@ -137,7 +137,7 @@ class Products extends localize(i18next)(PageView) {
|
|
|
137
137
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
138
138
|
{
|
|
139
139
|
type: 'string',
|
|
140
|
-
name: 'marketplaceStore|
|
|
140
|
+
name: 'marketplaceStore|storeName',
|
|
141
141
|
header: i18next.t('field.store_name'),
|
|
142
142
|
sortable: true,
|
|
143
143
|
imex: { header: i18next.t('field.store_name'), key: 'name', width: 25, type: 'string' },
|
|
@@ -230,6 +230,7 @@ class Products extends localize(i18next)(PageView) {
|
|
|
230
230
|
status
|
|
231
231
|
marketplaceStore {
|
|
232
232
|
name
|
|
233
|
+
storeName
|
|
233
234
|
}
|
|
234
235
|
updatedAt
|
|
235
236
|
createdAt
|
|
@@ -253,6 +253,7 @@ class WarehouseProducts extends localize(i18next)(PageView) {
|
|
|
253
253
|
id
|
|
254
254
|
name
|
|
255
255
|
platform
|
|
256
|
+
storeName
|
|
256
257
|
storeId
|
|
257
258
|
countryCode
|
|
258
259
|
status
|
|
@@ -276,7 +277,7 @@ class WarehouseProducts extends localize(i18next)(PageView) {
|
|
|
276
277
|
return {
|
|
277
278
|
type: 'string',
|
|
278
279
|
name: store.id.toString(),
|
|
279
|
-
header: store.name,
|
|
280
|
+
header: store.storeName ? store.storeName : store.name,
|
|
280
281
|
sortable: false,
|
|
281
282
|
width: 160,
|
|
282
283
|
handlers: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
|
|
3
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
8
|
import { client, PageView } from '@things-factory/shell'
|
|
5
|
-
import { ScrollbarStyles } from '@things-factory/styles'
|
|
9
|
+
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
6
10
|
import { flattenObject, gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
7
|
-
import gql from 'graphql-tag'
|
|
8
|
-
import { css, html } from 'lit-element'
|
|
9
11
|
|
|
10
12
|
class ProductVariations extends localize(i18next)(PageView) {
|
|
11
13
|
static get styles() {
|
|
@@ -42,6 +44,13 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
42
44
|
get context() {
|
|
43
45
|
return {
|
|
44
46
|
title: i18next.t('title.product_variations'),
|
|
47
|
+
actions: [
|
|
48
|
+
{
|
|
49
|
+
title: i18next.t('button.save'),
|
|
50
|
+
action: this._saveMarketplaceProductVariations.bind(this),
|
|
51
|
+
...CommonButtonStyles.save
|
|
52
|
+
}
|
|
53
|
+
],
|
|
45
54
|
exportable: {
|
|
46
55
|
name: i18next.t('title.product_variations'),
|
|
47
56
|
data: this._exportableData.bind(this)
|
|
@@ -100,10 +109,15 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
100
109
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
101
110
|
{
|
|
102
111
|
type: 'string',
|
|
103
|
-
name: 'marketplaceProduct|marketplaceStore|
|
|
112
|
+
name: 'marketplaceProduct|marketplaceStore|storeName',
|
|
104
113
|
header: i18next.t('field.store_name'),
|
|
105
114
|
sortable: true,
|
|
106
|
-
imex: {
|
|
115
|
+
imex: {
|
|
116
|
+
header: i18next.t('field.store_name'),
|
|
117
|
+
key: 'marketplaceProduct|marketplaceStore|storeName',
|
|
118
|
+
width: 25,
|
|
119
|
+
type: 'string'
|
|
120
|
+
},
|
|
107
121
|
width: 160
|
|
108
122
|
},
|
|
109
123
|
{
|
|
@@ -111,7 +125,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
111
125
|
name: 'marketplaceProduct|isku',
|
|
112
126
|
header: i18next.t('field.product_sku'),
|
|
113
127
|
sortable: true,
|
|
114
|
-
imex: { header: i18next.t('field.product_sku'), key: '
|
|
128
|
+
imex: { header: i18next.t('field.product_sku'), key: 'marketplaceProduct|isku', width: 25, type: 'string' },
|
|
115
129
|
record: { align: 'left' },
|
|
116
130
|
width: 400
|
|
117
131
|
},
|
|
@@ -120,7 +134,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
120
134
|
name: 'marketplaceProduct|name',
|
|
121
135
|
header: i18next.t('field.product_name'),
|
|
122
136
|
sortable: true,
|
|
123
|
-
imex: { header: i18next.t('field.product_name'), key: 'name', width: 25, type: 'string' },
|
|
137
|
+
imex: { header: i18next.t('field.product_name'), key: 'marketplaceProduct|name', width: 25, type: 'string' },
|
|
124
138
|
record: { align: 'left' },
|
|
125
139
|
width: 850
|
|
126
140
|
},
|
|
@@ -129,7 +143,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
129
143
|
name: 'channelSku',
|
|
130
144
|
header: i18next.t('field.channel_sku'),
|
|
131
145
|
sortable: true,
|
|
132
|
-
imex: { header: i18next.t('field.channel_sku'), key: '
|
|
146
|
+
imex: { header: i18next.t('field.channel_sku'), key: 'channelSku', width: 25, type: 'string' },
|
|
133
147
|
record: { align: 'left' },
|
|
134
148
|
width: 400
|
|
135
149
|
},
|
|
@@ -138,7 +152,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
138
152
|
name: 'variationSku',
|
|
139
153
|
header: i18next.t('field.variation_sku'),
|
|
140
154
|
sortable: true,
|
|
141
|
-
imex: { header: i18next.t('field.variation_sku'), key: '
|
|
155
|
+
imex: { header: i18next.t('field.variation_sku'), key: 'variationSku', width: 25, type: 'string' },
|
|
142
156
|
record: { align: 'left' },
|
|
143
157
|
width: 400
|
|
144
158
|
},
|
|
@@ -156,7 +170,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
156
170
|
name: 'description',
|
|
157
171
|
header: i18next.t('field.variation_description'),
|
|
158
172
|
sortable: true,
|
|
159
|
-
imex: { header: i18next.t('field.variation_description'), key: '
|
|
173
|
+
imex: { header: i18next.t('field.variation_description'), key: 'description', width: 25, type: 'string' },
|
|
160
174
|
record: { align: 'left' },
|
|
161
175
|
width: 850
|
|
162
176
|
},
|
|
@@ -165,7 +179,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
165
179
|
name: 'qty',
|
|
166
180
|
header: i18next.t('field.variation_qty'),
|
|
167
181
|
sortable: true,
|
|
168
|
-
imex: { header: i18next.t('field.variation_qty'), key: '
|
|
182
|
+
imex: { header: i18next.t('field.variation_qty'), key: 'qty', width: 25, type: 'string' },
|
|
169
183
|
record: { align: 'center' },
|
|
170
184
|
width: 150
|
|
171
185
|
},
|
|
@@ -174,7 +188,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
174
188
|
name: 'costPrice',
|
|
175
189
|
header: i18next.t('field.variation_cost_price'),
|
|
176
190
|
sortable: true,
|
|
177
|
-
imex: { header: i18next.t('field.variation_cost_price'), key: '
|
|
191
|
+
imex: { header: i18next.t('field.variation_cost_price'), key: 'costPrice', width: 25, type: 'string' },
|
|
178
192
|
record: { align: 'center' },
|
|
179
193
|
width: 150
|
|
180
194
|
},
|
|
@@ -183,16 +197,25 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
183
197
|
name: 'sellPrice',
|
|
184
198
|
header: i18next.t('field.variation_selling_price'),
|
|
185
199
|
sortable: true,
|
|
186
|
-
imex: { header: i18next.t('field.variation_selling_price'), key: '
|
|
200
|
+
imex: { header: i18next.t('field.variation_selling_price'), key: 'sellPrice', width: 25, type: 'string' },
|
|
187
201
|
record: { align: 'center' },
|
|
188
202
|
width: 150
|
|
189
203
|
},
|
|
204
|
+
{
|
|
205
|
+
type: 'float',
|
|
206
|
+
name: 'primaryUnitValue',
|
|
207
|
+
header: i18next.t('field.variation_uom_value'),
|
|
208
|
+
sortable: true,
|
|
209
|
+
imex: { header: i18next.t('field.variation_uom_value'), key: 'primaryUnitValue', width: 25, type: 'string' },
|
|
210
|
+
record: { align: 'center', editable: true },
|
|
211
|
+
width: 150
|
|
212
|
+
},
|
|
190
213
|
{
|
|
191
214
|
type: 'string',
|
|
192
215
|
name: 'status',
|
|
193
216
|
header: i18next.t('field.status'),
|
|
194
217
|
sortable: true,
|
|
195
|
-
imex: { header: i18next.t('field.status'), key: '
|
|
218
|
+
imex: { header: i18next.t('field.status'), key: 'status', width: 25, type: 'string' },
|
|
196
219
|
width: 180
|
|
197
220
|
},
|
|
198
221
|
{
|
|
@@ -200,7 +223,12 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
200
223
|
name: 'marketplaceStatus',
|
|
201
224
|
header: i18next.t('field.variation_marketplace_status'),
|
|
202
225
|
sortable: true,
|
|
203
|
-
imex: {
|
|
226
|
+
imex: {
|
|
227
|
+
header: i18next.t('field.variation_marketplace_status'),
|
|
228
|
+
key: 'marketplaceStatus',
|
|
229
|
+
width: 25,
|
|
230
|
+
type: 'string'
|
|
231
|
+
},
|
|
204
232
|
width: 180
|
|
205
233
|
},
|
|
206
234
|
{
|
|
@@ -269,6 +297,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
269
297
|
description
|
|
270
298
|
marketplaceStore{
|
|
271
299
|
name
|
|
300
|
+
storeName
|
|
272
301
|
description
|
|
273
302
|
}
|
|
274
303
|
}
|
|
@@ -289,6 +318,7 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
289
318
|
marketplaceStatus
|
|
290
319
|
afterTaxCostPrice
|
|
291
320
|
afterTaxSalesPrice
|
|
321
|
+
primaryUnitValue
|
|
292
322
|
updatedAt
|
|
293
323
|
}
|
|
294
324
|
total
|
|
@@ -307,6 +337,33 @@ class ProductVariations extends localize(i18next)(PageView) {
|
|
|
307
337
|
}
|
|
308
338
|
}
|
|
309
339
|
|
|
340
|
+
async _saveMarketplaceProductVariations() {
|
|
341
|
+
var patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
342
|
+
|
|
343
|
+
if (patches && patches.length) {
|
|
344
|
+
const response = await client.mutate({
|
|
345
|
+
mutation: gql`
|
|
346
|
+
mutation updateMultipleMarketplaceProductVariations($patches: [MarketplaceProductVariationPatch]!) {
|
|
347
|
+
updateMultipleMarketplaceProductVariations(patches: $patches)
|
|
348
|
+
}
|
|
349
|
+
`,
|
|
350
|
+
variables: {
|
|
351
|
+
patches
|
|
352
|
+
}
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
if (!response.errors) {
|
|
356
|
+
this.dataGrist.fetch()
|
|
357
|
+
this._showToast({ message: i18next.t('text.data_updated_successfully') })
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
CustomAlert({
|
|
361
|
+
title: i18next.t('text.nothing_changed'),
|
|
362
|
+
text: i18next.t('text.there_is_nothing_to_save')
|
|
363
|
+
})
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
310
367
|
async fetchStore(id) {
|
|
311
368
|
const response = await client.query({
|
|
312
369
|
query: gql`
|
|
@@ -253,6 +253,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
253
253
|
items {
|
|
254
254
|
id
|
|
255
255
|
name
|
|
256
|
+
storeName
|
|
256
257
|
platform
|
|
257
258
|
storeId
|
|
258
259
|
countryCode
|
|
@@ -310,7 +311,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
310
311
|
if (patches && patches.length) {
|
|
311
312
|
const response = await client.mutate({
|
|
312
313
|
mutation: gql`
|
|
313
|
-
mutation($patches: [MarketplaceProductVariationPatch]!) {
|
|
314
|
+
mutation updateMultipleMarketplaceProductVariationQuantity($patches: [MarketplaceProductVariationPatch]!) {
|
|
314
315
|
updateMultipleMarketplaceProductVariationQuantity(patches: $patches)
|
|
315
316
|
}
|
|
316
317
|
`,
|
|
@@ -334,7 +335,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
334
335
|
stores.push({
|
|
335
336
|
type: 'string',
|
|
336
337
|
name: store.id.toString() + '_store',
|
|
337
|
-
header: store.name,
|
|
338
|
+
header: store?.storeName ? store.storeName : store.name,
|
|
338
339
|
sortable: false,
|
|
339
340
|
record: { align: 'left' },
|
|
340
341
|
width: 160
|