@things-factory/biz-ui 10.1.123 → 10.1.135

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.
@@ -1,3 +1 @@
1
- export * from './connect-contact-points-popup'
2
- export * from './contact-points-popup'
3
1
  export * from './popup-partner-bizplaces-selector'
@@ -2,13 +2,11 @@ import '@things-factory/form-ui'
2
2
  import '@operato/data-grist'
3
3
  import { i18next, localize } from '@operato/i18n'
4
4
  import { openImportPopUp } from '@things-factory/import-ui'
5
- import { openPopup } from '@operato/layout'
6
5
  import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
6
  import { ScrollbarStyles, CommonButtonStyles, WorkSurfacePageStyles } from '@operato/styles'
8
7
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
9
8
  import gql from 'graphql-tag'
10
9
  import { css, html } from 'lit'
11
- import '../components/connect-contact-points-popup'
12
10
 
13
11
  class BizplaceList extends localize(i18next)(PageView) {
14
12
  static get properties() {
@@ -125,16 +123,6 @@ class BizplaceList extends localize(i18next)(PageView) {
125
123
  { type: 'gutter', gutterName: 'dirty' },
126
124
  { type: 'gutter', gutterName: 'sequence' },
127
125
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
128
- {
129
- type: 'gutter',
130
- gutterName: 'button',
131
- icon: 'reorder',
132
- handlers: {
133
- click: (_columns, _data, _column, record, _rowIndex) => {
134
- if (record.id && record.name) this._openContactPoints(record.id, record.name)
135
- }
136
- }
137
- },
138
126
  {
139
127
  type: 'string',
140
128
  name: 'name',
@@ -327,22 +315,6 @@ class BizplaceList extends localize(i18next)(PageView) {
327
315
  }
328
316
  }
329
317
 
330
- _openContactPoints(bizplaceId, bizplaceName) {
331
- openPopup(
332
- html`
333
- <connect-contact-point-popup
334
- .bizplaceId="${bizplaceId}"
335
- .bizplaceName="${bizplaceName}"
336
- ></connect-contact-point-popup>
337
- `,
338
- {
339
- backdrop: true,
340
- size: 'large',
341
- title: i18next.t('title.contact_point_list')
342
- }
343
- )
344
- }
345
-
346
318
  _exportableData() {
347
319
  let records = []
348
320
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
package/client/route.ts CHANGED
@@ -11,9 +11,5 @@ export default function route(page) {
11
11
  case 'partners':
12
12
  import('./pages/partner-list')
13
13
  return page
14
-
15
- case 'contact-points':
16
- import('./pages/contact-point-list')
17
- return page
18
14
  }
19
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/biz-ui",
3
- "version": "10.1.123",
3
+ "version": "10.1.135",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.ts",
6
6
  "things-factory": true,
@@ -27,12 +27,12 @@
27
27
  "@operato/data-grist": "^10.0.0",
28
28
  "@operato/layout": "^10.0.0",
29
29
  "@operato/styles": "^10.0.0",
30
- "@things-factory/biz-base": "^10.1.123",
30
+ "@things-factory/biz-base": "^10.1.135",
31
31
  "@things-factory/code-base": "^10.1.123",
32
32
  "@things-factory/form-ui": "^10.1.29",
33
33
  "@things-factory/i18n-base": "^10.1.123",
34
34
  "@things-factory/import-ui": "^10.1.123",
35
35
  "@things-factory/shell": "^10.1.123"
36
36
  },
37
- "gitHead": "9781f1eb37a7e6a37285878cff16f8683747eb7a"
37
+ "gitHead": "c693c5bc5a21fef4d5994ba352ff3427d030407e"
38
38
  }
@@ -15,10 +15,6 @@ export default {
15
15
  {
16
16
  tagname: 'partner-list',
17
17
  page: 'partners'
18
- },
19
- {
20
- tagname: 'contact-point-list',
21
- page: 'contact-points'
22
18
  }
23
19
  ],
24
20
  bootstrap
@@ -5,29 +5,9 @@
5
5
  "field.billing_address": "billing address",
6
6
  "field.company_name": "company name",
7
7
  "field.other_company": "other company",
8
- "title.contact_points": "contact points",
9
8
  "title.select_supplier": "select supplier",
10
9
  "text.bizplace_is_not_selected": "customer is not selected",
11
10
  "label.account_no": "account no",
12
- "text.invalid_form": "invalid form",
11
+ "text.invalid_form": "invalid form"
13
12
 
14
- "field.contact_point_customer_name": "Customer Name",
15
- "field.contact_point_company_name": "Company Name",
16
- "field.contact_point_other_company_name": "Other Company",
17
- "field.contact_point_company_description": "Description",
18
- "field.contact_point_email": "E-mail",
19
- "field.contact_point_phone": "Phone",
20
- "field.contact_point_company_address": "Address",
21
- "field.contact_point_company_address_2": "Address 2",
22
- "field.contact_point_postal_code": "Postal Code",
23
- "field.contact_point_city": "City",
24
- "field.contact_point_billing_address": "Billing Address",
25
- "field.contact_point_type": "Type",
26
- "field.contact_point_updater": "Updater",
27
- "field.contact_point_updated_at": "Updated At",
28
- "field.contact_point_state": "State",
29
- "field.contact_point_fax": "Fax",
30
- "field.contact_point_account_no": "Account No",
31
- "field.contact_point_registration_number": "Registration No",
32
- "field.contact_point_business_type": "Business Type"
33
13
  }
@@ -5,28 +5,8 @@
5
5
  "field.billing_address": "請求先住所",
6
6
  "field.company_name": "会社名",
7
7
  "field.other_company": "相手方会社",
8
- "title.contact_points": "連絡先",
9
8
  "title.select_supplier": "サプライヤー選択",
10
9
  "text.bizplace_is_not_selected": "顧客が選択されていません",
11
10
  "label.account_no": "口座番号",
12
- "text.invalid_form": "無効なフォーム",
13
- "field.contact_point_customer_name": "顧客企業名",
14
- "field.contact_point_company_name": "会社名",
15
- "field.contact_point_other_company_name": "相手方会社",
16
- "field.contact_point_company_description": "説明",
17
- "field.contact_point_email": "メール",
18
- "field.contact_point_phone": "電話番号",
19
- "field.contact_point_company_address": "住所",
20
- "field.contact_point_company_address_2": "住所 2",
21
- "field.contact_point_postal_code": "郵便番号",
22
- "field.contact_point_city": "市",
23
- "field.contact_point_billing_address": "請求先住所",
24
- "field.contact_point_type": "タイプ",
25
- "field.contact_point_updater": "更新者",
26
- "field.contact_point_updated_at": "更新日",
27
- "field.contact_point_state": "州",
28
- "field.contact_point_fax": "ファックス",
29
- "field.contact_point_account_no": "口座番号",
30
- "field.contact_point_registration_number": "登録番号",
31
- "field.contact_point_business_type": "業種"
11
+ "text.invalid_form": "無効なフォーム"
32
12
  }
@@ -5,28 +5,8 @@
5
5
  "field.billing_address": "청구지 주소",
6
6
  "field.company_name": "회사명",
7
7
  "field.other_company": "상대방 회사",
8
- "title.contact_points": "연락처",
9
8
  "title.select_supplier": "공급업체 선택",
10
9
  "text.bizplace_is_not_selected": "고객이 선택되지 않았습니다",
11
10
  "label.account_no": "계정번호",
12
- "text.invalid_form": "유효하지않은 양식",
13
- "field.contact_point_customer_name": "고객사명",
14
- "field.contact_point_company_name": "회사명",
15
- "field.contact_point_other_company_name": "상대방 회사",
16
- "field.contact_point_company_description": "설명",
17
- "field.contact_point_email": "이메일",
18
- "field.contact_point_phone": "전화번호",
19
- "field.contact_point_company_address": "주소",
20
- "field.contact_point_company_address_2": "주소 2",
21
- "field.contact_point_postal_code": "우편번호",
22
- "field.contact_point_city": "시",
23
- "field.contact_point_billing_address": "청구지 주소",
24
- "field.contact_point_type": "종류",
25
- "field.contact_point_updater": "수정자",
26
- "field.contact_point_updated_at": "수정일",
27
- "field.contact_point_state": "주",
28
- "field.contact_point_fax": "팩스",
29
- "field.contact_point_account_no": "계정 번호",
30
- "field.contact_point_registration_number": "등록번호",
31
- "field.contact_point_business_type": "종목"
11
+ "text.invalid_form": "유효하지않은 양식"
32
12
  }
@@ -5,28 +5,8 @@
5
5
  "field.billing_address": "alamat bil",
6
6
  "field.company_name": "nama syarikat",
7
7
  "field.other_company": "syarikat pihak lain",
8
- "title.contact_points": "titik hubungan",
9
8
  "title.select_supplier": "pilih pembekal",
10
9
  "text.bizplace_is_not_selected": "pelanggan tidak dipilih",
11
10
  "label.account_no": "nombor akaun",
12
- "text.invalid_form": "borang tidak sah",
13
- "field.contact_point_customer_name": "nama syarikat pelanggan",
14
- "field.contact_point_company_name": "nama syarikat",
15
- "field.contact_point_other_company_name": "syarikat pihak lain",
16
- "field.contact_point_company_description": "keterangan",
17
- "field.contact_point_email": "emel",
18
- "field.contact_point_phone": "nombor telefon",
19
- "field.contact_point_company_address": "alamat",
20
- "field.contact_point_company_address_2": "alamat 2",
21
- "field.contact_point_postal_code": "poskod",
22
- "field.contact_point_city": "bandar",
23
- "field.contact_point_billing_address": "alamat bil",
24
- "field.contact_point_type": "jenis",
25
- "field.contact_point_updater": "pengemaskini",
26
- "field.contact_point_updated_at": "tarikh dikemaskini",
27
- "field.contact_point_state": "negeri",
28
- "field.contact_point_fax": "faks",
29
- "field.contact_point_account_no": "nombor akaun",
30
- "field.contact_point_registration_number": "nombor pendaftaran",
31
- "field.contact_point_business_type": "jenis perniagaan"
11
+ "text.invalid_form": "borang tidak sah"
32
12
  }
@@ -5,28 +5,8 @@
5
5
  "field.billing_address": "账单地址",
6
6
  "field.company_name": "公司名称",
7
7
  "field.other_company": "对方公司",
8
- "title.contact_points": "联系点",
9
8
  "title.select_supplier": "选择供应商",
10
9
  "text.bizplace_is_not_selected": "客户未被选中",
11
10
  "label.account_no": "账号",
12
- "text.invalid_form": "无效表格",
13
- "field.contact_point_customer_name": "客户公司名",
14
- "field.contact_point_company_name": "公司名称",
15
- "field.contact_point_other_company_name": "对方公司",
16
- "field.contact_point_company_description": "描述",
17
- "field.contact_point_email": "电子邮件",
18
- "field.contact_point_phone": "电话号码",
19
- "field.contact_point_company_address": "地址",
20
- "field.contact_point_company_address_2": "地址 2",
21
- "field.contact_point_postal_code": "邮编",
22
- "field.contact_point_city": "城市",
23
- "field.contact_point_billing_address": "账单地址",
24
- "field.contact_point_type": "类型",
25
- "field.contact_point_updater": "更新者",
26
- "field.contact_point_updated_at": "更新日期",
27
- "field.contact_point_state": "州",
28
- "field.contact_point_fax": "传真",
29
- "field.contact_point_account_no": "账号",
30
- "field.contact_point_registration_number": "注册号",
31
- "field.contact_point_business_type": "行业"
11
+ "text.invalid_form": "无效表格"
32
12
  }
@@ -1,294 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@things-factory/form-ui'
3
- import '@operato/data-grist'
4
- import { i18next, localize } from '@operato/i18n'
5
- import { client, CustomAlert } from '@things-factory/shell'
6
- import { ScrollbarStyles, ButtonContainerStyles } from '@operato/styles'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
8
- import gql from 'graphql-tag'
9
- import { css, html, LitElement } from 'lit'
10
-
11
- export class ConnectContactPointsPopup extends localize(i18next)(LitElement) {
12
- static get styles() {
13
- return [
14
- ButtonContainerStyles,
15
- ScrollbarStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
- overflow: hidden;
21
- background-color: var(--md-sys-color-surface);
22
- }
23
- search-form {
24
- overflow: visible;
25
- }
26
- .grist {
27
- display: flex;
28
- flex-direction: column;
29
- flex: 1;
30
- overflow-y: auto;
31
- }
32
- ox-grist {
33
- overflow-y: hidden;
34
- flex: 1;
35
- }
36
- `
37
- ]
38
- }
39
-
40
- static get properties() {
41
- return {
42
- bizplaceId: String,
43
- searchFields: Array,
44
- config: Object
45
- }
46
- }
47
-
48
- get searchForm() {
49
- return this.shadowRoot.querySelector('search-form')
50
- }
51
-
52
- get dataGrist() {
53
- return this.shadowRoot.querySelector('ox-grist')
54
- }
55
-
56
- render() {
57
- return html`
58
- <search-form .fields=${this.searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
59
-
60
- <div class="grist">
61
- <ox-grist
62
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
63
- .config=${this.config}
64
- .fetchHandler=${this.fetchHandler.bind(this)}
65
- ></ox-grist>
66
- </div>
67
-
68
- <div class="button-container">
69
- <button danger @click=${this._deleteContactPoints}>
70
- <md-icon>remove_forever</md-icon>${i18next.t('button.delete')}
71
- </button>
72
- <button @click=${this._saveContactPoints}><md-icon>save</md-icon>${i18next.t('button.save')}</button>
73
- </div>
74
- `
75
- }
76
-
77
- firstUpdated() {
78
- this.searchFields = [
79
- {
80
- label: i18next.t('field.name'),
81
- name: 'name',
82
- type: 'text',
83
- props: { searchOper: 'i_like' }
84
- },
85
- {
86
- label: i18next.t('field.email'),
87
- name: 'email',
88
- type: 'text',
89
- props: { searchOper: 'i_like' }
90
- },
91
- {
92
- label: i18next.t('field.fax'),
93
- name: 'fax',
94
- type: 'text',
95
- props: { searchOper: 'i_like' }
96
- },
97
- {
98
- label: i18next.t('field.phone'),
99
- name: 'phone',
100
- type: 'text',
101
- props: { searchOper: 'i_like' }
102
- },
103
- {
104
- label: i18next.t('field.description'),
105
- name: 'description',
106
- type: 'text',
107
- props: { searchOper: 'i_like' }
108
- }
109
- ]
110
-
111
- this.config = {
112
- rows: {
113
- selectable: {
114
- multiple: true
115
- }
116
- },
117
- columns: [
118
- { type: 'gutter', gutterName: 'dirty' },
119
- { type: 'gutter', gutterName: 'sequence' },
120
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
121
- {
122
- type: 'string',
123
- name: 'name',
124
- record: { editable: true },
125
- header: i18next.t('field.name'),
126
- width: 120
127
- },
128
- {
129
- type: 'string',
130
- name: 'description',
131
- record: { editable: true },
132
- header: i18next.t('field.description'),
133
- width: 220
134
- },
135
- {
136
- type: 'string',
137
- name: 'email',
138
- record: { editable: true },
139
- header: i18next.t('field.email'),
140
- width: 120
141
- },
142
- {
143
- type: 'string',
144
- name: 'fax',
145
- record: { editable: true },
146
- header: i18next.t('field.fax'),
147
- width: 120
148
- },
149
- {
150
- type: 'string',
151
- name: 'phone',
152
- record: { editable: true },
153
- header: i18next.t('field.phone'),
154
- width: 120
155
- },
156
- {
157
- type: 'string',
158
- name: 'address',
159
- record: { editable: true },
160
- header: i18next.t('field.address'),
161
- width: 300
162
- },
163
- {
164
- type: 'object',
165
- name: 'updater',
166
- header: i18next.t('field.updater'),
167
- width: 150
168
- },
169
- {
170
- type: 'datetime',
171
- name: 'updatedAt',
172
- header: i18next.t('field.updated_at'),
173
- width: 150
174
- }
175
- ]
176
- }
177
- }
178
-
179
- async fetchHandler({ page, limit, sorters = [{ name: 'name' }] }) {
180
- let filters = []
181
- if (this.bizplaceId) {
182
- filters.push({
183
- name: 'bizplace',
184
- operator: 'eq',
185
- value: this.bizplaceId
186
- })
187
- }
188
-
189
- const response = await client.query({
190
- query: gql`
191
- query {
192
- contactPoints(${gqlBuilder.buildArgs({
193
- filters: [...filters, ...this.searchForm.queryFilters],
194
- pagination: { page, limit },
195
- sortings: sorters
196
- })}) {
197
- items {
198
- id
199
- name
200
- email
201
- fax
202
- phone
203
- address
204
- description
205
- updatedAt
206
- updater{
207
- name
208
- description
209
- }
210
- }
211
- total
212
- }
213
- }
214
- `
215
- })
216
-
217
- return {
218
- total: response.data.contactPoints.total || 0,
219
- records: response.data.contactPoints.items || []
220
- }
221
- }
222
-
223
- async _saveContactPoints() {
224
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
225
- if (patches && patches.length) {
226
- patches = patches.map(contactPoint => {
227
- return {
228
- ...contactPoint,
229
- bizplace: { id: this.bizplaceId }
230
- }
231
- })
232
-
233
- const response = await client.query({
234
- query: gql`
235
- mutation {
236
- updateMultipleContactPoint(${gqlBuilder.buildArgs({
237
- patches
238
- })}) {
239
- name
240
- }
241
- }
242
- `
243
- })
244
-
245
- if (!response.errors) {
246
- this.dataGrist.fetch()
247
- this.showToast(i18next.t('text.data_updated_successfully'))
248
- }
249
- } else {
250
- CustomAlert({
251
- title: i18next.t('text.nothing_changed'),
252
- text: i18next.t('text.there_is_nothing_to_save')
253
- })
254
- }
255
- }
256
-
257
- async _deleteContactPoints() {
258
- const ids = this.dataGrist.selected.map(record => record.id)
259
- if (ids && ids.length > 0) {
260
- const answer = await CustomAlert({
261
- type: 'warning',
262
- title: i18next.t('button.delete'),
263
- text: i18next.t('text.are_you_sure'),
264
- confirmButton: { text: i18next.t('button.delete') },
265
- cancelButton: { text: i18next.t('button.cancel') }
266
- })
267
-
268
- if (!answer.value) return
269
-
270
- const response = await client.query({
271
- query: gql`
272
- mutation {
273
- deleteContactPoints(${gqlBuilder.buildArgs({ ids })})
274
- }
275
- `
276
- })
277
- if (!response.errors) {
278
- this.dataGrist.fetch()
279
- this.showToast(i18next.t('text.data_deleted_successfully'))
280
- }
281
- } else {
282
- CustomAlert({
283
- title: i18next.t('text.nothing_selected'),
284
- text: i18next.t('text.there_is_nothing_to_delete')
285
- })
286
- }
287
- }
288
-
289
- showToast(message) {
290
- document.dispatchEvent(new CustomEvent('notify', { detail: { message } }))
291
- }
292
- }
293
-
294
- window.customElements.define('connect-contact-point-popup', ConnectContactPointsPopup)