@things-factory/sales-ui 4.0.26 → 4.0.30

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.
@@ -12,7 +12,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
12
12
  import { fetchSettingRule } from '@things-factory/setting-ui'
13
13
  import { client, CustomAlert, gqlContext, navigate, PageView, store } from '@things-factory/shell'
14
14
  import { CommonButtonStyles } from '@things-factory/styles'
15
- import { flattenObject, gqlBuilder, isMobileDevice } from '@things-factory/utils'
15
+ import { flattenObject, isMobileDevice } from '@things-factory/utils'
16
16
 
17
17
  import { PURCHASE_ORDER_STATUS } from '../../constants'
18
18
 
@@ -798,10 +798,8 @@ class PurchaseOrderApprovalDetail extends connect(store)(localize(i18next)(PageV
798
798
 
799
799
  const response = await client.query({
800
800
  query: gql`
801
- query {
802
- purchaseOrder(${gqlBuilder.buildArgs({
803
- name: this._poNo
804
- })}) {
801
+ query purchaseOrder($name: String!) {
802
+ purchaseOrder(name: $name) {
805
803
  id
806
804
  name
807
805
  remark
@@ -865,13 +863,13 @@ class PurchaseOrderApprovalDetail extends connect(store)(localize(i18next)(PageV
865
863
  name
866
864
  description
867
865
  }
868
- supplier{
866
+ supplier {
869
867
  id
870
868
  name
871
869
  companyName
872
870
  description
873
871
  }
874
- bufferLocation{
872
+ bufferLocation {
875
873
  id
876
874
  name
877
875
  description
@@ -890,7 +888,10 @@ class PurchaseOrderApprovalDetail extends connect(store)(localize(i18next)(PageV
890
888
  }
891
889
  }
892
890
  }
893
- `
891
+ `,
892
+ variables: {
893
+ name: this._poNo
894
+ }
894
895
  })
895
896
 
896
897
  if (!response.errors) {
@@ -4,7 +4,7 @@ import '@things-factory/grist-ui'
4
4
  import { i18next, localize } from '@things-factory/i18n-base'
5
5
  import { client, navigate, PageView } from '@things-factory/shell'
6
6
  import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
9
  import { css, html } from 'lit-element'
10
10
  // import { ORDER_STATUS } from '../../constants'
@@ -235,12 +235,8 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
235
235
  async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
236
236
  const response = await client.query({
237
237
  query: gql`
238
- query {
239
- purchaseOrders(${gqlBuilder.buildArgs({
240
- filters: this.searchForm.queryFilters,
241
- pagination: { page, limit },
242
- sortings: sorters
243
- })}) {
238
+ query purchaseOrders($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
239
+ purchaseOrders(filters: $filters, pagination: $pagination, sortings: $sortings) {
244
240
  items {
245
241
  id
246
242
  name
@@ -256,8 +252,8 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
256
252
  container
257
253
  ownTransport
258
254
  importCargo
259
- currency
260
- arrivalNotice{
255
+ currency
256
+ arrivalNotice {
261
257
  id
262
258
  name
263
259
  description
@@ -267,7 +263,7 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
267
263
  name
268
264
  description
269
265
  }
270
- supplier{
266
+ supplier {
271
267
  id
272
268
  name
273
269
  description
@@ -288,7 +284,12 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
288
284
  total
289
285
  }
290
286
  }
291
- `
287
+ `,
288
+ variables: {
289
+ filters: this.searchForm.queryFilters,
290
+ pagination: { page, limit },
291
+ sortings: sorters
292
+ }
292
293
  })
293
294
 
294
295
  if (!response.errors) {
@@ -302,12 +303,8 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
302
303
  async _fetchContactPoints() {
303
304
  const response = await client.query({
304
305
  query: gql`
305
- query {
306
- contactPoints(${gqlBuilder.buildArgs({
307
- filters: [{ name: 'type', operator: 'eq', value: 'SUPPLIER' }],
308
- pagination: { page: 0, limit: 999999 },
309
- sortings: [{ name: 'name' }]
310
- })}) {
306
+ query contactPoints($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
307
+ contactPoints(filters: $filters, pagination: $pagination, sortings: $sortings) {
311
308
  items {
312
309
  id
313
310
  name
@@ -315,7 +312,12 @@ class PurchaseOrderApprovalList extends localize(i18next)(PageView) {
315
312
  }
316
313
  }
317
314
  }
318
- `
315
+ `,
316
+ variables: {
317
+ filters: [{ name: 'type', operator: 'eq', value: 'SUPPLIER' }],
318
+ pagination: { page: 0, limit: 999999 },
319
+ sortings: [{ name: 'name' }]
320
+ }
319
321
  })
320
322
 
321
323
  return response.data.contactPoints.items || []
@@ -13,7 +13,7 @@ import { openPopup } from '@things-factory/layout-base'
13
13
  import { fetchSettingRule } from '@things-factory/setting-ui'
14
14
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
15
15
  import { CommonButtonStyles } from '@things-factory/styles'
16
- import { flattenObject, gqlBuilder, isMobileDevice } from '@things-factory/utils'
16
+ import { flattenObject, isMobileDevice } from '@things-factory/utils'
17
17
 
18
18
  import { PURCHASE_ORDER_STATUS } from '../../constants'
19
19
 
@@ -940,17 +940,23 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
940
940
  }
941
941
  }
942
942
 
943
- const response = await client.query({
944
- query: gql`
945
- mutation ($attachments: Upload) {
946
- upsertPurchaseOrder(${gqlBuilder.buildArgs(args)}, file:$attachments) {
947
- id
948
- name
949
- }
943
+ const response = await client.mutate({
944
+ mutation: gql`
945
+ mutation upsertPurchaseOrder($purchaseOrder: PurchaseOrderPatch!, $attachments: Upload) {
946
+ upsertPurchaseOrder(purchaseOrder: $purchaseOrder, file: $attachments) {
947
+ id
948
+ name
950
949
  }
951
- `,
950
+ }
951
+ `,
952
952
  variables: {
953
- attachments
953
+ attachments,
954
+ purchaseOrder: {
955
+ ...purchaseOrder,
956
+ status,
957
+ ownTransport: this._purchaseOrderData?.importCargo ? true : this._purchaseOrderData?.ownTransport,
958
+ supplier: { id: purchaseOrder?.supplier?.id }
959
+ }
954
960
  },
955
961
  context: {
956
962
  hasUpload: true
@@ -984,10 +990,8 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
984
990
  this._status = ''
985
991
  const response = await client.query({
986
992
  query: gql`
987
- query {
988
- purchaseOrder(${gqlBuilder.buildArgs({
989
- name: this._poNo
990
- })}) {
993
+ query purchaseOrder($name: String!) {
994
+ purchaseOrder(name: $name) {
991
995
  id
992
996
  name
993
997
  remark
@@ -1051,13 +1055,13 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1051
1055
  name
1052
1056
  description
1053
1057
  }
1054
- supplier{
1058
+ supplier {
1055
1059
  id
1056
1060
  name
1057
1061
  companyName
1058
1062
  description
1059
1063
  }
1060
- bufferLocation{
1064
+ bufferLocation {
1061
1065
  id
1062
1066
  name
1063
1067
  description
@@ -1076,7 +1080,10 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1076
1080
  }
1077
1081
  }
1078
1082
  }
1079
- `
1083
+ `,
1084
+ variables: {
1085
+ name: this._poNo
1086
+ }
1080
1087
  })
1081
1088
 
1082
1089
  if (!response.errors) {
@@ -4,7 +4,7 @@ import '@things-factory/grist-ui'
4
4
  import { i18next, localize } from '@things-factory/i18n-base'
5
5
  import { client, navigate, PageView } from '@things-factory/shell'
6
6
  import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
9
  import { css, html } from 'lit-element'
10
10
  // import { ORDER_STATUS } from '../../constants'
@@ -242,12 +242,8 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
242
242
  async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
243
243
  const response = await client.query({
244
244
  query: gql`
245
- query {
246
- purchaseOrders(${gqlBuilder.buildArgs({
247
- filters: this.searchForm.queryFilters,
248
- pagination: { page, limit },
249
- sortings: sorters
250
- })}) {
245
+ query purchaseOrders($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
246
+ purchaseOrders(filters: $filters, pagination: $pagination, sortings: $sortings) {
251
247
  items {
252
248
  id
253
249
  name
@@ -263,8 +259,8 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
263
259
  container
264
260
  ownTransport
265
261
  importCargo
266
- currency
267
- arrivalNotice{
262
+ currency
263
+ arrivalNotice {
268
264
  id
269
265
  name
270
266
  description
@@ -274,7 +270,7 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
274
270
  name
275
271
  description
276
272
  }
277
- supplier{
273
+ supplier {
278
274
  id
279
275
  name
280
276
  description
@@ -295,7 +291,12 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
295
291
  total
296
292
  }
297
293
  }
298
- `
294
+ `,
295
+ variables: {
296
+ filters: this.searchForm.queryFilters,
297
+ pagination: { page, limit },
298
+ sortings: sorters
299
+ }
299
300
  })
300
301
 
301
302
  if (!response.errors) {
@@ -317,12 +318,8 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
317
318
  async _fetchContactPoints() {
318
319
  const response = await client.query({
319
320
  query: gql`
320
- query {
321
- contactPoints(${gqlBuilder.buildArgs({
322
- filters: [{ name: 'type', operator: 'eq', value: 'SUPPLIER' }],
323
- pagination: { page: 0, limit: 999999 },
324
- sortings: [{ name: 'name' }]
325
- })}) {
321
+ query contactPoints($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
322
+ contactPoints(filters: $filters, pagination: $pagination, sortings: $sortings) {
326
323
  items {
327
324
  id
328
325
  name
@@ -330,7 +327,12 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
330
327
  }
331
328
  }
332
329
  }
333
- `
330
+ `,
331
+ variables: {
332
+ filters: [{ name: 'type', operator: 'eq', value: 'SUPPLIER' }],
333
+ pagination: { page: 0, limit: 999999 },
334
+ sortings: [{ name: 'name' }]
335
+ }
334
336
  })
335
337
 
336
338
  return response.data.contactPoints.items || []
@@ -299,7 +299,7 @@ class VasList extends localize(i18next)(PageView) {
299
299
 
300
300
  const response = await client.mutate({
301
301
  mutation: gql`
302
- mutation updateMultipleVas($patches: [VasPatch!]) {
302
+ mutation updateMultipleVas($patches: [VasPatch!]!) {
303
303
  updateMultipleVas(patches: $patches) {
304
304
  name
305
305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/sales-ui",
3
- "version": "4.0.26",
3
+ "version": "4.0.30",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,15 +24,15 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/code-base": "^4.0.26",
28
- "@things-factory/form-ui": "^4.0.26",
29
- "@things-factory/grist-ui": "^4.0.26",
30
- "@things-factory/i18n-base": "^4.0.26",
31
- "@things-factory/import-ui": "^4.0.26",
32
- "@things-factory/sales-base": "^4.0.26",
33
- "@things-factory/setting-ui": "^4.0.26",
34
- "@things-factory/shell": "^4.0.26",
35
- "@things-factory/warehouse-ui": "^4.0.26"
27
+ "@things-factory/code-base": "^4.0.30",
28
+ "@things-factory/form-ui": "^4.0.30",
29
+ "@things-factory/grist-ui": "^4.0.30",
30
+ "@things-factory/i18n-base": "^4.0.30",
31
+ "@things-factory/import-ui": "^4.0.30",
32
+ "@things-factory/sales-base": "^4.0.30",
33
+ "@things-factory/setting-ui": "^4.0.30",
34
+ "@things-factory/shell": "^4.0.30",
35
+ "@things-factory/warehouse-ui": "^4.0.30"
36
36
  },
37
- "gitHead": "c4b39c74b9ce2472f30c26eb36ec62054c1ecf82"
37
+ "gitHead": "4ab590326e3fc60d113fb438e90eefee708f1f19"
38
38
  }