@things-factory/worklist 6.0.26 → 6.0.28

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 (213) hide show
  1. package/client/bootstrap.ts +13 -4
  2. package/client/components/activity-starter-form.ts +41 -10
  3. package/client/grist-editor/grist-editor-activity-search-key.ts +79 -0
  4. package/client/grist-editor/popup-activity-search-keys-input.ts +167 -0
  5. package/client/pages/activity/activity-list-page.ts +74 -11
  6. package/client/pages/activity/activity-partial-view.ts +82 -0
  7. package/client/pages/activity/starter-list-page.ts +1 -0
  8. package/client/pages/activity-approval/activity-approval-page.ts +61 -14
  9. package/client/pages/activity-instance/activity-instance-page.ts +18 -0
  10. package/client/pages/activity-instance/activity-instance-search-page.ts +377 -0
  11. package/client/pages/activity-instance/activity-instance-view.ts +135 -0
  12. package/client/pages/activity-store/activity-store-page.ts +1 -1
  13. package/client/pages/activity-template/activity-template-list-page.ts +1 -1
  14. package/client/pages/activity-thread/activity-thread-page.ts +32 -6
  15. package/client/pages/activity-thread/activity-thread-view.ts +102 -0
  16. package/client/pages/installable-activity/installable-activity-list-page.ts +1 -1
  17. package/client/pages/todo/approval-waiting-list-page.ts +12 -2
  18. package/client/pages/todo/draft-list-page.ts +19 -5
  19. package/client/pages/todo/todo-list-page.ts +14 -3
  20. package/client/route.ts +4 -0
  21. package/client/types/activity-instance-type.ts +123 -0
  22. package/client/types/activity-instance.ts +124 -0
  23. package/client/types/activity-model-type.ts +40 -0
  24. package/client/types/activity-search-key-item-type.ts +9 -0
  25. package/client/types/activity-thread-type.ts +19 -0
  26. package/client/types/activity-thread.ts +88 -0
  27. package/client/types/activity.ts +97 -0
  28. package/client/{types.js → types/types.ts} +1 -9
  29. package/dist-client/bootstrap.d.ts +1 -0
  30. package/dist-client/bootstrap.js +7 -3
  31. package/dist-client/bootstrap.js.map +1 -1
  32. package/dist-client/components/activity-starter-form.d.ts +1 -1
  33. package/dist-client/components/activity-starter-form.js +40 -9
  34. package/dist-client/components/activity-starter-form.js.map +1 -1
  35. package/dist-client/grist-editor/grist-editor-activity-search-key.d.ts +12 -0
  36. package/dist-client/grist-editor/grist-editor-activity-search-key.js +70 -0
  37. package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -0
  38. package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +17 -0
  39. package/dist-client/grist-editor/popup-activity-search-keys-input.js +177 -0
  40. package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -0
  41. package/dist-client/pages/activity/activity-list-page.d.ts +4 -0
  42. package/dist-client/pages/activity/activity-list-page.js +73 -11
  43. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  44. package/dist-client/pages/activity/activity-partial-view.d.ts +13 -0
  45. package/dist-client/pages/activity/activity-partial-view.js +56 -0
  46. package/dist-client/pages/activity/activity-partial-view.js.map +1 -0
  47. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  48. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +2 -2
  49. package/dist-client/pages/activity-approval/activity-approval-page.js +59 -14
  50. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  51. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +2 -1
  52. package/dist-client/pages/activity-instance/activity-instance-page.js +15 -0
  53. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
  54. package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +76 -0
  55. package/dist-client/pages/activity-instance/activity-instance-search-page.js +371 -0
  56. package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -0
  57. package/dist-client/pages/activity-instance/activity-instance-view.d.ts +14 -0
  58. package/dist-client/pages/activity-instance/activity-instance-view.js +130 -0
  59. package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -0
  60. package/dist-client/pages/activity-store/activity-store-page.js +1 -1
  61. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
  62. package/dist-client/pages/activity-template/activity-template-list-page.js +1 -1
  63. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
  64. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +2 -2
  65. package/dist-client/pages/activity-thread/activity-thread-page.js +29 -6
  66. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  67. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +11 -0
  68. package/dist-client/pages/activity-thread/activity-thread-view.js +103 -0
  69. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -0
  70. package/dist-client/pages/installable-activity/installable-activity-list-page.js +1 -1
  71. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  72. package/dist-client/pages/todo/approval-waiting-list-page.js +12 -2
  73. package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
  74. package/dist-client/pages/todo/draft-list-page.d.ts +4 -8
  75. package/dist-client/pages/todo/draft-list-page.js +16 -3
  76. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  77. package/dist-client/pages/todo/todo-list-page.js +13 -3
  78. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  79. package/dist-client/route.d.ts +1 -1
  80. package/dist-client/route.js +3 -0
  81. package/dist-client/route.js.map +1 -1
  82. package/dist-client/tsconfig.tsbuildinfo +1 -1
  83. package/dist-client/types/activity-instance-type.d.ts +76 -0
  84. package/dist-client/types/activity-instance-type.js +11 -0
  85. package/dist-client/types/activity-instance-type.js.map +1 -0
  86. package/dist-client/types/activity-instance.d.ts +70 -0
  87. package/dist-client/types/activity-instance.js +36 -0
  88. package/dist-client/types/activity-instance.js.map +1 -0
  89. package/dist-client/types/activity-model-type.d.ts +31 -0
  90. package/dist-client/types/activity-model-type.js +18 -0
  91. package/dist-client/types/activity-model-type.js.map +1 -0
  92. package/dist-client/types/activity-search-key-item-type.d.ts +6 -0
  93. package/dist-client/types/activity-search-key-item-type.js +3 -0
  94. package/dist-client/types/activity-search-key-item-type.js.map +1 -0
  95. package/dist-client/types/activity-thread-type.d.ts +15 -0
  96. package/dist-client/types/activity-thread-type.js +7 -0
  97. package/dist-client/types/activity-thread-type.js.map +1 -0
  98. package/dist-client/types/activity-thread.d.ts +37 -0
  99. package/dist-client/types/activity-thread.js +51 -0
  100. package/dist-client/types/activity-thread.js.map +1 -0
  101. package/dist-client/types/activity.d.ts +62 -0
  102. package/dist-client/types/activity.js +35 -0
  103. package/dist-client/types/activity.js.map +1 -0
  104. package/dist-client/types/types.d.ts +15 -0
  105. package/dist-client/types/types.js +30 -0
  106. package/dist-client/types/types.js.map +1 -0
  107. package/dist-client/types.js +1 -0
  108. package/dist-client/types.js.map +1 -1
  109. package/dist-server/controllers/activity-approval/approve.js +3 -1
  110. package/dist-server/controllers/activity-approval/approve.js.map +1 -1
  111. package/dist-server/controllers/activity-approval/reject.js +2 -0
  112. package/dist-server/controllers/activity-approval/reject.js.map +1 -1
  113. package/dist-server/controllers/activity-installation/activity-installation-controller.js +25 -0
  114. package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -0
  115. package/dist-server/controllers/activity-installation/call-webhook.js +41 -0
  116. package/dist-server/controllers/activity-installation/call-webhook.js.map +1 -0
  117. package/dist-server/controllers/activity-installation/callback-registry.js +21 -0
  118. package/dist-server/controllers/activity-installation/callback-registry.js.map +1 -0
  119. package/dist-server/controllers/activity-instance/abort.js +1 -1
  120. package/dist-server/controllers/activity-instance/abort.js.map +1 -1
  121. package/dist-server/controllers/activity-instance/adjust.js +1 -1
  122. package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
  123. package/dist-server/controllers/activity-instance/delegate.js +5 -0
  124. package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
  125. package/dist-server/controllers/activity-instance/draft.js +27 -1
  126. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  127. package/dist-server/controllers/activity-instance/post.js +39 -4
  128. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  129. package/dist-server/controllers/activity-instance/start.js +1 -1
  130. package/dist-server/controllers/activity-instance/start.js.map +1 -1
  131. package/dist-server/controllers/activity-thread/submit.js +2 -2
  132. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  133. package/dist-server/controllers/common.js +105 -57
  134. package/dist-server/controllers/common.js.map +1 -1
  135. package/dist-server/controllers/index.js +1 -1
  136. package/dist-server/controllers/index.js.map +1 -1
  137. package/dist-server/service/activity/activity-history.js +15 -0
  138. package/dist-server/service/activity/activity-history.js.map +1 -1
  139. package/dist-server/service/activity/activity-search-key-item-type.js +28 -0
  140. package/dist-server/service/activity/activity-search-key-item-type.js.map +1 -0
  141. package/dist-server/service/activity/activity-type.js +32 -0
  142. package/dist-server/service/activity/activity-type.js.map +1 -1
  143. package/dist-server/service/activity/activity.js +25 -3
  144. package/dist-server/service/activity/activity.js.map +1 -1
  145. package/dist-server/service/activity-approval/event-subscriber.js +1 -1
  146. package/dist-server/service/activity-approval/event-subscriber.js.map +1 -1
  147. package/dist-server/service/activity-instance/activity-instance-history.js +53 -0
  148. package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
  149. package/dist-server/service/activity-instance/activity-instance-query.js +70 -0
  150. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  151. package/dist-server/service/activity-instance/activity-instance.js +53 -0
  152. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  153. package/dist-server/service/activity-instance/event-subscriber.js +4 -4
  154. package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
  155. package/dist-server/service/activity-thread/activity-thread.js +4 -1
  156. package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
  157. package/dist-server/service/installable-activity/installable-activity-mutation.js +1 -1
  158. package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
  159. package/dist-server/service/installable-activity/installable-activity-query.js +1 -1
  160. package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -1
  161. package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
  162. package/dist-server/tsconfig.tsbuildinfo +1 -1
  163. package/package.json +8 -7
  164. package/server/controllers/activity-approval/approve.ts +5 -2
  165. package/server/controllers/activity-approval/reject.ts +3 -0
  166. package/server/controllers/{activity-installation-controller.ts → activity-installation/activity-installation-controller.ts} +12 -1
  167. package/server/controllers/activity-instance/abort.ts +1 -1
  168. package/server/controllers/activity-instance/adjust.ts +1 -1
  169. package/server/controllers/activity-instance/delegate.ts +9 -1
  170. package/server/controllers/activity-instance/draft.ts +30 -3
  171. package/server/controllers/activity-instance/post.ts +55 -7
  172. package/server/controllers/activity-instance/start.ts +1 -1
  173. package/server/controllers/activity-thread/submit.ts +3 -2
  174. package/server/controllers/common.ts +133 -56
  175. package/server/controllers/index.ts +1 -1
  176. package/server/service/activity/activity-history.ts +13 -0
  177. package/server/service/activity/activity-search-key-item-type.ts +16 -0
  178. package/server/service/activity/activity-type.ts +28 -1
  179. package/server/service/activity/activity.ts +22 -3
  180. package/server/service/activity-approval/event-subscriber.ts +1 -1
  181. package/server/service/activity-instance/activity-instance-history.ts +41 -0
  182. package/server/service/activity-instance/activity-instance-query.ts +74 -1
  183. package/server/service/activity-instance/activity-instance.ts +41 -0
  184. package/server/service/activity-instance/event-subscriber.ts +4 -4
  185. package/server/service/activity-thread/activity-thread.ts +6 -3
  186. package/server/service/installable-activity/installable-activity-mutation.ts +1 -1
  187. package/server/service/installable-activity/installable-activity-query.ts +1 -1
  188. package/server/service/installable-activity/installable-activity.ts +3 -1
  189. package/things-factory.config.js +5 -5
  190. package/translations/en.json +5 -0
  191. package/translations/ko.json +5 -0
  192. package/translations/ms.json +5 -0
  193. package/translations/zh.json +5 -0
  194. package/dist-client/pages/installed-activity/installed-activity-list-page.d.ts +0 -45
  195. package/dist-client/pages/installed-activity/installed-activity-list-page.js +0 -412
  196. package/dist-client/pages/installed-activity/installed-activity-list-page.js.map +0 -1
  197. package/dist-client/pages/installed-activity/installed-activity-model-item-list.d.ts +0 -1
  198. package/dist-client/pages/installed-activity/installed-activity-model-item-list.js +0 -20
  199. package/dist-client/pages/installed-activity/installed-activity-model-item-list.js.map +0 -1
  200. package/dist-client/templates/activity-context-template.d.ts +0 -2
  201. package/dist-client/templates/activity-context-template.js +0 -62
  202. package/dist-client/templates/activity-context-template.js.map +0 -1
  203. package/dist-server/service/installed-activity/index.js +0 -10
  204. package/dist-server/service/installed-activity/index.js.map +0 -1
  205. package/dist-server/service/installed-activity/installed-activity-mutation.js +0 -60
  206. package/dist-server/service/installed-activity/installed-activity-mutation.js.map +0 -1
  207. package/dist-server/service/installed-activity/installed-activity-query.js +0 -48
  208. package/dist-server/service/installed-activity/installed-activity-query.js.map +0 -1
  209. package/dist-server/service/installed-activity/installed-activity-type.js +0 -21
  210. package/dist-server/service/installed-activity/installed-activity-type.js.map +0 -1
  211. package/dist-server/service/installed-activity/installed-activity.js +0 -70
  212. package/dist-server/service/installed-activity/installed-activity.js.map +0 -1
  213. /package/server/controllers/{call-webhook.ts → activity-installation/call-webhook.ts} +0 -0
@@ -1,16 +1,22 @@
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'
4
8
  import { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui'
5
9
 
6
- import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
10
+ import {
11
+ OxGristRendererJson5,
12
+ registerEditor as registerGristEditor,
13
+ registerRenderer as registerGristRenderer
14
+ } from '@operato/data-grist'
7
15
  import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js'
8
16
  import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js'
9
17
  import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'
10
18
  import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'
11
-
12
- import './templates/activity-approval-context-template.js'
13
- import './templates/activity-thread-context-template.js'
19
+ import { GristEditorActivitySearchKeys } from './grist-editor/grist-editor-activity-search-key.js'
14
20
 
15
21
  export default function bootstrap() {
16
22
  ;[
@@ -46,4 +52,7 @@ export default function bootstrap() {
46
52
  registerGristRenderer('duration', OxGristRendererDuration)
47
53
  registerGristEditor('quantifier', OxGristEditorQuantifier)
48
54
  registerGristRenderer('quantifier', OxGristRendererQuantifier)
55
+
56
+ registerGristEditor('activity-search-keys', GristEditorActivitySearchKeys)
57
+ registerGristRenderer('activity-search-keys', OxGristRendererJson5)
49
58
  }
@@ -5,7 +5,7 @@ import '@things-factory/organization'
5
5
 
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html, LitElement } from 'lit'
8
- import { customElement, property } from 'lit/decorators.js'
8
+ import { customElement, property, state } from 'lit/decorators.js'
9
9
  import { when } from 'lit/directives/when.js'
10
10
 
11
11
  import { client } from '@operato/graphql'
@@ -55,11 +55,12 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
55
55
  ]
56
56
 
57
57
  @property({ type: String }) activityId?: string
58
- @property({ type: Object }) activity?: any
59
- @property({ type: Object }) activityInstance: any = {}
58
+
59
+ @state() activity: any
60
+ @state() activityInstance: any = {}
60
61
 
61
62
  render() {
62
- const { model, thumbnail } = this.activity || {}
63
+ var { model, thumbnail } = this.activity || {}
63
64
 
64
65
  const inputSpec = (model || [])
65
66
  .filter(item => item.inout === 'in' || item.inout === 'inout')
@@ -70,17 +71,18 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
70
71
  }
71
72
  })
72
73
 
73
- const {
74
+ var {
74
75
  id,
75
76
  name,
76
77
  description,
77
78
  input,
78
79
  state,
79
- approvalLine,
80
- assignees,
80
+ approvalLine = this.activity?.approvalLine,
81
+ assignees = this.activity?.assignees,
81
82
  threadsMin = 0,
82
83
  threadsMax = 0
83
- } = this.activityInstance || {}
84
+ } = this.activityInstance
85
+
84
86
  const draftable = !id
85
87
  const postable = id && state === 'draft'
86
88
 
@@ -202,6 +204,26 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
202
204
  name
203
205
  description
204
206
  state
207
+ assignees {
208
+ type
209
+ value
210
+ assignee {
211
+ id
212
+ name
213
+ description
214
+ controlNo
215
+ }
216
+ }
217
+ approvalLine {
218
+ type
219
+ value
220
+ approver {
221
+ id
222
+ name
223
+ description
224
+ controlNo
225
+ }
226
+ }
205
227
  thumbnail
206
228
  model {
207
229
  name
@@ -228,11 +250,14 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
228
250
 
229
251
  async draftActivityInstance() {
230
252
  const { activityId } = this
253
+ var { name, description, assignees, approvalLine } = this.activity
231
254
 
232
255
  const activityInstance = {
233
256
  activityId,
234
- name: this.activity.name,
235
- description: this.activity.description,
257
+ name,
258
+ description,
259
+ assignees,
260
+ approvalLine,
236
261
  ...this.activityInstance
237
262
  }
238
263
 
@@ -247,6 +272,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
247
272
  state
248
273
  assignees {
249
274
  type
275
+ value
250
276
  assignee {
251
277
  id
252
278
  name
@@ -256,6 +282,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
256
282
  }
257
283
  approvalLine {
258
284
  type
285
+ value
259
286
  approver {
260
287
  id
261
288
  name
@@ -316,6 +343,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
316
343
  state
317
344
  assignees {
318
345
  type
346
+ value
319
347
  assignee {
320
348
  id
321
349
  name
@@ -325,6 +353,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
325
353
  }
326
354
  approvalLine {
327
355
  type
356
+ value
328
357
  approver {
329
358
  id
330
359
  name
@@ -387,6 +416,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
387
416
  state
388
417
  assignees {
389
418
  type
419
+ value
390
420
  assignee {
391
421
  id
392
422
  name
@@ -396,6 +426,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
396
426
  }
397
427
  approvalLine {
398
428
  type
429
+ value
399
430
  approver {
400
431
  id
401
432
  name
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+
5
+ import '../grist-editor/popup-activity-search-keys-input.js'
6
+
7
+ import { html } from 'lit'
8
+ import { customElement } from 'lit/decorators.js'
9
+
10
+ import { OxGristEditor } from '@operato/data-grist'
11
+ import { i18next } from '@operato/i18n'
12
+ import { openPopup, PopupHandle } from '@operato/popup'
13
+
14
+ @customElement('grist-editor-activity-search-keys')
15
+ export class GristEditorActivitySearchKeys extends OxGristEditor {
16
+ private popup?: PopupHandle
17
+
18
+ get editorTemplate() {
19
+ const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value
20
+ return html` <div tabindex="0">${value || ''}</div> `
21
+ }
22
+
23
+ _onclick(e: Event): void {
24
+ e.stopPropagation()
25
+ this.openEditorPopup()
26
+ }
27
+
28
+ _onkeydown(e: KeyboardEvent): void {
29
+ const key = e.key
30
+ if (key == 'Enter') {
31
+ e.stopPropagation()
32
+ this.openEditorPopup()
33
+ }
34
+ }
35
+
36
+ async openEditorPopup() {
37
+ if (this.popup) {
38
+ delete this.popup
39
+ }
40
+
41
+ const { name, help } = this.column.record?.options || {}
42
+
43
+ const confirmCallback = (newval: any) => {
44
+ this.dispatchEvent(
45
+ new CustomEvent('field-change', {
46
+ bubbles: true,
47
+ composed: true,
48
+ detail: {
49
+ before: this.value,
50
+ after: newval,
51
+ record: this.record,
52
+ column: this.column,
53
+ row: this.row
54
+ }
55
+ })
56
+ )
57
+ }
58
+
59
+ /*
60
+ 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
61
+ layout의 구성에 변화가 발생하면, 다시 render된다.
62
+ 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
63
+ 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
64
+ 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
65
+ 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
66
+ */
67
+ var template = html`
68
+ <popup-activity-search-keys-input .value=${this.value} .confirmCallback=${confirmCallback}>
69
+ </popup-activity-search-keys-input>
70
+ `
71
+
72
+ this.popup = openPopup(template, {
73
+ backdrop: true,
74
+ size: 'large',
75
+ title: `${name?.toUpperCase() || i18next.t('field.search-keys')} `,
76
+ help
77
+ })
78
+ }
79
+ }
@@ -0,0 +1,167 @@
1
+ import { css, html, LitElement } from 'lit'
2
+ import { customElement, property, query, state } from 'lit/decorators.js'
3
+
4
+ import { i18next } from '@operato/i18n'
5
+ import { closePopup } from '@operato/popup'
6
+ import { ScrollbarStyles } from '@operato/styles'
7
+ import { isMobileDevice } from '@operato/utils'
8
+ import { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
9
+ import { ActivitySearchKeyItem } from '../types/activity-search-key-item-type'
10
+
11
+ @customElement('popup-activity-search-keys-input')
12
+ export class PopupActivitySearchKeysInput extends LitElement {
13
+ static styles = [
14
+ ScrollbarStyles,
15
+ css`
16
+ :host {
17
+ display: flex;
18
+ flex-direction: column;
19
+
20
+ background-color: #fff;
21
+
22
+ width: var(--overlay-center-normal-width, 50%);
23
+ height: var(--overlay-center-normal-height, 50%);
24
+ }
25
+
26
+ ox-grist {
27
+ flex: 1;
28
+ }
29
+
30
+ .button-container {
31
+ display: flex;
32
+ margin-left: auto;
33
+ padding: var(--padding-default);
34
+ }
35
+ `
36
+ ]
37
+
38
+ @property({ type: Array }) value: ActivitySearchKeyItem[] = []
39
+ @property({ type: Object }) confirmCallback!: (newval: any) => void
40
+
41
+ @state() gristConfig: any = {
42
+ list: { fields: ['name', 'description', 'active'] },
43
+ columns: [
44
+ { type: 'gutter', gutterName: 'sequence' },
45
+ {
46
+ type: 'gutter',
47
+ gutterName: 'button',
48
+ icon: 'add',
49
+ handlers: {
50
+ click: 'record-copy'
51
+ }
52
+ },
53
+ {
54
+ type: 'gutter',
55
+ gutterName: 'button',
56
+ icon: 'delete',
57
+ handlers: {
58
+ click: 'record-delete'
59
+ }
60
+ },
61
+ {
62
+ type: 'gutter',
63
+ gutterName: 'button',
64
+ icon: 'arrow_upward',
65
+ handlers: {
66
+ click: 'move-up'
67
+ }
68
+ },
69
+ {
70
+ type: 'gutter',
71
+ gutterName: 'button',
72
+ icon: 'arrow_downward',
73
+ handlers: {
74
+ click: 'move-down'
75
+ }
76
+ },
77
+ {
78
+ type: 'string',
79
+ name: 'name',
80
+ header: i18next.t('field.name'),
81
+ record: {
82
+ editable: true
83
+ },
84
+ width: 140
85
+ },
86
+ {
87
+ type: 'string',
88
+ name: 'description',
89
+ header: i18next.t('field.description'),
90
+ record: {
91
+ editable: true
92
+ },
93
+ width: 180
94
+ },
95
+ {
96
+ type: 'string',
97
+ name: 'inputKey',
98
+ header: i18next.t('field.input-key'),
99
+ record: {
100
+ editable: true
101
+ },
102
+ width: 180
103
+ },
104
+ {
105
+ type: 'string',
106
+ name: 'tKey',
107
+ header: i18next.t('field.t-key'),
108
+ record: {
109
+ editable: true
110
+ },
111
+ width: 180
112
+ }
113
+ ],
114
+ rows: {
115
+ selectable: false
116
+ },
117
+ pagination: {
118
+ infinite: true
119
+ },
120
+ sorters: []
121
+ }
122
+
123
+ @query('ox-grist') private grist!: DataGrist
124
+
125
+ render() {
126
+ return html`
127
+ <ox-grist
128
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
129
+ .config=${this.gristConfig}
130
+ .fetchHandler=${this.fetchHandler.bind(this)}
131
+ ></ox-grist>
132
+
133
+ <div class="button-container">
134
+ <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
135
+ <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
136
+ </div>
137
+ `
138
+ }
139
+
140
+ async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {
141
+ const records = this.value || []
142
+ return {
143
+ total: records.length,
144
+ records
145
+ }
146
+ }
147
+
148
+ private onCancel(e: Event) {
149
+ closePopup(this)
150
+ }
151
+
152
+ private onConfirm(e: Event) {
153
+ this.grist.commit()
154
+
155
+ this.value = this.grist.data.records.map(({ name, description, inputKey, tKey }) => {
156
+ return {
157
+ name,
158
+ description,
159
+ inputKey,
160
+ tKey
161
+ }
162
+ })
163
+
164
+ this.confirmCallback && this.confirmCallback(this.value)
165
+ closePopup(this)
166
+ }
167
+ }
@@ -14,7 +14,14 @@ import { PageView, store } from '@operato/shell'
14
14
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
16
 
17
- import { ActivityTypes, ActivityUITypes } from '../../types.js'
17
+ import { ActivityTypes, ActivityUITypes } from '../../types/types.js'
18
+
19
+ export const ActivityStatus = [
20
+ { display: '', value: '' },
21
+ { display: 'Draft', value: 'draft' },
22
+ { display: 'Released', value: 'released' },
23
+ { display: 'Deprecated', value: 'deprecated' }
24
+ ]
18
25
 
19
26
  @customElement('activity-list-page')
20
27
  export class ActivityListPage extends connect(store)(localize(i18next)(PageView)) {
@@ -153,6 +160,17 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
153
160
  filter: 'search',
154
161
  width: 200
155
162
  },
163
+ {
164
+ type: 'select',
165
+ name: 'state',
166
+ header: i18next.t('field.status'),
167
+ record: {
168
+ editable: true,
169
+ options: ActivityStatus
170
+ },
171
+ filter: true,
172
+ width: 60
173
+ },
156
174
  {
157
175
  type: 'select',
158
176
  name: 'activityType',
@@ -166,16 +184,16 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
166
184
  // filter: true,
167
185
  width: 60
168
186
  },
169
- // {
170
- // type: 'json5',
171
- // name: 'model',
172
- // label: true,
173
- // header: i18next.t('field.model'),
174
- // record: {
175
- // editable: true
176
- // },
177
- // width: 120
178
- // },
187
+ {
188
+ type: 'activity-search-keys',
189
+ name: 'searchKeys',
190
+ label: true,
191
+ header: i18next.t('field.search-keys'),
192
+ record: {
193
+ editable: true
194
+ },
195
+ width: 120
196
+ },
179
197
  {
180
198
  type: 'number',
181
199
  name: 'priority',
@@ -257,6 +275,24 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
257
275
  filter: 'search',
258
276
  width: 120
259
277
  },
278
+ {
279
+ type: 'assignees',
280
+ name: 'assignees',
281
+ header: i18next.t('field.assignees'),
282
+ record: {
283
+ editable: true
284
+ },
285
+ width: 120
286
+ },
287
+ {
288
+ type: 'approval-line',
289
+ name: 'approvalLine',
290
+ header: i18next.t('field.approval-line'),
291
+ record: {
292
+ editable: true
293
+ },
294
+ width: 120
295
+ },
260
296
  {
261
297
  type: 'select',
262
298
  name: 'uiType',
@@ -400,6 +436,13 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
400
436
  name
401
437
  description
402
438
  activityType
439
+ searchKeys {
440
+ name
441
+ description
442
+ inputKey
443
+ tKey
444
+ }
445
+ state
403
446
  model {
404
447
  name
405
448
  description
@@ -426,6 +469,26 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
426
469
  id
427
470
  name
428
471
  }
472
+ assignees {
473
+ type
474
+ value
475
+ assignee {
476
+ id
477
+ name
478
+ description
479
+ controlNo
480
+ }
481
+ }
482
+ approvalLine {
483
+ type
484
+ value
485
+ approver {
486
+ id
487
+ name
488
+ description
489
+ controlNo
490
+ }
491
+ }
429
492
  uiType
430
493
  uiSource
431
494
  reportType
@@ -0,0 +1,82 @@
1
+ import { css, html, LitElement } from 'lit'
2
+ import { customElement, property, query, state } from 'lit/decorators.js'
3
+
4
+ import { i18next, localize } from '@operato/i18n'
5
+ import { ScrollbarStyles } from '@operato/styles'
6
+ import { Activity } from '../../types/activity'
7
+ import { ActivitySearchKeyItem } from '../../types/activity-search-key-item-type'
8
+ import { ActivityModelItem } from '../../types/activity-model-type'
9
+
10
+ @customElement('activity-partial-view')
11
+ export class ActivityView extends localize(i18next)(LitElement) {
12
+ static styles = [
13
+ ScrollbarStyles,
14
+ css`
15
+ :host {
16
+ display: flex;
17
+ flex-direction: column;
18
+
19
+ background-color: #fff;
20
+ }
21
+
22
+ div[content] {
23
+ flex: 1;
24
+
25
+ display: flex;
26
+ overflow: auto;
27
+ }
28
+ `
29
+ ]
30
+
31
+ @property({ type: Object }) activity?: Activity
32
+
33
+ render() {
34
+ if (!this.activity) {
35
+ return html`<div>no activity info.</div>`
36
+ }
37
+
38
+ const {
39
+ id,
40
+ name,
41
+ description,
42
+ activityType,
43
+ state,
44
+ searchKeys,
45
+ model,
46
+ priority,
47
+ startable,
48
+ schedule,
49
+ standardTime,
50
+ cycleTime,
51
+ tactTime,
52
+ leadTime,
53
+ issuerRole,
54
+ assigneeRole,
55
+ supervisoryRole,
56
+ assignees,
57
+ approvalLine,
58
+ uiType,
59
+ uiSource,
60
+ reportType,
61
+ reportSource
62
+ } = this.activity
63
+
64
+ return html`
65
+ <div>name: ${name}</div>
66
+ <div>description: ${description}</div>
67
+ <div>activityType: ${activityType}</div>
68
+ <div>state: ${state}</div>
69
+ ${this.renderSearchKeys(searchKeys!)} ${this.renderModel(model!)}
70
+ <div>priority: ${priority}</div>
71
+ <div>startable: ${startable}</div>
72
+ `
73
+ }
74
+
75
+ renderSearchKeys(searchKeys: ActivitySearchKeyItem[]) {
76
+ return html``
77
+ }
78
+
79
+ renderModel(model: ActivityModelItem[]) {
80
+ return html``
81
+ }
82
+ }
@@ -29,6 +29,7 @@ const FILTERS = [
29
29
  value: 'Warehouse'
30
30
  }
31
31
  ]
32
+
32
33
  @customElement('starter-list-page')
33
34
  export class StarterListPage extends connect(store)(localize(i18next)(PageView)) {
34
35
  static styles = [