@things-factory/worklist 5.0.7 → 5.0.13
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/{bootstrap.js → bootstrap.ts} +0 -0
- package/client/components/activity-/bowner-view.js +0 -1
- package/client/components/activity-instance-preview.js +1 -2
- package/client/components/{activity-intro-view.js → activity-intro-view.ts} +29 -42
- package/client/components/activity-reporter-view.js +0 -1
- package/client/components/activity-starter-form.js +2 -3
- package/client/{index.js → index.ts} +0 -0
- package/client/pages/activity/{activity-list-page.js → activity-list-page.ts} +26 -36
- package/client/pages/activity/activity-model-item-list.js +4 -1
- package/client/pages/activity/activity-page.js +2 -3
- package/client/pages/activity/starter-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-page.js +2 -2
- package/client/pages/activity-store/activity-store-page.js +1 -1
- package/client/pages/activity-supervisor/reporter-list-page.js +1 -1
- package/client/pages/activity-template/activity-template-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-page.js +2 -2
- package/client/pages/todo/assigned-list-page.js +1 -1
- package/client/pages/todo/draft-list-page.js +4 -2
- package/client/pages/todo/pickable-list-page.js +2 -2
- package/client/pages/todo/todo-list-page.js +2 -2
- package/client/pages/{worklist-home.js → worklist-home.ts} +2 -6
- package/client/{route.js → route.ts} +1 -1
- package/client/tsconfig.json +11 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +12 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/activity-/bowner-view.d.ts +1 -0
- package/dist-client/components/activity-/bowner-view.js +96 -0
- package/dist-client/components/activity-/bowner-view.js.map +1 -0
- package/dist-client/components/activity-instance-preview.d.ts +1 -0
- package/dist-client/components/activity-instance-preview.js +180 -0
- package/dist-client/components/activity-instance-preview.js.map +1 -0
- package/dist-client/components/activity-intro-view.d.ts +1 -0
- package/dist-client/components/activity-intro-view.js +104 -0
- package/dist-client/components/activity-intro-view.js.map +1 -0
- package/dist-client/components/activity-reporter-view.d.ts +1 -0
- package/dist-client/components/activity-reporter-view.js +96 -0
- package/dist-client/components/activity-reporter-view.js.map +1 -0
- package/dist-client/components/activity-starter-form.d.ts +1 -0
- package/dist-client/components/activity-starter-form.js +293 -0
- package/dist-client/components/activity-starter-form.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.d.ts +47 -0
- package/dist-client/pages/activity/activity-list-page.js +479 -0
- package/dist-client/pages/activity/activity-list-page.js.map +1 -0
- package/dist-client/pages/activity/activity-model-item-list.d.ts +194 -0
- package/dist-client/pages/activity/activity-model-item-list.js +288 -0
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -0
- package/dist-client/pages/activity/activity-page.d.ts +49 -0
- package/dist-client/pages/activity/activity-page.js +367 -0
- package/dist-client/pages/activity/activity-page.js.map +1 -0
- package/dist-client/pages/activity/starter-list-page.d.ts +143 -0
- package/dist-client/pages/activity/starter-list-page.js +209 -0
- package/dist-client/pages/activity/starter-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +137 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +202 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-page.d.ts +49 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js +365 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -0
- package/dist-client/pages/activity-store/activity-store-page.d.ts +174 -0
- package/dist-client/pages/activity-store/activity-store-page.js +211 -0
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +143 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +209 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-importer.d.ts +24 -0
- package/dist-client/pages/activity-template/activity-template-importer.js +98 -0
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +263 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js +402 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.d.ts +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +36 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +24 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js +98 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +145 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +284 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +46 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js +331 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -0
- package/dist-client/pages/dashboard/dashboard-home.d.ts +1 -0
- package/dist-client/pages/dashboard/dashboard-home.js +17 -0
- package/dist-client/pages/dashboard/dashboard-home.js.map +1 -0
- package/dist-client/pages/todo/assigned-list-page.d.ts +124 -0
- package/dist-client/pages/todo/assigned-list-page.js +233 -0
- package/dist-client/pages/todo/assigned-list-page.js.map +1 -0
- package/dist-client/pages/todo/draft-list-page.d.ts +198 -0
- package/dist-client/pages/todo/draft-list-page.js +312 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -0
- package/dist-client/pages/todo/pickable-list-page.d.ts +150 -0
- package/dist-client/pages/todo/pickable-list-page.js +260 -0
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -0
- package/dist-client/pages/todo/todo-list-page.d.ts +232 -0
- package/dist-client/pages/todo/todo-list-page.js +333 -0
- package/dist-client/pages/todo/todo-list-page.js.map +1 -0
- package/dist-client/pages/worklist-home.d.ts +1 -0
- package/dist-client/pages/worklist-home.js +18 -0
- package/dist-client/pages/worklist-home.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +53 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/types.d.ts +19 -0
- package/dist-client/types.js +37 -0
- package/dist-client/types.js.map +1 -0
- package/dist-server/controllers/activity-extension-controller.js.map +1 -1
- package/dist-server/controllers/activity-instance/abort.js +4 -5
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/adjust.js +3 -2
- package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
- package/dist-server/controllers/activity-instance/assign.js +9 -25
- package/dist-server/controllers/activity-instance/assign.js.map +1 -1
- package/dist-server/controllers/activity-instance/delegate.js +5 -6
- package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +6 -7
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/end.js +5 -6
- package/dist-server/controllers/activity-instance/end.js.map +1 -1
- package/dist-server/controllers/activity-instance/index.js +11 -24
- package/dist-server/controllers/activity-instance/index.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +6 -6
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/controllers/activity-instance/post.js +10 -6
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-instance/start.js +3 -2
- package/dist-server/controllers/activity-instance/start.js.map +1 -1
- package/dist-server/controllers/activity-instance/terminate.js +5 -6
- package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
- package/dist-server/controllers/activity-thread/abort.js +3 -4
- package/dist-server/controllers/activity-thread/abort.js.map +1 -1
- package/dist-server/controllers/activity-thread/adjust.js +2 -1
- package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
- package/dist-server/controllers/activity-thread/delegate.js +4 -5
- package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
- package/dist-server/controllers/activity-thread/end.js +4 -5
- package/dist-server/controllers/activity-thread/end.js.map +1 -1
- package/dist-server/controllers/activity-thread/index.js +8 -21
- package/dist-server/controllers/activity-thread/index.js.map +1 -1
- package/dist-server/controllers/activity-thread/save.js +2 -1
- package/dist-server/controllers/activity-thread/save.js.map +1 -1
- package/dist-server/controllers/activity-thread/start.js +4 -5
- package/dist-server/controllers/activity-thread/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/terminate.js +3 -4
- package/dist-server/controllers/activity-thread/terminate.js.map +1 -1
- package/dist-server/controllers/common.js +23 -6
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +4 -17
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/activity/activity-history.js +68 -76
- package/dist-server/service/activity/activity-history.js.map +1 -1
- package/dist-server/service/activity/activity-model-type.js +51 -60
- package/dist-server/service/activity/activity-model-type.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +39 -50
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +61 -72
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity/activity-type.js +91 -102
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.js +68 -76
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity/event-subscriber.js +2 -7
- package/dist-server/service/activity/event-subscriber.js.map +1 -1
- package/dist-server/service/activity/index.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-history.js +81 -89
- package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-mutation.js +71 -85
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +67 -78
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-subscription.js +8 -21
- package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +106 -106
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +85 -93
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-instance/event-subscriber.js +3 -8
- package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/index.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-history.js +50 -58
- package/dist-server/service/activity-template/activity-template-history.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-mutation.js +39 -50
- package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-query.js +48 -45
- package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-type.js +65 -76
- package/dist-server/service/activity-template/activity-template-type.js.map +1 -1
- package/dist-server/service/activity-template/activity-template.js +48 -56
- package/dist-server/service/activity-template/activity-template.js.map +1 -1
- package/dist-server/service/activity-template/event-subscriber.js +2 -7
- package/dist-server/service/activity-template/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-template/index.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-mutation.js +84 -95
- package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-query.js +45 -56
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-subscription.js +7 -20
- package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-type.js +25 -34
- package/dist-server/service/activity-thread/activity-thread-type.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread.js +43 -51
- package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
- package/dist-server/service/activity-thread/event-subscriber.js +5 -10
- package/dist-server/service/activity-thread/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-thread/index.js.map +1 -1
- package/dist-server/service/index.js +5 -18
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -11
- package/server/controllers/activity-instance/abort.ts +5 -10
- package/server/controllers/activity-instance/adjust.ts +5 -7
- package/server/controllers/activity-instance/assign.ts +13 -45
- package/server/controllers/activity-instance/delegate.ts +6 -8
- package/server/controllers/activity-instance/draft.ts +7 -13
- package/server/controllers/activity-instance/end.ts +6 -9
- package/server/controllers/activity-instance/pick.ts +12 -9
- package/server/controllers/activity-instance/post.ts +14 -12
- package/server/controllers/activity-instance/start.ts +5 -3
- package/server/controllers/activity-instance/terminate.ts +6 -8
- package/server/controllers/activity-thread/abort.ts +3 -9
- package/server/controllers/activity-thread/adjust.ts +3 -6
- package/server/controllers/activity-thread/delegate.ts +4 -7
- package/server/controllers/activity-thread/end.ts +4 -7
- package/server/controllers/activity-thread/save.ts +3 -6
- package/server/controllers/activity-thread/start.ts +4 -11
- package/server/controllers/activity-thread/terminate.ts +3 -7
- package/server/controllers/common.ts +33 -14
- package/server/routes.ts +0 -2
- package/server/service/activity/activity-model-type.ts +4 -4
- package/server/service/activity-instance/activity-instance-history.ts +2 -2
- package/server/service/activity-instance/activity-instance-mutation.ts +11 -15
- package/server/service/activity-instance/activity-instance-subscription.ts +1 -5
- package/server/service/activity-instance/activity-instance-type.ts +17 -11
- package/server/service/activity-instance/activity-instance.ts +2 -2
- package/server/service/activity-template/activity-template-query.ts +10 -0
- package/server/service/activity-thread/activity-thread-mutation.ts +7 -7
- package/server/service/activity-thread/activity-thread-subscription.ts +0 -4
- package/server/service/activity-thread/activity-thread-type.ts +1 -1
- package/server/service/activity-thread/activity-thread.ts +1 -1
- package/server/service/activity-thread/event-subscriber.ts +3 -3
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +2 -2
- package/tsconfig.json +0 -9
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
declare const ActivityThreadListPage_base: (new (...args: any[]) => {
|
|
2
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
disconnectedCallback(): void;
|
|
5
|
+
stateChanged(_state: unknown): void;
|
|
6
|
+
readonly isConnected: boolean;
|
|
7
|
+
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
8
|
+
export class ActivityThreadListPage extends ActivityThreadListPage_base {
|
|
9
|
+
static get properties(): {
|
|
10
|
+
gristConfig: ObjectConstructor;
|
|
11
|
+
mode: StringConstructor;
|
|
12
|
+
};
|
|
13
|
+
static get styles(): import("lit").CSSResult[];
|
|
14
|
+
get context(): {
|
|
15
|
+
title: string;
|
|
16
|
+
help: string;
|
|
17
|
+
actions: {
|
|
18
|
+
icon: string;
|
|
19
|
+
emphasis: {
|
|
20
|
+
raised: boolean;
|
|
21
|
+
outlined: boolean;
|
|
22
|
+
dense: boolean;
|
|
23
|
+
danger: boolean;
|
|
24
|
+
};
|
|
25
|
+
title: string;
|
|
26
|
+
action: () => Promise<void>;
|
|
27
|
+
}[];
|
|
28
|
+
exportable: {
|
|
29
|
+
name: string;
|
|
30
|
+
data: () => Promise<any>;
|
|
31
|
+
};
|
|
32
|
+
importable: {
|
|
33
|
+
handler: (records: any) => Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
mode: string | undefined;
|
|
38
|
+
get grist(): Element | null;
|
|
39
|
+
pageInitialized(lifecycle: any): Promise<void>;
|
|
40
|
+
gristConfig: {
|
|
41
|
+
list: {
|
|
42
|
+
fields: string[];
|
|
43
|
+
details: string[];
|
|
44
|
+
};
|
|
45
|
+
columns: ({
|
|
46
|
+
type: string;
|
|
47
|
+
gutterName: string;
|
|
48
|
+
multiple?: undefined;
|
|
49
|
+
name?: undefined;
|
|
50
|
+
header?: undefined;
|
|
51
|
+
record?: undefined;
|
|
52
|
+
filter?: undefined;
|
|
53
|
+
sortable?: undefined;
|
|
54
|
+
width?: undefined;
|
|
55
|
+
label?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
type: string;
|
|
58
|
+
gutterName: string;
|
|
59
|
+
multiple: boolean;
|
|
60
|
+
name?: undefined;
|
|
61
|
+
header?: undefined;
|
|
62
|
+
record?: undefined;
|
|
63
|
+
filter?: undefined;
|
|
64
|
+
sortable?: undefined;
|
|
65
|
+
width?: undefined;
|
|
66
|
+
label?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
type: string;
|
|
69
|
+
name: string;
|
|
70
|
+
header: string;
|
|
71
|
+
record: {
|
|
72
|
+
editable: boolean;
|
|
73
|
+
};
|
|
74
|
+
filter: string;
|
|
75
|
+
sortable: boolean;
|
|
76
|
+
width: number;
|
|
77
|
+
gutterName?: undefined;
|
|
78
|
+
multiple?: undefined;
|
|
79
|
+
label?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
type: string;
|
|
82
|
+
name: string;
|
|
83
|
+
header: string;
|
|
84
|
+
record: {
|
|
85
|
+
editable: boolean;
|
|
86
|
+
};
|
|
87
|
+
filter: string;
|
|
88
|
+
width: number;
|
|
89
|
+
gutterName?: undefined;
|
|
90
|
+
multiple?: undefined;
|
|
91
|
+
sortable?: undefined;
|
|
92
|
+
label?: undefined;
|
|
93
|
+
} | {
|
|
94
|
+
type: string;
|
|
95
|
+
name: string;
|
|
96
|
+
label: boolean;
|
|
97
|
+
header: string;
|
|
98
|
+
record: {
|
|
99
|
+
editable: boolean;
|
|
100
|
+
};
|
|
101
|
+
filter: boolean;
|
|
102
|
+
sortable: boolean;
|
|
103
|
+
width: number;
|
|
104
|
+
gutterName?: undefined;
|
|
105
|
+
multiple?: undefined;
|
|
106
|
+
} | {
|
|
107
|
+
type: string;
|
|
108
|
+
name: string;
|
|
109
|
+
header: string;
|
|
110
|
+
record: {
|
|
111
|
+
editable: boolean;
|
|
112
|
+
};
|
|
113
|
+
sortable: boolean;
|
|
114
|
+
width: number;
|
|
115
|
+
gutterName?: undefined;
|
|
116
|
+
multiple?: undefined;
|
|
117
|
+
filter?: undefined;
|
|
118
|
+
label?: undefined;
|
|
119
|
+
})[];
|
|
120
|
+
rows: {
|
|
121
|
+
selectable: {
|
|
122
|
+
multiple: boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
sorters: {
|
|
126
|
+
name: string;
|
|
127
|
+
}[];
|
|
128
|
+
} | undefined;
|
|
129
|
+
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
130
|
+
fetchHandler({ page, limit, sortings, filters }: {
|
|
131
|
+
page: any;
|
|
132
|
+
limit: any;
|
|
133
|
+
sortings?: any[] | undefined;
|
|
134
|
+
filters?: any[] | undefined;
|
|
135
|
+
}): Promise<{
|
|
136
|
+
total: any;
|
|
137
|
+
records: any;
|
|
138
|
+
}>;
|
|
139
|
+
_deleteActivityThread(): Promise<void>;
|
|
140
|
+
_updateActivityThread(): Promise<void>;
|
|
141
|
+
exportHandler(): Promise<any>;
|
|
142
|
+
importHandler(records: any): Promise<void>;
|
|
143
|
+
}
|
|
144
|
+
import { PageView } from "@operato/shell/page-view.js";
|
|
145
|
+
export {};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import '@operato/data-grist';
|
|
2
|
+
import './activity-thread-importer.js';
|
|
3
|
+
import gql from 'graphql-tag';
|
|
4
|
+
import { css, html } from 'lit';
|
|
5
|
+
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
6
|
+
import { client } from '@operato/graphql';
|
|
7
|
+
import { i18next, localize } from '@operato/i18n';
|
|
8
|
+
import { notify, openPopup } from '@operato/layout';
|
|
9
|
+
import { PageView, store } from '@operato/shell';
|
|
10
|
+
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
11
|
+
import { isMobileDevice } from '@operato/utils';
|
|
12
|
+
export class ActivityThreadListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
13
|
+
static get properties() {
|
|
14
|
+
return {
|
|
15
|
+
gristConfig: Object,
|
|
16
|
+
mode: String
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get styles() {
|
|
20
|
+
return [
|
|
21
|
+
ScrollbarStyles,
|
|
22
|
+
CommonGristStyles,
|
|
23
|
+
css `
|
|
24
|
+
:host {
|
|
25
|
+
display: flex;
|
|
26
|
+
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
--grid-record-emphasized-background-color: red;
|
|
30
|
+
--grid-record-emphasized-color: yellow;
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
get context() {
|
|
36
|
+
return {
|
|
37
|
+
title: i18next.t('title.activity-thread list'),
|
|
38
|
+
help: 'worklist/activity-thread',
|
|
39
|
+
actions: [
|
|
40
|
+
Object.assign({ title: i18next.t('button.save'), action: this._updateActivityThread.bind(this) }, CommonButtonStyles.save),
|
|
41
|
+
Object.assign({ title: i18next.t('button.delete'), action: this._deleteActivityThread.bind(this) }, CommonButtonStyles.delete)
|
|
42
|
+
],
|
|
43
|
+
exportable: {
|
|
44
|
+
name: i18next.t('title.activity-thread list'),
|
|
45
|
+
data: this.exportHandler.bind(this)
|
|
46
|
+
},
|
|
47
|
+
importable: {
|
|
48
|
+
handler: this.importHandler.bind(this)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID');
|
|
54
|
+
return html `
|
|
55
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
56
|
+
<div slot="headroom">
|
|
57
|
+
<div id="filters">
|
|
58
|
+
<ox-filters-form autofocus></ox-filters-form>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div id="sorters">
|
|
62
|
+
Sort
|
|
63
|
+
<mwc-icon
|
|
64
|
+
@click=${e => {
|
|
65
|
+
const target = e.currentTarget;
|
|
66
|
+
this.renderRoot.querySelector('#sorter-control').open({
|
|
67
|
+
right: 0,
|
|
68
|
+
top: target.offsetTop + target.offsetHeight
|
|
69
|
+
});
|
|
70
|
+
}}
|
|
71
|
+
>expand_more</mwc-icon
|
|
72
|
+
>
|
|
73
|
+
<ox-popup id="sorter-control">
|
|
74
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
75
|
+
</ox-popup>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div id="modes">
|
|
79
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
|
80
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
|
81
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</ox-grist>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
get grist() {
|
|
88
|
+
return this.renderRoot.querySelector('ox-grist');
|
|
89
|
+
}
|
|
90
|
+
async pageInitialized(lifecycle) {
|
|
91
|
+
this.gristConfig = {
|
|
92
|
+
list: {
|
|
93
|
+
fields: ['name', 'description'],
|
|
94
|
+
details: ['active', 'updatedAt']
|
|
95
|
+
},
|
|
96
|
+
columns: [
|
|
97
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
98
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
99
|
+
{
|
|
100
|
+
type: 'string',
|
|
101
|
+
name: 'name',
|
|
102
|
+
header: i18next.t('field.name'),
|
|
103
|
+
record: {
|
|
104
|
+
editable: true
|
|
105
|
+
},
|
|
106
|
+
filter: 'search',
|
|
107
|
+
sortable: true,
|
|
108
|
+
width: 150
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'string',
|
|
112
|
+
name: 'description',
|
|
113
|
+
header: i18next.t('field.description'),
|
|
114
|
+
record: {
|
|
115
|
+
editable: true
|
|
116
|
+
},
|
|
117
|
+
filter: 'search',
|
|
118
|
+
width: 200
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
type: 'checkbox',
|
|
122
|
+
name: 'active',
|
|
123
|
+
label: true,
|
|
124
|
+
header: i18next.t('field.active'),
|
|
125
|
+
record: {
|
|
126
|
+
editable: true
|
|
127
|
+
},
|
|
128
|
+
filter: true,
|
|
129
|
+
sortable: true,
|
|
130
|
+
width: 60
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'resource-object',
|
|
134
|
+
name: 'updater',
|
|
135
|
+
header: i18next.t('field.updater'),
|
|
136
|
+
record: {
|
|
137
|
+
editable: false
|
|
138
|
+
},
|
|
139
|
+
sortable: true,
|
|
140
|
+
width: 120
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'datetime',
|
|
144
|
+
name: 'updatedAt',
|
|
145
|
+
header: i18next.t('field.updated_at'),
|
|
146
|
+
record: {
|
|
147
|
+
editable: false
|
|
148
|
+
},
|
|
149
|
+
sortable: true,
|
|
150
|
+
width: 180
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
rows: {
|
|
154
|
+
selectable: {
|
|
155
|
+
multiple: true
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
sorters: [
|
|
159
|
+
{
|
|
160
|
+
name: 'name'
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
async pageUpdated(changes, lifecycle) {
|
|
166
|
+
if (this.active) {
|
|
167
|
+
// do something here when this page just became as active
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
171
|
+
const response = await client.query({
|
|
172
|
+
query: gql `
|
|
173
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
174
|
+
responses: activityThreads(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
175
|
+
items {
|
|
176
|
+
id
|
|
177
|
+
name
|
|
178
|
+
description
|
|
179
|
+
active
|
|
180
|
+
updater {
|
|
181
|
+
id
|
|
182
|
+
name
|
|
183
|
+
}
|
|
184
|
+
updatedAt
|
|
185
|
+
}
|
|
186
|
+
total
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`,
|
|
190
|
+
variables: {
|
|
191
|
+
filters,
|
|
192
|
+
pagination: { page, limit },
|
|
193
|
+
sortings
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
return {
|
|
197
|
+
total: response.data.responses.total || 0,
|
|
198
|
+
records: response.data.responses.items || []
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
async _deleteActivityThread() {
|
|
202
|
+
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
|
203
|
+
const ids = this.grist.selected.map(record => record.id);
|
|
204
|
+
if (ids && ids.length > 0) {
|
|
205
|
+
const response = await client.mutate({
|
|
206
|
+
mutation: gql `
|
|
207
|
+
mutation ($ids: [String!]!) {
|
|
208
|
+
deleteActivityThreads(ids: $ids)
|
|
209
|
+
}
|
|
210
|
+
`,
|
|
211
|
+
variables: {
|
|
212
|
+
ids
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
if (!response.errors) {
|
|
216
|
+
this.grist.fetch();
|
|
217
|
+
notify({
|
|
218
|
+
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
async _updateActivityThread() {
|
|
225
|
+
let patches = this.grist.dirtyRecords;
|
|
226
|
+
if (patches && patches.length) {
|
|
227
|
+
patches = patches.map(patch => {
|
|
228
|
+
let patchField = patch.id ? { id: patch.id } : {};
|
|
229
|
+
const dirtyFields = patch.__dirtyfields__;
|
|
230
|
+
for (let key in dirtyFields) {
|
|
231
|
+
patchField[key] = dirtyFields[key].after;
|
|
232
|
+
}
|
|
233
|
+
patchField.cuFlag = patch.__dirty__;
|
|
234
|
+
return patchField;
|
|
235
|
+
});
|
|
236
|
+
const response = await client.mutate({
|
|
237
|
+
mutation: gql `
|
|
238
|
+
mutation ($patches: [ActivityThreadPatch!]!) {
|
|
239
|
+
updateMultipleActivityThread(patches: $patches) {
|
|
240
|
+
name
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
`,
|
|
244
|
+
variables: {
|
|
245
|
+
patches
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
if (!response.errors) {
|
|
249
|
+
this.grist.fetch();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async exportHandler() {
|
|
254
|
+
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
|
|
255
|
+
const targetFieldSet = new Set(['id', 'name', 'description', 'active']);
|
|
256
|
+
return exportTargets.map(activityThread => {
|
|
257
|
+
let tempObj = {};
|
|
258
|
+
for (const field of targetFieldSet) {
|
|
259
|
+
tempObj[field] = activityThread[field];
|
|
260
|
+
}
|
|
261
|
+
return tempObj;
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
async importHandler(records) {
|
|
265
|
+
const popup = openPopup(html `
|
|
266
|
+
<activity-thread-importer
|
|
267
|
+
.activityThreads=${records}
|
|
268
|
+
@imported=${() => {
|
|
269
|
+
history.back();
|
|
270
|
+
this.grist.fetch();
|
|
271
|
+
}}
|
|
272
|
+
></activity-thread-importer>
|
|
273
|
+
`, {
|
|
274
|
+
backdrop: true,
|
|
275
|
+
size: 'large',
|
|
276
|
+
title: i18next.t('title.import activity-thread')
|
|
277
|
+
});
|
|
278
|
+
popup.onclosed = () => {
|
|
279
|
+
this.grist.fetch();
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
window.customElements.define('activity-thread-list-page', ActivityThreadListPage);
|
|
284
|
+
//# sourceMappingURL=activity-thread-list-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-thread-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-list-page.js"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,+BAA+B,CAAA;AAEtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,OAAO,sBAAuB,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IACrF,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,eAAe;YACf,iBAAiB;YACjB,GAAG,CAAA;;;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KAAK,CAAC,CAAA;aACvC;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAO;QACzB,MAAM,KAAK,GAAG,SAAS,CACrB,IAAI,CAAA;;6BAEmB,OAAO;sBACd,GAAG,EAAE;YACf,OAAO,CAAC,IAAI,EAAE,CAAA;YACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC;SACjD,CACF,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC,CAAA;IACH,CAAC;CACF;AAED,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import '@operato/data-grist'\nimport './activity-thread-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\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\nexport class ActivityThreadListPage extends connect(store)(localize(i18next)(PageView)) {\n static get properties() {\n return {\n gristConfig: Object,\n mode: String\n }\n }\n\n static get styles() {\n return [\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\n get context() {\n return {\n title: i18next.t('title.activity-thread list'),\n help: 'worklist/activity-thread',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteActivityThread.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.activity-thread list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\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></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.renderRoot.querySelector('#sorter-control').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 get grist() {\n return this.renderRoot.querySelector('ox-grist')\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\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: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\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 type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n // do something here when this page just became as 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: activityThreads(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteActivityThread() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteActivityThreads(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateActivityThread() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ActivityThreadPatch!]!) {\n updateMultipleActivityThread(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(activityThread => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = activityThread[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <activity-thread-importer\n .activityThreads=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></activity-thread-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-thread')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n\nwindow.customElements.define('activity-thread-list-page', ActivityThreadListPage)\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export namespace ActivityThreadStatus {
|
|
2
|
+
const Assigned: string;
|
|
3
|
+
const Started: string;
|
|
4
|
+
const Delegated: string;
|
|
5
|
+
const Ended: string;
|
|
6
|
+
const Aborted: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ActivityThreadPage_base: (new (...args: any[]) => {
|
|
9
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
stateChanged(_state: unknown): void;
|
|
13
|
+
readonly isConnected: boolean;
|
|
14
|
+
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
15
|
+
export class ActivityThreadPage extends ActivityThreadPage_base {
|
|
16
|
+
static get properties(): {
|
|
17
|
+
activityThread: ObjectConstructor;
|
|
18
|
+
board: ObjectConstructor;
|
|
19
|
+
};
|
|
20
|
+
static get styles(): import("lit").CSSResult[];
|
|
21
|
+
get context(): {
|
|
22
|
+
title: any;
|
|
23
|
+
help: string;
|
|
24
|
+
actions: any[];
|
|
25
|
+
};
|
|
26
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
activityContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
28
|
+
templateContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
29
|
+
getInputSpec(): any;
|
|
30
|
+
getOutputSpec(): any;
|
|
31
|
+
generatedContent(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
boardContent(): import("lit-html").TemplateResult<1>;
|
|
33
|
+
board: {
|
|
34
|
+
id: any;
|
|
35
|
+
} | undefined;
|
|
36
|
+
getOutputFromBoard(): any;
|
|
37
|
+
updated(changes: any): void;
|
|
38
|
+
pageUpdated(changes: any, lifecycle: any, changedBefore: any): Promise<void>;
|
|
39
|
+
fetchActivityThread(id: any): Promise<void>;
|
|
40
|
+
activityThread: any;
|
|
41
|
+
_startActivityThread(): Promise<void>;
|
|
42
|
+
_saveActivityThread(): Promise<void>;
|
|
43
|
+
_endActivityThread(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
import { PageView } from "@operato/shell/page-view";
|
|
46
|
+
export {};
|