@things-factory/worklist 6.0.43 → 6.0.45
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/pages/activity-stats/activity-stats-importer.ts +97 -0
- package/client/pages/activity-stats/activity-stats-list-page.ts +348 -0
- package/client/pages/todo/approval-done-list-page.ts +340 -0
- package/client/pages/todo/approval-pending-list-page.ts +1 -1
- package/client/pages/todo/done-list-calendar-page.ts +115 -0
- package/client/pages/todo/done-list-page.ts +1 -2
- package/client/pages/todo/pickable-list-page.ts +2 -1
- package/client/route.ts +12 -0
- package/client/themes/calendar-theme.css +54 -0
- package/dist-client/pages/activity-stats/activity-stats-importer.d.ts +22 -0
- package/dist-client/pages/activity-stats/activity-stats-importer.js +100 -0
- package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -0
- package/dist-client/pages/activity-stats/activity-stats-list-page.d.ts +62 -0
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +326 -0
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -0
- package/dist-client/pages/todo/approval-done-list-page.d.ts +39 -0
- package/dist-client/pages/todo/approval-done-list-page.js +338 -0
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -0
- package/dist-client/pages/todo/approval-pending-list-page.js +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.d.ts +24 -0
- package/dist-client/pages/todo/done-list-calendar-page.js +107 -0
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -0
- package/dist-client/pages/todo/done-list-page.js +1 -2
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +1 -0
- package/dist-client/pages/todo/pickable-list-page.js +2 -1
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +9 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity-approval/activity-approval-query.js +48 -0
- package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
- package/dist-server/service/activity-stats/activity-stats-query.js +93 -0
- package/dist-server/service/activity-stats/activity-stats-query.js.map +1 -0
- package/dist-server/service/activity-stats/activity-stats-type.js +47 -0
- package/dist-server/service/activity-stats/activity-stats-type.js.map +1 -0
- package/dist-server/service/activity-stats/index.js +6 -0
- package/dist-server/service/activity-stats/index.js.map +1 -0
- package/dist-server/service/activity-summary/activity-summary-query.js +4 -22
- package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -1
- package/dist-server/service/index.js +2 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/worklist/activity-bank.md +22 -0
- package/helps/worklist/{activity-approval.md → activity-stats.md} +1 -1
- package/helps/worklist/draft-list.md +15 -0
- package/helps/worklist/worklist-concept.md +11 -8
- package/package.json +3 -2
- package/server/service/activity-approval/activity-approval-query.ts +45 -1
- package/server/service/activity-stats/activity-stats-query.ts +94 -0
- package/server/service/activity-stats/activity-stats-type.ts +34 -0
- package/server/service/activity-stats/index.ts +3 -0
- package/server/service/activity-summary/activity-summary-query.ts +4 -22
- package/server/service/index.ts +2 -0
- package/things-factory.config.js +4 -1
- package/translations/en.json +10 -0
- package/translations/ko.json +12 -2
- package/translations/ms.json +10 -0
- package/translations/zh.json +10 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import '@operato/data-grist'
|
|
2
|
+
import '@operato/input/ox-input-select-buttons.js'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit'
|
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
|
+
|
|
9
|
+
import { DataGrist, FetchOption, getRenderer } from '@operato/data-grist'
|
|
10
|
+
import { client } from '@operato/graphql'
|
|
11
|
+
import { i18next, localize } from '@operato/i18n'
|
|
12
|
+
import { navigate, PageView, store } from '@operato/shell'
|
|
13
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
14
|
+
import { adjustFilters, isMobileDevice, sleep } from '@operato/utils'
|
|
15
|
+
|
|
16
|
+
const MIN = 60
|
|
17
|
+
const HOUR = 60 * MIN
|
|
18
|
+
const DAY = 24 * HOUR
|
|
19
|
+
|
|
20
|
+
@customElement('approval-done-list-page')
|
|
21
|
+
export class ApprovalDoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
22
|
+
static styles = [
|
|
23
|
+
ScrollbarStyles,
|
|
24
|
+
CommonGristStyles,
|
|
25
|
+
css`
|
|
26
|
+
:host {
|
|
27
|
+
display: flex;
|
|
28
|
+
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
--grid-record-emphasized-background-color: red;
|
|
32
|
+
--grid-record-emphasized-color: yellow;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#modes {
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
@property({ type: Object }) gristConfig?: any
|
|
42
|
+
@property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
43
|
+
|
|
44
|
+
@query('ox-grist') grist!: DataGrist
|
|
45
|
+
|
|
46
|
+
@state() filters?: string[]
|
|
47
|
+
|
|
48
|
+
get context() {
|
|
49
|
+
return {
|
|
50
|
+
search: {
|
|
51
|
+
handler: (search: string) => {
|
|
52
|
+
this.grist.searchText = search
|
|
53
|
+
},
|
|
54
|
+
placeholder: i18next.t('title.approval done list'),
|
|
55
|
+
value: this.grist.searchText
|
|
56
|
+
},
|
|
57
|
+
filter: {
|
|
58
|
+
handler: () => {
|
|
59
|
+
this.grist.toggleHeadroom()
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
help: 'worklist/worklist-concept',
|
|
63
|
+
actions: []
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
render() {
|
|
68
|
+
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
69
|
+
|
|
70
|
+
return html`
|
|
71
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
72
|
+
<div slot="headroom">
|
|
73
|
+
<div id="filters">
|
|
74
|
+
<ox-input-select-buttons
|
|
75
|
+
.value=${this.filters}
|
|
76
|
+
.options=${[
|
|
77
|
+
{
|
|
78
|
+
display: i18next.t('label.filter-important'),
|
|
79
|
+
value: 'important'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
display: i18next.t('label.filter-due'),
|
|
83
|
+
value: 'due'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
display: i18next.t('label.filter-rejected'),
|
|
87
|
+
value: 'rejected'
|
|
88
|
+
}
|
|
89
|
+
]}
|
|
90
|
+
@change=${(e: CustomEvent) => {
|
|
91
|
+
this.filters = (e.currentTarget as any)?.value
|
|
92
|
+
this.grist.fetch()
|
|
93
|
+
}}
|
|
94
|
+
></ox-input-select-buttons>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div id="modes">
|
|
98
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
|
99
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
|
100
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</ox-grist>
|
|
104
|
+
`
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async pageInitialized(lifecycle) {
|
|
108
|
+
this.gristConfig = {
|
|
109
|
+
list: {
|
|
110
|
+
thumbnail: 'thumbnail',
|
|
111
|
+
fields: ['name', 'description'],
|
|
112
|
+
details: ['createdAt', 'due']
|
|
113
|
+
},
|
|
114
|
+
columns: [
|
|
115
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
116
|
+
{
|
|
117
|
+
type: 'gutter',
|
|
118
|
+
gutterName: 'button',
|
|
119
|
+
name: 'start',
|
|
120
|
+
icon: 'play_arrow',
|
|
121
|
+
handlers: {
|
|
122
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
123
|
+
const { id } = record
|
|
124
|
+
this.openActivityApproval(record)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'string',
|
|
130
|
+
name: 'name',
|
|
131
|
+
header: i18next.t('field.name'),
|
|
132
|
+
record: {
|
|
133
|
+
editable: false
|
|
134
|
+
},
|
|
135
|
+
filter: 'search',
|
|
136
|
+
sortable: true,
|
|
137
|
+
width: 150
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: 'string',
|
|
141
|
+
name: 'description',
|
|
142
|
+
header: i18next.t('field.description'),
|
|
143
|
+
record: {
|
|
144
|
+
editable: false
|
|
145
|
+
},
|
|
146
|
+
filter: 'search',
|
|
147
|
+
width: 200
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'number',
|
|
151
|
+
name: 'round',
|
|
152
|
+
header: i18next.t('field.round'),
|
|
153
|
+
record: {
|
|
154
|
+
editable: false
|
|
155
|
+
},
|
|
156
|
+
width: 30
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'string',
|
|
160
|
+
name: 'viewSource',
|
|
161
|
+
header: i18next.t('field.view-source'),
|
|
162
|
+
record: {
|
|
163
|
+
editable: false,
|
|
164
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
165
|
+
const { viewType, viewSource } = record.activity || {}
|
|
166
|
+
var type = viewType !== 'board' ? 'string' : 'board'
|
|
167
|
+
return getRenderer(type)(viewSource, column, record, rowIndex, field)
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
width: 140,
|
|
171
|
+
hidden: true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'number',
|
|
175
|
+
name: 'priority',
|
|
176
|
+
header: i18next.t('field.priority'),
|
|
177
|
+
record: {
|
|
178
|
+
editable: false,
|
|
179
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
180
|
+
const count = new Array(value > 4 ? 4 : value || 0).fill('')
|
|
181
|
+
return html`${count.map(() => html`<mwc-icon style="color:gray;">star</mwc-icon>`)}`
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
width: 60
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'select',
|
|
188
|
+
name: 'judgment',
|
|
189
|
+
header: i18next.t('field.judgment'),
|
|
190
|
+
record: {
|
|
191
|
+
editable: false,
|
|
192
|
+
options: [
|
|
193
|
+
{ display: i18next.t('label.activity-state-rejected'), value: 'rejected' },
|
|
194
|
+
{ display: i18next.t('label.activity-state-escalated'), value: 'escalated' },
|
|
195
|
+
{ display: i18next.t('label.activity-state-delegated'), value: 'delegated' },
|
|
196
|
+
{ display: i18next.t('label.activity-state-approved'), value: 'approved' },
|
|
197
|
+
{ display: i18next.t('label.activity-state-aborted'), value: 'aborted' }
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
width: 80
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: 'string',
|
|
204
|
+
name: 'comment',
|
|
205
|
+
header: i18next.t('field.comment'),
|
|
206
|
+
record: {
|
|
207
|
+
editable: false
|
|
208
|
+
},
|
|
209
|
+
width: 160
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: 'datetime',
|
|
213
|
+
name: 'createdAt',
|
|
214
|
+
header: i18next.t('field.created-at'),
|
|
215
|
+
record: {
|
|
216
|
+
editable: false
|
|
217
|
+
},
|
|
218
|
+
sortable: true,
|
|
219
|
+
filter: false,
|
|
220
|
+
width: 180
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 'datetime',
|
|
224
|
+
name: 'terminatedAt',
|
|
225
|
+
header: i18next.t('field.terminated-at'),
|
|
226
|
+
record: {
|
|
227
|
+
editable: false
|
|
228
|
+
},
|
|
229
|
+
sortable: true,
|
|
230
|
+
filter: false,
|
|
231
|
+
width: 180
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: 'image',
|
|
235
|
+
name: 'thumbnail',
|
|
236
|
+
header: i18next.t('field.thumbnail'),
|
|
237
|
+
record: { editable: false },
|
|
238
|
+
hidden: true
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
rows: {
|
|
242
|
+
appendable: false
|
|
243
|
+
}
|
|
244
|
+
// sorters: [
|
|
245
|
+
// {
|
|
246
|
+
// name: 'dueAt',
|
|
247
|
+
// desc: false
|
|
248
|
+
// }
|
|
249
|
+
// ]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async pageUpdated(changes, lifecycle, changedBefore) {
|
|
254
|
+
if (this.active) {
|
|
255
|
+
this.grist?.fetch()
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
260
|
+
if (this.filters?.includes('important')) {
|
|
261
|
+
filters = adjustFilters(filters, [{ name: 'priority', operator: 'gte', value: 2 }])
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (this.filters?.includes('due')) {
|
|
265
|
+
let tomorrow = new Date(Date.now() + 24 * 3600 * 1000).toISOString().replace('T', ' ')
|
|
266
|
+
filters = adjustFilters(filters, [{ name: 'dueAt', operator: 'lte', value: tomorrow }])
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (this.filters?.includes('rejected')) {
|
|
270
|
+
filters = adjustFilters(filters, [{ name: 'judgment', operator: 'eq', value: 'rejected' }])
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const response = await client.query({
|
|
274
|
+
query: gql`
|
|
275
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
276
|
+
responses: approvalDoneList(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
277
|
+
items {
|
|
278
|
+
id
|
|
279
|
+
round
|
|
280
|
+
judgment
|
|
281
|
+
comment
|
|
282
|
+
createdAt
|
|
283
|
+
terminatedAt
|
|
284
|
+
activityThread {
|
|
285
|
+
activityInstance {
|
|
286
|
+
activityId: id
|
|
287
|
+
name
|
|
288
|
+
description
|
|
289
|
+
priority
|
|
290
|
+
input
|
|
291
|
+
refBy
|
|
292
|
+
activityType
|
|
293
|
+
viewType
|
|
294
|
+
viewSource
|
|
295
|
+
thumbnail
|
|
296
|
+
updatedAt
|
|
297
|
+
createdAt
|
|
298
|
+
creator {
|
|
299
|
+
id
|
|
300
|
+
name
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
state
|
|
304
|
+
output
|
|
305
|
+
dueAt
|
|
306
|
+
assignedAt
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
total
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
`,
|
|
313
|
+
variables: {
|
|
314
|
+
filters,
|
|
315
|
+
pagination: { page, limit },
|
|
316
|
+
sortings
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
total: response.data.responses.total || 0,
|
|
322
|
+
records: (response.data.responses.items || []).map(item => {
|
|
323
|
+
let thread = item.activityThread
|
|
324
|
+
return {
|
|
325
|
+
id: item.id,
|
|
326
|
+
...thread.activityInstance,
|
|
327
|
+
judgment: item.judgment,
|
|
328
|
+
comment: item.comment,
|
|
329
|
+
round: item.round,
|
|
330
|
+
createdAt: item.createdAt,
|
|
331
|
+
terminatedAt: item.terminatedAt
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
openActivityApproval(activityApproval) {
|
|
338
|
+
navigate(`activity-approval/${activityApproval.id}?title=${activityApproval.name}`)
|
|
339
|
+
}
|
|
340
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
2
|
+
import '@operato/event-view/ox-event-view.js'
|
|
3
|
+
|
|
4
|
+
import { PropertyValues, html, css } from 'lit'
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
|
+
import { store, PageView } from '@operato/shell'
|
|
9
|
+
import { client } from '@operato/graphql'
|
|
10
|
+
import { i18next, localize } from '@operato/i18n'
|
|
11
|
+
import { OxEventView } from '@operato/event-view'
|
|
12
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
13
|
+
import { BizEvent, CALENDAR } from '@operato/event-view/types.js'
|
|
14
|
+
|
|
15
|
+
@customElement('done-list-calendar-page')
|
|
16
|
+
export class DoneListCalendarPage extends connect(store)(PageView) {
|
|
17
|
+
static styles = [
|
|
18
|
+
ScrollbarStyles,
|
|
19
|
+
css`
|
|
20
|
+
:host {
|
|
21
|
+
display: flex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
ox-event-view {
|
|
25
|
+
flex: 1;
|
|
26
|
+
padding: 10px;
|
|
27
|
+
overflow: auto;
|
|
28
|
+
}
|
|
29
|
+
`
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
@query('ox-event-view') eventView!: OxEventView
|
|
33
|
+
|
|
34
|
+
get context() {
|
|
35
|
+
return {
|
|
36
|
+
title: i18next.t('title.done list calendar'),
|
|
37
|
+
help: 'worklist/worklist-concept'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
render() {
|
|
42
|
+
return html` <ox-event-view mode="monthly" .eventProvider=${this}></ox-event-view> `
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {
|
|
46
|
+
const from = calendar[0].date.toISOString().split('T').join(' ')
|
|
47
|
+
const to = calendar[calendar.length - 1].date.toISOString().split('T').join(' ')
|
|
48
|
+
|
|
49
|
+
const response = await client.query({
|
|
50
|
+
query: gql`
|
|
51
|
+
query ($from: String!, $to: String!) {
|
|
52
|
+
responses: activityEvents(from: $from, to: $to) {
|
|
53
|
+
id
|
|
54
|
+
name
|
|
55
|
+
type
|
|
56
|
+
state
|
|
57
|
+
priority
|
|
58
|
+
date
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
variables: {
|
|
63
|
+
from,
|
|
64
|
+
to
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const eventMap = new Map<Date, BizEvent[]>()
|
|
69
|
+
|
|
70
|
+
if (response.data) {
|
|
71
|
+
const activityEvents = response.data.responses
|
|
72
|
+
|
|
73
|
+
calendar.forEach(({ date }) => {
|
|
74
|
+
const localDateString = date.toLocaleDateString()
|
|
75
|
+
|
|
76
|
+
var events = activityEvents
|
|
77
|
+
.filter(({ date: activityDate }) => new Date(activityDate).toLocaleDateString() == localDateString)
|
|
78
|
+
.sort((a, b) => (a.date > b.date ? 1 : -1))
|
|
79
|
+
.map(({ id, name, priority, date, type, state }) => {
|
|
80
|
+
const color = ['black', 'darkgray', 'orange', 'red'][priority || 0]
|
|
81
|
+
const href =
|
|
82
|
+
type == 'activity-thread'
|
|
83
|
+
? `activity-thread-view/${id}?title=${name}`
|
|
84
|
+
: `activity-approval/${id}?title=${name}`
|
|
85
|
+
const at = new Date(date).toLocaleTimeString([], {
|
|
86
|
+
hourCycle: 'h23',
|
|
87
|
+
hour: '2-digit',
|
|
88
|
+
minute: '2-digit'
|
|
89
|
+
})
|
|
90
|
+
const icon = type == 'activity-thread' ? 'done' : state == 'approved' ? 'done_all' : 'assignment_return'
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
template: html`<a href=${href} style="color:${color};display:block;text-decoration:none;"
|
|
94
|
+
><mwc-icon style="font-size:1em;">${icon}</mwc-icon> ${at} ${name}</a
|
|
95
|
+
>`
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
eventMap.set(date, events)
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return eventMap
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
pageUpdated(changes: any, lifecycle: any, before: any) {
|
|
107
|
+
if (this.active) {
|
|
108
|
+
/*
|
|
109
|
+
* this page is activated
|
|
110
|
+
*/
|
|
111
|
+
} else {
|
|
112
|
+
/* this page is deactivated */
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -167,9 +167,8 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
167
167
|
record: {
|
|
168
168
|
editable: false,
|
|
169
169
|
renderer: function (value, column, record, rowIndex, field) {
|
|
170
|
-
const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
|
|
171
170
|
const count = new Array(value > 4 ? 4 : value || 0).fill('')
|
|
172
|
-
return html`${count.map(() => html`<mwc-icon style="color
|
|
171
|
+
return html`${count.map(() => html`<mwc-icon style="color:gray;">star</mwc-icon>`)}`
|
|
173
172
|
}
|
|
174
173
|
},
|
|
175
174
|
width: 60
|
|
@@ -45,7 +45,7 @@ export class PickableListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
45
45
|
handler: (search: string) => {
|
|
46
46
|
this.grist.searchText = search
|
|
47
47
|
},
|
|
48
|
-
placeholder: i18next.t('title.activity
|
|
48
|
+
placeholder: i18next.t('title.activity shopping'),
|
|
49
49
|
value: this.grist.searchText
|
|
50
50
|
},
|
|
51
51
|
filter: {
|
|
@@ -53,6 +53,7 @@ export class PickableListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
53
53
|
this.grist.toggleHeadroom()
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
+
help: 'worklist/activity-bank',
|
|
56
57
|
actions: []
|
|
57
58
|
}
|
|
58
59
|
}
|
package/client/route.ts
CHANGED
|
@@ -8,6 +8,10 @@ export default function route(page: string) {
|
|
|
8
8
|
import('./pages/dashboard/dashboard-home.js')
|
|
9
9
|
return page
|
|
10
10
|
|
|
11
|
+
case 'done-list-calendar':
|
|
12
|
+
import('./pages/todo/done-list-calendar-page.js')
|
|
13
|
+
return page
|
|
14
|
+
|
|
11
15
|
case 'todo-list':
|
|
12
16
|
import('./pages/todo/todo-list-page.js')
|
|
13
17
|
return page
|
|
@@ -20,6 +24,10 @@ export default function route(page: string) {
|
|
|
20
24
|
import('./pages/todo/approval-pending-list-page.js')
|
|
21
25
|
return page
|
|
22
26
|
|
|
27
|
+
case 'approval-done-list':
|
|
28
|
+
import('./pages/todo/approval-done-list-page.js')
|
|
29
|
+
return page
|
|
30
|
+
|
|
23
31
|
case 'draft-list':
|
|
24
32
|
import('./pages/todo/draft-list-page.js')
|
|
25
33
|
return page
|
|
@@ -87,5 +95,9 @@ export default function route(page: string) {
|
|
|
87
95
|
case 'installable-activity-list':
|
|
88
96
|
import('./pages/installable-activity/installable-activity-list-page')
|
|
89
97
|
return page
|
|
98
|
+
|
|
99
|
+
case 'activity-stats-list':
|
|
100
|
+
import('./pages/activity-stats/activity-stats-list-page')
|
|
101
|
+
return page
|
|
90
102
|
}
|
|
91
103
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
body {
|
|
2
|
+
--ox-calendar-padding: var(--padding-default);
|
|
3
|
+
|
|
4
|
+
/* monthly common color */
|
|
5
|
+
--calendar-monthly-text-color: var(--secondary-color);
|
|
6
|
+
--calendar-monthly-border: 1px solid rgba(0, 0, 0, 0.1);
|
|
7
|
+
--calendar-monthly-border-width: 0 1px 1px 0px;
|
|
8
|
+
|
|
9
|
+
/* monthly layout */
|
|
10
|
+
--calendar-monthly-ol-margin: var(--margin-default) 0;
|
|
11
|
+
--calendar-monthly-ol-top-border: 2px solid rgba(var(--secondary-color-rgb), 0.7);
|
|
12
|
+
--calendar-current-monty-background-color: var(--theme-white-color);
|
|
13
|
+
--calendar-monthly-label-align: left;
|
|
14
|
+
--calendar-monthly-label-padding: var(--padding-narrow) 0;
|
|
15
|
+
--calendar-monthly-label-color: rgba(var(--secondary-color-rgb), 0.8);
|
|
16
|
+
--calendar-monthly-opacity: 0.5;
|
|
17
|
+
--calendar-monthly-date-label-background-color: var(--status-danger-color);
|
|
18
|
+
--calendar-monthly-date-label-margin: var(--margin-narrow);
|
|
19
|
+
--calendar-monthly-date-label-padding: 0px 6px;
|
|
20
|
+
--calendar-monthly-date-label-color: var(--theme-white-color);
|
|
21
|
+
|
|
22
|
+
--calendar-monthly-background-color: #f4f4f4;
|
|
23
|
+
--calendar-monthly-event-border-radius: var(--border-radius);
|
|
24
|
+
--calendar-monthly-event-margin: var(--padding-narrow) 0 0 0;
|
|
25
|
+
--calendar-monthly-event-padding: 2px var(--padding-default);
|
|
26
|
+
--calendar-monthly-event-border: 3px solid #ccc;
|
|
27
|
+
--calendar-monthly-event-border-width: 0 0 0 3px;
|
|
28
|
+
|
|
29
|
+
/* weekly layout */
|
|
30
|
+
--calendar-weekly-ol-margin: var(--margin-default) 0;
|
|
31
|
+
--calendar-weekly-ol-top-border: 2px solid rgba(var(--secondary-color-rgb), 0.7);
|
|
32
|
+
--calendar-current-week-background-color: var(--theme-white-color);
|
|
33
|
+
--calendar-weekly-label-align: center;
|
|
34
|
+
--calendar-weekly-label-padding: var(--padding-narrow) 0;
|
|
35
|
+
--calendar-weekly-label-color: rgba(var(--secondary-color-rgb), 0.8);
|
|
36
|
+
--calendar-weekly-opacity: 0.5;
|
|
37
|
+
--calendar-weekly-date-label-background-color: var(--status-danger-color);
|
|
38
|
+
--calendar-weekly-date-label-margin: var(--margin-narrow);
|
|
39
|
+
--calendar-weekly-date-label-padding: 0px 6px;
|
|
40
|
+
--calendar-weekly-date-label-color: var(--theme-white-color);
|
|
41
|
+
|
|
42
|
+
--calendar-weekly-background-color: #f4f4f4;
|
|
43
|
+
--calendar-weekly-event-border-radius: var(--border-radius);
|
|
44
|
+
--calendar-weekly-event-margin: var(--padding-narrow) 0 0 0;
|
|
45
|
+
--calendar-weekly-event-padding: 2px var(--padding-default);
|
|
46
|
+
--calendar-weekly-event-border: 3px solid #ccc;
|
|
47
|
+
--calendar-weekly-event-border-width: 0 0 0 3px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media only screen and (max-width: 460px) {
|
|
51
|
+
body {
|
|
52
|
+
--calendar-monthly-text-color: tomato;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '@operato/data-grist';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
export declare class ActivityStatsImporter extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
activityStats: any[];
|
|
6
|
+
columns: {
|
|
7
|
+
list: {
|
|
8
|
+
fields: string[];
|
|
9
|
+
};
|
|
10
|
+
pagination: {
|
|
11
|
+
infinite: boolean;
|
|
12
|
+
};
|
|
13
|
+
columns: {
|
|
14
|
+
type: string;
|
|
15
|
+
name: string;
|
|
16
|
+
header: string;
|
|
17
|
+
width: number;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
21
|
+
save(): Promise<void>;
|
|
22
|
+
}
|