@things-factory/integration-ui 9.0.20 → 9.0.25

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.
Files changed (38) hide show
  1. package/client/pages/connection.ts +72 -3
  2. package/client/pages/integration-monitor.ts +22 -5
  3. package/client/pages/scenario.ts +1 -1
  4. package/client/types.ts +9 -0
  5. package/client/viewparts/connections-monitor.ts +29 -6
  6. package/client/viewparts/scenario-monitor.ts +15 -5
  7. package/client/viewparts/scenarios-monitor.ts +20 -2
  8. package/dist-client/pages/connection.js +61 -3
  9. package/dist-client/pages/connection.js.map +1 -1
  10. package/dist-client/pages/integration-monitor.js +19 -4
  11. package/dist-client/pages/integration-monitor.js.map +1 -1
  12. package/dist-client/pages/scenario.js +1 -1
  13. package/dist-client/pages/scenario.js.map +1 -1
  14. package/dist-client/tsconfig.tsbuildinfo +1 -1
  15. package/dist-client/types.d.ts +13 -0
  16. package/dist-client/types.js +2 -0
  17. package/dist-client/types.js.map +1 -0
  18. package/dist-client/viewparts/connections-monitor.d.ts +3 -0
  19. package/dist-client/viewparts/connections-monitor.js +37 -5
  20. package/dist-client/viewparts/connections-monitor.js.map +1 -1
  21. package/dist-client/viewparts/scenario-monitor.d.ts +1 -0
  22. package/dist-client/viewparts/scenario-monitor.js +17 -4
  23. package/dist-client/viewparts/scenario-monitor.js.map +1 -1
  24. package/dist-client/viewparts/scenarios-monitor.d.ts +3 -0
  25. package/dist-client/viewparts/scenarios-monitor.js +23 -2
  26. package/dist-client/viewparts/scenarios-monitor.js.map +1 -1
  27. package/dist-server/tsconfig.tsbuildinfo +1 -1
  28. package/helps/integration/ui/connection.ja.md +2 -0
  29. package/helps/integration/ui/connection.ko.md +2 -0
  30. package/helps/integration/ui/connection.md +2 -0
  31. package/helps/integration/ui/connection.ms.md +2 -0
  32. package/helps/integration/ui/connection.zh.md +2 -0
  33. package/package.json +6 -6
  34. package/translations/en.json +3 -1
  35. package/translations/ja.json +3 -1
  36. package/translations/ko.json +3 -1
  37. package/translations/ms.json +3 -1
  38. package/translations/zh.json +3 -1
@@ -16,6 +16,55 @@ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato
16
16
  import { isMobileDevice } from '@operato/utils'
17
17
  import { FetchOption } from '@operato/data-grist'
18
18
  import { p13n } from '@operato/p13n'
19
+ import { PropertySpec } from '../types.js'
20
+
21
+ async function copyToClipboard(text: string): Promise<void> {
22
+ try {
23
+ await navigator.clipboard.writeText(text)
24
+ } catch (err) {
25
+ // fallback: old way
26
+ const textArea = document.createElement('textarea')
27
+ textArea.value = text
28
+ document.body.appendChild(textArea)
29
+ textArea.select()
30
+ document.execCommand('copy')
31
+ document.body.removeChild(textArea)
32
+ }
33
+ }
34
+
35
+ function createActionInjector(
36
+ connectionName: string
37
+ ): (propName: string, propSpec: PropertySpec) => HTMLElement | null {
38
+ return (propName: string, propSpec: PropertySpec): HTMLElement | null => {
39
+ if (!propSpec.useDomainAttribute) {
40
+ return null
41
+ }
42
+
43
+ const attributeName = `Connection::${connectionName}::${propName}`
44
+
45
+ const copyIcon = document.createElement('md-icon')
46
+ copyIcon.textContent = 'dictionary'
47
+ copyIcon.style.cssText =
48
+ 'cursor: pointer; color: var(--md-sys-color-primary); font-size: 16px; --md-icon-size: 16px;'
49
+ copyIcon.title = `Copy ${attributeName}`
50
+
51
+ copyIcon.addEventListener('click', () => {
52
+ copyToClipboard(attributeName)
53
+
54
+ // 복사 성공 피드백
55
+ const originalText = copyIcon.textContent
56
+ copyIcon.textContent = 'check'
57
+ copyIcon.style.color = 'var(--md-sys-color-tertiary)'
58
+
59
+ setTimeout(() => {
60
+ copyIcon.textContent = originalText
61
+ copyIcon.style.color = 'var(--md-sys-color-primary)'
62
+ }, 1000)
63
+ })
64
+
65
+ return copyIcon
66
+ }
67
+ }
19
68
 
20
69
  @customElement('connection-page')
21
70
  export class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {
@@ -175,7 +224,7 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
175
224
  type: 'checkbox',
176
225
  name: 'active',
177
226
  label: true,
178
- header: i18next.t('field.active'),
227
+ header: i18next.t('field.startup-connect'),
179
228
  record: {
180
229
  editable: true,
181
230
  align: 'center'
@@ -183,6 +232,16 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
183
232
  sortable: true,
184
233
  width: 60
185
234
  },
235
+ {
236
+ type: 'checkbox',
237
+ name: 'onDemand',
238
+ label: true,
239
+ header: i18next.t('field.on-demand'),
240
+ record: {
241
+ editable: true
242
+ },
243
+ width: 120
244
+ },
186
245
  {
187
246
  type: 'connector',
188
247
  name: 'type',
@@ -208,7 +267,7 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
208
267
  },
209
268
  filter: 'search',
210
269
  sortable: true,
211
- width: 200
270
+ width: 280
212
271
  },
213
272
  {
214
273
  type: 'parameters',
@@ -219,7 +278,15 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
219
278
  options: async (value, column, record, row, field) => {
220
279
  const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : ({} as any)
221
280
  const context = this.grist
222
- return { name, help, spec, context, objectified: true }
281
+
282
+ return {
283
+ name,
284
+ help,
285
+ spec,
286
+ context,
287
+ objectified: true,
288
+ actionInjector: createActionInjector(record.name)
289
+ }
223
290
  },
224
291
  renderer: 'json5'
225
292
  },
@@ -293,6 +360,7 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
293
360
  }
294
361
  endpoint
295
362
  active
363
+ onDemand
296
364
  state
297
365
  params
298
366
  updater {
@@ -334,6 +402,7 @@ export class Connection extends connect(store)(p13n(localize(i18next)(PageView))
334
402
  placeholder
335
403
  property
336
404
  styles
405
+ useDomainAttribute
337
406
  }
338
407
  }
339
408
  }
@@ -5,7 +5,7 @@ import '../viewparts/connections-monitor.js'
5
5
 
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html } from 'lit'
8
- import { customElement, property, query } from 'lit/decorators.js'
8
+ import { customElement, property, state } from 'lit/decorators.js'
9
9
 
10
10
  import { client, subscribe } from '@operato/graphql'
11
11
  import { i18next, localize } from '@operato/i18n'
@@ -169,6 +169,10 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
169
169
  name
170
170
  }
171
171
  updatedAt
172
+ domain {
173
+ id
174
+ name
175
+ }
172
176
  }
173
177
  total
174
178
  }
@@ -195,19 +199,26 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
195
199
  async fetchConnections() {
196
200
  const response = await client.query({
197
201
  query: gql`
198
- query {
199
- responses: connections {
202
+ query ($inherited: InheritedValueType) {
203
+ responses: connections(inherited: $inherited) {
200
204
  items {
201
205
  id
202
206
  name
203
207
  description
204
208
  type
205
209
  state
210
+ domain {
211
+ id
212
+ name
213
+ }
206
214
  }
207
215
  total
208
216
  }
209
217
  }
210
- `
218
+ `,
219
+ variables: {
220
+ inherited: InheritedValueType.Include
221
+ }
211
222
  })
212
223
 
213
224
  this.connections = response.data.responses.items || []
@@ -328,6 +339,10 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
328
339
  description
329
340
  type
330
341
  state
342
+ domain {
343
+ id
344
+ name
345
+ }
331
346
  }
332
347
  }
333
348
  `
@@ -338,7 +353,9 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
338
353
  var state = data.connectionState
339
354
 
340
355
  this.connections = this.connections || []
341
- var idx = this.connections.findIndex(connection => connection.id === state.id)
356
+ var idx = this.connections.findIndex(
357
+ connection => connection.id === state.id && connection.domain.id === state.domain.id
358
+ )
342
359
 
343
360
  if (idx !== -1) {
344
361
  this.connections[idx] = data.connectionState
@@ -292,7 +292,7 @@ export class Scenario extends connect(store)(p13n(localize(i18next)(PageView)))
292
292
  type: 'checkbox',
293
293
  name: 'active',
294
294
  label: true,
295
- header: i18next.t('field.active'),
295
+ header: i18next.t('field.startup-scenario'),
296
296
  record: {
297
297
  align: 'center',
298
298
  editable: true
@@ -0,0 +1,9 @@
1
+ export type PropertySpec = {
2
+ type: string
3
+ label: string
4
+ name: string
5
+ placeholder?: string
6
+ property?: { [key: string]: any }
7
+ styles?: { [key: string]: any }
8
+ useDomainAttribute?: boolean
9
+ }
@@ -1,11 +1,12 @@
1
1
  import '@material/web/icon/icon.js'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property, query } from 'lit/decorators.js'
4
+ import { css, html, LitElement, nothing } from 'lit'
5
+ import { customElement, property, query, state } from 'lit/decorators.js'
6
6
 
7
7
  import { client } from '@operato/graphql'
8
8
  import { ScrollbarStyles } from '@operato/styles'
9
+ import { auth, hasPrivilege } from '@things-factory/auth-base/dist-client'
9
10
 
10
11
  @customElement('connections-monitor')
11
12
  export class ConnectionsMonitor extends LitElement {
@@ -51,7 +52,11 @@ export class ConnectionsMonitor extends LitElement {
51
52
  white-space: nowrap;
52
53
  }
53
54
  [card] strong {
55
+ display: flex;
56
+ align-items: center;
57
+ gap: var(--spacing-small);
54
58
  color: var(--md-sys-color-primary);
59
+ --md-icon-size: 16px;
55
60
  }
56
61
  [card] span {
57
62
  font-size: var(--fontsize-default);
@@ -94,6 +99,22 @@ export class ConnectionsMonitor extends LitElement {
94
99
 
95
100
  @property({ type: Array }) connections: any
96
101
 
102
+ @state() domainName: string = ''
103
+ @state() canManageConnections: boolean = false
104
+
105
+ connectedCallback() {
106
+ super.connectedCallback()
107
+ auth.on('profile', async ({ domain }) => {
108
+ this.domainName = domain.name
109
+ this.canManageConnections = await hasPrivilege({
110
+ privilege: 'mutation',
111
+ category: 'connection',
112
+ domainOwnerGranted: true,
113
+ superUserGranted: true
114
+ })
115
+ })
116
+ }
117
+
97
118
  render() {
98
119
  var connections = this.connections || []
99
120
 
@@ -107,17 +128,19 @@ export class ConnectionsMonitor extends LitElement {
107
128
  }
108
129
 
109
130
  renderConnection(connection) {
110
- const { id, name, description, type, state } = connection
131
+ const { id, name, description, type, state, domain } = connection
111
132
  const connected = state == 'CONNECTED'
133
+ const isParent = domain.name !== this.domainName
134
+ const manageable = !isParent && this.canManageConnections
112
135
 
113
136
  return html`
114
137
  <div card ?connected=${connected}>
115
- <strong>${name}</strong>
116
- <span>${description}</span>
138
+ <strong name>${name} ${isParent ? html`<md-icon title="inherited">arrow_downward</md-icon>` : ''}</strong>
139
+ <span>${description}&nbsp;</span>
117
140
  <span>Type : ${type}</span>
118
141
  <div buttons>
119
142
  <md-icon
120
- @click=${e => (connected ? this.disconnect(connection) : this.connect(connection))}
143
+ @click=${e => manageable && (connected ? this.disconnect(connection) : this.connect(connection))}
121
144
  title=${connected ? 'disconnect' : 'connect'}
122
145
  >${connected ? 'link_off' : 'link'}</md-icon
123
146
  >
@@ -4,8 +4,8 @@ import '@operato/data-grist'
4
4
  import './scenario-instance-monitor.js'
5
5
 
6
6
  import gql from 'graphql-tag'
7
- import { css, html, LitElement } from 'lit'
8
- import { customElement, property, query, state } from 'lit/decorators.js'
7
+ import { css, html, LitElement, nothing } from 'lit'
8
+ import { customElement, property } from 'lit/decorators.js'
9
9
 
10
10
  import { client } from '@operato/graphql'
11
11
  import { i18next, localize } from '@operato/i18n'
@@ -53,7 +53,9 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
53
53
  }
54
54
 
55
55
  [desc] strong {
56
- display: block;
56
+ display: flex;
57
+ align-items: center;
58
+ gap: var(--spacing-small);
57
59
  overflow: hidden;
58
60
  text-overflow: ellipsis;
59
61
  white-space: nowrap;
@@ -93,6 +95,11 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
93
95
  color: var(--md-sys-color-on-primary);
94
96
  }
95
97
 
98
+ [desc] strong md-icon {
99
+ --md-icon-size: 16px;
100
+ color: var(--md-sys-color-primary);
101
+ }
102
+
96
103
  [buttons] {
97
104
  display: flex;
98
105
  flex-direction: row-reverse;
@@ -185,6 +192,7 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
185
192
 
186
193
  @property({ type: Object }) scenario: any
187
194
  @property({ type: String }) mode?: string
195
+ @property({ type: Boolean, attribute: 'is-parent' }) isParent?: boolean
188
196
 
189
197
  render() {
190
198
  const scenario = this.scenario || {}
@@ -196,8 +204,10 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
196
204
  return html`
197
205
  <div desc>
198
206
  <div detail-info title=${name}>
199
- <strong>${name}</strong>
200
- ${description}
207
+ <strong
208
+ >${name} ${this.isParent ? html`<md-icon title="inherited">arrow_downward</md-icon>` : nothing}</strong
209
+ >
210
+ ${description}&nbsp;
201
211
  <span>${instances.length}</span>
202
212
  </div>
203
213
  <div schedule>
@@ -4,10 +4,11 @@ import '@operato/data-grist'
4
4
  import './scenario-monitor.js'
5
5
 
6
6
  import { css, html, LitElement } from 'lit'
7
- import { customElement, property, query } from 'lit/decorators.js'
7
+ import { customElement, property, query, state } from 'lit/decorators.js'
8
8
 
9
9
  import { i18next, localize } from '@operato/i18n'
10
10
  import { ScrollbarStyles } from '@operato/styles'
11
+ import { auth } from '@things-factory/auth-base/dist-client'
11
12
 
12
13
  @customElement('scenarios-monitor')
13
14
  export class ScenariosMonitor extends localize(i18next)(LitElement) {
@@ -115,6 +116,16 @@ export class ScenariosMonitor extends localize(i18next)(LitElement) {
115
116
  @property({ type: Object }) colorIndex: any
116
117
  @property({ type: Boolean }) running: boolean = false
117
118
 
119
+ @state() domainName: string = ''
120
+ @state() canManageScenarios: boolean = false
121
+
122
+ connectedCallback() {
123
+ super.connectedCallback()
124
+ auth.on('profile', async ({ domain }) => {
125
+ this.domainName = domain.name
126
+ })
127
+ }
128
+
118
129
  render() {
119
130
  var scenarios = this.scenarios || []
120
131
  const mode = this.mode || 'brief'
@@ -141,7 +152,14 @@ export class ScenariosMonitor extends localize(i18next)(LitElement) {
141
152
  <div flowbox>
142
153
  ${scenarios
143
154
  .filter(scenario => new RegExp(filter, 'i').test(scenario.name))
144
- .map(scenario => html`<scenario-monitor .scenario=${scenario} mode=${mode}></scenario-monitor>`)}
155
+ .map(
156
+ scenario =>
157
+ html`<scenario-monitor
158
+ .scenario=${scenario}
159
+ mode=${mode}
160
+ ?is-parent=${scenario.domain.name !== this.domainName}
161
+ ></scenario-monitor>`
162
+ )}
145
163
  </div>
146
164
  </div>
147
165
  </div>
@@ -14,6 +14,45 @@ import { PageView, store } from '@operato/shell';
14
14
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
15
15
  import { isMobileDevice } from '@operato/utils';
16
16
  import { p13n } from '@operato/p13n';
17
+ async function copyToClipboard(text) {
18
+ try {
19
+ await navigator.clipboard.writeText(text);
20
+ }
21
+ catch (err) {
22
+ // fallback: old way
23
+ const textArea = document.createElement('textarea');
24
+ textArea.value = text;
25
+ document.body.appendChild(textArea);
26
+ textArea.select();
27
+ document.execCommand('copy');
28
+ document.body.removeChild(textArea);
29
+ }
30
+ }
31
+ function createActionInjector(connectionName) {
32
+ return (propName, propSpec) => {
33
+ if (!propSpec.useDomainAttribute) {
34
+ return null;
35
+ }
36
+ const attributeName = `Connection::${connectionName}::${propName}`;
37
+ const copyIcon = document.createElement('md-icon');
38
+ copyIcon.textContent = 'dictionary';
39
+ copyIcon.style.cssText =
40
+ 'cursor: pointer; color: var(--md-sys-color-primary); font-size: 16px; --md-icon-size: 16px;';
41
+ copyIcon.title = `Copy ${attributeName}`;
42
+ copyIcon.addEventListener('click', () => {
43
+ copyToClipboard(attributeName);
44
+ // 복사 성공 피드백
45
+ const originalText = copyIcon.textContent;
46
+ copyIcon.textContent = 'check';
47
+ copyIcon.style.color = 'var(--md-sys-color-tertiary)';
48
+ setTimeout(() => {
49
+ copyIcon.textContent = originalText;
50
+ copyIcon.style.color = 'var(--md-sys-color-primary)';
51
+ }, 1000);
52
+ });
53
+ return copyIcon;
54
+ };
55
+ }
17
56
  let Connection = class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {
18
57
  constructor() {
19
58
  super(...arguments);
@@ -165,7 +204,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
165
204
  type: 'checkbox',
166
205
  name: 'active',
167
206
  label: true,
168
- header: i18next.t('field.active'),
207
+ header: i18next.t('field.startup-connect'),
169
208
  record: {
170
209
  editable: true,
171
210
  align: 'center'
@@ -173,6 +212,16 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
173
212
  sortable: true,
174
213
  width: 60
175
214
  },
215
+ {
216
+ type: 'checkbox',
217
+ name: 'onDemand',
218
+ label: true,
219
+ header: i18next.t('field.on-demand'),
220
+ record: {
221
+ editable: true
222
+ },
223
+ width: 120
224
+ },
176
225
  {
177
226
  type: 'connector',
178
227
  name: 'type',
@@ -198,7 +247,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
198
247
  },
199
248
  filter: 'search',
200
249
  sortable: true,
201
- width: 200
250
+ width: 280
202
251
  },
203
252
  {
204
253
  type: 'parameters',
@@ -209,7 +258,14 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
209
258
  options: async (value, column, record, row, field) => {
210
259
  const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : {};
211
260
  const context = this.grist;
212
- return { name, help, spec, context, objectified: true };
261
+ return {
262
+ name,
263
+ help,
264
+ spec,
265
+ context,
266
+ objectified: true,
267
+ actionInjector: createActionInjector(record.name)
268
+ };
213
269
  },
214
270
  renderer: 'json5'
215
271
  },
@@ -282,6 +338,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
282
338
  }
283
339
  endpoint
284
340
  active
341
+ onDemand
285
342
  state
286
343
  params
287
344
  updater {
@@ -321,6 +378,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
321
378
  placeholder
322
379
  property
323
380
  styles
381
+ useDomainAttribute
324
382
  }
325
383
  }
326
384
  }
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../client/pages/connection.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,G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AC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAgB;AAExB;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;yCAAA;AAvBzB,UAAU;IADtB,aAAa,CAAC,iBAAiB,CAAC;GACpB,UAAU,CAmetB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport './connection-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { FetchOption } from '@operato/data-grist'\nimport { p13n } from '@operato/p13n'\n\n@customElement('connection-page')\nexport class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {\n static styles = [\n CommonGristStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) connectors: any\n\n @query('ox-grist') grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.connection list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n // 필터가 설정되면, 아래 코멘트 해제\n // filter: {\n // handler: () => {\n // const display = this.headroom.style.display\n // this.headroom.style.display = display !== 'none' ? 'none' : 'flex'\n // }\n // },\n help: 'integration/ui/connection',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateConnectionManager.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteConnections.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('text.connection list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageInitialized() {\n this.fetchConnectors()\n\n this.gristConfig = {\n list: { fields: ['name', 'description', 'type', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),\n iconOnly: false,\n title: record =>\n !record\n ? i18next.t('button.connect')\n : !record.id\n ? ''\n : record.state == 'CONNECTED'\n ? i18next.t('button.disconnect')\n : i18next.t('button.connect'),\n width: 80,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.name || record.__dirty__ == '+') {\n return\n }\n if (record.state == 'CONNECTED') {\n this.disconnect(record)\n } else {\n this.connect(record)\n }\n }\n }\n },\n {\n type: 'object',\n name: 'domain',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 150,\n validation: function (after, before, record, column) {\n /* connected 상태에서는 이름을 바꿀 수 없다. */\n if (record.state == 'CONNECTED') {\n notify({\n level: 'warn',\n message: 'connection name cannot be changed during connected.'\n })\n return false\n }\n return true\n }\n },\n {\n type: 'string',\n name: 'description',\n label: true,\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true,\n align: 'center'\n },\n sortable: true,\n width: 60\n },\n {\n type: 'connector',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: {\n renderer: HelpDecoratedRenderer,\n editable: true,\n help: value => this.connectors?.[value]?.help,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n {\n type: 'string',\n name: 'endpoint',\n header: i18next.t('field.endpoint'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n {\n type: 'parameters',\n name: 'params',\n header: i18next.t('field.params'),\n record: {\n editable: true,\n options: async (value, column, record, row, field) => {\n const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : ({} as any)\n const context = this.grist\n return { name, help, spec, context, objectified: true }\n },\n renderer: 'json5'\n },\n width: 100\n },\n {\n type: 'resource-object',\n name: 'edge',\n header: i18next.t('field.edge-server'),\n record: {\n editable: true,\n options: {\n queryName: 'edges'\n }\n },\n sortable: true,\n width: 120\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n domain {\n id\n name\n description\n }\n name\n description\n type\n edge {\n id\n name\n }\n endpoint\n active\n state\n params\n updater {\n id\n name\n description\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async fetchConnectors() {\n const response = await client.query({\n query: gql`\n query {\n connectors {\n items {\n name\n help\n parameterSpec {\n type\n name\n label\n placeholder\n property\n styles\n }\n }\n }\n }\n `\n })\n\n if (!response.errors) {\n this.connectors = response.data.connectors.items.reduce((connectors, connector) => {\n connectors[connector.name] = connector\n return connectors\n }, {})\n } else {\n console.error('fetch connectors error')\n }\n }\n\n async _deleteConnections(name) {\n if (\n confirm(\n i18next.t('text.sure_to_x', {\n x: i18next.t('text.delete')\n })\n )\n ) {\n const names = this.grist.selected.map(record => record.name)\n if (names && names.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($names: [String!]!) {\n deleteConnections(names: $names)\n }\n `,\n variables: {\n names\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: i18next.t('text.delete')\n })\n })\n }\n }\n }\n }\n\n async _updateConnectionManager() {\n var patches = this.grist.dirtyRecords\n\n if (patches && patches.length) {\n patches = patches.map(connection => {\n let patchField: any = connection.id ? { id: connection.id } : {}\n const dirtyFields = connection.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = connection.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ConnectionPatch!]!) {\n updateMultipleConnection(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) this.grist.fetch()\n }\n }\n\n async connect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n connectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.connectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`\n })\n }\n\n async disconnect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n disconnectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.disconnectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`\n })\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'type', 'description', 'endpoint', 'params'])\n\n return exportTargets.map(connection => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = connection[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n openPopup(\n html`\n <connection-importer\n .connections=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></connection-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import connection')\n }\n )\n }\n}\n"]}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../client/pages/connection.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EA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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAgB;AAExB;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;yCAAA;AAvBzB,UAAU;IADtB,aAAa,CAAC,iBAAiB,CAAC;GACpB,UAAU,CAuftB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport './connection-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { FetchOption } from '@operato/data-grist'\nimport { p13n } from '@operato/p13n'\nimport { PropertySpec } from '../types.js'\n\nasync function copyToClipboard(text: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(text)\n } catch (err) {\n // fallback: old way\n const textArea = document.createElement('textarea')\n textArea.value = text\n document.body.appendChild(textArea)\n textArea.select()\n document.execCommand('copy')\n document.body.removeChild(textArea)\n }\n}\n\nfunction createActionInjector(\n connectionName: string\n): (propName: string, propSpec: PropertySpec) => HTMLElement | null {\n return (propName: string, propSpec: PropertySpec): HTMLElement | null => {\n if (!propSpec.useDomainAttribute) {\n return null\n }\n\n const attributeName = `Connection::${connectionName}::${propName}`\n\n const copyIcon = document.createElement('md-icon')\n copyIcon.textContent = 'dictionary'\n copyIcon.style.cssText =\n 'cursor: pointer; color: var(--md-sys-color-primary); font-size: 16px; --md-icon-size: 16px;'\n copyIcon.title = `Copy ${attributeName}`\n\n copyIcon.addEventListener('click', () => {\n copyToClipboard(attributeName)\n\n // 복사 성공 피드백\n const originalText = copyIcon.textContent\n copyIcon.textContent = 'check'\n copyIcon.style.color = 'var(--md-sys-color-tertiary)'\n\n setTimeout(() => {\n copyIcon.textContent = originalText\n copyIcon.style.color = 'var(--md-sys-color-primary)'\n }, 1000)\n })\n\n return copyIcon\n }\n}\n\n@customElement('connection-page')\nexport class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {\n static styles = [\n CommonGristStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) connectors: any\n\n @query('ox-grist') grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.connection list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n // 필터가 설정되면, 아래 코멘트 해제\n // filter: {\n // handler: () => {\n // const display = this.headroom.style.display\n // this.headroom.style.display = display !== 'none' ? 'none' : 'flex'\n // }\n // },\n help: 'integration/ui/connection',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateConnectionManager.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteConnections.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('text.connection list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageInitialized() {\n this.fetchConnectors()\n\n this.gristConfig = {\n list: { fields: ['name', 'description', 'type', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),\n iconOnly: false,\n title: record =>\n !record\n ? i18next.t('button.connect')\n : !record.id\n ? ''\n : record.state == 'CONNECTED'\n ? i18next.t('button.disconnect')\n : i18next.t('button.connect'),\n width: 80,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.name || record.__dirty__ == '+') {\n return\n }\n if (record.state == 'CONNECTED') {\n this.disconnect(record)\n } else {\n this.connect(record)\n }\n }\n }\n },\n {\n type: 'object',\n name: 'domain',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 150,\n validation: function (after, before, record, column) {\n /* connected 상태에서는 이름을 바꿀 수 없다. */\n if (record.state == 'CONNECTED') {\n notify({\n level: 'warn',\n message: 'connection name cannot be changed during connected.'\n })\n return false\n }\n return true\n }\n },\n {\n type: 'string',\n name: 'description',\n label: true,\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.startup-connect'),\n record: {\n editable: true,\n align: 'center'\n },\n sortable: true,\n width: 60\n },\n {\n type: 'checkbox',\n name: 'onDemand',\n label: true,\n header: i18next.t('field.on-demand'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'connector',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: {\n renderer: HelpDecoratedRenderer,\n editable: true,\n help: value => this.connectors?.[value]?.help,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n {\n type: 'string',\n name: 'endpoint',\n header: i18next.t('field.endpoint'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 280\n },\n {\n type: 'parameters',\n name: 'params',\n header: i18next.t('field.params'),\n record: {\n editable: true,\n options: async (value, column, record, row, field) => {\n const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : ({} as any)\n const context = this.grist\n\n return {\n name,\n help,\n spec,\n context,\n objectified: true,\n actionInjector: createActionInjector(record.name)\n }\n },\n renderer: 'json5'\n },\n width: 100\n },\n {\n type: 'resource-object',\n name: 'edge',\n header: i18next.t('field.edge-server'),\n record: {\n editable: true,\n options: {\n queryName: 'edges'\n }\n },\n sortable: true,\n width: 120\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n domain {\n id\n name\n description\n }\n name\n description\n type\n edge {\n id\n name\n }\n endpoint\n active\n onDemand\n state\n params\n updater {\n id\n name\n description\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async fetchConnectors() {\n const response = await client.query({\n query: gql`\n query {\n connectors {\n items {\n name\n help\n parameterSpec {\n type\n name\n label\n placeholder\n property\n styles\n useDomainAttribute\n }\n }\n }\n }\n `\n })\n\n if (!response.errors) {\n this.connectors = response.data.connectors.items.reduce((connectors, connector) => {\n connectors[connector.name] = connector\n return connectors\n }, {})\n } else {\n console.error('fetch connectors error')\n }\n }\n\n async _deleteConnections(name) {\n if (\n confirm(\n i18next.t('text.sure_to_x', {\n x: i18next.t('text.delete')\n })\n )\n ) {\n const names = this.grist.selected.map(record => record.name)\n if (names && names.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($names: [String!]!) {\n deleteConnections(names: $names)\n }\n `,\n variables: {\n names\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: i18next.t('text.delete')\n })\n })\n }\n }\n }\n }\n\n async _updateConnectionManager() {\n var patches = this.grist.dirtyRecords\n\n if (patches && patches.length) {\n patches = patches.map(connection => {\n let patchField: any = connection.id ? { id: connection.id } : {}\n const dirtyFields = connection.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = connection.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ConnectionPatch!]!) {\n updateMultipleConnection(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) this.grist.fetch()\n }\n }\n\n async connect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n connectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.connectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`\n })\n }\n\n async disconnect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n disconnectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.disconnectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`\n })\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'type', 'description', 'endpoint', 'params'])\n\n return exportTargets.map(connection => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = connection[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n openPopup(\n html`\n <connection-importer\n .connections=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></connection-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import connection')\n }\n )\n }\n}\n"]}