@things-factory/worklist 6.0.36 → 6.0.37
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.
- package/client/grist-editor/popup-activity-search-keys-input.ts +1 -1
- package/client/pages/activity/activity-list-page.ts +2 -2
- package/client/pages/activity/starter-list-page.ts +2 -2
- package/client/pages/activity-instance/activity-instance-list-page.ts +2 -2
- package/client/pages/activity-store/activity-store-page.ts +2 -2
- package/client/pages/activity-supervisor/reporter-list-page.ts +2 -2
- package/client/pages/activity-template/activity-template-list-page.ts +2 -2
- package/client/pages/activity-thread/activity-thread-list-page.ts +2 -2
- package/client/pages/installable-activity/installable-activity-list-page.ts +2 -2
- package/client/pages/todo/approval-waiting-list-page.ts +33 -45
- package/client/pages/todo/assigned-list-page.ts +2 -2
- package/client/pages/todo/done-list-page.ts +33 -19
- package/client/pages/todo/pickable-list-page.ts +2 -2
- package/client/pages/todo/todo-list-page.ts +33 -45
- package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +1 -1
- package/dist-client/grist-editor/popup-activity-search-keys-input.js +1 -1
- package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -1
- package/dist-client/pages/activity/activity-list-page.d.ts +2 -7
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/starter-list-page.d.ts +2 -7
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +2 -7
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-store/activity-store-page.d.ts +2 -7
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +2 -7
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +2 -7
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +2 -7
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +2 -7
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-waiting-list-page.d.ts +2 -7
- package/dist-client/pages/todo/approval-waiting-list-page.js +28 -42
- package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
- package/dist-client/pages/todo/assigned-list-page.d.ts +2 -7
- package/dist-client/pages/todo/assigned-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.d.ts +2 -7
- package/dist-client/pages/todo/done-list-page.js +29 -16
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +2 -7
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +2 -7
- package/dist-client/pages/todo/todo-list-page.js +29 -41
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity-approval/activity-approval-query.js +8 -0
- package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-query.js +4 -2
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/activity-approval/activity-approval-query.ts +8 -0
- package/server/service/activity-thread/activity-thread-query.ts +4 -2
- package/translations/en.json +6 -0
- package/translations/ko.json +6 -0
- package/translations/ms.json +6 -0
- package/translations/zh.json +6 -0
|
@@ -137,7 +137,7 @@ export class PopupActivitySearchKeysInput extends LitElement {
|
|
|
137
137
|
`
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
async fetchHandler({
|
|
140
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
141
141
|
const records = this.value || []
|
|
142
142
|
return {
|
|
143
143
|
total: records.length,
|
|
@@ -7,7 +7,7 @@ import { customElement, property, query } from 'lit/decorators.js'
|
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
8
|
import moment from 'moment-timezone'
|
|
9
9
|
|
|
10
|
-
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist'
|
|
10
|
+
import { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'
|
|
11
11
|
import { client } from '@operato/graphql'
|
|
12
12
|
import { i18next, localize } from '@operato/i18n'
|
|
13
13
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -491,7 +491,7 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
494
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
495
495
|
const response = await client.query({
|
|
496
496
|
query: gql`
|
|
497
497
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -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 } from '@operato/data-grist'
|
|
10
|
+
import { FetchOption, DataGrist } 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/layout'
|
|
@@ -204,7 +204,7 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
207
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
208
208
|
const response = await client.query({
|
|
209
209
|
query: gql`
|
|
210
210
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -5,7 +5,7 @@ import { css, html } from 'lit'
|
|
|
5
5
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
6
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
7
7
|
|
|
8
|
-
import { DataGrist } from '@operato/data-grist'
|
|
8
|
+
import { FetchOption, DataGrist } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { PageView, store } from '@operato/shell'
|
|
@@ -181,7 +181,7 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
184
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
185
185
|
const response = await client.query({
|
|
186
186
|
query: gql`
|
|
187
187
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -6,7 +6,7 @@ import { css, html } from 'lit'
|
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
8
|
|
|
9
|
-
import { DataGrist } from '@operato/data-grist'
|
|
9
|
+
import { FetchOption, DataGrist } from '@operato/data-grist'
|
|
10
10
|
import { client } from '@operato/graphql'
|
|
11
11
|
import { i18next, localize } from '@operato/i18n'
|
|
12
12
|
import { openPopup } from '@operato/layout'
|
|
@@ -198,7 +198,7 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
201
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
202
202
|
const response = await client.query({
|
|
203
203
|
query: gql`
|
|
204
204
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -6,7 +6,7 @@ import { css, html } from 'lit'
|
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
8
|
|
|
9
|
-
import { DataGrist } from '@operato/data-grist'
|
|
9
|
+
import { FetchOption, DataGrist } from '@operato/data-grist'
|
|
10
10
|
import { client } from '@operato/graphql'
|
|
11
11
|
import { i18next, localize } from '@operato/i18n'
|
|
12
12
|
import { openPopup } from '@operato/layout'
|
|
@@ -193,7 +193,7 @@ export class ReporterListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
196
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
197
197
|
const response = await client.query({
|
|
198
198
|
query: gql`
|
|
199
199
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -7,7 +7,7 @@ import { css, html } from 'lit'
|
|
|
7
7
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
8
8
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
9
9
|
|
|
10
|
-
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist'
|
|
10
|
+
import { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'
|
|
11
11
|
import { client } from '@operato/graphql'
|
|
12
12
|
import { i18next, localize } from '@operato/i18n'
|
|
13
13
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -322,7 +322,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
325
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
326
326
|
const response = await client.query({
|
|
327
327
|
query: gql`
|
|
328
328
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -6,7 +6,7 @@ import { css, html } from 'lit'
|
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
8
|
|
|
9
|
-
import { DataGrist } from '@operato/data-grist'
|
|
9
|
+
import { DataGrist, FetchOption } from '@operato/data-grist'
|
|
10
10
|
import { client } from '@operato/graphql'
|
|
11
11
|
import { i18next, localize } from '@operato/i18n'
|
|
12
12
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -193,7 +193,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
196
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
197
197
|
const response = await client.query({
|
|
198
198
|
query: gql`
|
|
199
199
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -5,7 +5,7 @@ import { css, html } from 'lit'
|
|
|
5
5
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
6
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
7
7
|
|
|
8
|
-
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist'
|
|
8
|
+
import { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -331,7 +331,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
334
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
335
335
|
const response = await client.query({
|
|
336
336
|
query: gql`
|
|
337
337
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -7,34 +7,20 @@ 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 { ActivityThreadStatus } from '../../types/activity-thread'
|
|
17
18
|
import { Priorities } from '../../types/types.js'
|
|
18
19
|
|
|
19
20
|
const MIN = 60
|
|
20
21
|
const HOUR = 60 * MIN
|
|
21
22
|
const DAY = 24 * HOUR
|
|
22
23
|
|
|
23
|
-
const FILTERS = [
|
|
24
|
-
{
|
|
25
|
-
display: 'Important',
|
|
26
|
-
value: 'Important'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
display: 'Imminent',
|
|
30
|
-
value: 'Imminent'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
display: 'Disapproved',
|
|
34
|
-
value: 'Disapproved'
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
|
|
38
24
|
@customElement('approval-waiting-list-page')
|
|
39
25
|
export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
40
26
|
static styles = [
|
|
@@ -91,9 +77,23 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
|
|
|
91
77
|
<div id="filters">
|
|
92
78
|
<ox-input-select-buttons
|
|
93
79
|
.value=${this.filters}
|
|
94
|
-
.options=${
|
|
80
|
+
.options=${[
|
|
81
|
+
{
|
|
82
|
+
display: i18next.t('label.filter-important'),
|
|
83
|
+
value: 'important'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
display: i18next.t('label.filter-due'),
|
|
87
|
+
value: 'due'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
display: i18next.t('label.filter-resubmitted'),
|
|
91
|
+
value: 'resubmitted'
|
|
92
|
+
}
|
|
93
|
+
]}
|
|
95
94
|
@change=${(e: CustomEvent) => {
|
|
96
95
|
this.filters = (e.currentTarget as any)?.value
|
|
96
|
+
this.grist.fetch()
|
|
97
97
|
}}
|
|
98
98
|
multiple
|
|
99
99
|
></ox-input-select-buttons>
|
|
@@ -210,32 +210,6 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
|
|
|
210
210
|
day: 'numeric'
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
// 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
213
|
width: 100
|
|
240
214
|
},
|
|
241
215
|
{
|
|
@@ -298,13 +272,27 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
|
|
|
298
272
|
}
|
|
299
273
|
}
|
|
300
274
|
|
|
301
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
275
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
276
|
+
if (this.filters?.includes('important')) {
|
|
277
|
+
filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (this.filters?.includes('due')) {
|
|
281
|
+
let tomorrow = new Date(Date.now() + 24 * 3600 * 1000).toISOString().replace('T', ' ')
|
|
282
|
+
filters = adjustFilters(filters, [{ name: 'dueAt', operator: 'lte', value: tomorrow }])
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (this.filters?.includes('resubmitted')) {
|
|
286
|
+
filters = adjustFilters(filters, [{ name: 'round', operator: 'gte', value: 2 }])
|
|
287
|
+
}
|
|
288
|
+
|
|
302
289
|
const response = await client.query({
|
|
303
290
|
query: gql`
|
|
304
291
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
305
292
|
responses: approvalWaitingList(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
306
293
|
items {
|
|
307
294
|
id
|
|
295
|
+
round
|
|
308
296
|
activityThread {
|
|
309
297
|
activityInstance {
|
|
310
298
|
activityId: id
|
|
@@ -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,30 +6,16 @@ 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 {
|
|
14
|
+
import { adjustFilters, isMobileDevice } from '@operato/utils'
|
|
15
15
|
|
|
16
|
+
import { ActivityThreadStatus } from '../../types/activity-thread'
|
|
16
17
|
import { Priorities } from '../../types/types.js'
|
|
17
18
|
|
|
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
|
-
]
|
|
32
|
-
|
|
33
19
|
@customElement('done-list-page')
|
|
34
20
|
export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
35
21
|
static styles = [
|
|
@@ -86,9 +72,23 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
86
72
|
<div id="filters">
|
|
87
73
|
<ox-input-select-buttons
|
|
88
74
|
.value=${this.filters}
|
|
89
|
-
.options=${
|
|
75
|
+
.options=${[
|
|
76
|
+
{
|
|
77
|
+
display: i18next.t('label.filter-important'),
|
|
78
|
+
value: 'important'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
display: i18next.t('label.filter-recent'),
|
|
82
|
+
value: 'recent'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
display: i18next.t('label.filter-aborted'),
|
|
86
|
+
value: 'aborted'
|
|
87
|
+
}
|
|
88
|
+
]}
|
|
90
89
|
@change=${(e: CustomEvent) => {
|
|
91
90
|
this.filters = (e.currentTarget as any)?.value
|
|
91
|
+
this.grist.fetch()
|
|
92
92
|
}}
|
|
93
93
|
multiple
|
|
94
94
|
></ox-input-select-buttons>
|
|
@@ -275,7 +275,21 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
278
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
279
|
+
if (this.filters?.includes('important')) {
|
|
280
|
+
filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (this.filters?.includes('recent')) {
|
|
284
|
+
/* 최근 24시간 이내에 완료한 작업 */
|
|
285
|
+
let tomorrow = new Date(Date.now() - 24 * 3600 * 1000).toISOString().replace('T', ' ')
|
|
286
|
+
filters = adjustFilters(filters, [{ name: 'terminatedAt', operator: 'gte', value: tomorrow }])
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (this.filters?.includes('aborted')) {
|
|
290
|
+
filters = adjustFilters(filters, [{ name: 'state', operator: 'eq', value: ActivityThreadStatus.Aborted }])
|
|
291
|
+
}
|
|
292
|
+
|
|
279
293
|
const response = await client.query({
|
|
280
294
|
query: gql`
|
|
281
295
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -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,20 @@ 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 {
|
|
17
|
+
import { ActivityThreadStatus } from '../../types/activity-thread'
|
|
18
18
|
import { Priorities } from '../../types/types.js'
|
|
19
19
|
|
|
20
20
|
const MIN = 60
|
|
21
21
|
const HOUR = 60 * MIN
|
|
22
22
|
const DAY = 24 * HOUR
|
|
23
23
|
|
|
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
24
|
@customElement('todo-list-page')
|
|
40
25
|
export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
41
26
|
static styles = [
|
|
@@ -92,9 +77,23 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
92
77
|
<div id="filters">
|
|
93
78
|
<ox-input-select-buttons
|
|
94
79
|
.value=${this.filters}
|
|
95
|
-
.options=${
|
|
80
|
+
.options=${[
|
|
81
|
+
{
|
|
82
|
+
display: i18next.t('label.filter-important'),
|
|
83
|
+
value: 'important'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
display: i18next.t('label.filter-due'),
|
|
87
|
+
value: 'due'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
display: i18next.t('label.filter-rejected'),
|
|
91
|
+
value: 'rejected'
|
|
92
|
+
}
|
|
93
|
+
]}
|
|
96
94
|
@change=${(e: CustomEvent) => {
|
|
97
95
|
this.filters = (e.currentTarget as any)?.value
|
|
96
|
+
this.grist.fetch()
|
|
98
97
|
}}
|
|
99
98
|
multiple
|
|
100
99
|
></ox-input-select-buttons>
|
|
@@ -211,31 +210,6 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
211
210
|
}
|
|
212
211
|
},
|
|
213
212
|
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
213
|
width: 100
|
|
240
214
|
},
|
|
241
215
|
{
|
|
@@ -298,7 +272,21 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
298
272
|
}
|
|
299
273
|
}
|
|
300
274
|
|
|
301
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
275
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
276
|
+
if (this.filters?.includes('important')) {
|
|
277
|
+
filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (this.filters?.includes('due')) {
|
|
281
|
+
/* 24시간 이내에 만기가 도래하는 작업 */
|
|
282
|
+
let tomorrow = new Date(Date.now() + 24 * 3600 * 1000).toISOString().replace('T', ' ')
|
|
283
|
+
filters = adjustFilters(filters, [{ name: 'dueAt', operator: 'lte', value: tomorrow }])
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (this.filters?.includes('rejected')) {
|
|
287
|
+
filters = adjustFilters(filters, [{ name: 'state', operator: 'eq', value: ActivityThreadStatus.Rejected }])
|
|
288
|
+
}
|
|
289
|
+
|
|
302
290
|
const response = await client.query({
|
|
303
291
|
query: gql`
|
|
304
292
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
@@ -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({
|
|
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({
|
|
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,E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
|
+
{"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,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE;YACnD,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE;gBAC1C;oBACE,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,QAAQ;oBACpB,IAAI,EAAE,KAAK;oBACX,QAAQ,EAAE;wBACR,KAAK,EAAE,aAAa;qBACrB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,QAAQ;oBACpB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE;wBACR,KAAK,EAAE,eAAe;qBACvB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,QAAQ;oBACpB,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE;wBACR,KAAK,EAAE,SAAS;qBACjB;iBACF;gBACD;oBACE,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,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
|
}>;
|