@things-factory/worklist 6.0.36 → 6.0.39

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 (96) hide show
  1. package/client/bootstrap.ts +3 -6
  2. package/client/grist-editor/grist-editor-activity-search-key.ts +3 -2
  3. package/client/grist-editor/grist-renderer-activity-search-key.ts +25 -0
  4. package/client/grist-editor/popup-activity-search-keys-input.ts +1 -1
  5. package/client/pages/activity/activity-list-page.ts +27 -54
  6. package/client/pages/activity/activity-partial-view.ts +0 -3
  7. package/client/pages/activity/starter-list-page.ts +2 -2
  8. package/client/pages/activity-instance/activity-instance-list-page.ts +10 -5
  9. package/client/pages/activity-store/activity-store-page.ts +2 -2
  10. package/client/pages/activity-supervisor/reporter-list-page.ts +2 -2
  11. package/client/pages/activity-template/activity-template-list-page.ts +2 -2
  12. package/client/pages/activity-thread/activity-thread-list-page.ts +2 -2
  13. package/client/pages/activity-thread/activity-thread-page.ts +4 -11
  14. package/client/pages/installable-activity/installable-activity-list-page.ts +6 -28
  15. package/client/pages/todo/approval-waiting-list-page.ts +42 -59
  16. package/client/pages/todo/assigned-list-page.ts +2 -2
  17. package/client/pages/todo/done-list-page.ts +52 -36
  18. package/client/pages/todo/draft-list-page.ts +16 -14
  19. package/client/pages/todo/pickable-list-page.ts +2 -2
  20. package/client/pages/todo/todo-list-page.ts +57 -59
  21. package/client/types/activity.ts +0 -6
  22. package/dist-client/bootstrap.js +3 -2
  23. package/dist-client/bootstrap.js.map +1 -1
  24. package/dist-client/grist-editor/grist-editor-activity-search-key.js +3 -2
  25. package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -1
  26. package/dist-client/grist-editor/grist-renderer-activity-search-key.d.ts +3 -0
  27. package/dist-client/grist-editor/grist-renderer-activity-search-key.js +22 -0
  28. package/dist-client/grist-editor/grist-renderer-activity-search-key.js.map +1 -0
  29. package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +1 -1
  30. package/dist-client/grist-editor/popup-activity-search-keys-input.js +1 -1
  31. package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -1
  32. package/dist-client/pages/activity/activity-list-page.d.ts +2 -7
  33. package/dist-client/pages/activity/activity-list-page.js +25 -52
  34. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  35. package/dist-client/pages/activity/activity-partial-view.js +1 -1
  36. package/dist-client/pages/activity/activity-partial-view.js.map +1 -1
  37. package/dist-client/pages/activity/starter-list-page.d.ts +2 -7
  38. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  39. package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +2 -7
  40. package/dist-client/pages/activity-instance/activity-instance-list-page.js +8 -3
  41. package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
  42. package/dist-client/pages/activity-store/activity-store-page.d.ts +2 -7
  43. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
  44. package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +2 -7
  45. package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
  46. package/dist-client/pages/activity-template/activity-template-list-page.d.ts +2 -7
  47. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
  48. package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +2 -7
  49. package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
  50. package/dist-client/pages/activity-thread/activity-thread-page.js +4 -6
  51. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  52. package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +2 -8
  53. package/dist-client/pages/installable-activity/installable-activity-list-page.js +2 -24
  54. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  55. package/dist-client/pages/todo/approval-waiting-list-page.d.ts +2 -7
  56. package/dist-client/pages/todo/approval-waiting-list-page.js +37 -57
  57. package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
  58. package/dist-client/pages/todo/assigned-list-page.d.ts +2 -7
  59. package/dist-client/pages/todo/assigned-list-page.js.map +1 -1
  60. package/dist-client/pages/todo/done-list-page.d.ts +2 -7
  61. package/dist-client/pages/todo/done-list-page.js +48 -33
  62. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  63. package/dist-client/pages/todo/draft-list-page.js +16 -15
  64. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  65. package/dist-client/pages/todo/pickable-list-page.d.ts +2 -7
  66. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  67. package/dist-client/pages/todo/todo-list-page.d.ts +2 -7
  68. package/dist-client/pages/todo/todo-list-page.js +52 -55
  69. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  70. package/dist-client/tsconfig.tsbuildinfo +1 -1
  71. package/dist-client/types/activity.d.ts +0 -3
  72. package/dist-client/types/activity.js.map +1 -1
  73. package/dist-server/controllers/activity-thread/save.js +2 -2
  74. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  75. package/dist-server/service/activity/activity-history.js +0 -15
  76. package/dist-server/service/activity/activity-history.js.map +1 -1
  77. package/dist-server/service/activity/activity-type.js +0 -24
  78. package/dist-server/service/activity/activity-type.js.map +1 -1
  79. package/dist-server/service/activity/activity.js +7 -22
  80. package/dist-server/service/activity/activity.js.map +1 -1
  81. package/dist-server/service/activity-approval/activity-approval-query.js +8 -0
  82. package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
  83. package/dist-server/service/activity-thread/activity-thread-query.js +4 -2
  84. package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
  85. package/dist-server/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +3 -3
  87. package/server/controllers/activity-thread/save.ts +2 -1
  88. package/server/service/activity/activity-history.ts +0 -12
  89. package/server/service/activity/activity-type.ts +0 -18
  90. package/server/service/activity/activity.ts +7 -19
  91. package/server/service/activity-approval/activity-approval-query.ts +8 -0
  92. package/server/service/activity-thread/activity-thread-query.ts +4 -2
  93. package/translations/en.json +27 -1
  94. package/translations/ko.json +27 -1
  95. package/translations/ms.json +70 -44
  96. package/translations/zh.json +69 -43
@@ -6,7 +6,7 @@ import { css, html } from 'lit'
6
6
  import { customElement, property, query, state } 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 { PageView, store } from '@operato/shell'
@@ -215,7 +215,7 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
215
215
  }
216
216
  }
217
217
 
218
- async fetchHandler({ page, limit, sortings = [], filters = [] }) {
218
+ async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
219
219
  const response = await client.query({
220
220
  query: gql`
221
221
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -6,29 +6,14 @@ import { css, html } from 'lit'
6
6
  import { customElement, property, query, state } 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 { navigate, PageView, store } from '@operato/shell'
13
13
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
- import { isMobileDevice, sleep } from '@operato/utils'
14
+ import { adjustFilters, isMobileDevice } from '@operato/utils'
15
15
 
16
- import { Priorities } from '../../types/types.js'
17
-
18
- const FILTERS = [
19
- {
20
- display: 'Important',
21
- value: 'Important'
22
- },
23
- {
24
- display: 'Imminent',
25
- value: 'Imminent'
26
- },
27
- {
28
- display: 'Disapproved',
29
- value: 'Disapproved'
30
- }
31
- ]
16
+ import { ActivityThreadStatus } from '../../types/activity-thread'
32
17
 
33
18
  @customElement('done-list-page')
34
19
  export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
@@ -86,9 +71,23 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
86
71
  <div id="filters">
87
72
  <ox-input-select-buttons
88
73
  .value=${this.filters}
89
- .options=${FILTERS}
74
+ .options=${[
75
+ {
76
+ display: i18next.t('label.filter-important'),
77
+ value: 'important'
78
+ },
79
+ {
80
+ display: i18next.t('label.filter-recent'),
81
+ value: 'recent'
82
+ },
83
+ {
84
+ display: i18next.t('label.filter-aborted'),
85
+ value: 'aborted'
86
+ }
87
+ ]}
90
88
  @change=${(e: CustomEvent) => {
91
89
  this.filters = (e.currentTarget as any)?.value
90
+ this.grist.fetch()
92
91
  }}
93
92
  multiple
94
93
  ></ox-input-select-buttons>
@@ -116,8 +115,9 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
116
115
  {
117
116
  type: 'gutter',
118
117
  gutterName: 'button',
119
- name: 'start',
120
- icon: 'play_arrow',
118
+ name: 'view',
119
+ icon: 'pageview',
120
+ title: i18next.t('title.view page'),
121
121
  handlers: {
122
122
  click: (columns, data, column, record, rowIndex) => {
123
123
  const { id } = record
@@ -162,14 +162,17 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
162
162
  hidden: true
163
163
  },
164
164
  {
165
- type: 'select',
165
+ type: 'number',
166
166
  name: 'priority',
167
167
  header: i18next.t('field.priority'),
168
168
  record: {
169
169
  editable: false,
170
- options: Priorities
170
+ renderer: function (value, column, record, rowIndex, field) {
171
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
172
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
173
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
174
+ }
171
175
  },
172
- // filter: true,
173
176
  width: 60
174
177
  },
175
178
  {
@@ -179,19 +182,18 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
179
182
  record: {
180
183
  editable: false,
181
184
  options: [
182
- { display: 'Draft', value: 'draft' },
183
- { display: 'Posted', value: 'posted' },
184
- { display: 'WaitingAssignment', value: 'waiting-assignment' },
185
- { display: 'Assigned', value: 'assigned' },
186
- { display: 'Started', value: 'started' },
187
- { display: 'Pending', value: 'pending' },
188
- { display: 'Escalated', value: 'escalated' },
189
- { display: 'Ended', value: 'ended' },
190
- { display: 'Aborted', value: 'aborted' }
185
+ { display: i18next.t('label.activity-state-draft'), value: 'draft' },
186
+ { display: i18next.t('label.activity-state-posted'), value: 'posted' },
187
+ { display: i18next.t('label.activity-state-waiting-assignment'), value: 'waiting-assignment' },
188
+ { display: i18next.t('label.activity-state-assigned'), value: 'assigned' },
189
+ { display: i18next.t('label.activity-state-started'), value: 'started' },
190
+ { display: i18next.t('label.activity-state-pending'), value: 'pending' },
191
+ { display: i18next.t('label.activity-state-escalated'), value: 'escalated' },
192
+ { display: i18next.t('label.activity-state-ended'), value: 'ended' },
193
+ { display: i18next.t('label.activity-state-aborted'), value: 'aborted' }
191
194
  ]
192
195
  },
193
- filter: false,
194
- width: 60
196
+ width: 80
195
197
  },
196
198
  {
197
199
  type: 'datetime',
@@ -275,7 +277,21 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
275
277
  }
276
278
  }
277
279
 
278
- async fetchHandler({ page, limit, sortings = [], filters = [] }) {
280
+ async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
281
+ if (this.filters?.includes('important')) {
282
+ filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
283
+ }
284
+
285
+ if (this.filters?.includes('recent')) {
286
+ /* 최근 24시간 이내에 완료한 작업 */
287
+ let tomorrow = new Date(Date.now() - 24 * 3600 * 1000).toISOString().replace('T', ' ')
288
+ filters = adjustFilters(filters, [{ name: 'terminatedAt', operator: 'gte', value: tomorrow }])
289
+ }
290
+
291
+ if (this.filters?.includes('aborted')) {
292
+ filters = adjustFilters(filters, [{ name: 'state', operator: 'eq', value: ActivityThreadStatus.Aborted }])
293
+ }
294
+
279
295
  const response = await client.query({
280
296
  query: gql`
281
297
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -178,14 +178,17 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
178
178
  hidden: true
179
179
  },
180
180
  {
181
- type: 'select',
181
+ type: 'number',
182
182
  name: 'priority',
183
183
  header: i18next.t('field.priority'),
184
184
  record: {
185
185
  editable: false,
186
- options: Priorities
186
+ renderer: function (value, column, record, rowIndex, field) {
187
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
188
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
189
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
190
+ }
187
191
  },
188
- // filter: true,
189
192
  width: 60
190
193
  },
191
194
  {
@@ -195,19 +198,18 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
195
198
  record: {
196
199
  editable: false,
197
200
  options: [
198
- { display: 'Draft', value: 'draft' },
199
- { display: 'Posted', value: 'posted' },
200
- { display: 'WaitingAssignment', value: 'waiting-assignment' },
201
- { display: 'Assigned', value: 'assigned' },
202
- { display: 'Started', value: 'started' },
203
- { display: 'Pending', value: 'pending' },
204
- { display: 'Escalated', value: 'escalated' },
205
- { display: 'Ended', value: 'ended' },
206
- { display: 'Aborted', value: 'aborted' }
201
+ { display: i18next.t('label.activity-state-draft'), value: 'draft' },
202
+ { display: i18next.t('label.activity-state-posted'), value: 'posted' },
203
+ { display: i18next.t('label.activity-state-waiting-assignment'), value: 'waiting-assignment' },
204
+ { display: i18next.t('label.activity-state-assigned'), value: 'assigned' },
205
+ { display: i18next.t('label.activity-state-started'), value: 'started' },
206
+ { display: i18next.t('label.activity-state-pending'), value: 'pending' },
207
+ { display: i18next.t('label.activity-state-escalated'), value: 'escalated' },
208
+ { display: i18next.t('label.activity-state-ended'), value: 'ended' },
209
+ { display: i18next.t('label.activity-state-aborted'), value: 'aborted' }
207
210
  ]
208
211
  },
209
- // filter: true,
210
- width: 60
212
+ width: 80
211
213
  },
212
214
  {
213
215
  type: 'datetime',
@@ -7,7 +7,7 @@ import { css, html } from 'lit'
7
7
  import { customElement, property, query, state } from 'lit/decorators.js'
8
8
  import { connect } from 'pwa-helpers/connect-mixin.js'
9
9
 
10
- import { DataGrist, getRenderer } from '@operato/data-grist'
10
+ import { DataGrist, FetchOption, getRenderer } from '@operato/data-grist'
11
11
  import { client } from '@operato/graphql'
12
12
  import { i18next, localize } from '@operato/i18n'
13
13
  import { openPopup } from '@operato/popup'
@@ -244,7 +244,7 @@ export class PickableListPage extends connect(store)(localize(i18next)(PageView)
244
244
  }
245
245
  }
246
246
 
247
- async fetchHandler({ page, limit, sortings = [], filters = [] }) {
247
+ async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
248
248
  const response = await client.query({
249
249
  query: gql`
250
250
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -7,35 +7,19 @@ import { customElement, property, query, state } from 'lit/decorators.js'
7
7
  import { asyncReplace } from 'lit/directives/async-replace.js'
8
8
  import { connect } from 'pwa-helpers/connect-mixin.js'
9
9
 
10
- import { DataGrist, getRenderer } from '@operato/data-grist'
10
+ import { DataGrist, FetchOption, getRenderer } from '@operato/data-grist'
11
11
  import { client } from '@operato/graphql'
12
12
  import { i18next, localize } from '@operato/i18n'
13
13
  import { navigate, PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
- import { isMobileDevice, sleep } from '@operato/utils'
15
+ import { adjustFilters, isMobileDevice, sleep } from '@operato/utils'
16
16
 
17
- import { ActivityInstanceStatus } from '../../types/activity-instance'
18
- import { Priorities } from '../../types/types.js'
17
+ import { ActivityThreadStatus } from '../../types/activity-thread'
19
18
 
20
19
  const MIN = 60
21
20
  const HOUR = 60 * MIN
22
21
  const DAY = 24 * HOUR
23
22
 
24
- const FILTERS = [
25
- {
26
- display: 'Important',
27
- value: 'Important'
28
- },
29
- {
30
- display: 'Imminent',
31
- value: 'Imminent'
32
- },
33
- {
34
- display: 'Disapproved',
35
- value: 'Disapproved'
36
- }
37
- ]
38
-
39
23
  @customElement('todo-list-page')
40
24
  export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
41
25
  static styles = [
@@ -92,9 +76,27 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
92
76
  <div id="filters">
93
77
  <ox-input-select-buttons
94
78
  .value=${this.filters}
95
- .options=${FILTERS}
79
+ .options=${[
80
+ {
81
+ display: i18next.t('label.filter-important'),
82
+ value: 'important'
83
+ },
84
+ {
85
+ display: i18next.t('label.filter-due'),
86
+ value: 'due'
87
+ },
88
+ {
89
+ display: i18next.t('label.filter-rejected'),
90
+ value: 'rejected'
91
+ },
92
+ {
93
+ display: i18next.t('label.filter-proceeding'),
94
+ value: 'proceeding'
95
+ }
96
+ ]}
96
97
  @change=${(e: CustomEvent) => {
97
98
  this.filters = (e.currentTarget as any)?.value
99
+ this.grist.fetch()
98
100
  }}
99
101
  multiple
100
102
  ></ox-input-select-buttons>
@@ -168,14 +170,17 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
168
170
  hidden: true
169
171
  },
170
172
  {
171
- type: 'select',
173
+ type: 'number',
172
174
  name: 'priority',
173
175
  header: i18next.t('field.priority'),
174
176
  record: {
175
177
  editable: false,
176
- options: Priorities
178
+ renderer: function (value, column, record, rowIndex, field) {
179
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
180
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
181
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
182
+ }
177
183
  },
178
- // filter: true,
179
184
  width: 60
180
185
  },
181
186
  {
@@ -185,18 +190,17 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
185
190
  record: {
186
191
  editable: false,
187
192
  options: [
188
- { display: 'Assigned', value: 'assigned' },
189
- { display: 'Started', value: 'started' },
190
- { display: 'Delegated', value: 'delegated' },
191
- { display: 'Submitted', value: 'submitted' },
192
- { display: 'Escalated', value: 'escalated' },
193
- { display: 'Rejected', value: 'rejected' },
194
- { display: 'Ended', value: 'ended' },
195
- { display: 'Aborted', value: 'aborted' }
193
+ { display: i18next.t('label.activity-state-assigned'), value: 'assigned' },
194
+ { display: i18next.t('label.activity-state-started'), value: 'started' },
195
+ { display: i18next.t('label.activity-state-delegated'), value: 'delegated' },
196
+ { display: i18next.t('label.activity-state-submitted'), value: 'submitted' },
197
+ { display: i18next.t('label.activity-state-escalated'), value: 'escalated' },
198
+ { display: i18next.t('label.activity-state-rejected'), value: 'rejected' },
199
+ { display: i18next.t('label.activity-state-ended'), value: 'ended' },
200
+ { display: i18next.t('label.activity-state-aborted'), value: 'aborted' }
196
201
  ]
197
202
  },
198
- filter: false,
199
- width: 60
203
+ width: 80
200
204
  },
201
205
  {
202
206
  type: 'datetime',
@@ -211,31 +215,6 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
211
215
  }
212
216
  },
213
217
  sortable: true,
214
- // filter: {
215
- // type: 'date',
216
- // operator: 'between'
217
- // },
218
- // filter: {
219
- // type: 'select',
220
- // operator: 'between',
221
- // options: (column, owner) => {
222
- // const now = Date.now()
223
- // return [
224
- // {
225
- // display: '1일 이내 처리',
226
- // value: [now, Date.now() + 60 * 60 * 3600 * 1000]
227
- // },
228
- // {
229
- // display: '2일 이내 처리',
230
- // value: [now, Date.now() + 2 * 60 * 60 * 3600 * 1000]
231
- // },
232
- // {
233
- // display: '3일 이내 처리',
234
- // value: [now, Date.now() + 3 * 60 * 60 * 3600 * 1000]
235
- // }
236
- // ]
237
- // }
238
- // },
239
218
  width: 100
240
219
  },
241
220
  {
@@ -298,7 +277,26 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
298
277
  }
299
278
  }
300
279
 
301
- async fetchHandler({ page, limit, sortings = [], filters = [] }) {
280
+ async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
281
+ if (this.filters?.includes('important')) {
282
+ filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
283
+ }
284
+
285
+ if (this.filters?.includes('due')) {
286
+ /* 24시간 이내에 만기가 도래하는 작업 */
287
+ let tomorrow = new Date(Date.now() + 24 * 3600 * 1000).toISOString().replace('T', ' ')
288
+ filters = adjustFilters(filters, [{ name: 'dueAt', operator: 'lte', value: tomorrow }])
289
+ }
290
+
291
+ const status = [
292
+ this.filters?.includes('rejected') && ActivityThreadStatus.Rejected,
293
+ this.filters?.includes('proceeding') && ActivityThreadStatus.Started
294
+ ].filter(Boolean)
295
+
296
+ if (status.length > 0) {
297
+ filters = adjustFilters(filters, [{ name: 'state', operator: 'in', value: status }])
298
+ }
299
+
302
300
  const response = await client.query({
303
301
  query: gql`
304
302
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -61,12 +61,6 @@ export class Activity {
61
61
 
62
62
  standardTime?: number
63
63
 
64
- cycleTime?: number
65
-
66
- tactTime?: number
67
-
68
- leadTime?: number
69
-
70
64
  issuerRole?: Role
71
65
 
72
66
  assigneeRole?: Role
@@ -5,12 +5,13 @@ import { html } from 'lit-html';
5
5
  import { store } from '@operato/shell';
6
6
  import { openOverlay, TOOL_POSITION } from '@operato/layout';
7
7
  import { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui';
8
- import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
8
+ import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
9
9
  import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js';
10
10
  import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js';
11
11
  import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js';
12
12
  import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js';
13
13
  import { GristEditorActivitySearchKeys } from './grist-editor/grist-editor-activity-search-key.js';
14
+ import { GristRendererActivitySearchKeys } from './grist-editor/grist-renderer-activity-search-key.js';
14
15
  export default function bootstrap() {
15
16
  ;
16
17
  [
@@ -46,6 +47,6 @@ export default function bootstrap() {
46
47
  registerGristEditor('quantifier', OxGristEditorQuantifier);
47
48
  registerGristRenderer('quantifier', OxGristRendererQuantifier);
48
49
  registerGristEditor('activity-search-keys', GristEditorActivitySearchKeys);
49
- registerGristRenderer('activity-search-keys', OxGristRendererJson5);
50
+ registerGristRenderer('activity-search-keys', GristRendererActivitySearchKeys);
50
51
  }
51
52
  //# sourceMappingURL=bootstrap.js.map
@@ -1 +1 @@
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;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EACL,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EAC1C,MAAM,qBAAqB,CAAA;AAC5B,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;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAElG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,CAAC;IAAA;QACC;YACE,QAAQ,EAAE,IAAI,CAAA,6EAA6E;YAC3F,OAAO,EAAE,kBAAkB;SAC5B;QACD;YACE,QAAQ,EAAE,IAAI,CAAA,yEAAyE;YACvF,OAAO,EAAE,gBAAgB;SAC1B;KACF,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAClC,KAAK,CAAC,QAAQ,CAAC;YACb,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE;gBACJ,QAAQ,EAAE,aAAa,CAAC,KAAK;gBAC7B,QAAQ,EAAE,IAAI,CAAA;;qBAED,KAAK,EAAC,CAAC,EAAC,EAAE;oBACjB,WAAW,CAAC,yBAAyB,EAAE;wBACrC,QAAQ;qBACT,CAAC,CAAA;gBACJ,CAAC;;;SAGJ;gBACD,OAAO;aACR;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,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;IAE9D,mBAAmB,CAAC,sBAAsB,EAAE,6BAA6B,CAAC,CAAA;IAC1E,qBAAqB,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAA;AACrE,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 {\n OxGristRendererJson5,\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer\n} 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'\nimport { GristEditorActivitySearchKeys } from './grist-editor/grist-editor-activity-search-key.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 registerGristEditor('activity-search-keys', GristEditorActivitySearchKeys)\n registerGristRenderer('activity-search-keys', OxGristRendererJson5)\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;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAA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import './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'\nimport { GristEditorActivitySearchKeys } from './grist-editor/grist-editor-activity-search-key.js'\nimport { GristRendererActivitySearchKeys } from './grist-editor/grist-renderer-activity-search-key.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 registerGristEditor('activity-search-keys', GristEditorActivitySearchKeys)\n registerGristRenderer('activity-search-keys', GristRendererActivitySearchKeys)\n}\n"]}
@@ -10,8 +10,9 @@ import { i18next } from '@operato/i18n';
10
10
  import { openPopup } from '@operato/popup';
11
11
  let GristEditorActivitySearchKeys = class GristEditorActivitySearchKeys extends OxGristEditor {
12
12
  get editorTemplate() {
13
- const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
14
- return html ` <div tabindex="0">${value || ''}</div> `;
13
+ return this.value && this.value instanceof Array && this.value.length > 0
14
+ ? html `<mwc-icon style="--mdc-icon-size:1.3em">key</mwc-icon>`
15
+ : html ``;
15
16
  }
16
17
  _onclick(e) {
17
18
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"file":"grist-editor-activity-search-key.js","sourceRoot":"","sources":["../../client/grist-editor/grist-editor-activity-search-key.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,qDAAqD,CAAA;AAE5D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAGhD,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,aAAa;IAG9D,IAAI,cAAc;QAChB,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;QACtF,OAAO,IAAI,CAAA,sBAAsB,KAAK,IAAI,EAAE,SAAS,CAAA;IACvD,CAAC;IAED,QAAQ,CAAC,CAAQ;QACf,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,eAAe,EAAE,CAAA;IACxB,CAAC;IAED,UAAU,CAAC,CAAgB;QACzB,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAA;QACjB,IAAI,GAAG,IAAI,OAAO,EAAE;YAClB,CAAC,CAAC,eAAe,EAAE,CAAA;YACnB,IAAI,CAAC,eAAe,EAAE,CAAA;SACvB;IACH,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAED,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,OAAO,KAAI,EAAE,CAAA;QAExD,MAAM,eAAe,GAAG,CAAC,MAAW,EAAE,EAAE;YACtC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED;;;;;;;UAOE;QACF,IAAI,QAAQ,GAAG,IAAI,CAAA;iDAC0B,IAAI,CAAC,KAAK,qBAAqB,eAAe;;KAE1F,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,KAAI,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG;YAClE,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhEY,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAgEzC;SAhEY,6BAA6B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '../grist-editor/popup-activity-search-keys-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/popup'\n\n@customElement('grist-editor-activity-search-keys')\nexport class GristEditorActivitySearchKeys extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html` <div tabindex=\"0\">${value || ''}</div> `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openEditorPopup()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openEditorPopup()\n }\n }\n\n async openEditorPopup() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help } = this.column.record?.options || {}\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n */\n var template = html`\n <popup-activity-search-keys-input .value=${this.value} .confirmCallback=${confirmCallback}>\n </popup-activity-search-keys-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('field.search-keys')} `,\n help\n })\n }\n}\n"]}
1
+ {"version":3,"file":"grist-editor-activity-search-key.js","sourceRoot":"","sources":["../../client/grist-editor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C,cAAc,EAAE;gBAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED;;;;;;;UAOE;QACF,IAAI,QAAQ,GAAG,IAAI,CAAA;iDAC0B,IAAI,CAAC,KAAK,qBAAqB,eAAe;;KAE1F,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,KAAI,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG;YAClE,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAjEY,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAiEzC;SAjEY,6BAA6B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '../grist-editor/popup-activity-search-keys-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/popup'\n\n@customElement('grist-editor-activity-search-keys')\nexport class GristEditorActivitySearchKeys extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return this.value && this.value instanceof Array && this.value.length > 0\n ? html`<mwc-icon style=\"--mdc-icon-size:1.3em\">key</mwc-icon>`\n : html``\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openEditorPopup()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openEditorPopup()\n }\n }\n\n async openEditorPopup() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help } = this.column.record?.options || {}\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n */\n var template = html`\n <popup-activity-search-keys-input .value=${this.value} .confirmCallback=${confirmCallback}>\n </popup-activity-search-keys-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('field.search-keys')} `,\n help\n })\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import '@material/mwc-icon';
2
+ import { FieldRenderer } from '@operato/data-grist';
3
+ export declare const GristRendererActivitySearchKeys: FieldRenderer;
@@ -0,0 +1,22 @@
1
+ import '@material/mwc-icon';
2
+ import { html } from 'lit';
3
+ function onmouseover(e, value) {
4
+ const element = e.target;
5
+ const tooltip = value.map(key => key.name).join(',');
6
+ element.setAttribute('data-tooltip', tooltip);
7
+ }
8
+ function onmouseout(e) {
9
+ const element = e.target;
10
+ element.removeAttribute('data-tooltip');
11
+ }
12
+ export const GristRendererActivitySearchKeys = (value, column, record, rowIndex, field) => {
13
+ return value && value instanceof Array && value.length > 0
14
+ ? html `<mwc-icon
15
+ style="--mdc-icon-size:1.3em"
16
+ @mouseover=${(e) => onmouseover(e, value)}
17
+ @mouseout=${onmouseout}
18
+ >key</mwc-icon
19
+ >`
20
+ : html ``;
21
+ };
22
+ //# sourceMappingURL=grist-renderer-activity-search-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grist-renderer-activity-search-key.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-activity-search-key.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,SAAS,WAAW,CAAC,CAAa,EAAE,KAAY;IAC9C,MAAM,OAAO,GAAG,CAAC,CAAC,MAAwB,CAAA;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;AAC/C,CAAC;AAED,SAAS,UAAU,CAAC,CAAa;IAC/B,MAAM,OAAO,GAAG,CAAC,CAAC,MAAwB,CAAA;IAC1C,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACvG,OAAO,KAAK,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QACxD,CAAC,CAAC,IAAI,CAAA;;qBAEW,CAAC,CAAa,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC;oBACzC,UAAU;;QAEtB;QACJ,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\nimport { html } from 'lit'\nimport { FieldRenderer } from '@operato/data-grist'\n\nfunction onmouseover(e: MouseEvent, value: any[]) {\n const element = e.target as HTMLPreElement\n const tooltip = value.map(key => key.name).join(',')\n element.setAttribute('data-tooltip', tooltip)\n}\n\nfunction onmouseout(e: MouseEvent) {\n const element = e.target as HTMLPreElement\n element.removeAttribute('data-tooltip')\n}\n\nexport const GristRendererActivitySearchKeys: FieldRenderer = (value, column, record, rowIndex, field) => {\n return value && value instanceof Array && value.length > 0\n ? html`<mwc-icon\n style=\"--mdc-icon-size:1.3em\"\n @mouseover=${(e: MouseEvent) => onmouseover(e, value)}\n @mouseout=${onmouseout}\n >key</mwc-icon\n >`\n : html``\n}\n"]}
@@ -8,7 +8,7 @@ export declare class PopupActivitySearchKeysInput extends LitElement {
8
8
  gristConfig: any;
9
9
  private grist;
10
10
  render(): import("lit-html").TemplateResult<1>;
11
- fetchHandler({ filters, page, limit, sortings }: FetchOption): Promise<{
11
+ fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
12
12
  total: number;
13
13
  records: ActivitySearchKeyItem[];
14
14
  }>;
@@ -106,7 +106,7 @@ let PopupActivitySearchKeysInput = class PopupActivitySearchKeysInput extends Li
106
106
  </div>
107
107
  `;
108
108
  }
109
- async fetchHandler({ filters, page, limit, sortings = [] }) {
109
+ async fetchHandler({ page, limit, sortings = [], filters = [] }) {
110
110
  const records = this.value || [];
111
111
  return {
112
112
  total: records.length,
@@ -1 +1 @@
1
- {"version":3,"file":"popup-activity-search-keys-input.js","sourceRoot":"","sources":["../../client/grist-editor/popup-activity-search-keys-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,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QAAQ,GAAG,EAAE,EAAe;QACrE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAChC,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,OAAO;SACR,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAEO,SAAS,CAAC,CAAQ;QACxB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;QAEnB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;YACjF,OAAO;gBACL,IAAI;gBACJ,WAAW;gBACX,QAAQ;gBACR,IAAI;aACL,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AAzJM,mCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2DAAoC;AAC9D;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAAwC;AAEnE;IAAC,KAAK,EAAE;;iEAgFP;AAED;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;2DAAA;AA/GjC,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CA2JxC;SA3JY,4BAA4B","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { ActivitySearchKeyItem } from '../types/activity-search-key-item-type'\n\n@customElement('popup-activity-search-keys-input')\nexport class PopupActivitySearchKeysInput extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-grist {\n flex: 1;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n `\n ]\n\n @property({ type: Array }) value: ActivitySearchKeyItem[] = []\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n @state() gristConfig: any = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'delete',\n handlers: {\n click: 'record-delete'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'string',\n name: 'inputKey',\n header: i18next.t('field.input-key'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'string',\n name: 'tKey',\n header: i18next.t('field.t-key'),\n record: {\n editable: true\n },\n width: 180\n }\n ],\n rows: {\n selectable: false\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n\n @query('ox-grist') private grist!: DataGrist\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ></ox-grist>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {\n const records = this.value || []\n return {\n total: records.length,\n records\n }\n }\n\n private onCancel(e: Event) {\n closePopup(this)\n }\n\n private onConfirm(e: Event) {\n this.grist.commit()\n\n this.value = this.grist.data.records.map(({ name, description, inputKey, tKey }) => {\n return {\n name,\n description,\n inputKey,\n tKey\n }\n })\n\n this.confirmCallback && this.confirmCallback(this.value)\n closePopup(this)\n }\n}\n"]}
1
+ {"version":3,"file":"popup-activity-search-keys-input.js","sourceRoot":"","sources":["../../client/grist-editor/popup-activity-search-keys-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAwC,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAI3G,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,UAAU;IAArD;;QA0BsB,UAAK,GAA4B,EAAE,CAAA;QAGrD,gBAAW,GAAQ;YAC1B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MA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AAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;YACjF,OAAO;gBACL,IAAI;gBACJ,WAAW;gBACX,QAAQ;gBACR,IAAI;aACL,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AAzJM,mCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2DAAoC;AAC9D;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAAwC;AAEnE;IAAC,KAAK,EAAE;;iEAgFP;AAED;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;2DAAA;AA/GjC,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CA2JxC;SA3JY,4BAA4B","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { ActivitySearchKeyItem } from '../types/activity-search-key-item-type'\n\n@customElement('popup-activity-search-keys-input')\nexport class PopupActivitySearchKeysInput extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-grist {\n flex: 1;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n `\n ]\n\n @property({ type: Array }) value: ActivitySearchKeyItem[] = []\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n @state() gristConfig: any = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'delete',\n handlers: {\n click: 'record-delete'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'string',\n name: 'inputKey',\n header: i18next.t('field.input-key'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'string',\n name: 'tKey',\n header: i18next.t('field.t-key'),\n record: {\n editable: true\n },\n width: 180\n }\n ],\n rows: {\n selectable: false\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n\n @query('ox-grist') private grist!: DataGrist\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ></ox-grist>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const records = this.value || []\n return {\n total: records.length,\n records\n }\n }\n\n private onCancel(e: Event) {\n closePopup(this)\n }\n\n private onConfirm(e: Event) {\n this.grist.commit()\n\n this.value = this.grist.data.records.map(({ name, description, inputKey, tKey }) => {\n return {\n name,\n description,\n inputKey,\n tKey\n }\n })\n\n this.confirmCallback && this.confirmCallback(this.value)\n closePopup(this)\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import '@operato/data-grist';
2
2
  import './activity-model-item-list.js';
3
- import { DataGrist } from '@operato/data-grist';
3
+ import { DataGrist, FetchOption } from '@operato/data-grist';
4
4
  import { PageView } from '@operato/shell';
5
5
  export declare const ActivityStatus: {
6
6
  display: string;
@@ -43,12 +43,7 @@ export declare class ActivityListPage extends ActivityListPage_base {
43
43
  };
44
44
  render(): import("lit-html").TemplateResult<1>;
45
45
  pageInitialized(lifecycle: any): Promise<void>;
46
- fetchHandler({ page, limit, sortings, filters }: {
47
- page: any;
48
- limit: any;
49
- sortings?: never[] | undefined;
50
- filters?: never[] | undefined;
51
- }): Promise<{
46
+ fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
52
47
  total: any;
53
48
  records: any;
54
49
  }>;