@things-factory/worklist 6.0.26 → 6.0.27

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 (76) hide show
  1. package/client/bootstrap.ts +4 -3
  2. package/client/components/activity-starter-form.ts +6 -0
  3. package/client/pages/activity-approval/activity-approval-page.ts +61 -14
  4. package/client/pages/activity-instance/activity-instance-page.ts +18 -0
  5. package/client/pages/activity-thread/activity-thread-page.ts +24 -3
  6. package/client/pages/todo/draft-list-page.ts +6 -3
  7. package/client/types.js +1 -0
  8. package/dist-client/bootstrap.d.ts +1 -0
  9. package/dist-client/bootstrap.js +3 -2
  10. package/dist-client/bootstrap.js.map +1 -1
  11. package/dist-client/components/activity-starter-form.js +6 -0
  12. package/dist-client/components/activity-starter-form.js.map +1 -1
  13. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +2 -2
  14. package/dist-client/pages/activity-approval/activity-approval-page.js +59 -14
  15. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  16. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +2 -1
  17. package/dist-client/pages/activity-instance/activity-instance-page.js +15 -0
  18. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
  19. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +2 -2
  20. package/dist-client/pages/activity-thread/activity-thread-page.js +21 -3
  21. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  22. package/dist-client/pages/todo/draft-list-page.d.ts +4 -8
  23. package/dist-client/pages/todo/draft-list-page.js +4 -1
  24. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  25. package/dist-client/tsconfig.tsbuildinfo +1 -1
  26. package/dist-client/types.js +1 -0
  27. package/dist-client/types.js.map +1 -1
  28. package/dist-server/controllers/activity-approval/approve.js +1 -1
  29. package/dist-server/controllers/activity-approval/approve.js.map +1 -1
  30. package/dist-server/controllers/activity-instance/draft.js +16 -0
  31. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  32. package/dist-server/controllers/activity-instance/post.js +2 -2
  33. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  34. package/dist-server/controllers/activity-thread/submit.js +1 -1
  35. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  36. package/dist-server/controllers/common.js +45 -36
  37. package/dist-server/controllers/common.js.map +1 -1
  38. package/dist-server/service/activity/activity.js +2 -1
  39. package/dist-server/service/activity/activity.js.map +1 -1
  40. package/dist-server/service/activity-instance/activity-instance-query.js +41 -0
  41. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  42. package/dist-server/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +8 -7
  44. package/server/controllers/activity-approval/approve.ts +2 -2
  45. package/server/controllers/activity-instance/draft.ts +18 -0
  46. package/server/controllers/activity-instance/post.ts +3 -3
  47. package/server/controllers/activity-thread/submit.ts +2 -2
  48. package/server/controllers/common.ts +52 -32
  49. package/server/service/activity/activity.ts +2 -1
  50. package/server/service/activity-instance/activity-instance-query.ts +44 -0
  51. package/things-factory.config.js +1 -4
  52. package/translations/en.json +1 -0
  53. package/translations/ko.json +1 -0
  54. package/translations/ms.json +1 -0
  55. package/translations/zh.json +1 -0
  56. package/dist-client/pages/installed-activity/installed-activity-list-page.d.ts +0 -45
  57. package/dist-client/pages/installed-activity/installed-activity-list-page.js +0 -412
  58. package/dist-client/pages/installed-activity/installed-activity-list-page.js.map +0 -1
  59. package/dist-client/pages/installed-activity/installed-activity-model-item-list.d.ts +0 -1
  60. package/dist-client/pages/installed-activity/installed-activity-model-item-list.js +0 -20
  61. package/dist-client/pages/installed-activity/installed-activity-model-item-list.js.map +0 -1
  62. package/dist-client/templates/activity-context-template.d.ts +0 -2
  63. package/dist-client/templates/activity-context-template.js +0 -62
  64. package/dist-client/templates/activity-context-template.js.map +0 -1
  65. package/dist-server/controllers/activity-extension-controller.js +0 -11
  66. package/dist-server/controllers/activity-extension-controller.js.map +0 -1
  67. package/dist-server/service/installed-activity/index.js +0 -10
  68. package/dist-server/service/installed-activity/index.js.map +0 -1
  69. package/dist-server/service/installed-activity/installed-activity-mutation.js +0 -60
  70. package/dist-server/service/installed-activity/installed-activity-mutation.js.map +0 -1
  71. package/dist-server/service/installed-activity/installed-activity-query.js +0 -48
  72. package/dist-server/service/installed-activity/installed-activity-query.js.map +0 -1
  73. package/dist-server/service/installed-activity/installed-activity-type.js +0 -21
  74. package/dist-server/service/installed-activity/installed-activity-type.js.map +0 -1
  75. package/dist-server/service/installed-activity/installed-activity.js +0 -70
  76. package/dist-server/service/installed-activity/installed-activity.js.map +0 -1
@@ -1,3 +1,7 @@
1
+ import '@material/mwc-icon'
2
+ import './templates/activity-approval-context-template.js'
3
+ import './templates/activity-thread-context-template.js'
4
+
1
5
  import { html } from 'lit-html'
2
6
  import { store } from '@operato/shell'
3
7
  import { openOverlay, TOOL_POSITION } from '@operato/layout'
@@ -9,9 +13,6 @@ import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-q
9
13
  import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'
10
14
  import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'
11
15
 
12
- import './templates/activity-approval-context-template.js'
13
- import './templates/activity-thread-context-template.js'
14
-
15
16
  export default function bootstrap() {
16
17
  ;[
17
18
  {
@@ -247,6 +247,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
247
247
  state
248
248
  assignees {
249
249
  type
250
+ value
250
251
  assignee {
251
252
  id
252
253
  name
@@ -256,6 +257,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
256
257
  }
257
258
  approvalLine {
258
259
  type
260
+ value
259
261
  approver {
260
262
  id
261
263
  name
@@ -316,6 +318,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
316
318
  state
317
319
  assignees {
318
320
  type
321
+ value
319
322
  assignee {
320
323
  id
321
324
  name
@@ -325,6 +328,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
325
328
  }
326
329
  approvalLine {
327
330
  type
331
+ value
328
332
  approver {
329
333
  id
330
334
  name
@@ -387,6 +391,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
387
391
  state
388
392
  assignees {
389
393
  type
394
+ value
390
395
  assignee {
391
396
  id
392
397
  name
@@ -396,6 +401,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
396
401
  }
397
402
  approvalLine {
398
403
  type
404
+ value
399
405
  approver {
400
406
  id
401
407
  name
@@ -1,11 +1,10 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js'
2
2
  import '@operato/board/ox-board-viewer.js'
3
- import '@things-factory/organization'
4
3
 
5
4
  import gql from 'graphql-tag'
6
5
  import { css, html } from 'lit'
7
6
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
8
- import { customElement, property, query } from 'lit/decorators.js'
7
+ import { customElement, property, query, state } from 'lit/decorators.js'
9
8
  import { keyed } from 'lit/directives/keyed.js'
10
9
  import { connect } from 'pwa-helpers/connect-mixin.js'
11
10
 
@@ -57,6 +56,7 @@ const ActivityApprovalFetchResult = `\
57
56
  }
58
57
  approvalLine {
59
58
  type
59
+ value
60
60
  approver {
61
61
  id
62
62
  name
@@ -92,6 +92,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
92
92
  :host {
93
93
  display: flex;
94
94
  flex-direction: column;
95
+ position: relative;
95
96
 
96
97
  width: 100%;
97
98
  padding: 5px;
@@ -102,12 +103,36 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
102
103
  width: 100%;
103
104
  height: 100%;
104
105
  }
106
+
107
+ #custom-content {
108
+ flex: 1;
109
+ }
110
+
111
+ div[comment] {
112
+ display: flex;
113
+ width: 100%;
114
+ height: 100px;
115
+ right: 0;
116
+ bottom: 0;
117
+ margin: 0;
118
+ padding: 0;
119
+ opacity: 0.8;
120
+ }
121
+
122
+ textarea {
123
+ flex: 1;
124
+ padding: 10px;
125
+ resize: none;
126
+ background-color: black;
127
+ color: yellow;
128
+ outline: none;
129
+ }
105
130
  `
106
131
  ]
107
132
 
108
- @property({ type: Object }) activityApproval: any
109
- @property({ type: Object }) activityThread: any
110
- @property({ type: Object }) board: any
133
+ @state() activityApproval: any
134
+ @state() activityThread: any
135
+ @state() board: any
111
136
 
112
137
  get context() {
113
138
  const judgment = this.activityApproval?.judgment
@@ -141,7 +166,18 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
141
166
  }
142
167
 
143
168
  render() {
144
- return html` ${this.activityContent()}`
169
+ return html`
170
+ ${this.activityContent()}
171
+ <div comment>
172
+ <textarea
173
+ placeholder="Jot down your comment here."
174
+ .value=${this.activityApproval?.comment}
175
+ @change=${(e: Event) => {
176
+ this.activityApproval.comment = (e.target as HTMLTextAreaElement).value
177
+ }}
178
+ ></textarea>
179
+ </div>
180
+ `
145
181
  }
146
182
 
147
183
  activityContent() {
@@ -152,6 +188,8 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
152
188
  return this.generatedContent()
153
189
  case 'board':
154
190
  return this.boardContent()
191
+ case 'custom-element':
192
+ return this.customElementContent()
155
193
  case 'page':
156
194
  case 'external':
157
195
  default:
@@ -207,7 +245,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
207
245
  }
208
246
 
209
247
  return keyed(
210
- activityInstance.id,
248
+ this.activityApproval.id,
211
249
  html`
212
250
  <fieldset>
213
251
  <legend>Input</legend>
@@ -242,7 +280,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
242
280
  }
243
281
 
244
282
  return keyed(
245
- activityInstance.id,
283
+ this.activityApproval.id,
246
284
  html`
247
285
  <ox-board-viewer
248
286
  style="background-color: white;"
@@ -256,6 +294,18 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
256
294
  )
257
295
  }
258
296
 
297
+ customElementContent() {
298
+ const { output, activityInstance } = this.activityThread
299
+ const { uiSource: tagName, input } = activityInstance || {}
300
+
301
+ const element = document.createElement(tagName)
302
+ element.id = 'custom-content'
303
+ element.input = input
304
+ element.output = output
305
+
306
+ return element
307
+ }
308
+
259
309
  @query('ox-board-viewer') oxBoardViewer: any
260
310
 
261
311
  getOutputFromBoard() {
@@ -299,8 +349,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
299
349
  }
300
350
 
301
351
  async _rejectActivityApproval() {
302
- var { id } = this.activityApproval
303
- var comment = 'xxxxxxxxxxxxxxxxxxx'
352
+ var { id, comment } = this.activityApproval
304
353
 
305
354
  const response = await client.mutate({
306
355
  mutation: gql`
@@ -328,8 +377,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
328
377
  }
329
378
 
330
379
  async _approveActivityApproval() {
331
- var { id } = this.activityApproval
332
- var comment = 'xxxxxxxxxxxxxxxxxxx'
380
+ var { id, comment } = this.activityApproval
333
381
 
334
382
  const response = await client.mutate({
335
383
  mutation: gql`
@@ -357,8 +405,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
357
405
  }
358
406
 
359
407
  async _saveActivityApproval() {
360
- var { id } = this.activityApproval
361
- var comment = 'yyyyyyyyyyyyyyyyyyy'
408
+ var { id, comment } = this.activityApproval
362
409
 
363
410
  const response = await client.mutate({
364
411
  mutation: gql`
@@ -57,6 +57,10 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
57
57
  width: 100%;
58
58
  height: 100%;
59
59
  }
60
+
61
+ #custom-content {
62
+ flex: 1;
63
+ }
60
64
  `
61
65
  ]
62
66
 
@@ -111,6 +115,8 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
111
115
  return this.generatedContent()
112
116
  case 'board':
113
117
  return this.boardContent()
118
+ case 'custom-element':
119
+ return this.customElementContent()
114
120
  case 'page':
115
121
  case 'external':
116
122
  default:
@@ -203,6 +209,17 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
203
209
  `
204
210
  }
205
211
 
212
+ customElementContent() {
213
+ const { uiSource: tagName, input, output } = this.activityInstance
214
+
215
+ const element = document.createElement(tagName)
216
+ element.id = 'custom-content'
217
+ element.input = input
218
+ element.output = output
219
+
220
+ return element
221
+ }
222
+
206
223
  getOutputFromBoard() {
207
224
  const outputSpec = this.getOutputSpec()
208
225
  const data = this.viewer?.getSceneValues() || {}
@@ -255,6 +272,7 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
255
272
  uiSource
256
273
  approvalLine {
257
274
  type
275
+ value
258
276
  approver {
259
277
  id
260
278
  name
@@ -1,6 +1,5 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js'
2
2
  import '@operato/board/ox-board-viewer.js'
3
- import '@things-factory/organization'
4
3
 
5
4
  import gql from 'graphql-tag'
6
5
  import { css, html } from 'lit'
@@ -48,6 +47,7 @@ const ActivityThreadFetchResult = `\
48
47
  }
49
48
  approvalLine {
50
49
  type
50
+ value
51
51
  approver {
52
52
  id
53
53
  name
@@ -93,6 +93,10 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
93
93
  width: 100%;
94
94
  height: 100%;
95
95
  }
96
+
97
+ #custom-content {
98
+ flex: 1;
99
+ }
96
100
  `
97
101
  ]
98
102
 
@@ -165,6 +169,8 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
165
169
  return this.generatedContent()
166
170
  case 'board':
167
171
  return this.boardContent()
172
+ case 'custom-element':
173
+ return this.customElementContent()
168
174
  case 'page':
169
175
  case 'external':
170
176
  default:
@@ -220,7 +226,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
220
226
  }
221
227
 
222
228
  return keyed(
223
- activityInstance.id,
229
+ this.activityThread.id,
224
230
  html`
225
231
  <fieldset>
226
232
  <legend>Input</legend>
@@ -255,7 +261,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
255
261
  }
256
262
 
257
263
  return keyed(
258
- activityInstance.id,
264
+ this.activityThread.id,
259
265
  html`
260
266
  <ox-board-viewer
261
267
  style="background-color: white;"
@@ -269,6 +275,21 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
269
275
  )
270
276
  }
271
277
 
278
+ customElementContent() {
279
+ const { output, activityInstance } = this.activityThread
280
+ const { uiSource: tagName, input } = activityInstance || {}
281
+
282
+ const element = document.createElement(tagName)
283
+ element.id = 'custom-content'
284
+ element.input = input
285
+ element.output = output
286
+ element.addEventListener('change', (e: CustomEvent) => {
287
+ this.activityThread.output = e.detail
288
+ })
289
+
290
+ return element
291
+ }
292
+
272
293
  @query('ox-board-viewer') oxBoardViewer: any
273
294
 
274
295
  getOutputFromBoard() {
@@ -6,13 +6,14 @@ import { css, html } from 'lit'
6
6
  import { customElement, property, query } from 'lit/decorators.js'
7
7
  import { connect } from 'pwa-helpers/connect-mixin.js'
8
8
 
9
- import { DataGrist, getRenderer } from '@operato/data-grist'
9
+ import { DataGrist, FetchOption, getRenderer } from '@operato/data-grist'
10
10
  import { client } from '@operato/graphql'
11
11
  import { i18next, localize } from '@operato/i18n'
12
12
  import { openPopup } from '@operato/layout'
13
13
  import { PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
+ import { OxPopup } from '@operato/popup'
16
17
 
17
18
  import { ActivityInstanceStatus, Priorities } from '../../types.js'
18
19
 
@@ -59,7 +60,7 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
59
60
  }
60
61
  }
61
62
 
62
- @query('#sorter-control') sorterControl?: any
63
+ @query('#sorter-control') sorterControl!: OxPopup
63
64
  @query('ox-grist') grist!: DataGrist
64
65
 
65
66
  render() {
@@ -283,7 +284,7 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
283
284
  }
284
285
  }
285
286
 
286
- async fetchHandler({ page, limit, sortings = [], filters = [] }) {
287
+ async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
287
288
  const response = await client.query({
288
289
  query: gql`
289
290
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -303,6 +304,7 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
303
304
  activityType
304
305
  assignees {
305
306
  type
307
+ value
306
308
  assignee {
307
309
  id
308
310
  name
@@ -312,6 +314,7 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
312
314
  }
313
315
  approvalLine {
314
316
  type
317
+ value
315
318
  approver {
316
319
  id
317
320
  name
package/client/types.js CHANGED
@@ -20,6 +20,7 @@ export const ActivityUITypes = [
20
20
  { display: 'Generated', value: 'generated' },
21
21
  { display: 'Template', value: 'template' },
22
22
  { display: 'Board', value: 'board' },
23
+ { display: 'CustomElement', value: 'custom-element' },
23
24
  { display: 'Page', value: 'page' },
24
25
  { display: 'External URL', value: 'external' }
25
26
  ]
@@ -1,3 +1,4 @@
1
+ import '@material/mwc-icon';
1
2
  import './templates/activity-approval-context-template.js';
2
3
  import './templates/activity-thread-context-template.js';
3
4
  export default function bootstrap(): void;
@@ -1,3 +1,6 @@
1
+ import '@material/mwc-icon';
2
+ import './templates/activity-approval-context-template.js';
3
+ import './templates/activity-thread-context-template.js';
1
4
  import { html } from 'lit-html';
2
5
  import { store } from '@operato/shell';
3
6
  import { openOverlay, TOOL_POSITION } from '@operato/layout';
@@ -7,8 +10,6 @@ import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-dur
7
10
  import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js';
8
11
  import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js';
9
12
  import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js';
10
- import './templates/activity-approval-context-template.js';
11
- import './templates/activity-thread-context-template.js';
12
13
  export default function bootstrap() {
13
14
  ;
14
15
  [
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,I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D,qBAAqB,CAAC,UAAU,EAAE,uBAAuB,CAAC,CAAA;IAC1D,mBAAmB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;IAC1D,qBAAqB,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import { html } from 'lit-html'\nimport { store } from '@operato/shell'\nimport { openOverlay, TOOL_POSITION } from '@operato/layout'\nimport { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui'\n\nimport { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'\nimport { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js'\nimport { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js'\nimport { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'\nimport { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'\n\nimport './templates/activity-approval-context-template.js'\nimport './templates/activity-thread-context-template.js'\n\nexport default function bootstrap() {\n ;[\n {\n template: html` <activity-approval-context-template></activity-approval-context-template> `,\n context: 'activityApproval'\n },\n {\n template: html` <activity-thread-context-template></activity-thread-context-template> `,\n context: 'activityThread'\n }\n ].forEach(({ template, context }) => {\n store.dispatch({\n type: APPEND_CONTEXT_TOOL,\n tool: {\n position: TOOL_POSITION.FRONT,\n template: html`\n <mwc-icon\n @click=${async e => {\n openOverlay('context-toolbar-overlay', {\n template\n })\n }}\n >info</mwc-icon\n >\n `,\n context\n }\n })\n })\n\n registerGristEditor('duration', OxGristEditorDuration)\n registerGristRenderer('duration', OxGristRendererDuration)\n registerGristEditor('quantifier', OxGristEditorQuantifier)\n registerGristRenderer('quantifier', OxGristRendererQuantifier)\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,mDAAmD,CAAA;AAC1D,OAAO,iDAAiD,CAAA;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B,CAAC,CAAA;IAC1D,mBAAmB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;IAC1D,qBAAqB,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import '@material/mwc-icon'\nimport './templates/activity-approval-context-template.js'\nimport './templates/activity-thread-context-template.js'\n\nimport { html } from 'lit-html'\nimport { store } from '@operato/shell'\nimport { openOverlay, TOOL_POSITION } from '@operato/layout'\nimport { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui'\n\nimport { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'\nimport { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js'\nimport { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js'\nimport { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'\nimport { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'\n\nexport default function bootstrap() {\n ;[\n {\n template: html` <activity-approval-context-template></activity-approval-context-template> `,\n context: 'activityApproval'\n },\n {\n template: html` <activity-thread-context-template></activity-thread-context-template> `,\n context: 'activityThread'\n }\n ].forEach(({ template, context }) => {\n store.dispatch({\n type: APPEND_CONTEXT_TOOL,\n tool: {\n position: TOOL_POSITION.FRONT,\n template: html`\n <mwc-icon\n @click=${async e => {\n openOverlay('context-toolbar-overlay', {\n template\n })\n }}\n >info</mwc-icon\n >\n `,\n context\n }\n })\n })\n\n registerGristEditor('duration', OxGristEditorDuration)\n registerGristRenderer('duration', OxGristRendererDuration)\n registerGristEditor('quantifier', OxGristEditorQuantifier)\n registerGristRenderer('quantifier', OxGristRendererQuantifier)\n}\n"]}
@@ -173,6 +173,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
173
173
  state
174
174
  assignees {
175
175
  type
176
+ value
176
177
  assignee {
177
178
  id
178
179
  name
@@ -182,6 +183,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
182
183
  }
183
184
  approvalLine {
184
185
  type
186
+ value
185
187
  approver {
186
188
  id
187
189
  name
@@ -229,6 +231,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
229
231
  state
230
232
  assignees {
231
233
  type
234
+ value
232
235
  assignee {
233
236
  id
234
237
  name
@@ -238,6 +241,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
238
241
  }
239
242
  approvalLine {
240
243
  type
244
+ value
241
245
  approver {
242
246
  id
243
247
  name
@@ -287,6 +291,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
287
291
  state
288
292
  assignees {
289
293
  type
294
+ value
290
295
  assignee {
291
296
  id
292
297
  name
@@ -296,6 +301,7 @@ let ActivityStarterForm = class ActivityStarterForm extends localize(i18next)(Li
296
301
  }
297
302
  approvalLine {
298
303
  type
304
+ value
299
305
  approver {
300
306
  id
301
307
  name
@@ -1 +1 @@
1
- {"version":3,"file":"activity-starter-form.js","sourceRoot":"","sources":["../../client/components/activity-starter-form.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,2BAA2B,CAAA;AAClC,OAAO,wDAAwD,CAAA;AAC/D,OAAO,8BAA8B,CAAA;AAErC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,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IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAe;AAC1C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAA2B;AA1C3C,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAsc/B;SAtcY,mBAAmB","sourcesContent":["import '@material/mwc-button'\nimport '@material/mwc-icon-button'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@things-factory/organization'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-starter-form')\nexport class ActivityStarterForm extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n content {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: var(--padding-default);\n overflow: auto;\n }\n\n section {\n display: flex;\n flex-direction: column;\n }\n\n #description {\n height: 60px;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n\n mwc-button {\n margin-left: var(--margin-default);\n }\n `\n ]\n\n @property({ type: String }) activityId?: string\n @property({ type: Object }) activity?: any\n @property({ type: Object }) activityInstance: any = {}\n\n render() {\n const { model, thumbnail } = this.activity || {}\n\n const inputSpec = (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n label: item.name\n }\n })\n\n const {\n id,\n name,\n description,\n input,\n state,\n approvalLine,\n assignees,\n threadsMin = 0,\n threadsMax = 0\n } = this.activityInstance || {}\n const draftable = !id\n const postable = id && state === 'draft'\n\n return html`\n <content>\n <section>\n <label for=\"name\">title</label>\n <input\n id=\"name\"\n .value=${name || this.activity?.name}\n @change=${e => (this.activityInstance.name = e.currentTarget.value)}\n />\n </section>\n\n <section>\n <label for=\"description\">description</label>\n <textarea\n id=\"description\"\n .value=${description || this.activity?.description}\n @change=${e => {\n this.activityInstance.description = e.currentTarget.value\n }}\n ></textarea>\n </section>\n\n <section>\n <label for=\"threads-min\">Threads Min</label>\n <input\n id=\"threadsMin\"\n type=\"number\"\n .value=${threadsMin || 0}\n @change=${e => (this.activityInstance.threadsMin = e.currentTarget.valueAsNumber)}\n />\n\n <label for=\"threads-max\">Threads Max</label>\n <input\n id=\"threads-max\"\n type=\"number\"\n .value=${threadsMax || 0}\n @change=${e => (this.activityInstance.threadsMax = e.currentTarget.valueAsNumber)}\n />\n </section>\n\n <section>\n <label>Assignees</label>\n ${assignees\n ? html`\n <assignees-view\n .value=${assignees}\n @click=${this.onClickAssignees.bind(this)}\n @change=${e => (this.activityInstance.assignees = e.currentTarget.value)}\n ></assignees-view>\n `\n : html`<mwc-icon-button icon=\"group_add\" @click=${this.onClickAssignees.bind(this)}></mwc-icon-button>`}\n </section>\n\n <section>\n <label>Approval Line</label>\n ${approvalLine\n ? html`\n <approval-line-view\n .model=${approvalLine}\n @click=${this.onClickApprovalLine.bind(this)}\n @change=${e => (this.activityInstance.approvalLine = e.currentTarget.value)}\n ></approval-line-view>\n `\n : html`<mwc-icon-button icon=\"group_add\" @click=${this.onClickApprovalLine.bind(this)}></mwc-icon-button>`}\n </section>\n\n <section>\n <img src=${thumbnail} />\n </section>\n\n <label>Input</label>\n\n ${!model\n ? html``\n : html`\n <ox-properties-dynamic-view\n .props=${inputSpec}\n .value=${input}\n @property-change=${e => {\n this.activityInstance.input = e.currentTarget.value\n console.log('activity-instance', this.activityInstance.input)\n }}\n ></ox-properties-dynamic-view>\n `}\n </content>\n\n <div class=\"button-container\">\n <mwc-button raised @click=${e => history.back()}>${i18next.t('button.close')}</mwc-button>\n ${when(\n draftable,\n () => html`\n <mwc-button raised @click=${this.draftActivityInstance.bind(this)}>${i18next.t('button.draft')}</mwc-button>\n `\n )}\n ${when(\n postable,\n () => html`\n <mwc-button raised @click=${this.updateActivityInstance.bind(this)}>${i18next.t('button.save')}</mwc-button>\n <mwc-button raised @click=${this.postActivityInstance.bind(this)}>${i18next.t('button.post')}</mwc-button>\n `\n )}\n </div>\n `\n }\n\n firstUpdated() {\n this.fetchActivity(this.activityId)\n }\n\n async fetchActivity(id) {\n const response = await client.query({\n query: gql`\n query activity($id: String!) {\n activity(id: $id) {\n id\n name\n description\n state\n thumbnail\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activity = response.data.activity\n }\n\n async draftActivityInstance() {\n const { activityId } = this\n\n const activityInstance = {\n activityId,\n name: this.activity.name,\n description: this.activity.description,\n ...this.activityInstance\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: NewActivityInstance!) {\n draftActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n state\n assignees {\n type\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.draftActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`\n })\n })\n }\n }\n\n async updateActivityInstance() {\n const {\n id,\n name,\n description,\n input,\n threadsMin = 0,\n threadsMax = 0,\n assignees,\n approvalLine\n } = this.activityInstance\n\n const patch = {\n name: name || this.activity.name,\n description: description || this.activity.description,\n input,\n threadsMin,\n threadsMax,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $patch: ActivityInstancePatch!) {\n updateActivityInstance(id: $id, patch: $patch) {\n id\n name\n description\n input\n state\n assignees {\n type\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n id,\n patch\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.updateActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.save')}`\n })\n })\n }\n }\n\n async postActivityInstance() {\n const {\n id,\n name,\n description,\n input,\n threadsMin = 0,\n threadsMax = 0,\n assignees,\n approvalLine\n } = this.activityInstance\n\n const activityInstance = {\n id,\n name: name || this.activity.name,\n description: description || this.activity.description,\n threadsMin,\n threadsMax,\n input,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstancePost!) {\n postActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n state\n assignees {\n type\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.postActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`\n })\n })\n }\n }\n\n onClickAssignees() {\n const { assignees } = this.activityInstance || {}\n\n const popup = openPopup(\n html`\n <assignees-editor-popup\n .value=${assignees}\n .confirmCallback=${value => {\n this.activityInstance.assignees = value\n this.requestUpdate()\n }}\n ></assignees-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/assignees-editor',\n size: 'large',\n title: i18next.t('title.assignee list')\n }\n )\n popup.onclosed = () => {}\n }\n\n onClickApprovalLine() {\n const { approvalLine } = this.activityInstance || {}\n\n const popup = openPopup(\n html`\n <approval-line-items-editor-popup\n .value=${approvalLine}\n .confirmCallback=${value => {\n this.activityInstance.approvalLine = value\n this.requestUpdate()\n }}\n ></approval-line-items-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/approval-line-items-editor',\n size: 'large',\n title: i18next.t('title.approval-line item list')\n }\n )\n popup.onclosed = () => {}\n }\n}\n"]}
1
+ {"version":3,"file":"activity-starter-form.js","sourceRoot":"","sources":["../../client/components/activity-starter-form.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,2BAA2B,CAAA;AAClC,OAAO,wDAAwD,CAAA;AAC/D,OAAO,8BAA8B,CAAA;AAErC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA/D;;QA0CuB,qBAAgB,GAAQ,EAAE,CAAA;IAkaxD,CAAC;IAhaC,MAAM;;QACJ,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAEhD,MAAM,SAAS,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;aAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;aAC7D,GAAG,CAAC,IAAI,CAAC,EAAE;YACV,uCACK,IAAI,KACP,KAAK,EAAE,IAAI,CAAC,IAAI,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,mBAAmB;QACjB,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAA;QAEpD,MAAM,KAAK,GAAG,SAAS,CACrB,IAAI,CAAA;;mBAES,YAAY;6BACF,KAAK,CAAC,EAAE;YACzB,IAAI,CAAC,gBAAgB,CAAC,YAAY,GAAG,KAAK,CAAA;YAC1C,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;SAClD,CACF,CAAA;QACD,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;IAC3B,CAAC;;AA1cM,0BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAoB;AAC/C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAe;AAC1C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAA2B;AA1C3C,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA4c/B;SA5cY,mBAAmB","sourcesContent":["import '@material/mwc-button'\nimport '@material/mwc-icon-button'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@things-factory/organization'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-starter-form')\nexport class ActivityStarterForm extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n content {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: var(--padding-default);\n overflow: auto;\n }\n\n section {\n display: flex;\n flex-direction: column;\n }\n\n #description {\n height: 60px;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n\n mwc-button {\n margin-left: var(--margin-default);\n }\n `\n ]\n\n @property({ type: String }) activityId?: string\n @property({ type: Object }) activity?: any\n @property({ type: Object }) activityInstance: any = {}\n\n render() {\n const { model, thumbnail } = this.activity || {}\n\n const inputSpec = (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n label: item.name\n }\n })\n\n const {\n id,\n name,\n description,\n input,\n state,\n approvalLine,\n assignees,\n threadsMin = 0,\n threadsMax = 0\n } = this.activityInstance || {}\n const draftable = !id\n const postable = id && state === 'draft'\n\n return html`\n <content>\n <section>\n <label for=\"name\">title</label>\n <input\n id=\"name\"\n .value=${name || this.activity?.name}\n @change=${e => (this.activityInstance.name = e.currentTarget.value)}\n />\n </section>\n\n <section>\n <label for=\"description\">description</label>\n <textarea\n id=\"description\"\n .value=${description || this.activity?.description}\n @change=${e => {\n this.activityInstance.description = e.currentTarget.value\n }}\n ></textarea>\n </section>\n\n <section>\n <label for=\"threads-min\">Threads Min</label>\n <input\n id=\"threadsMin\"\n type=\"number\"\n .value=${threadsMin || 0}\n @change=${e => (this.activityInstance.threadsMin = e.currentTarget.valueAsNumber)}\n />\n\n <label for=\"threads-max\">Threads Max</label>\n <input\n id=\"threads-max\"\n type=\"number\"\n .value=${threadsMax || 0}\n @change=${e => (this.activityInstance.threadsMax = e.currentTarget.valueAsNumber)}\n />\n </section>\n\n <section>\n <label>Assignees</label>\n ${assignees\n ? html`\n <assignees-view\n .value=${assignees}\n @click=${this.onClickAssignees.bind(this)}\n @change=${e => (this.activityInstance.assignees = e.currentTarget.value)}\n ></assignees-view>\n `\n : html`<mwc-icon-button icon=\"group_add\" @click=${this.onClickAssignees.bind(this)}></mwc-icon-button>`}\n </section>\n\n <section>\n <label>Approval Line</label>\n ${approvalLine\n ? html`\n <approval-line-view\n .model=${approvalLine}\n @click=${this.onClickApprovalLine.bind(this)}\n @change=${e => (this.activityInstance.approvalLine = e.currentTarget.value)}\n ></approval-line-view>\n `\n : html`<mwc-icon-button icon=\"group_add\" @click=${this.onClickApprovalLine.bind(this)}></mwc-icon-button>`}\n </section>\n\n <section>\n <img src=${thumbnail} />\n </section>\n\n <label>Input</label>\n\n ${!model\n ? html``\n : html`\n <ox-properties-dynamic-view\n .props=${inputSpec}\n .value=${input}\n @property-change=${e => {\n this.activityInstance.input = e.currentTarget.value\n console.log('activity-instance', this.activityInstance.input)\n }}\n ></ox-properties-dynamic-view>\n `}\n </content>\n\n <div class=\"button-container\">\n <mwc-button raised @click=${e => history.back()}>${i18next.t('button.close')}</mwc-button>\n ${when(\n draftable,\n () => html`\n <mwc-button raised @click=${this.draftActivityInstance.bind(this)}>${i18next.t('button.draft')}</mwc-button>\n `\n )}\n ${when(\n postable,\n () => html`\n <mwc-button raised @click=${this.updateActivityInstance.bind(this)}>${i18next.t('button.save')}</mwc-button>\n <mwc-button raised @click=${this.postActivityInstance.bind(this)}>${i18next.t('button.post')}</mwc-button>\n `\n )}\n </div>\n `\n }\n\n firstUpdated() {\n this.fetchActivity(this.activityId)\n }\n\n async fetchActivity(id) {\n const response = await client.query({\n query: gql`\n query activity($id: String!) {\n activity(id: $id) {\n id\n name\n description\n state\n thumbnail\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activity = response.data.activity\n }\n\n async draftActivityInstance() {\n const { activityId } = this\n\n const activityInstance = {\n activityId,\n name: this.activity.name,\n description: this.activity.description,\n ...this.activityInstance\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: NewActivityInstance!) {\n draftActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n state\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.draftActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`\n })\n })\n }\n }\n\n async updateActivityInstance() {\n const {\n id,\n name,\n description,\n input,\n threadsMin = 0,\n threadsMax = 0,\n assignees,\n approvalLine\n } = this.activityInstance\n\n const patch = {\n name: name || this.activity.name,\n description: description || this.activity.description,\n input,\n threadsMin,\n threadsMax,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $patch: ActivityInstancePatch!) {\n updateActivityInstance(id: $id, patch: $patch) {\n id\n name\n description\n input\n state\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n id,\n patch\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.updateActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.save')}`\n })\n })\n }\n }\n\n async postActivityInstance() {\n const {\n id,\n name,\n description,\n input,\n threadsMin = 0,\n threadsMax = 0,\n assignees,\n approvalLine\n } = this.activityInstance\n\n const activityInstance = {\n id,\n name: name || this.activity.name,\n description: description || this.activity.description,\n threadsMin,\n threadsMax,\n input,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstancePost!) {\n postActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n state\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.activityInstance = response.data.postActivityInstance\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`\n })\n })\n }\n }\n\n onClickAssignees() {\n const { assignees } = this.activityInstance || {}\n\n const popup = openPopup(\n html`\n <assignees-editor-popup\n .value=${assignees}\n .confirmCallback=${value => {\n this.activityInstance.assignees = value\n this.requestUpdate()\n }}\n ></assignees-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/assignees-editor',\n size: 'large',\n title: i18next.t('title.assignee list')\n }\n )\n popup.onclosed = () => {}\n }\n\n onClickApprovalLine() {\n const { approvalLine } = this.activityInstance || {}\n\n const popup = openPopup(\n html`\n <approval-line-items-editor-popup\n .value=${approvalLine}\n .confirmCallback=${value => {\n this.activityInstance.approvalLine = value\n this.requestUpdate()\n }}\n ></approval-line-items-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/approval-line-items-editor',\n size: 'large',\n title: i18next.t('title.approval-line item list')\n }\n )\n popup.onclosed = () => {}\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js';
2
2
  import '@operato/board/ox-board-viewer.js';
3
- import '@things-factory/organization';
4
3
  import { PageView } from '@operato/shell';
5
4
  export declare const ActivityThreadStatus: {
6
5
  Assigned: string;
@@ -38,12 +37,13 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
38
37
  activityApproval: any;
39
38
  };
40
39
  render(): import("lit-html").TemplateResult<1>;
41
- activityContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
40
+ activityContent(): any;
42
41
  templateContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
43
42
  getInputSpec(): any;
44
43
  getOutputSpec(): any;
45
44
  generatedContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/keyed").Keyed>;
46
45
  boardContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/keyed").Keyed>;
46
+ customElementContent(): any;
47
47
  oxBoardViewer: any;
48
48
  getOutputFromBoard(): any;
49
49
  updated(changes: any): void;