@things-factory/worklist 6.0.21 → 6.0.25
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/activity-summary-generator.ts +132 -0
- package/client/components/activity-starter-form.ts +89 -3
- package/client/index.ts +1 -0
- package/client/pages/installable-activity/installable-activity-list-page.ts +410 -0
- package/client/pages/installable-activity/installable-activity-model-item-list.ts +18 -0
- package/client/pages/todo/draft-list-page.ts +9 -0
- package/client/route.ts +4 -0
- package/dist-client/activity-summary-generator.d.ts +2 -0
- package/dist-client/activity-summary-generator.js +114 -0
- package/dist-client/activity-summary-generator.js.map +1 -0
- package/dist-client/components/activity-starter-form.d.ts +1 -0
- package/dist-client/components/activity-starter-form.js +66 -4
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +1 -0
- package/dist-client/index.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +45 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +414 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.d.ts +1 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.js +20 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.js.map +1 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.d.ts +45 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.js +412 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.js.map +1 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.d.ts +1 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js +20 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js.map +1 -0
- package/dist-client/pages/todo/draft-list-page.js +9 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-installation-controller.js +17 -0
- package/dist-server/controllers/activity-installation-controller.js.map +1 -0
- package/dist-server/controllers/activity-instance/post.js +3 -6
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/controllers/call-webhook.js +4 -2
- package/dist-server/controllers/call-webhook.js.map +1 -1
- package/dist-server/controllers/common.js +44 -4
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js +4 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/activity/activity-model-type.js +1 -1
- package/dist-server/service/activity/activity-model-type.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +1 -0
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity/activity.js +9 -0
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity-approval/event-subscriber.js +21 -4
- package/dist-server/service/activity-approval/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +40 -0
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +13 -1
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +25 -1
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/index.js +4 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/installable-activity/index.js +10 -0
- package/dist-server/service/installable-activity/index.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js +60 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-query.js +48 -0
- package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-type.js +21 -0
- package/dist-server/service/installable-activity/installable-activity-type.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity.js +70 -0
- package/dist-server/service/installable-activity/installable-activity.js.map +1 -0
- package/dist-server/service/installed-activity/index.js +10 -0
- package/dist-server/service/installed-activity/index.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-mutation.js +60 -0
- package/dist-server/service/installed-activity/installed-activity-mutation.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-query.js +48 -0
- package/dist-server/service/installed-activity/installed-activity-query.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-type.js +21 -0
- package/dist-server/service/installed-activity/installed-activity-type.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity.js +70 -0
- package/dist-server/service/installed-activity/installed-activity.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/controllers/activity-installation-controller.ts +17 -0
- package/server/controllers/activity-instance/bid.ts +52 -0
- package/server/controllers/activity-instance/post.ts +9 -9
- package/server/controllers/activity-thread/submit.ts +1 -1
- package/server/controllers/call-webhook.ts +40 -0
- package/server/controllers/common.ts +41 -5
- package/server/controllers/index.ts +1 -0
- package/server/index.ts +1 -1
- package/server/service/activity/activity-model-type.ts +3 -3
- package/server/service/activity/activity-query.ts +2 -1
- package/server/service/activity/activity.ts +7 -0
- package/server/service/activity-approval/event-subscriber.ts +22 -5
- package/server/service/activity-instance/activity-instance-query.ts +44 -1
- package/server/service/activity-instance/activity-instance-type.ts +12 -4
- package/server/service/activity-instance/activity-instance.ts +17 -1
- package/server/service/index.ts +7 -0
- package/server/service/installable-activity/index.ts +7 -0
- package/server/service/installable-activity/installable-activity-mutation.ts +61 -0
- package/server/service/installable-activity/installable-activity-query.ts +36 -0
- package/server/service/installable-activity/installable-activity-type.ts +12 -0
- package/server/service/installable-activity/installable-activity.ts +49 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
- package/server/controllers/activity-extension-controller.ts +0 -12
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@operato/data-grist';
|
|
3
|
+
import './installable-activity-model-item-list.js';
|
|
4
|
+
import gql from 'graphql-tag';
|
|
5
|
+
import { css, html } from 'lit';
|
|
6
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
8
|
+
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist';
|
|
9
|
+
import { client } from '@operato/graphql';
|
|
10
|
+
import { i18next, localize } from '@operato/i18n';
|
|
11
|
+
import { openPopup } from '@operato/layout';
|
|
12
|
+
import { PageView, store } from '@operato/shell';
|
|
13
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
14
|
+
import { isMobileDevice } from '@operato/utils';
|
|
15
|
+
import { ActivityTypes, ActivityUITypes } from '../../types.js';
|
|
16
|
+
let ActivityTemplateListPage = class ActivityTemplateListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
20
|
+
}
|
|
21
|
+
get context() {
|
|
22
|
+
return {
|
|
23
|
+
search: {
|
|
24
|
+
handler: (search) => {
|
|
25
|
+
this.grist.searchText = search;
|
|
26
|
+
},
|
|
27
|
+
placeholder: i18next.t('title.installable activity list'),
|
|
28
|
+
value: this.grist.searchText
|
|
29
|
+
},
|
|
30
|
+
filter: {
|
|
31
|
+
handler: () => {
|
|
32
|
+
this.grist.toggleHeadroom();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
help: 'worklist/installable-activity',
|
|
36
|
+
actions: []
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const mode = this.mode;
|
|
41
|
+
return html `
|
|
42
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
43
|
+
<div slot="headroom">
|
|
44
|
+
<div id="filters">
|
|
45
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="sorters">
|
|
49
|
+
Sort
|
|
50
|
+
<mwc-icon
|
|
51
|
+
@click=${e => {
|
|
52
|
+
const target = e.currentTarget;
|
|
53
|
+
this.sorterControl.open({
|
|
54
|
+
right: 0,
|
|
55
|
+
top: target.offsetTop + target.offsetHeight
|
|
56
|
+
});
|
|
57
|
+
}}
|
|
58
|
+
>expand_more</mwc-icon
|
|
59
|
+
>
|
|
60
|
+
<ox-popup id="sorter-control">
|
|
61
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
62
|
+
</ox-popup>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div id="modes">
|
|
66
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
|
67
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
|
68
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</ox-grist>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
async pageInitialized(lifecycle) {
|
|
75
|
+
this.gristConfig = {
|
|
76
|
+
list: {
|
|
77
|
+
thumbnail: 'thumbnail',
|
|
78
|
+
fields: ['name', 'description'],
|
|
79
|
+
details: ['visibility', 'updatedAt']
|
|
80
|
+
},
|
|
81
|
+
columns: [
|
|
82
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
83
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
84
|
+
{
|
|
85
|
+
type: 'gutter',
|
|
86
|
+
gutterName: 'button',
|
|
87
|
+
icon: 'reorder',
|
|
88
|
+
handlers: {
|
|
89
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
90
|
+
const popup = openPopup(html `
|
|
91
|
+
<installable-activity-model-item-list .activity=${record}></installable-activity-model-item-list>
|
|
92
|
+
`, {
|
|
93
|
+
backdrop: true,
|
|
94
|
+
help: 'worklist/activity-model-item-list',
|
|
95
|
+
size: 'large',
|
|
96
|
+
title: i18next.t('title.activity model item list')
|
|
97
|
+
});
|
|
98
|
+
popup.onclosed = () => {
|
|
99
|
+
var _a;
|
|
100
|
+
(_a = this.grist) === null || _a === void 0 ? void 0 : _a.fetch();
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'gutter',
|
|
107
|
+
gutterName: 'button',
|
|
108
|
+
name: 'state',
|
|
109
|
+
icon: record => (record && record.active ? 'pause' : 'play_arrow'),
|
|
110
|
+
handlers: {
|
|
111
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
112
|
+
if (record.active) {
|
|
113
|
+
this.deactivate(record);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.activate(record);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'string',
|
|
123
|
+
name: 'name',
|
|
124
|
+
header: i18next.t('field.name'),
|
|
125
|
+
record: {
|
|
126
|
+
editable: false
|
|
127
|
+
},
|
|
128
|
+
filter: 'search',
|
|
129
|
+
sortable: true,
|
|
130
|
+
width: 150
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'string',
|
|
134
|
+
name: 'description',
|
|
135
|
+
header: i18next.t('field.description'),
|
|
136
|
+
record: {
|
|
137
|
+
editable: false
|
|
138
|
+
},
|
|
139
|
+
filter: 'search',
|
|
140
|
+
width: 200
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'string',
|
|
144
|
+
name: 'version',
|
|
145
|
+
header: i18next.t('field.version'),
|
|
146
|
+
record: {
|
|
147
|
+
editable: false
|
|
148
|
+
},
|
|
149
|
+
filter: 'search',
|
|
150
|
+
sortable: true,
|
|
151
|
+
width: 150
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: 'string',
|
|
155
|
+
name: 'provider',
|
|
156
|
+
header: i18next.t('field.provider'),
|
|
157
|
+
record: {
|
|
158
|
+
editable: false
|
|
159
|
+
},
|
|
160
|
+
filter: 'search',
|
|
161
|
+
sortable: true,
|
|
162
|
+
width: 150
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'select',
|
|
166
|
+
name: 'activityType',
|
|
167
|
+
label: true,
|
|
168
|
+
header: i18next.t('field.activity-type'),
|
|
169
|
+
record: {
|
|
170
|
+
editable: false,
|
|
171
|
+
options: ActivityTypes
|
|
172
|
+
},
|
|
173
|
+
sortable: true,
|
|
174
|
+
// filter: true,
|
|
175
|
+
width: 60
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: 'image',
|
|
179
|
+
name: 'thumbnail',
|
|
180
|
+
header: i18next.t('field.thumbnail'),
|
|
181
|
+
record: { editable: false },
|
|
182
|
+
width: 120
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'select',
|
|
186
|
+
name: 'uiType',
|
|
187
|
+
label: true,
|
|
188
|
+
header: i18next.t('field.ui-type'),
|
|
189
|
+
record: {
|
|
190
|
+
editable: false,
|
|
191
|
+
options: ActivityUITypes
|
|
192
|
+
},
|
|
193
|
+
width: 80
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'string',
|
|
197
|
+
name: 'uiSource',
|
|
198
|
+
header: i18next.t('field.ui-source'),
|
|
199
|
+
record: {
|
|
200
|
+
editable: false,
|
|
201
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
202
|
+
var type = record.uiType !== 'board' ? 'script' : 'board';
|
|
203
|
+
return getRenderer(type)(value, column, record, rowIndex, field);
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
width: 140
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: 'select',
|
|
210
|
+
name: 'reportType',
|
|
211
|
+
label: true,
|
|
212
|
+
header: i18next.t('field.report-type'),
|
|
213
|
+
record: {
|
|
214
|
+
editable: false,
|
|
215
|
+
options: ActivityUITypes
|
|
216
|
+
},
|
|
217
|
+
width: 80
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'string',
|
|
221
|
+
name: 'reportSource',
|
|
222
|
+
header: i18next.t('field.report-source'),
|
|
223
|
+
record: {
|
|
224
|
+
editable: false,
|
|
225
|
+
editor: function (value, column, record, rowIndex, field) {
|
|
226
|
+
var type = record.reportType !== 'board' ? 'script' : 'board';
|
|
227
|
+
return getEditor(type)(value, column, record, rowIndex, field);
|
|
228
|
+
},
|
|
229
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
230
|
+
var type = record.reportType !== 'board' ? 'script' : 'board';
|
|
231
|
+
return getRenderer(type)(value, column, record, rowIndex, field);
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
width: 140
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
type: 'checkbox',
|
|
238
|
+
name: 'startable',
|
|
239
|
+
label: true,
|
|
240
|
+
header: i18next.t('field.startable'),
|
|
241
|
+
record: {
|
|
242
|
+
editable: false
|
|
243
|
+
},
|
|
244
|
+
// filter: true,
|
|
245
|
+
sortable: true,
|
|
246
|
+
width: 60
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'checkbox',
|
|
250
|
+
name: 'active',
|
|
251
|
+
label: true,
|
|
252
|
+
header: i18next.t('field.active'),
|
|
253
|
+
record: {
|
|
254
|
+
editable: false,
|
|
255
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
256
|
+
var type = record.reportType !== 'board' ? 'script' : 'board';
|
|
257
|
+
return getRenderer(type)(value, column, record, rowIndex, field);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
// filter: true,
|
|
261
|
+
sortable: true,
|
|
262
|
+
width: 60
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
type: 'resource-object',
|
|
266
|
+
name: 'updater',
|
|
267
|
+
header: i18next.t('field.updater'),
|
|
268
|
+
record: {
|
|
269
|
+
editable: false
|
|
270
|
+
},
|
|
271
|
+
sortable: true,
|
|
272
|
+
width: 120
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
rows: {
|
|
276
|
+
selectable: false,
|
|
277
|
+
appendable: false
|
|
278
|
+
},
|
|
279
|
+
sorters: [
|
|
280
|
+
{
|
|
281
|
+
name: 'name'
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
async pageUpdated(changes, lifecycle) {
|
|
287
|
+
if (this.active) {
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
291
|
+
var _a;
|
|
292
|
+
const response = await client.query({
|
|
293
|
+
query: gql `
|
|
294
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
295
|
+
responses: installableActivities(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
296
|
+
items {
|
|
297
|
+
activity {
|
|
298
|
+
id
|
|
299
|
+
state
|
|
300
|
+
}
|
|
301
|
+
name
|
|
302
|
+
description
|
|
303
|
+
provider
|
|
304
|
+
release
|
|
305
|
+
activityType
|
|
306
|
+
startable
|
|
307
|
+
model {
|
|
308
|
+
name
|
|
309
|
+
description
|
|
310
|
+
active
|
|
311
|
+
tag
|
|
312
|
+
inout
|
|
313
|
+
type
|
|
314
|
+
unit
|
|
315
|
+
options
|
|
316
|
+
quantifier
|
|
317
|
+
spec
|
|
318
|
+
}
|
|
319
|
+
thumbnail
|
|
320
|
+
uiType
|
|
321
|
+
uiSource
|
|
322
|
+
reportType
|
|
323
|
+
reportSource
|
|
324
|
+
}
|
|
325
|
+
total
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
`,
|
|
329
|
+
variables: {
|
|
330
|
+
filters,
|
|
331
|
+
pagination: { page, limit },
|
|
332
|
+
sortings
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
if (!response.data) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const { total, items: records } = (_a = response.data) === null || _a === void 0 ? void 0 : _a.responses;
|
|
339
|
+
for (var item of records) {
|
|
340
|
+
item.active = item.activity && item.activity.state == 'released';
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
total,
|
|
344
|
+
records
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
async activate(record) {
|
|
348
|
+
var _a;
|
|
349
|
+
await client.mutate({
|
|
350
|
+
mutation: gql `
|
|
351
|
+
mutation ($name: String!) {
|
|
352
|
+
activateInstallableActivity(name: $name) {
|
|
353
|
+
name
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
`,
|
|
357
|
+
variables: {
|
|
358
|
+
name: record.name
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
(_a = this.grist) === null || _a === void 0 ? void 0 : _a.fetch();
|
|
362
|
+
}
|
|
363
|
+
async deactivate(record) {
|
|
364
|
+
var _a;
|
|
365
|
+
await client.mutate({
|
|
366
|
+
mutation: gql `
|
|
367
|
+
mutation ($name: String!) {
|
|
368
|
+
deactivateInstallableActivity(name: $name) {
|
|
369
|
+
name
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
`,
|
|
373
|
+
variables: {
|
|
374
|
+
name: record.name
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
(_a = this.grist) === null || _a === void 0 ? void 0 : _a.fetch();
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
ActivityTemplateListPage.styles = [
|
|
381
|
+
ScrollbarStyles,
|
|
382
|
+
CommonGristStyles,
|
|
383
|
+
css `
|
|
384
|
+
:host {
|
|
385
|
+
display: flex;
|
|
386
|
+
|
|
387
|
+
width: 100%;
|
|
388
|
+
|
|
389
|
+
--grid-record-emphasized-background-color: red;
|
|
390
|
+
--grid-record-emphasized-color: yellow;
|
|
391
|
+
}
|
|
392
|
+
`
|
|
393
|
+
];
|
|
394
|
+
__decorate([
|
|
395
|
+
property({ type: Object }),
|
|
396
|
+
__metadata("design:type", Object)
|
|
397
|
+
], ActivityTemplateListPage.prototype, "gristConfig", void 0);
|
|
398
|
+
__decorate([
|
|
399
|
+
property({ type: String }),
|
|
400
|
+
__metadata("design:type", String)
|
|
401
|
+
], ActivityTemplateListPage.prototype, "mode", void 0);
|
|
402
|
+
__decorate([
|
|
403
|
+
query('#sorter-control'),
|
|
404
|
+
__metadata("design:type", Object)
|
|
405
|
+
], ActivityTemplateListPage.prototype, "sorterControl", void 0);
|
|
406
|
+
__decorate([
|
|
407
|
+
query('ox-grist'),
|
|
408
|
+
__metadata("design:type", DataGrist)
|
|
409
|
+
], ActivityTemplateListPage.prototype, "grist", void 0);
|
|
410
|
+
ActivityTemplateListPage = __decorate([
|
|
411
|
+
customElement('installable-activity-list-page')
|
|
412
|
+
], ActivityTemplateListPage);
|
|
413
|
+
export { ActivityTemplateListPage };
|
|
414
|
+
//# sourceMappingURL=installable-activity-list-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installable-activity-list-page.js","sourceRoot":"","sources":["../../../client/pages/installable-activity/installable-activity-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,2CAA2C,CAAA;AAClD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE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AK;YACL,OAAO;SACR,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAM;;QACnB,MAAM,MAAM,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,GAAG,CAAA;;;;;;OAMZ;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB;SACF,CAAC,CAAA;QAEF,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,EAAE,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAM;;QACrB,MAAM,MAAM,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,GAAG,CAAA;;;;;;OAMZ;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB;SACF,CAAC,CAAA;QAEF,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,EAAE,CAAA;IACrB,CAAC;;AArYM,+BAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAqE;AAqBhG;IAAC,KAAK,CAAC,iBAAiB,CAAC;;+DAAoB;AAC7C;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;uDAAA;AAvCzB,wBAAwB;IADpC,aAAa,CAAC,gCAAgC,CAAC;GACnC,wBAAwB,CAuYpC;SAvYY,wBAAwB","sourcesContent":["import '@operato/data-grist'\nimport './installable-activity-model-item-list.js'\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { DataGrist, getEditor, getRenderer } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { ActivityTypes, ActivityUITypes } from '../../types.js'\n\n@customElement('installable-activity-list-page')\nexport class ActivityTemplateListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode?: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'CARD' : 'GRID'\n\n get context() {\n return {\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n placeholder: i18next.t('title.installable activity list'),\n value: this.grist.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'worklist/installable-activity',\n actions: []\n }\n }\n\n @query('#sorter-control') sorterControl?: any\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n\n <div id=\"sorters\">\n Sort\n <mwc-icon\n @click=${e => {\n const target = e.currentTarget\n this.sorterControl.open({\n right: 0,\n top: target.offsetTop + target.offsetHeight\n })\n }}\n >expand_more</mwc-icon\n >\n <ox-popup id=\"sorter-control\">\n <ox-sorters-control> </ox-sorters-control>\n </ox-popup>\n </div>\n\n <div id=\"modes\">\n <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'description'],\n details: ['visibility', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n const popup = openPopup(\n html`\n <installable-activity-model-item-list .activity=${record}></installable-activity-model-item-list>\n `,\n {\n backdrop: true,\n help: 'worklist/activity-model-item-list',\n size: 'large',\n title: i18next.t('title.activity model item list')\n }\n )\n popup.onclosed = () => {\n this.grist?.fetch()\n }\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (record && record.active ? 'pause' : 'play_arrow'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (record.active) {\n this.deactivate(record)\n } else {\n this.activate(record)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: false\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'string',\n name: 'version',\n header: i18next.t('field.version'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'provider',\n header: i18next.t('field.provider'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'select',\n name: 'activityType',\n label: true,\n header: i18next.t('field.activity-type'),\n record: {\n editable: false,\n options: ActivityTypes\n },\n sortable: true,\n // filter: true,\n width: 60\n },\n {\n type: 'image',\n name: 'thumbnail',\n header: i18next.t('field.thumbnail'),\n record: { editable: false },\n width: 120\n },\n {\n type: 'select',\n name: 'uiType',\n label: true,\n header: i18next.t('field.ui-type'),\n record: {\n editable: false,\n options: ActivityUITypes\n },\n width: 80\n },\n {\n type: 'string',\n name: 'uiSource',\n header: i18next.t('field.ui-source'),\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n var type = record.uiType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n {\n type: 'select',\n name: 'reportType',\n label: true,\n header: i18next.t('field.report-type'),\n record: {\n editable: false,\n options: ActivityUITypes\n },\n width: 80\n },\n {\n type: 'string',\n name: 'reportSource',\n header: i18next.t('field.report-source'),\n record: {\n editable: false,\n editor: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n {\n type: 'checkbox',\n name: 'startable',\n label: true,\n header: i18next.t('field.startable'),\n record: {\n editable: false\n },\n // filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n // filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n }\n ],\n rows: {\n selectable: false,\n appendable: false\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: installableActivities(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n activity {\n id\n state\n }\n name\n description\n provider\n release\n activityType\n startable\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n thumbnail\n uiType\n uiSource\n reportType\n reportSource\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n if (!response.data) {\n return\n }\n\n const { total, items: records } = response.data?.responses\n\n for (var item of records) {\n item.active = item.activity && item.activity.state == 'released'\n }\n\n return {\n total,\n records\n }\n }\n\n async activate(record) {\n await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n activateInstallableActivity(name: $name) {\n name\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n this.grist?.fetch()\n }\n\n async deactivate(record) {\n await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n deactivateInstallableActivity(name: $name) {\n name\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n this.grist?.fetch()\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { isMobileDevice } from '@operato/utils';
|
|
5
|
+
import { ActivityModelItemList } from '../activity/activity-model-item-list';
|
|
6
|
+
let InstallableActivityModelItemList = class InstallableActivityModelItemList extends ActivityModelItemList {
|
|
7
|
+
render() {
|
|
8
|
+
return html `
|
|
9
|
+
<ox-grist
|
|
10
|
+
.mode=${isMobileDevice() ? 'CARD' : 'GRID'}
|
|
11
|
+
.config=${this.gristConfig}
|
|
12
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
13
|
+
></ox-grist>
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
InstallableActivityModelItemList = __decorate([
|
|
18
|
+
customElement('installable-activity-model-item-list')
|
|
19
|
+
], InstallableActivityModelItemList);
|
|
20
|
+
//# sourceMappingURL=installable-activity-model-item-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installable-activity-model-item-list.js","sourceRoot":"","sources":["../../../client/pages/installable-activity/installable-activity-model-item-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAG5E,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,qBAAqB;IAClE,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,WAAW;wBACV,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;KAE/C,CAAA;IACH,CAAC;CACF,CAAA;AAVK,gCAAgC;IADrC,aAAa,CAAC,sCAAsC,CAAC;GAChD,gCAAgC,CAUrC","sourcesContent":["import { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { isMobileDevice } from '@operato/utils'\nimport { ActivityModelItemList } from '../activity/activity-model-item-list'\n\n@customElement('installable-activity-model-item-list')\nclass InstallableActivityModelItemList extends ActivityModelItemList {\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ></ox-grist>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import '@operato/data-grist';
|
|
2
|
+
import './installed-activity-model-item-list.js';
|
|
3
|
+
import { DataGrist } from '@operato/data-grist';
|
|
4
|
+
import { PageView } from '@operato/shell';
|
|
5
|
+
declare const ActivityTemplateListPage_base: (new (...args: any[]) => {
|
|
6
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
stateChanged(_state: unknown): void;
|
|
10
|
+
readonly isConnected: boolean;
|
|
11
|
+
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
12
|
+
export declare class ActivityTemplateListPage extends ActivityTemplateListPage_base {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
gristConfig: any;
|
|
15
|
+
mode?: 'GRID' | 'LIST' | 'CARD';
|
|
16
|
+
get context(): {
|
|
17
|
+
search: {
|
|
18
|
+
handler: (search: string) => void;
|
|
19
|
+
placeholder: string;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
filter: {
|
|
23
|
+
handler: () => void;
|
|
24
|
+
};
|
|
25
|
+
help: string;
|
|
26
|
+
actions: never[];
|
|
27
|
+
};
|
|
28
|
+
sorterControl?: any;
|
|
29
|
+
grist: DataGrist;
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
pageInitialized(lifecycle: any): Promise<void>;
|
|
32
|
+
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
33
|
+
fetchHandler({ page, limit, sortings, filters }: {
|
|
34
|
+
page: any;
|
|
35
|
+
limit: any;
|
|
36
|
+
sortings?: never[] | undefined;
|
|
37
|
+
filters?: never[] | undefined;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
total: any;
|
|
40
|
+
records: any;
|
|
41
|
+
} | undefined>;
|
|
42
|
+
activate(record: any): Promise<void>;
|
|
43
|
+
deactivate(record: any): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|