@things-factory/biz-ui 4.3.35 → 4.3.43

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.
@@ -14,7 +14,7 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
14
14
  config: Object,
15
15
  data: Object,
16
16
  type: String,
17
- partnerBizplaceId: String
17
+ partnerBizplaceIds: Array
18
18
  }
19
19
  }
20
20
 
@@ -71,6 +71,11 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
71
71
  ]
72
72
  }
73
73
 
74
+ constructor() {
75
+ super()
76
+ this.partnerBizplaceIds = []
77
+ }
78
+
74
79
  render() {
75
80
  return html`
76
81
  <search-form id="search-form" .fields=${this._searchFields} @submit=${() => this.dataGrist.fetch()}></search-form>
@@ -86,6 +91,8 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
86
91
  </div>
87
92
 
88
93
  <div class="button-container">
94
+ <mwc-button @click=${this._cancel.bind(this)} label="${`${i18next.t('button.cancel')}`}" raised></mwc-button>
95
+
89
96
  <mwc-button
90
97
  @click=${this._selectBizplace.bind(this)}
91
98
  label="${`${i18next.t('button.confirm')}`}"
@@ -105,17 +112,12 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
105
112
  selectable: {
106
113
  multiple: false
107
114
  },
108
- appendable: false
115
+ appendable: false,
116
+ handlers: { dblclick: this._dblClickHandler.bind(this) }
109
117
  },
110
118
  columns: [
111
119
  { type: 'gutter', gutterName: 'sequence' },
112
120
  { type: 'gutter', gutterName: 'row-selector', multiple: false },
113
- {
114
- type: 'string',
115
- name: 'companyName',
116
- header: i18next.t('field.company'),
117
- width: 300
118
- },
119
121
  {
120
122
  type: 'string',
121
123
  name: 'accountNo',
@@ -124,21 +126,51 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
124
126
  },
125
127
  {
126
128
  type: 'string',
127
- name: 'name',
128
- header: i18next.t('field.name'),
129
+ name: 'companyName',
130
+ header: i18next.t('field.company'),
129
131
  width: 300
130
132
  },
131
133
  {
132
134
  type: 'string',
133
- name: 'email',
134
- header: i18next.t('field.email'),
135
- width: 150
135
+ name: 'name',
136
+ header: i18next.t('field.name'),
137
+ width: 300
136
138
  },
137
139
  {
138
140
  type: 'string',
139
141
  name: 'description',
140
142
  header: i18next.t('field.description'),
141
143
  width: 350
144
+ },
145
+ {
146
+ type: 'string',
147
+ name: 'fullAddress',
148
+ header: i18next.t('field.delivery_address'),
149
+ width: 350
150
+ },
151
+ {
152
+ type: 'string',
153
+ name: 'billingAddress',
154
+ header: i18next.t('field.billing_address'),
155
+ width: 350
156
+ },
157
+ {
158
+ type: 'string',
159
+ name: 'phone',
160
+ header: i18next.t('field.phone'),
161
+ width: 350
162
+ },
163
+ {
164
+ type: 'string',
165
+ name: 'fax',
166
+ header: i18next.t('field.fax'),
167
+ width: 350
168
+ },
169
+ {
170
+ type: 'string',
171
+ name: 'email',
172
+ header: i18next.t('field.email'),
173
+ width: 150
142
174
  }
143
175
  ]
144
176
  }
@@ -161,6 +193,12 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
161
193
  name: 'name',
162
194
  type: 'text',
163
195
  props: { searchOper: 'i_like' }
196
+ },
197
+ {
198
+ label: i18next.t('label.contact'),
199
+ name: 'phone',
200
+ type: 'text',
201
+ props: { searchOper: 'i_like' }
164
202
  }
165
203
  ]
166
204
  }
@@ -177,8 +215,8 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
177
215
  let filters = await this.searchForm.getQueryFilters()
178
216
 
179
217
  if (this.type) filters = [...filters, { name: 'type', operator: 'eq', value: this.type }]
180
- if (this.partnerBizplaceId)
181
- filters = [...filters, { name: 'bizplace_id', operator: 'eq', value: this.partnerBizplaceId }]
218
+ if (this.partnerBizplaceIds && this.partnerBizplaceIds.length > 0)
219
+ filters = [...filters, { name: 'bizplace_id', operator: 'in', value: this.partnerBizplaceIds }]
182
220
 
183
221
  const response = await client.query({
184
222
  query: gql`
@@ -191,6 +229,14 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
191
229
  companyName
192
230
  email
193
231
  accountNo
232
+ phone
233
+ fax
234
+ address
235
+ address2
236
+ postCode
237
+ city
238
+ state
239
+ billingAddress
194
240
  }
195
241
  total
196
242
  }
@@ -201,7 +247,17 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
201
247
 
202
248
  return {
203
249
  total: response.data.contactPoints.total || 0,
204
- records: response.data.contactPoints.items || []
250
+ records:
251
+ response.data.contactPoints.items.map(res => {
252
+ return {
253
+ ...res,
254
+ fullAddress: res.address
255
+ ? `${res.address ? res.address : ''} ${res.address2 ? res.address : ''} ${
256
+ res.postCode ? res.postCode + ',' : ''
257
+ } ${res.city ? res.city + ',' : ''} ${res.state ? res.state + ',' : ''} Malaysia`
258
+ : ''
259
+ }
260
+ }) || []
205
261
  }
206
262
  }
207
263
 
@@ -216,6 +272,15 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
216
272
  )
217
273
  }
218
274
  }
275
+
276
+ _dblClickHandler(columns, data, column, record, rowIndex, target) {
277
+ this.dispatchEvent(new CustomEvent('selected', { detail: record }))
278
+ history.back()
279
+ }
280
+
281
+ _cancel() {
282
+ history.back()
283
+ }
219
284
  }
220
285
 
221
286
  window.customElements.define('contact-points-popup', ContactPointsPopup)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/biz-ui",
3
- "version": "4.3.35",
3
+ "version": "4.3.43",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,8 +24,8 @@
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.35",
28
- "@things-factory/code-base": "^4.3.35",
27
+ "@things-factory/biz-base": "^4.3.40",
28
+ "@things-factory/code-base": "^4.3.40",
29
29
  "@things-factory/form-ui": "^4.3.35",
30
30
  "@things-factory/grist-ui": "^4.3.35",
31
31
  "@things-factory/i18n-base": "^4.3.35",
@@ -33,5 +33,5 @@
33
33
  "@things-factory/layout-base": "^4.3.35",
34
34
  "@things-factory/shell": "^4.3.35"
35
35
  },
36
- "gitHead": "3500a8c074e7ec6d112454b0b0631fcc9e41b886"
36
+ "gitHead": "45b1a76384731ef43ba872c9867fa56bc3b491ec"
37
37
  }