@things-factory/worklist 7.0.1-alpha.0 → 7.0.1-alpha.4
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-approval/activity-approval-page.ts +4 -3
- package/client/pages/activity-instance/activity-instance-start-page.ts +7 -32
- package/client/pages/activity-thread/activity-thread-page.ts +3 -2
- package/client/pages/activity-thread/activity-thread-view-page.ts +3 -2
- package/dist-client/components/activity-approval-ribon.d.ts +1 -1
- package/dist-client/components/activity-instance-ribon.d.ts +1 -1
- package/dist-client/components/activity-starter-form.d.ts +1 -1
- package/dist-client/components/activity-thread-ribon.d.ts +1 -1
- package/dist-client/components/activity-thread-timeline.d.ts +4 -4
- package/dist-client/grist-editor/grist-editor-activity-search-key.d.ts +1 -1
- package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +1 -1
- package/dist-client/pages/activity/activity-list-page.d.ts +1 -1
- package/dist-client/pages/activity/activity-model-item-list.d.ts +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +3 -3
- package/dist-client/pages/activity/activity-partial-view.d.ts +3 -3
- package/dist-client/pages/activity/starter-list-page.d.ts +1 -1
- package/dist-client/pages/activity-approval/activity-approval-importer.d.ts +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.d.ts +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +6 -4
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +7 -5
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +5 -5
- package/dist-client/pages/activity-stats/activity-stats-importer.d.ts +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.d.ts +1 -1
- package/dist-client/pages/activity-store/activity-store-page.d.ts +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +1 -1
- package/dist-client/pages/activity-template/activity-template-importer.d.ts +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +5 -4
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +5 -4
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.d.ts +2 -2
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +1 -1
- package/dist-client/pages/todo/approval-done-list-page.d.ts +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.d.ts +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.d.ts +1 -1
- package/dist-client/pages/todo/done-list-page.d.ts +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -4,7 +4,8 @@ import '../../components/activity-approval-ribon.js'
|
|
|
4
4
|
import '../../components/activity-thread-timeline.js'
|
|
5
5
|
|
|
6
6
|
import gql from 'graphql-tag'
|
|
7
|
-
import { css, html, nothing } from 'lit'
|
|
7
|
+
import { css, html, nothing, TemplateResult } from 'lit'
|
|
8
|
+
import { DirectiveResult } from 'lit-html/directive.js'
|
|
8
9
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
9
10
|
import { customElement, query, state } from 'lit/decorators.js'
|
|
10
11
|
import { keyed } from 'lit/directives/keyed.js'
|
|
@@ -303,7 +304,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
303
304
|
})
|
|
304
305
|
}
|
|
305
306
|
|
|
306
|
-
generatedContent() {
|
|
307
|
+
generatedContent(): DirectiveResult {
|
|
307
308
|
if (!this.activityApproval) {
|
|
308
309
|
return html``
|
|
309
310
|
}
|
|
@@ -344,7 +345,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
344
345
|
)
|
|
345
346
|
}
|
|
346
347
|
|
|
347
|
-
boardContent() {
|
|
348
|
+
boardContent(): DirectiveResult {
|
|
348
349
|
if (!this.activityApproval) {
|
|
349
350
|
return html``
|
|
350
351
|
}
|
|
@@ -4,7 +4,8 @@ import '@things-factory/organization'
|
|
|
4
4
|
import '../../components/activity-instance-ribon.js'
|
|
5
5
|
|
|
6
6
|
import gql from 'graphql-tag'
|
|
7
|
-
import { css, html } from 'lit'
|
|
7
|
+
import { css, html, TemplateResult } from 'lit'
|
|
8
|
+
import { DirectiveResult } from 'lit-html/directive.js'
|
|
8
9
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
9
10
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
10
11
|
import { keyed } from 'lit/directives/keyed.js'
|
|
@@ -78,7 +79,7 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
78
79
|
`
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
activityContent() {
|
|
82
|
+
activityContent(): DirectiveResult {
|
|
82
83
|
switch (this.activityInstance?.uiType) {
|
|
83
84
|
case 'template':
|
|
84
85
|
return this.templateContent()
|
|
@@ -134,7 +135,7 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
134
135
|
})
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
generatedContent() {
|
|
138
|
+
generatedContent(): DirectiveResult {
|
|
138
139
|
if (!this.activityInstance) {
|
|
139
140
|
return html``
|
|
140
141
|
}
|
|
@@ -179,7 +180,7 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
179
180
|
)
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
boardContent() {
|
|
183
|
+
boardContent(): DirectiveResult {
|
|
183
184
|
if (!this.activityInstance) {
|
|
184
185
|
return html``
|
|
185
186
|
}
|
|
@@ -333,21 +334,7 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
333
334
|
|
|
334
335
|
async draftActivityInstance() {
|
|
335
336
|
var { id: activityId } = this.activity
|
|
336
|
-
var {
|
|
337
|
-
id,
|
|
338
|
-
name,
|
|
339
|
-
description,
|
|
340
|
-
priority,
|
|
341
|
-
threadsMin,
|
|
342
|
-
threadsMax,
|
|
343
|
-
dueAt,
|
|
344
|
-
input,
|
|
345
|
-
output,
|
|
346
|
-
reason,
|
|
347
|
-
uiType,
|
|
348
|
-
assignees,
|
|
349
|
-
approvalLine
|
|
350
|
-
} = this.activityInstance
|
|
337
|
+
var { id, name, description, priority, threadsMin, threadsMax, dueAt, input, output, reason, uiType, assignees, approvalLine } = this.activityInstance
|
|
351
338
|
|
|
352
339
|
if (uiType === 'board') {
|
|
353
340
|
;[input, output] = this.getInOutFromBoard()
|
|
@@ -446,19 +433,7 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
446
433
|
}
|
|
447
434
|
|
|
448
435
|
async issueActivityInstance() {
|
|
449
|
-
var {
|
|
450
|
-
id,
|
|
451
|
-
name,
|
|
452
|
-
description,
|
|
453
|
-
input,
|
|
454
|
-
output,
|
|
455
|
-
reason,
|
|
456
|
-
uiType,
|
|
457
|
-
threadsMin = 0,
|
|
458
|
-
threadsMax = 0,
|
|
459
|
-
assignees,
|
|
460
|
-
approvalLine
|
|
461
|
-
} = this.activityInstance
|
|
436
|
+
var { id, name, description, input, output, reason, uiType, threadsMin = 0, threadsMax = 0, assignees, approvalLine } = this.activityInstance
|
|
462
437
|
|
|
463
438
|
if (uiType === 'board') {
|
|
464
439
|
;[input, output] = this.getInOutFromBoard()
|
|
@@ -5,6 +5,7 @@ import '../../components/activity-thread-timeline.js'
|
|
|
5
5
|
|
|
6
6
|
import gql from 'graphql-tag'
|
|
7
7
|
import { css, html } from 'lit'
|
|
8
|
+
import { DirectiveResult } from 'lit-html/directive.js'
|
|
8
9
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
9
10
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
10
11
|
import { keyed } from 'lit/directives/keyed.js'
|
|
@@ -264,7 +265,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
264
265
|
})
|
|
265
266
|
}
|
|
266
267
|
|
|
267
|
-
generatedContent() {
|
|
268
|
+
generatedContent(): DirectiveResult {
|
|
268
269
|
if (!this.activityThread) {
|
|
269
270
|
return html``
|
|
270
271
|
}
|
|
@@ -305,7 +306,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
305
306
|
)
|
|
306
307
|
}
|
|
307
308
|
|
|
308
|
-
boardContent() {
|
|
309
|
+
boardContent(): DirectiveResult {
|
|
309
310
|
if (!this.activityThread) {
|
|
310
311
|
return html``
|
|
311
312
|
}
|
|
@@ -5,6 +5,7 @@ import './activity-thread-view.js'
|
|
|
5
5
|
|
|
6
6
|
import gql from 'graphql-tag'
|
|
7
7
|
import { css, html } from 'lit'
|
|
8
|
+
import { DirectiveResult } from 'lit-html/directive.js'
|
|
8
9
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
9
10
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
10
11
|
import { keyed } from 'lit/directives/keyed.js'
|
|
@@ -241,7 +242,7 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
|
|
|
241
242
|
})
|
|
242
243
|
}
|
|
243
244
|
|
|
244
|
-
generatedContent() {
|
|
245
|
+
generatedContent(): DirectiveResult {
|
|
245
246
|
if (!this.activityThread) {
|
|
246
247
|
return html``
|
|
247
248
|
}
|
|
@@ -249,7 +250,7 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
|
|
|
249
250
|
return keyed(this.activityThread.id, html` <activity-thread-view .activityThreadId=${this.activityThread.id}></activity-thread-view> `)
|
|
250
251
|
}
|
|
251
252
|
|
|
252
|
-
boardContent() {
|
|
253
|
+
boardContent(): DirectiveResult {
|
|
253
254
|
if (!this.activityThread) {
|
|
254
255
|
return html``
|
|
255
256
|
}
|
|
@@ -7,7 +7,7 @@ declare const ActivityApprovalRibon_base: (new (...args: any[]) => LitElement) &
|
|
|
7
7
|
export declare class ActivityApprovalRibon extends ActivityApprovalRibon_base {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
activityApproval: any;
|
|
10
|
-
render(): import("lit
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
11
|
updated(changes: any): void;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -7,7 +7,7 @@ declare const ActivityInstanceRibon_base: (new (...args: any[]) => LitElement) &
|
|
|
7
7
|
export declare class ActivityInstanceRibon extends ActivityInstanceRibon_base {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
activityInstance: any;
|
|
10
|
-
render(): import("lit
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
11
|
updated(changes: any): void;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -9,7 +9,7 @@ export declare class ActivityStarterForm extends ActivityStarterForm_base {
|
|
|
9
9
|
activityId?: string;
|
|
10
10
|
activity: any;
|
|
11
11
|
activityInstance: any;
|
|
12
|
-
render(): import("lit
|
|
12
|
+
render(): import("lit").TemplateResult<1>;
|
|
13
13
|
firstUpdated(): void;
|
|
14
14
|
fetchActivity(id: any): Promise<void>;
|
|
15
15
|
draftActivityInstance(): Promise<void>;
|
|
@@ -7,7 +7,7 @@ declare const ActivityThreadRibon_base: (new (...args: any[]) => LitElement) & t
|
|
|
7
7
|
export declare class ActivityThreadRibon extends ActivityThreadRibon_base {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
activityThread: any;
|
|
10
|
-
render(): import("lit
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
11
|
updated(changes: any): void;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -16,9 +16,9 @@ export declare class ActivityThreadTimeline extends ActivityThreadTimeline_base
|
|
|
16
16
|
activityThread?: ActivityThread;
|
|
17
17
|
subtitle?: string;
|
|
18
18
|
shortForm?: boolean;
|
|
19
|
-
render(): import("lit
|
|
20
|
-
renderActivityThreadHistory(activityThreadHistory: ActivityThreadHistory): import("lit
|
|
21
|
-
renderActivityApproval(activityApproval: ActivityApproval): import("lit
|
|
22
|
-
renderOutput(output: any): import("lit
|
|
19
|
+
render(): import("lit").TemplateResult<1>;
|
|
20
|
+
renderActivityThreadHistory(activityThreadHistory: ActivityThreadHistory): import("lit").TemplateResult<1>;
|
|
21
|
+
renderActivityApproval(activityApproval: ActivityApproval): import("lit").TemplateResult<1>;
|
|
22
|
+
renderOutput(output: any): import("lit").TemplateResult<1>;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -5,7 +5,7 @@ import '../grist-editor/popup-activity-search-keys-input.js';
|
|
|
5
5
|
import { OxGristEditor } from '@operato/data-grist';
|
|
6
6
|
export declare class GristEditorActivitySearchKeys extends OxGristEditor {
|
|
7
7
|
private popup?;
|
|
8
|
-
get editorTemplate(): import("lit
|
|
8
|
+
get editorTemplate(): import("lit").TemplateResult<1>;
|
|
9
9
|
_onclick(e: Event): void;
|
|
10
10
|
_onkeydown(e: KeyboardEvent): void;
|
|
11
11
|
openEditorPopup(): Promise<void>;
|
|
@@ -7,7 +7,7 @@ export declare class PopupActivitySearchKeysInput extends LitElement {
|
|
|
7
7
|
confirmCallback: (newval: any) => void;
|
|
8
8
|
gristConfig: any;
|
|
9
9
|
private grist;
|
|
10
|
-
render(): import("lit
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
11
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
12
12
|
total: number;
|
|
13
13
|
records: ActivitySearchKeyItem[];
|
|
@@ -41,7 +41,7 @@ export declare class ActivityListPage extends ActivityListPage_base {
|
|
|
41
41
|
action: () => Promise<void>;
|
|
42
42
|
}[];
|
|
43
43
|
};
|
|
44
|
-
render(): import("lit
|
|
44
|
+
render(): import("lit").TemplateResult<1>;
|
|
45
45
|
pageInitialized(lifecycle: any): Promise<void>;
|
|
46
46
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
47
47
|
total: any;
|
|
@@ -10,7 +10,7 @@ export declare class ActivityModelItemList extends ActivityModelItemList_base {
|
|
|
10
10
|
deleteSelectedRecords: any;
|
|
11
11
|
data: any;
|
|
12
12
|
};
|
|
13
|
-
render(): import("lit
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
firstUpdated(): Promise<void>;
|
|
15
15
|
fetchHandler({ filters, page, limit, sortings }: {
|
|
16
16
|
filters: any;
|
|
@@ -37,13 +37,13 @@ export declare class ActivityPage extends ActivityPage_base {
|
|
|
37
37
|
action: () => Promise<void>;
|
|
38
38
|
})[];
|
|
39
39
|
};
|
|
40
|
-
render(): import("lit
|
|
40
|
+
render(): import("lit").TemplateResult<1>;
|
|
41
41
|
activityContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
42
42
|
templateContent(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
43
43
|
getInputSpec(): any;
|
|
44
44
|
getOutputSpec(): any;
|
|
45
|
-
generatedContent(): import("lit
|
|
46
|
-
boardContent(): import("lit
|
|
45
|
+
generatedContent(): import("lit").TemplateResult<1>;
|
|
46
|
+
boardContent(): import("lit").TemplateResult<1>;
|
|
47
47
|
boardViewer: any;
|
|
48
48
|
getOutputFromBoard(): any;
|
|
49
49
|
updated(changes: any): void;
|
|
@@ -6,8 +6,8 @@ declare const ActivityView_base: (new (...args: any[]) => LitElement) & typeof L
|
|
|
6
6
|
export declare class ActivityView extends ActivityView_base {
|
|
7
7
|
static styles: import("lit").CSSResult[];
|
|
8
8
|
activity?: Activity;
|
|
9
|
-
render(): import("lit
|
|
10
|
-
renderSearchKeys(searchKeys: ActivitySearchKeyItem[]): import("lit
|
|
11
|
-
renderModel(model: ActivityModelItem[]): import("lit
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
renderSearchKeys(searchKeys: ActivitySearchKeyItem[]): import("lit").TemplateResult<1>;
|
|
11
|
+
renderModel(model: ActivityModelItem[]): import("lit").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -27,7 +27,7 @@ export declare class StarterListPage extends StarterListPage_base {
|
|
|
27
27
|
sorterControl?: any;
|
|
28
28
|
grist: DataGrist;
|
|
29
29
|
filters?: string[];
|
|
30
|
-
render(): import("lit
|
|
30
|
+
render(): import("lit").TemplateResult<1>;
|
|
31
31
|
pageInitialized(lifecycle: any): Promise<void>;
|
|
32
32
|
pageUpdated(changes: any, lifecycle: any, changedBefore: any): Promise<void>;
|
|
33
33
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
@@ -47,7 +47,7 @@ export declare class ActivityApprovalListPage extends ActivityApprovalListPage_b
|
|
|
47
47
|
handler: (records: any) => Promise<void>;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
render(): import("lit
|
|
50
|
+
render(): import("lit").TemplateResult<1>;
|
|
51
51
|
pageInitialized(lifecycle: any): Promise<void>;
|
|
52
52
|
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
53
53
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
@@ -2,6 +2,8 @@ import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
|
2
2
|
import '@operato/board/ox-board-viewer.js';
|
|
3
3
|
import '../../components/activity-approval-ribon.js';
|
|
4
4
|
import '../../components/activity-thread-timeline.js';
|
|
5
|
+
import { TemplateResult } from 'lit';
|
|
6
|
+
import { DirectiveResult } from 'lit-html/directive.js';
|
|
5
7
|
import { PageView } from '@operato/shell';
|
|
6
8
|
export declare const ActivityThreadStatus: {
|
|
7
9
|
Assigned: string;
|
|
@@ -38,13 +40,13 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
|
|
|
38
40
|
action: () => void;
|
|
39
41
|
}[];
|
|
40
42
|
};
|
|
41
|
-
render():
|
|
43
|
+
render(): TemplateResult<1>;
|
|
42
44
|
activityContent(): any;
|
|
43
|
-
templateContent():
|
|
45
|
+
templateContent(): DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
44
46
|
getInputSpec(): any;
|
|
45
47
|
getOutputSpec(): any;
|
|
46
|
-
generatedContent():
|
|
47
|
-
boardContent():
|
|
48
|
+
generatedContent(): DirectiveResult;
|
|
49
|
+
boardContent(): DirectiveResult;
|
|
48
50
|
customElementContent(): any;
|
|
49
51
|
oxBoardViewer: any;
|
|
50
52
|
getOutputFromBoard(): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,6CAA6C,CAAA;AACpD,OAAO,8CAA8C,CAAA;AAErD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,KAAK,E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aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAAC;iBACtD;aACF,CAAC,CACH,CAAA;SACF;IACH,CAAC;;AAvaM,2BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgDF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;8DAAsB;AAC9B;IAAC,KAAK,EAAE;;4DAAoB;AAC5B;IAAC,KAAK,EAAE;;mDAAW;AAEnB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAgB,mBAAmB;0DAAA;AA6NrD;IAAC,KAAK,CAAC,iBAAiB,CAAC;;2DAAmB;AAvRjC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAyahC;SAzaY,oBAAoB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-approval-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\n\nconst ActivityApprovalFetchResult = `\\\n{\n id\n judgment\n comment\n approver {\n id\n name\n }\n round\n order\n createdAt\n terminatedAt\n activityThread {\n state\n dueAt\n assignedAt\n assignee {\n id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals {\n round\n order\n approver {\n name\n }\n judgment\n comment\n createdAt\n updatedAt\n terminatedAt\n }\n activityThreadHistories {\n transaction\n reason\n updater {\n name\n }\n updatedAt\n state\n output\n }\n activityInstance {\n id\n name\n description\n state\n activity {\n id\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = {\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background-color: var(--main-section-background-color);\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n activity-thread-timeline {\n margin: var(--margin-default);\n }\n\n div[comment] {\n display: flex;\n position: sticky;\n bottom: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n background-color: var(--main-section-background-color);\n\n textarea {\n flex: 1;\n margin: var(--margin-default);\n padding: var(--input-padding);\n font: var(--input-font);\n outline: none;\n height: 80px;\n border-radius: 10px;\n border: var(--input-field-border);\n resize: none;\n }\n }\n\n [empty] {\n flex: 1;\n display: flex;\n align-items: center;\n align-self: center;\n }\n `\n ]\n\n @state() activityApproval: any\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n get context() {\n const judgment = this.activityApproval?.judgment\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n actions: judgment\n ? [\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n : [\n {\n title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n ...CommonButtonStyles.play\n },\n\n {\n title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n\n {\n title: i18next.t('button.save'),\n action: this.saveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() {\n if (!this.activityThread) {\n return html`<div empty>${i18next.t('text.no activity thread info')}</div>`\n }\n\n const { terminatedAt } = this.activityApproval\n const editable = !terminatedAt\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <activity-thread-timeline .activityThread=${this.activityThread} short-form></activity-thread-timeline>\n ${editable\n ? html`\n <div comment>\n <textarea\n placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\n </div>\n `\n : nothing}\n `\n }\n\n activityContent() {\n switch (this.activityThread?.activityInstance?.viewType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n templateContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityApproval.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityApproval')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) {\n const response = await client.query({\n query: gql`\n query activityApproval($id: String!) {\n activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() {\n var { id, comment } = this.activityApproval\n\n if (!comment) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String!) {\n rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,6CAA6C,CAAA;AACpD,OAAO,8CAA8C,CAAA;AAErD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,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,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFlC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,OAAO,EAA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Content":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-approval-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\n\nconst ActivityApprovalFetchResult = `\\\n{\n id\n judgment\n comment\n approver {\n id\n name\n }\n round\n order\n createdAt\n terminatedAt\n activityThread {\n state\n dueAt\n assignedAt\n assignee {\n id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals {\n round\n order\n approver {\n name\n }\n judgment\n comment\n createdAt\n updatedAt\n terminatedAt\n }\n activityThreadHistories {\n transaction\n reason\n updater {\n name\n }\n updatedAt\n state\n output\n }\n activityInstance {\n id\n name\n description\n state\n activity {\n id\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = {\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background-color: var(--main-section-background-color);\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n activity-thread-timeline {\n margin: var(--margin-default);\n }\n\n div[comment] {\n display: flex;\n position: sticky;\n bottom: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n background-color: var(--main-section-background-color);\n\n textarea {\n flex: 1;\n margin: var(--margin-default);\n padding: var(--input-padding);\n font: var(--input-font);\n outline: none;\n height: 80px;\n border-radius: 10px;\n border: var(--input-field-border);\n resize: none;\n }\n }\n\n [empty] {\n flex: 1;\n display: flex;\n align-items: center;\n align-self: center;\n }\n `\n ]\n\n @state() activityApproval: any\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n get context() {\n const judgment = this.activityApproval?.judgment\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n actions: judgment\n ? [\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n : [\n {\n title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n ...CommonButtonStyles.play\n },\n\n {\n title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n\n {\n title: i18next.t('button.save'),\n action: this.saveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() {\n if (!this.activityThread) {\n return html`<div empty>${i18next.t('text.no activity thread info')}</div>`\n }\n\n const { terminatedAt } = this.activityApproval\n const editable = !terminatedAt\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <activity-thread-timeline .activityThread=${this.activityThread} short-form></activity-thread-timeline>\n ${editable\n ? html`\n <div comment>\n <textarea\n placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\n </div>\n `\n : nothing}\n `\n }\n\n activityContent() {\n switch (this.activityThread?.activityInstance?.viewType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n templateContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent(): DirectiveResult {\n if (!this.activityApproval) {\n return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityApproval.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent(): DirectiveResult {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityApproval')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) {\n const response = await client.query({\n query: gql`\n query activityApproval($id: String!) {\n activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() {\n var { id, comment } = this.activityApproval\n\n if (!comment) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String!) {\n rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}
|
|
@@ -26,7 +26,7 @@ export declare class ActivityInstanceListPage extends ActivityInstanceListPage_b
|
|
|
26
26
|
};
|
|
27
27
|
sorterControl?: any;
|
|
28
28
|
grist: DataGrist;
|
|
29
|
-
render(): import("lit
|
|
29
|
+
render(): import("lit").TemplateResult<1>;
|
|
30
30
|
pageInitialized(lifecycle: any): Promise<void>;
|
|
31
31
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
32
32
|
total: any;
|
|
@@ -43,7 +43,7 @@ export declare class ActivityInstanceSearchPage extends ActivityInstanceSearchPa
|
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
render(): import("lit
|
|
46
|
+
render(): import("lit").TemplateResult<1>;
|
|
47
47
|
pageUpdated(changes: any, lifecycle: any): void;
|
|
48
48
|
updated(changes: any): Promise<void>;
|
|
49
49
|
getSearchKeyColumns(): {
|
|
@@ -2,6 +2,8 @@ import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
|
2
2
|
import '@operato/board/ox-board-viewer.js';
|
|
3
3
|
import '@things-factory/organization';
|
|
4
4
|
import '../../components/activity-instance-ribon.js';
|
|
5
|
+
import { TemplateResult } from 'lit';
|
|
6
|
+
import { DirectiveResult } from 'lit-html/directive.js';
|
|
5
7
|
import { PageView } from '@operato/shell';
|
|
6
8
|
declare const ActivityInstanceStartPage_base: (new (...args: any[]) => {
|
|
7
9
|
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
@@ -32,13 +34,13 @@ export declare class ActivityInstanceStartPage extends ActivityInstanceStartPage
|
|
|
32
34
|
action: () => Promise<void>;
|
|
33
35
|
})[];
|
|
34
36
|
};
|
|
35
|
-
render():
|
|
36
|
-
activityContent():
|
|
37
|
-
templateContent():
|
|
37
|
+
render(): TemplateResult<1>;
|
|
38
|
+
activityContent(): DirectiveResult;
|
|
39
|
+
templateContent(): DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
38
40
|
getInputSpec(): any;
|
|
39
41
|
getOutputSpec(): any;
|
|
40
|
-
generatedContent():
|
|
41
|
-
boardContent():
|
|
42
|
+
generatedContent(): DirectiveResult;
|
|
43
|
+
boardContent(): DirectiveResult;
|
|
42
44
|
customElementContent(): any;
|
|
43
45
|
getInOutFromBoard(): any[];
|
|
44
46
|
updated(changes: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-start-page.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-start-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CA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er.js'\nimport '@things-factory/organization'\nimport '../../components/activity-instance-ribon.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\nimport { notify } from '@operato/layout'\n\n@customElement('activity-instance-start-page')\nexport class ActivityInstanceStartPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n #custom-content {\n flex: 1;\n }\n `\n ]\n\n @state() activity: any = {}\n @state() activityInstance: any = {}\n @state() board: any\n @state() customHtmlElement: any\n\n @query('ox-board-viewer') viewer: any\n\n get context() {\n const { startingType } = this.activity\n const { state } = this.activityInstance\n\n const issuable = state === 'draft'\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity-instance-single-post',\n actions: [\n issuable && {\n title: i18next.t('button.draft'),\n action: this.draftActivityInstance.bind(this),\n ...CommonButtonStyles.save\n },\n issuable && {\n title: i18next.t(startingType == 'issue' ? 'button.issue' : 'button.post'),\n action: this.issueActivityInstance.bind(this),\n ...CommonButtonStyles.submit\n }\n ].filter(Boolean /* truthy only */)\n // activityInstance: this.activityInstance\n }\n }\n\n render() {\n return html`\n <activity-instance-ribon .activityInstance=${this.activityInstance}></activity-instance-ribon>\n\n ${this.activityContent()}\n `\n }\n\n activityContent() {\n switch (this.activityInstance?.uiType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n default:\n return html``\n }\n }\n\n templateContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: template } = this.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n var { input, output } = this.activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input?.[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityInstance.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view\n data-name=\"input\"\n .props=${inputSpec}\n .value=${input}\n @property-change=${e => (this.activityInstance.input = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityInstance.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: boardId, input, output } = this.activityInstance\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n /* \n ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,\n 동일한 id의 보드를 다른 page에 뺏기는 경우가 있다.\n 따라서, Page가 active될 때마다 타임스탬프를 refresh key로 설정하였다.\n */\n return keyed(\n this.activityInstance.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: tagName, input, output } = this.activityInstance\n\n if (!this.customHtmlElement) {\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = this.activityInstance.activity.id\n element.input = input\n element.output = output\n\n element.addEventListener('change-input', (e: CustomEvent) => {\n this.activityInstance.input = e.detail\n })\n element.addEventListener('change-output', (e: CustomEvent) => {\n this.activityInstance.output = e.detail\n })\n\n /* DEPRECATED 일반적으로 output만 수정될 가능성이 높기때문에, change 이벤트는 output을 수정하는 것으로 한다. */\n element.addEventListener('change', (e: CustomEvent) => {\n this.activityInstance.output = e.detail\n })\n\n this.customHtmlElement = element\n }\n\n return this.customHtmlElement\n }\n\n getInOutFromBoard() {\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n const data = this.viewer?.getSceneValues() || {}\n\n const input = inputSpec.reduce((input, spec) => {\n input[spec.name] = data[spec.name]\n return input\n }, {})\n\n const output = outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n\n return [input, output]\n }\n\n updated(changes) {\n if (changes.has('activityInstance')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityInstance(lifecycle.resourceId)\n } else {\n this.customHtmlElement = undefined\n }\n }\n\n async fetchActivityInstance(id) {\n const response = await client.query({\n query: gql`\n query activityInstance($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n dueAt\n createdAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.customHtmlElement = undefined\n this.activityInstance = response.data.activityInstance\n this.activity = this.activityInstance.activity\n }\n\n async draftActivityInstance() {\n var { id: activityId } = this.activity\n var {\n id,\n name,\n description,\n priority,\n threadsMin,\n threadsMax,\n dueAt,\n input,\n output,\n reason,\n uiType,\n assignees,\n approvalLine\n } = this.activityInstance\n\n if (uiType === 'board') {\n ;[input, output] = this.getInOutFromBoard()\n }\n\n name ||= this.activity.name\n description ||= this.activity.description\n assignees ||= this.activity.assignees\n approvalLine ||= this.activity.approvalLine\n\n var activityInstance = {\n id,\n activityId,\n name,\n description,\n priority,\n threadsMax,\n threadsMin,\n dueAt,\n input,\n output,\n reason,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstanceDraft!) {\n draftActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n output\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n uiType\n uiSource\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.customHtmlElement = undefined\n this.activityInstance = response.data.draftActivityInstance\n this.activity = this.activityInstance.activity\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`\n })\n })\n }\n }\n\n async issueActivityInstance() {\n var {\n id,\n name,\n description,\n input,\n output,\n reason,\n uiType,\n threadsMin = 0,\n threadsMax = 0,\n assignees,\n approvalLine\n } = this.activityInstance\n\n if (uiType === 'board') {\n ;[input, output] = this.getInOutFromBoard()\n }\n\n const activityInstance = {\n id,\n name: name || this.activity.name,\n description: description || this.activity.description,\n threadsMin,\n threadsMax,\n input,\n output,\n reason,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstanceIssue!) {\n issueActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n output\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n uiType\n uiSource\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.customHtmlElement = undefined\n this.activityInstance = response.data.issueActivityInstance\n this.activity = this.activityInstance.activity\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`\n })\n })\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-instance-start-page.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-start-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,8BAA8B,CAAA;AACrC,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAA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AAC,qBAAqB,CAAA;YAC3D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAA;YAE9C,MAAM,CAAC;gBACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE;oBAC7C,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;iBACzE,CAAC;aACH,CAAC,CAAA;SACH;IACH,CAAC;;AAtfM,gCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;2DAAmB;AAC3B;IAAC,KAAK,EAAE;;mEAA2B;AACnC;IAAC,KAAK,EAAE;;wDAAW;AACnB;IAAC,KAAK,EAAE;;oEAAuB;AAE/B;IAAC,KAAK,CAAC,iBAAiB,CAAC;;yDAAY;AA1B1B,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAwfrC;SAxfY,yBAAyB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '@things-factory/organization'\nimport '../../components/activity-instance-ribon.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, TemplateResult } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\nimport { notify } from '@operato/layout'\n\n@customElement('activity-instance-start-page')\nexport class ActivityInstanceStartPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n #custom-content {\n flex: 1;\n }\n `\n ]\n\n @state() activity: any = {}\n @state() activityInstance: any = {}\n @state() board: any\n @state() customHtmlElement: any\n\n @query('ox-board-viewer') viewer: any\n\n get context() {\n const { startingType } = this.activity\n const { state } = this.activityInstance\n\n const issuable = state === 'draft'\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity-instance-single-post',\n actions: [\n issuable && {\n title: i18next.t('button.draft'),\n action: this.draftActivityInstance.bind(this),\n ...CommonButtonStyles.save\n },\n issuable && {\n title: i18next.t(startingType == 'issue' ? 'button.issue' : 'button.post'),\n action: this.issueActivityInstance.bind(this),\n ...CommonButtonStyles.submit\n }\n ].filter(Boolean /* truthy only */)\n // activityInstance: this.activityInstance\n }\n }\n\n render() {\n return html`\n <activity-instance-ribon .activityInstance=${this.activityInstance}></activity-instance-ribon>\n\n ${this.activityContent()}\n `\n }\n\n activityContent(): DirectiveResult {\n switch (this.activityInstance?.uiType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n default:\n return html``\n }\n }\n\n templateContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: template } = this.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent(): DirectiveResult {\n if (!this.activityInstance) {\n return html``\n }\n\n var { input, output } = this.activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input?.[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityInstance.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view\n data-name=\"input\"\n .props=${inputSpec}\n .value=${input}\n @property-change=${e => (this.activityInstance.input = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityInstance.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent(): DirectiveResult {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: boardId, input, output } = this.activityInstance\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n /* \n ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,\n 동일한 id의 보드를 다른 page에 뺏기는 경우가 있다.\n 따라서, Page가 active될 때마다 타임스탬프를 refresh key로 설정하였다.\n */\n return keyed(\n this.activityInstance.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityInstance) {\n return html``\n }\n\n const { uiSource: tagName, input, output } = this.activityInstance\n\n if (!this.customHtmlElement) {\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = this.activityInstance.activity.id\n element.input = input\n element.output = output\n\n element.addEventListener('change-input', (e: CustomEvent) => {\n this.activityInstance.input = e.detail\n })\n element.addEventListener('change-output', (e: CustomEvent) => {\n this.activityInstance.output = e.detail\n })\n\n /* DEPRECATED 일반적으로 output만 수정될 가능성이 높기때문에, change 이벤트는 output을 수정하는 것으로 한다. */\n element.addEventListener('change', (e: CustomEvent) => {\n this.activityInstance.output = e.detail\n })\n\n this.customHtmlElement = element\n }\n\n return this.customHtmlElement\n }\n\n getInOutFromBoard() {\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n const data = this.viewer?.getSceneValues() || {}\n\n const input = inputSpec.reduce((input, spec) => {\n input[spec.name] = data[spec.name]\n return input\n }, {})\n\n const output = outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n\n return [input, output]\n }\n\n updated(changes) {\n if (changes.has('activityInstance')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityInstance(lifecycle.resourceId)\n } else {\n this.customHtmlElement = undefined\n }\n }\n\n async fetchActivityInstance(id) {\n const response = await client.query({\n query: gql`\n query activityInstance($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n dueAt\n createdAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.customHtmlElement = undefined\n this.activityInstance = response.data.activityInstance\n this.activity = this.activityInstance.activity\n }\n\n async draftActivityInstance() {\n var { id: activityId } = this.activity\n var { id, name, description, priority, threadsMin, threadsMax, dueAt, input, output, reason, uiType, assignees, approvalLine } = this.activityInstance\n\n if (uiType === 'board') {\n ;[input, output] = this.getInOutFromBoard()\n }\n\n name ||= this.activity.name\n description ||= this.activity.description\n assignees ||= this.activity.assignees\n approvalLine ||= this.activity.approvalLine\n\n var activityInstance = {\n id,\n activityId,\n name,\n description,\n priority,\n threadsMax,\n threadsMin,\n dueAt,\n input,\n output,\n reason,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstanceDraft!) {\n draftActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n output\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n uiType\n uiSource\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.customHtmlElement = undefined\n this.activityInstance = response.data.draftActivityInstance\n this.activity = this.activityInstance.activity\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`\n })\n })\n }\n }\n\n async issueActivityInstance() {\n var { id, name, description, input, output, reason, uiType, threadsMin = 0, threadsMax = 0, assignees, approvalLine } = this.activityInstance\n\n if (uiType === 'board') {\n ;[input, output] = this.getInOutFromBoard()\n }\n\n const activityInstance = {\n id,\n name: name || this.activity.name,\n description: description || this.activity.description,\n threadsMin,\n threadsMax,\n input,\n output,\n reason,\n assignees,\n approvalLine\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($activityInstance: ActivityInstanceIssue!) {\n issueActivityInstance(activityInstance: $activityInstance) {\n id\n name\n description\n input\n output\n state\n activity {\n id\n startingType\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n assignees {\n type\n value\n assignee {\n id\n name\n description\n controlNo\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n uiType\n uiSource\n threadsMin\n threadsMax\n }\n }\n `,\n variables: {\n activityInstance\n }\n })\n\n if (!response.errors) {\n this.customHtmlElement = undefined\n this.activityInstance = response.data.issueActivityInstance\n this.activity = this.activityInstance.activity\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`\n })\n })\n }\n }\n}\n"]}
|