@things-factory/worklist 5.0.7 → 5.0.8

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 (199) hide show
  1. package/client/{bootstrap.js → bootstrap.ts} +0 -0
  2. package/client/components/{activity-intro-view.js → activity-intro-view.ts} +29 -41
  3. package/client/{index.js → index.ts} +0 -0
  4. package/client/pages/activity/activity-list-page.js +2 -2
  5. package/client/pages/activity/activity-page.js +1 -1
  6. package/client/pages/activity/starter-list-page.js +1 -1
  7. package/client/pages/activity-instance/activity-instance-list-page.js +1 -1
  8. package/client/pages/activity-instance/activity-instance-page.js +1 -1
  9. package/client/pages/activity-store/activity-store-page.js +1 -1
  10. package/client/pages/activity-supervisor/reporter-list-page.js +1 -1
  11. package/client/pages/activity-template/activity-template-list-page.js +1 -1
  12. package/client/pages/activity-thread/activity-thread-list-page.js +1 -1
  13. package/client/pages/activity-thread/activity-thread-page.js +1 -1
  14. package/client/pages/todo/assigned-list-page.js +1 -1
  15. package/client/pages/todo/draft-list-page.js +2 -2
  16. package/client/pages/todo/pickable-list-page.js +2 -2
  17. package/client/pages/todo/todo-list-page.js +2 -2
  18. package/client/{route.js → route.ts} +1 -1
  19. package/client/tsconfig.json +11 -0
  20. package/dist-client/bootstrap.d.ts +1 -0
  21. package/dist-client/bootstrap.js +12 -0
  22. package/dist-client/bootstrap.js.map +1 -0
  23. package/dist-client/components/activity-/bowner-view.d.ts +1 -0
  24. package/dist-client/components/activity-/bowner-view.js +97 -0
  25. package/dist-client/components/activity-/bowner-view.js.map +1 -0
  26. package/dist-client/components/activity-instance-preview.d.ts +1 -0
  27. package/dist-client/components/activity-instance-preview.js +181 -0
  28. package/dist-client/components/activity-instance-preview.js.map +1 -0
  29. package/dist-client/components/activity-intro-view.d.ts +2 -0
  30. package/dist-client/components/activity-intro-view.js +105 -0
  31. package/dist-client/components/activity-intro-view.js.map +1 -0
  32. package/dist-client/components/activity-reporter-view.d.ts +1 -0
  33. package/dist-client/components/activity-reporter-view.js +97 -0
  34. package/dist-client/components/activity-reporter-view.js.map +1 -0
  35. package/dist-client/components/activity-starter-form.d.ts +1 -0
  36. package/dist-client/components/activity-starter-form.js +294 -0
  37. package/dist-client/components/activity-starter-form.js.map +1 -0
  38. package/dist-client/index.d.ts +1 -0
  39. package/dist-client/index.js +2 -0
  40. package/dist-client/index.js.map +1 -0
  41. package/dist-client/pages/activity/activity-list-page.d.ts +297 -0
  42. package/dist-client/pages/activity/activity-list-page.js +468 -0
  43. package/dist-client/pages/activity/activity-list-page.js.map +1 -0
  44. package/dist-client/pages/activity/activity-model-item-list.d.ts +169 -0
  45. package/dist-client/pages/activity/activity-model-item-list.js +285 -0
  46. package/dist-client/pages/activity/activity-model-item-list.js.map +1 -0
  47. package/dist-client/pages/activity/activity-page.d.ts +49 -0
  48. package/dist-client/pages/activity/activity-page.js +368 -0
  49. package/dist-client/pages/activity/activity-page.js.map +1 -0
  50. package/dist-client/pages/activity/starter-list-page.d.ts +143 -0
  51. package/dist-client/pages/activity/starter-list-page.js +209 -0
  52. package/dist-client/pages/activity/starter-list-page.js.map +1 -0
  53. package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +137 -0
  54. package/dist-client/pages/activity-instance/activity-instance-list-page.js +202 -0
  55. package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -0
  56. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +49 -0
  57. package/dist-client/pages/activity-instance/activity-instance-page.js +365 -0
  58. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -0
  59. package/dist-client/pages/activity-store/activity-store-page.d.ts +174 -0
  60. package/dist-client/pages/activity-store/activity-store-page.js +211 -0
  61. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -0
  62. package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +143 -0
  63. package/dist-client/pages/activity-supervisor/reporter-list-page.js +209 -0
  64. package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -0
  65. package/dist-client/pages/activity-template/activity-template-importer.d.ts +24 -0
  66. package/dist-client/pages/activity-template/activity-template-importer.js +98 -0
  67. package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -0
  68. package/dist-client/pages/activity-template/activity-template-list-page.d.ts +263 -0
  69. package/dist-client/pages/activity-template/activity-template-list-page.js +402 -0
  70. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -0
  71. package/dist-client/pages/activity-template/activity-template-model-item-list.d.ts +1 -0
  72. package/dist-client/pages/activity-template/activity-template-model-item-list.js +36 -0
  73. package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -0
  74. package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +24 -0
  75. package/dist-client/pages/activity-thread/activity-thread-importer.js +98 -0
  76. package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -0
  77. package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +145 -0
  78. package/dist-client/pages/activity-thread/activity-thread-list-page.js +284 -0
  79. package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -0
  80. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +46 -0
  81. package/dist-client/pages/activity-thread/activity-thread-page.js +331 -0
  82. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -0
  83. package/dist-client/pages/dashboard/dashboard-home.d.ts +1 -0
  84. package/dist-client/pages/dashboard/dashboard-home.js +17 -0
  85. package/dist-client/pages/dashboard/dashboard-home.js.map +1 -0
  86. package/dist-client/pages/todo/assigned-list-page.d.ts +124 -0
  87. package/dist-client/pages/todo/assigned-list-page.js +233 -0
  88. package/dist-client/pages/todo/assigned-list-page.js.map +1 -0
  89. package/dist-client/pages/todo/draft-list-page.d.ts +198 -0
  90. package/dist-client/pages/todo/draft-list-page.js +310 -0
  91. package/dist-client/pages/todo/draft-list-page.js.map +1 -0
  92. package/dist-client/pages/todo/pickable-list-page.d.ts +150 -0
  93. package/dist-client/pages/todo/pickable-list-page.js +260 -0
  94. package/dist-client/pages/todo/pickable-list-page.js.map +1 -0
  95. package/dist-client/pages/todo/todo-list-page.d.ts +232 -0
  96. package/dist-client/pages/todo/todo-list-page.js +333 -0
  97. package/dist-client/pages/todo/todo-list-page.js.map +1 -0
  98. package/dist-client/pages/worklist-home.d.ts +1 -0
  99. package/dist-client/pages/worklist-home.js +17 -0
  100. package/dist-client/pages/worklist-home.js.map +1 -0
  101. package/dist-client/route.d.ts +1 -0
  102. package/dist-client/route.js +53 -0
  103. package/dist-client/route.js.map +1 -0
  104. package/dist-client/tsconfig.tsbuildinfo +1 -0
  105. package/dist-client/types.d.ts +19 -0
  106. package/dist-client/types.js +37 -0
  107. package/dist-client/types.js.map +1 -0
  108. package/dist-server/controllers/activity-extension-controller.js.map +1 -1
  109. package/dist-server/controllers/activity-instance/abort.js.map +1 -1
  110. package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
  111. package/dist-server/controllers/activity-instance/assign.js.map +1 -1
  112. package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
  113. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  114. package/dist-server/controllers/activity-instance/end.js.map +1 -1
  115. package/dist-server/controllers/activity-instance/index.js +11 -24
  116. package/dist-server/controllers/activity-instance/index.js.map +1 -1
  117. package/dist-server/controllers/activity-instance/pick.js.map +1 -1
  118. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  119. package/dist-server/controllers/activity-instance/start.js.map +1 -1
  120. package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
  121. package/dist-server/controllers/activity-thread/abort.js.map +1 -1
  122. package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
  123. package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
  124. package/dist-server/controllers/activity-thread/end.js.map +1 -1
  125. package/dist-server/controllers/activity-thread/index.js +8 -21
  126. package/dist-server/controllers/activity-thread/index.js.map +1 -1
  127. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  128. package/dist-server/controllers/activity-thread/start.js.map +1 -1
  129. package/dist-server/controllers/activity-thread/terminate.js.map +1 -1
  130. package/dist-server/controllers/common.js.map +1 -1
  131. package/dist-server/controllers/index.js.map +1 -1
  132. package/dist-server/index.js +4 -17
  133. package/dist-server/index.js.map +1 -1
  134. package/dist-server/middlewares/index.js.map +1 -1
  135. package/dist-server/migrations/index.js.map +1 -1
  136. package/dist-server/routes.js.map +1 -1
  137. package/dist-server/service/activity/activity-history.js +68 -76
  138. package/dist-server/service/activity/activity-history.js.map +1 -1
  139. package/dist-server/service/activity/activity-model-type.js +51 -59
  140. package/dist-server/service/activity/activity-model-type.js.map +1 -1
  141. package/dist-server/service/activity/activity-mutation.js +39 -50
  142. package/dist-server/service/activity/activity-mutation.js.map +1 -1
  143. package/dist-server/service/activity/activity-query.js +61 -72
  144. package/dist-server/service/activity/activity-query.js.map +1 -1
  145. package/dist-server/service/activity/activity-type.js +91 -102
  146. package/dist-server/service/activity/activity-type.js.map +1 -1
  147. package/dist-server/service/activity/activity.js +68 -76
  148. package/dist-server/service/activity/activity.js.map +1 -1
  149. package/dist-server/service/activity/event-subscriber.js +2 -7
  150. package/dist-server/service/activity/event-subscriber.js.map +1 -1
  151. package/dist-server/service/activity/index.js.map +1 -1
  152. package/dist-server/service/activity-instance/activity-instance-history.js +80 -88
  153. package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
  154. package/dist-server/service/activity-instance/activity-instance-mutation.js +61 -72
  155. package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
  156. package/dist-server/service/activity-instance/activity-instance-query.js +67 -78
  157. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  158. package/dist-server/service/activity-instance/activity-instance-subscription.js +7 -18
  159. package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
  160. package/dist-server/service/activity-instance/activity-instance-type.js +96 -104
  161. package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
  162. package/dist-server/service/activity-instance/activity-instance.js +84 -92
  163. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  164. package/dist-server/service/activity-instance/event-subscriber.js +3 -8
  165. package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
  166. package/dist-server/service/activity-instance/index.js.map +1 -1
  167. package/dist-server/service/activity-template/activity-template-history.js +50 -58
  168. package/dist-server/service/activity-template/activity-template-history.js.map +1 -1
  169. package/dist-server/service/activity-template/activity-template-mutation.js +39 -50
  170. package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
  171. package/dist-server/service/activity-template/activity-template-query.js +34 -45
  172. package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
  173. package/dist-server/service/activity-template/activity-template-type.js +65 -76
  174. package/dist-server/service/activity-template/activity-template-type.js.map +1 -1
  175. package/dist-server/service/activity-template/activity-template.js +48 -56
  176. package/dist-server/service/activity-template/activity-template.js.map +1 -1
  177. package/dist-server/service/activity-template/event-subscriber.js +2 -7
  178. package/dist-server/service/activity-template/event-subscriber.js.map +1 -1
  179. package/dist-server/service/activity-template/index.js.map +1 -1
  180. package/dist-server/service/activity-thread/activity-thread-mutation.js +78 -89
  181. package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
  182. package/dist-server/service/activity-thread/activity-thread-query.js +45 -56
  183. package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
  184. package/dist-server/service/activity-thread/activity-thread-subscription.js +7 -18
  185. package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -1
  186. package/dist-server/service/activity-thread/activity-thread-type.js +25 -33
  187. package/dist-server/service/activity-thread/activity-thread-type.js.map +1 -1
  188. package/dist-server/service/activity-thread/activity-thread.js +42 -50
  189. package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
  190. package/dist-server/service/activity-thread/event-subscriber.js +2 -7
  191. package/dist-server/service/activity-thread/event-subscriber.js.map +1 -1
  192. package/dist-server/service/activity-thread/index.js.map +1 -1
  193. package/dist-server/service/index.js +5 -18
  194. package/dist-server/service/index.js.map +1 -1
  195. package/dist-server/tsconfig.tsbuildinfo +1 -0
  196. package/package.json +9 -7
  197. package/server/tsconfig.json +11 -0
  198. package/things-factory.config.js +2 -2
  199. package/tsconfig.json +0 -9
File without changes
@@ -3,52 +3,42 @@ import '@operato/property-editor/ox-properties-dynamic-view.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html, LitElement } from 'lit'
6
+ import { customElement, property } from 'lit/decorators.js'
6
7
 
7
8
  import { client } from '@operato/graphql'
8
9
  import { i18next, localize } from '@operato/i18n'
9
10
  import { ScrollbarStyles } from '@operato/styles'
10
11
 
12
+ @customElement('activity-intro-view')
11
13
  class ActivityIntroView extends localize(i18next)(LitElement) {
12
- static get properties() {
13
- return {
14
- activityTemplateId: String,
15
- activityTemplate: Object,
16
- activityInstance: Object
17
- }
18
- }
19
-
20
- static get styles() {
21
- return [
22
- ScrollbarStyles,
23
- css`
24
- :host {
25
- display: flex;
26
- flex-direction: column;
27
-
28
- background-color: #fff;
29
- }
30
-
31
- content {
32
- flex: 1;
33
- display: flex;
34
- flex-direction: column;
35
- padding: var(--padding-default);
36
- overflow: auto;
37
- }
38
-
39
- section {
40
- display: flex;
41
- flex-direction: column;
42
- }
43
- `
44
- ]
45
- }
14
+ @property({ type: String }) activityTemplateId: string = ''
15
+ @property({ type: Object }) activityTemplate: any
16
+ @property({ type: Object }) activityInstance: any = {}
17
+
18
+ static styles = [
19
+ ScrollbarStyles,
20
+ css`
21
+ :host {
22
+ display: flex;
23
+ flex-direction: column;
24
+
25
+ background-color: #fff;
26
+ }
46
27
 
47
- constructor() {
48
- super()
28
+ content {
29
+ flex: 1;
30
+ display: flex;
31
+ flex-direction: column;
32
+ padding: var(--padding-default);
33
+ overflow: auto;
34
+ }
49
35
 
50
- this.activityInstance = {}
51
- }
36
+ section {
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+ `
41
+ ]
52
42
 
53
43
  render() {
54
44
  const { name, description, thumbnail } = this.activityTemplate || {}
@@ -71,7 +61,7 @@ class ActivityIntroView extends localize(i18next)(LitElement) {
71
61
  this.fetchActivity(this.activityTemplateId)
72
62
  }
73
63
 
74
- async fetchActivity(id) {
64
+ async fetchActivity(id: string) {
75
65
  const response = await client.query({
76
66
  query: gql`
77
67
  query activityTemplate($id: String!) {
@@ -104,5 +94,3 @@ class ActivityIntroView extends localize(i18next)(LitElement) {
104
94
  this.activityTemplate = response.data.activityTemplate
105
95
  }
106
96
  }
107
-
108
- window.customElements.define('activity-intro-view', ActivityIntroView)
File without changes
@@ -3,7 +3,7 @@ import './activity-model-item-list.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { getEditor, getRenderer } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
@@ -13,7 +13,7 @@ import { PageView, store } from '@operato/shell'
13
13
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
14
  import { isMobileDevice } from '@operato/utils'
15
15
 
16
- import { ActivityTypes, ActivityUITypes } from '../../types'
16
+ import { ActivityTypes, ActivityUITypes } from '../../types.js'
17
17
 
18
18
  export class ActivityListPage extends connect(store)(localize(i18next)(PageView)) {
19
19
  static get properties() {
@@ -4,7 +4,7 @@ import '@operato/board/ox-board-viewer.js'
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
6
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
7
- import { connect } from 'pwa-helpers/connect-mixin'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
8
 
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
@@ -3,7 +3,7 @@ import '../../components/activity-starter-form.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next, localize } from '@operato/i18n'
@@ -2,7 +2,7 @@ import '@operato/data-grist'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html } from 'lit'
5
- import { connect } from 'pwa-helpers/connect-mixin'
5
+ import { connect } from 'pwa-helpers/connect-mixin.js'
6
6
 
7
7
  import { client } from '@operato/graphql'
8
8
  import { i18next, localize } from '@operato/i18n'
@@ -4,7 +4,7 @@ import '@operato/board/ox-board-viewer.js'
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
6
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
7
- import { connect } from 'pwa-helpers/connect-mixin'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
8
 
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
@@ -3,7 +3,7 @@ import '../../components/activity-intro-view'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next, localize } from '@operato/i18n'
@@ -3,7 +3,7 @@ import '../../components/activity-reporter-view.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next, localize } from '@operato/i18n'
@@ -4,7 +4,7 @@ import './activity-template-model-item-list.js'
4
4
 
5
5
  import gql from 'graphql-tag'
6
6
  import { css, html } from 'lit'
7
- import { connect } from 'pwa-helpers/connect-mixin'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
8
 
9
9
  import { getEditor, getRenderer } from '@operato/data-grist'
10
10
  import { client } from '@operato/graphql'
@@ -3,7 +3,7 @@ import './activity-thread-importer.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next, localize } from '@operato/i18n'
@@ -4,7 +4,7 @@ import '@operato/board/ox-board-viewer.js'
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
6
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
7
- import { connect } from 'pwa-helpers/connect-mixin'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
8
 
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
@@ -2,7 +2,7 @@ import '@operato/data-grist'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html } from 'lit'
5
- import { connect } from 'pwa-helpers/connect-mixin'
5
+ import { connect } from 'pwa-helpers/connect-mixin.js'
6
6
 
7
7
  import { getRenderer } from '@operato/data-grist'
8
8
  import { client } from '@operato/graphql'
@@ -3,7 +3,7 @@ import '../../components/activity-starter-form.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { getRenderer } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
@@ -13,7 +13,7 @@ import { PageView, store } from '@operato/shell'
13
13
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
14
  import { isMobileDevice } from '@operato/utils'
15
15
 
16
- import { ActivityInstanceStatus, Priorities } from '../../types'
16
+ import { ActivityInstanceStatus, Priorities } from '../../types.js'
17
17
 
18
18
  const MIN = 60
19
19
  const HOUR = 60 * MIN
@@ -1,9 +1,9 @@
1
1
  import '@operato/data-grist'
2
- import '../../components/activity-instance-preview'
2
+ import '../../components/activity-instance-preview.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { getRenderer } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
@@ -3,7 +3,7 @@ import '@operato/data-grist'
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html } from 'lit'
5
5
  import { asyncReplace } from 'lit/directives/async-replace.js'
6
- import { connect } from 'pwa-helpers/connect-mixin'
6
+ import { connect } from 'pwa-helpers/connect-mixin.js'
7
7
 
8
8
  import { getRenderer } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
@@ -12,7 +12,7 @@ import { navigate, PageView, store } from '@operato/shell'
12
12
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
13
13
  import { isMobileDevice, sleep } from '@operato/utils'
14
14
 
15
- import { ActivityInstanceStatus, Priorities } from '../../types'
15
+ import { ActivityInstanceStatus, Priorities } from '../../types.js'
16
16
 
17
17
  const MIN = 60
18
18
  const HOUR = 60 * MIN
@@ -1,4 +1,4 @@
1
- export default function route(page) {
1
+ export default function route(page: string) {
2
2
  switch (page) {
3
3
  case 'worklist-home':
4
4
  import('./pages/worklist-home.js')
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "declaration": true,
6
+ "module": "esnext",
7
+ "outDir": "../dist-client",
8
+ "baseUrl": "./"
9
+ },
10
+ "include": ["./**/*"]
11
+ }
@@ -0,0 +1 @@
1
+ export default function bootstrap(): void;
@@ -0,0 +1,12 @@
1
+ import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
2
+ import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js';
3
+ import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js';
4
+ import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js';
5
+ import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js';
6
+ export default function bootstrap() {
7
+ registerGristEditor('duration', OxGristEditorDuration);
8
+ registerGristRenderer('duration', OxGristRendererDuration);
9
+ registerGristEditor('quantifier', OxGristEditorQuantifier);
10
+ registerGristRenderer('quantifier', OxGristRendererQuantifier);
11
+ }
12
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAA;AAEjG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAA;IACtD,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 { 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 registerGristEditor('duration', OxGristEditorDuration)\n registerGristRenderer('duration', OxGristRendererDuration)\n registerGristEditor('quantifier', OxGristEditorQuantifier)\n registerGristRenderer('quantifier', OxGristRendererQuantifier)\n}\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,97 @@
1
+ import '@material/mwc-button';
2
+ import '@operato/property-editor/ox-properties-dynamic-view.js';
3
+ import gql from 'graphql-tag';
4
+ import { css, html, LitElement } from 'lit';
5
+ import { client } from '@operato/graphql';
6
+ import { i18next, localize } from '@operato/i18n';
7
+ import { ScrollbarStyles } from '@operato/styles';
8
+ class ActivityOwnerView extends localize(i18next)(LitElement) {
9
+ static get properties() {
10
+ return {
11
+ activityId: String,
12
+ activity: Object,
13
+ activityInstance: Object
14
+ };
15
+ }
16
+ static get styles() {
17
+ return [
18
+ ScrollbarStyles,
19
+ css `
20
+ :host {
21
+ display: flex;
22
+ flex-direction: column;
23
+
24
+ background-color: #fff;
25
+ }
26
+
27
+ content {
28
+ flex: 1;
29
+ display: flex;
30
+ flex-direction: column;
31
+ padding: var(--padding-default);
32
+ overflow: auto;
33
+ }
34
+
35
+ section {
36
+ display: flex;
37
+ flex-direction: column;
38
+ }
39
+ `
40
+ ];
41
+ }
42
+ constructor() {
43
+ super();
44
+ this.activityInstance = {};
45
+ }
46
+ render() {
47
+ const { name, description, thumbnail } = this.activity || {};
48
+ return html `
49
+ <content>
50
+ <section>
51
+ <div>name: ${name}</div>
52
+ <div>description: ${description}</div>
53
+ </section>
54
+
55
+ <section>
56
+ <img src=${thumbnail} />
57
+ </section>
58
+ </content>
59
+ `;
60
+ }
61
+ firstUpdated() {
62
+ this.fetchActivity(this.activityId);
63
+ }
64
+ async fetchActivity(id) {
65
+ const response = await client.query({
66
+ query: gql `
67
+ query activity($id: String!) {
68
+ activity(id: $id) {
69
+ id
70
+ name
71
+ description
72
+ state
73
+ thumbnail
74
+ model {
75
+ name
76
+ description
77
+ active
78
+ tag
79
+ inout
80
+ type
81
+ unit
82
+ options
83
+ quantifier
84
+ spec
85
+ }
86
+ }
87
+ }
88
+ `,
89
+ variables: {
90
+ id
91
+ }
92
+ });
93
+ this.activity = response.data.activity;
94
+ }
95
+ }
96
+ window.customElements.define('activity-owner-view', ActivityOwnerView);
97
+ //# sourceMappingURL=activity-%08owner-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-\bowner-view.js","sourceRoot":"","sources":["../../client/components/activity-\bowner-view.js"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,wDAAwD,CAAA;AAE/D,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAC3D,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAE,MAAM;YAChB,gBAAgB,EAAE,MAAM;SACzB,CAAA;IACH,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,eAAe;YACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;OAoBF;SACF,CAAA;IACH,CAAC;IAED;QACE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;IAC5B,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAE5D,OAAO,IAAI,CAAA;;;uBAGQ,IAAI;8BACG,WAAW;;;;qBAIpB,SAAS;;;KAGzB,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAE;QACpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;OAsBT;YACD,SAAS,EAAE;gBACT,EAAE;aACH;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAA;IACxC,CAAC;CACF;AAED,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAA","sourcesContent":["import '@material/mwc-button'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nclass ActivityOwnerView extends localize(i18next)(LitElement) {\n static get properties() {\n return {\n activityId: String,\n activity: Object,\n activityInstance: Object\n }\n }\n\n static get styles() {\n return [\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 ]\n }\n\n constructor() {\n super()\n\n this.activityInstance = {}\n }\n\n render() {\n const { name, description, thumbnail } = this.activity || {}\n\n return html`\n <content>\n <section>\n <div>name: ${name}</div>\n <div>description: ${description}</div>\n </section>\n\n <section>\n <img src=${thumbnail} />\n </section>\n </content>\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\nwindow.customElements.define('activity-owner-view', ActivityOwnerView)\n"]}
@@ -0,0 +1,181 @@
1
+ import '@material/mwc-button';
2
+ import '@operato/property-editor/ox-properties-dynamic-view.js';
3
+ import gql from 'graphql-tag';
4
+ import { css, html, LitElement } from 'lit';
5
+ import { client } from '@operato/graphql';
6
+ import { i18next, localize } from '@operato/i18n';
7
+ import { notify } from '@operato/layout';
8
+ import { ScrollbarStyles } from '@operato/styles';
9
+ class ActivityInstancePreview extends localize(i18next)(LitElement) {
10
+ static get properties() {
11
+ return {
12
+ activityInstanceId: String,
13
+ activityInstance: Object,
14
+ activityThreads: Array
15
+ };
16
+ }
17
+ static get styles() {
18
+ return [
19
+ ScrollbarStyles,
20
+ css `
21
+ :host {
22
+ display: flex;
23
+ flex-direction: column;
24
+
25
+ background-color: #fff;
26
+ }
27
+
28
+ content {
29
+ flex: 1;
30
+ display: flex;
31
+ flex-direction: column;
32
+ padding: var(--padding-default);
33
+ overflow: auto;
34
+ }
35
+
36
+ section {
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+
41
+ #description {
42
+ height: 60px;
43
+ }
44
+
45
+ .button-container {
46
+ display: flex;
47
+ margin-left: auto;
48
+ padding: var(--padding-default);
49
+ }
50
+
51
+ mwc-button {
52
+ margin-left: var(--margin-default);
53
+ }
54
+ `
55
+ ];
56
+ }
57
+ constructor() {
58
+ super();
59
+ this.activityInstance = {};
60
+ }
61
+ render() {
62
+ var _a;
63
+ const { id, name, description, input, state, threadsMin = 0, threadsMax = 0, activity } = this.activityInstance || {};
64
+ const { model, thumbnail } = activity || {};
65
+ const inputSpec = (model || [])
66
+ .filter(item => item.inout === 'in' || item.inout === 'inout')
67
+ .map(item => {
68
+ return Object.assign(Object.assign({}, item), { label: item.name });
69
+ });
70
+ const pickable = !(((_a = this.activityThreads) === null || _a === void 0 ? void 0 : _a.length) > 0);
71
+ return html `
72
+ <content>
73
+ <section>
74
+ <h2>mission statement</h2>
75
+ <div>title: ${name}</div>
76
+ <div>${description}</div>
77
+ <div>min-max: ${threadsMin} - ${threadsMax}</div>
78
+ <img src=${thumbnail} />
79
+ </section>
80
+
81
+ <label>Input</label>
82
+ ${!model
83
+ ? html ``
84
+ : html `
85
+ <ox-properties-dynamic-view
86
+ .props=${inputSpec}
87
+ .value=${input}
88
+ @change=${e => {
89
+ /* TODO remove this comment, after solving the problem of sometimes not saving. */
90
+ this.activityInstance.input = e.currentTarget.value;
91
+ console.log('activity-instance', this.activityInstance.input);
92
+ }}
93
+ ></ox-properties-dynamic-view>
94
+ `}
95
+ </content>
96
+
97
+ <div class="button-container">
98
+ <mwc-button raised @click=${e => history.back()}>${i18next.t('button.close')}</mwc-button>
99
+ ${pickable
100
+ ? html `<mwc-button raised @click=${this.pickActivityInstance.bind(this)}
101
+ >${i18next.t('button.pick')}</mwc-button
102
+ >`
103
+ : html ``}
104
+ </div>
105
+ `;
106
+ }
107
+ updated(changes) {
108
+ if (changes.has('activityInstanceId')) {
109
+ this.fetchAll(this.activityInstanceId);
110
+ }
111
+ }
112
+ async fetchAll(id) {
113
+ const response = await client.query({
114
+ query: gql `
115
+ {
116
+ activityInstance(id: "${id}") {
117
+ id
118
+ name
119
+ description
120
+ input
121
+ state
122
+ threadsMin
123
+ threadsMax
124
+ activity {
125
+ id
126
+ name
127
+ description
128
+ state
129
+ thumbnail
130
+ model {
131
+ name
132
+ description
133
+ active
134
+ tag
135
+ inout
136
+ type
137
+ unit
138
+ options
139
+ quantifier
140
+ spec
141
+ }
142
+ }
143
+ }
144
+
145
+ activityThreads(filters: [{ name: "activityInstanceId", operator: "eq", value: "${id}"}]) {
146
+ items {
147
+ id
148
+ }
149
+ total
150
+ }
151
+ }
152
+ `
153
+ });
154
+ this.activityInstance = response.data.activityInstance;
155
+ this.activityThreads = response.data.activityThreads.items;
156
+ }
157
+ async pickActivityInstance() {
158
+ const response = await client.mutate({
159
+ mutation: gql `
160
+ mutation ($id: String!) {
161
+ pickActivityInstance(id: $id) {
162
+ id
163
+ }
164
+ }
165
+ `,
166
+ variables: {
167
+ id: this.activityInstanceId
168
+ }
169
+ });
170
+ if (!response.errors) {
171
+ this.activityThreads = [response.data.pickActivityInstance];
172
+ notify({
173
+ message: i18next.t('text.info_x_successfully', {
174
+ x: `${i18next.t('label.activity-instance')} ${i18next.t('text.pick')}`
175
+ })
176
+ });
177
+ }
178
+ }
179
+ }
180
+ window.customElements.define('activity-instance-preview', ActivityInstancePreview);
181
+ //# sourceMappingURL=activity-instance-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-instance-preview.js","sourceRoot":"","sources":["../../client/components/activity-instance-preview.js"],"names":[],"mappings":"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","sourcesContent":["import '@material/mwc-button'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { ScrollbarStyles } from '@operato/styles'\n\nclass ActivityInstancePreview extends localize(i18next)(LitElement) {\n static get properties() {\n return {\n activityInstanceId: String,\n activityInstance: Object,\n activityThreads: Array\n }\n }\n\n static get styles() {\n return [\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\n constructor() {\n super()\n\n this.activityInstance = {}\n }\n\n render() {\n const {\n id,\n name,\n description,\n input,\n state,\n threadsMin = 0,\n threadsMax = 0,\n activity\n } = this.activityInstance || {}\n const { model, thumbnail } = 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 pickable = !(this.activityThreads?.length > 0)\n\n return html`\n <content>\n <section>\n <h2>mission statement</h2>\n <div>title: ${name}</div>\n <div>${description}</div>\n <div>min-max: ${threadsMin} - ${threadsMax}</div>\n <img src=${thumbnail} />\n </section>\n\n <label>Input</label>\n ${!model\n ? html``\n : html`\n <ox-properties-dynamic-view\n .props=${inputSpec}\n .value=${input}\n @change=${e => {\n /* TODO remove this comment, after solving the problem of sometimes not saving. */\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 ${pickable\n ? html`<mwc-button raised @click=${this.pickActivityInstance.bind(this)}\n >${i18next.t('button.pick')}</mwc-button\n >`\n : html``}\n </div>\n `\n }\n\n updated(changes) {\n if (changes.has('activityInstanceId')) {\n this.fetchAll(this.activityInstanceId)\n }\n }\n\n async fetchAll(id) {\n const response = await client.query({\n query: gql`\n {\n activityInstance(id: \"${id}\") {\n id\n name\n description\n input\n state\n threadsMin\n threadsMax\n activity {\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 activityThreads(filters: [{ name: \"activityInstanceId\", operator: \"eq\", value: \"${id}\"}]) {\n items {\n id\n }\n total\n }\n }\n `\n })\n\n this.activityInstance = response.data.activityInstance\n this.activityThreads = response.data.activityThreads.items\n }\n\n async pickActivityInstance() {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n pickActivityInstance(id: $id) {\n id\n }\n }\n `,\n variables: {\n id: this.activityInstanceId\n }\n })\n\n if (!response.errors) {\n this.activityThreads = [response.data.pickActivityInstance]\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.pick')}`\n })\n })\n }\n }\n}\n\nwindow.customElements.define('activity-instance-preview', ActivityInstancePreview)\n"]}
@@ -0,0 +1,2 @@
1
+ import '@material/mwc-button';
2
+ import '@operato/property-editor/ox-properties-dynamic-view.js';