@things-factory/worklist 6.1.48 → 6.1.52
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-instance/activity-instance-start-page.ts +104 -4
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +104 -4
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist-server/middlewares/index.js +0 -8
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
|
@@ -24,9 +24,6 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
24
24
|
:host {
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
|
-
|
|
28
|
-
width: 100%;
|
|
29
|
-
padding: 5px;
|
|
30
27
|
overflow: auto;
|
|
31
28
|
}
|
|
32
29
|
|
|
@@ -38,6 +35,88 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
38
35
|
#custom-content {
|
|
39
36
|
flex: 1;
|
|
40
37
|
}
|
|
38
|
+
[worklist-summary]{
|
|
39
|
+
display:flex;
|
|
40
|
+
padding:0 var(--padding-default);
|
|
41
|
+
color:var(--theme-white-color)
|
|
42
|
+
}
|
|
43
|
+
[worklist-summary] div{
|
|
44
|
+
border-left:var(--border-dark-color);
|
|
45
|
+
padding:var(--padding-narrow) var(--padding-default)
|
|
46
|
+
}
|
|
47
|
+
[assigned]{
|
|
48
|
+
background-color:#599B4D;
|
|
49
|
+
}
|
|
50
|
+
[submitted]{
|
|
51
|
+
background-color:#4B8BE1;
|
|
52
|
+
}
|
|
53
|
+
[rejected]{
|
|
54
|
+
background-color:#CB3A33;
|
|
55
|
+
}
|
|
56
|
+
[worklist-summary] mwc-icon{
|
|
57
|
+
padding:var(--padding-default) var(--padding-default) 0 0;
|
|
58
|
+
font-size: 24px;
|
|
59
|
+
}
|
|
60
|
+
[worklist-summary] [desc]{
|
|
61
|
+
font-size:var(--fontsize-small)
|
|
62
|
+
}
|
|
63
|
+
[worklist-summary] [assignee]{
|
|
64
|
+
text-align:center;
|
|
65
|
+
font-size:var(--fontsize-small);
|
|
66
|
+
line-height:1.3;
|
|
67
|
+
}
|
|
68
|
+
[assignee] span{
|
|
69
|
+
display:block;
|
|
70
|
+
font-size:var(--fontsize-large);
|
|
71
|
+
font-weight:bold
|
|
72
|
+
}
|
|
73
|
+
[flow] ul{
|
|
74
|
+
list-style:none;
|
|
75
|
+
margin:0;padding:0;
|
|
76
|
+
display:flex;
|
|
77
|
+
}
|
|
78
|
+
[flow] li{
|
|
79
|
+
width:85px;
|
|
80
|
+
text-align:center;
|
|
81
|
+
font-size:var(--fontsize-small);
|
|
82
|
+
}
|
|
83
|
+
[flow] span:before{
|
|
84
|
+
content: "";
|
|
85
|
+
height: 2px;
|
|
86
|
+
width: 70px;
|
|
87
|
+
display: block;
|
|
88
|
+
position: absolute;
|
|
89
|
+
margin-left: -70px;
|
|
90
|
+
margin-top: 6px;
|
|
91
|
+
background-color: rgba(0, 0, 0,.4);
|
|
92
|
+
}
|
|
93
|
+
[flow] span{
|
|
94
|
+
display:block;
|
|
95
|
+
width: 15px;
|
|
96
|
+
height: 15px;
|
|
97
|
+
margin:auto;
|
|
98
|
+
background-color: rgba(0, 0, 0,.4);
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
color:var(--theme-white-color);
|
|
101
|
+
line-height:1.2
|
|
102
|
+
}
|
|
103
|
+
[flow] [past] span{
|
|
104
|
+
background-color: rgba(255, 255, 255,.9);
|
|
105
|
+
color:var(--primary-text-color)
|
|
106
|
+
}
|
|
107
|
+
[flow] [now] span{
|
|
108
|
+
background-color: #84D600;
|
|
109
|
+
color:var(--theme-white-color);
|
|
110
|
+
}
|
|
111
|
+
[flow] [now]{
|
|
112
|
+
font-weight:bold
|
|
113
|
+
}
|
|
114
|
+
[flow] [past] span:before,[flow] [now] span:before{
|
|
115
|
+
background-color: rgba(255, 255, 255,.9);
|
|
116
|
+
}
|
|
117
|
+
[flow] li:first-child span:before{
|
|
118
|
+
display:none
|
|
119
|
+
}
|
|
41
120
|
`
|
|
42
121
|
]
|
|
43
122
|
|
|
@@ -74,7 +153,28 @@ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(
|
|
|
74
153
|
}
|
|
75
154
|
|
|
76
155
|
render() {
|
|
77
|
-
return html`
|
|
156
|
+
return html`
|
|
157
|
+
<div worklist-summary submitted>
|
|
158
|
+
<mwc-icon>description</mwc-icon>
|
|
159
|
+
|
|
160
|
+
<div desc>
|
|
161
|
+
assigned, submitted, rejected 스타일 작성해놨음
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div assignee>
|
|
165
|
+
assignee
|
|
166
|
+
<span>홍길동</span>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div flow>
|
|
170
|
+
<ul>
|
|
171
|
+
<li past><span>1</span>myself</li>
|
|
172
|
+
<li now><span>2</span>경리실장</li>
|
|
173
|
+
<li><span>3</span>사장님</li>
|
|
174
|
+
</ul>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
${this.activityContent()}`
|
|
78
178
|
}
|
|
79
179
|
|
|
80
180
|
activityContent() {
|
|
@@ -36,7 +36,28 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends connect(
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return html `
|
|
39
|
+
return html `
|
|
40
|
+
<div worklist-summary submitted>
|
|
41
|
+
<mwc-icon>description</mwc-icon>
|
|
42
|
+
|
|
43
|
+
<div desc>
|
|
44
|
+
assigned, submitted, rejected 스타일 작성해놨음
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div assignee>
|
|
48
|
+
assignee
|
|
49
|
+
<span>홍길동</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div flow>
|
|
53
|
+
<ul>
|
|
54
|
+
<li past><span>1</span>myself</li>
|
|
55
|
+
<li now><span>2</span>경리실장</li>
|
|
56
|
+
<li><span>3</span>사장님</li>
|
|
57
|
+
</ul>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
${this.activityContent()}`;
|
|
40
61
|
}
|
|
41
62
|
activityContent() {
|
|
42
63
|
var _a;
|
|
@@ -425,9 +446,6 @@ ActivityInstanceStartPage.styles = [
|
|
|
425
446
|
:host {
|
|
426
447
|
display: flex;
|
|
427
448
|
flex-direction: column;
|
|
428
|
-
|
|
429
|
-
width: 100%;
|
|
430
|
-
padding: 5px;
|
|
431
449
|
overflow: auto;
|
|
432
450
|
}
|
|
433
451
|
|
|
@@ -439,6 +457,88 @@ ActivityInstanceStartPage.styles = [
|
|
|
439
457
|
#custom-content {
|
|
440
458
|
flex: 1;
|
|
441
459
|
}
|
|
460
|
+
[worklist-summary]{
|
|
461
|
+
display:flex;
|
|
462
|
+
padding:0 var(--padding-default);
|
|
463
|
+
color:var(--theme-white-color)
|
|
464
|
+
}
|
|
465
|
+
[worklist-summary] div{
|
|
466
|
+
border-left:var(--border-dark-color);
|
|
467
|
+
padding:var(--padding-narrow) var(--padding-default)
|
|
468
|
+
}
|
|
469
|
+
[assigned]{
|
|
470
|
+
background-color:#599B4D;
|
|
471
|
+
}
|
|
472
|
+
[submitted]{
|
|
473
|
+
background-color:#4B8BE1;
|
|
474
|
+
}
|
|
475
|
+
[rejected]{
|
|
476
|
+
background-color:#CB3A33;
|
|
477
|
+
}
|
|
478
|
+
[worklist-summary] mwc-icon{
|
|
479
|
+
padding:var(--padding-default) var(--padding-default) 0 0;
|
|
480
|
+
font-size: 24px;
|
|
481
|
+
}
|
|
482
|
+
[worklist-summary] [desc]{
|
|
483
|
+
font-size:var(--fontsize-small)
|
|
484
|
+
}
|
|
485
|
+
[worklist-summary] [assignee]{
|
|
486
|
+
text-align:center;
|
|
487
|
+
font-size:var(--fontsize-small);
|
|
488
|
+
line-height:1.3;
|
|
489
|
+
}
|
|
490
|
+
[assignee] span{
|
|
491
|
+
display:block;
|
|
492
|
+
font-size:var(--fontsize-large);
|
|
493
|
+
font-weight:bold
|
|
494
|
+
}
|
|
495
|
+
[flow] ul{
|
|
496
|
+
list-style:none;
|
|
497
|
+
margin:0;padding:0;
|
|
498
|
+
display:flex;
|
|
499
|
+
}
|
|
500
|
+
[flow] li{
|
|
501
|
+
width:85px;
|
|
502
|
+
text-align:center;
|
|
503
|
+
font-size:var(--fontsize-small);
|
|
504
|
+
}
|
|
505
|
+
[flow] span:before{
|
|
506
|
+
content: "";
|
|
507
|
+
height: 2px;
|
|
508
|
+
width: 70px;
|
|
509
|
+
display: block;
|
|
510
|
+
position: absolute;
|
|
511
|
+
margin-left: -70px;
|
|
512
|
+
margin-top: 6px;
|
|
513
|
+
background-color: rgba(0, 0, 0,.4);
|
|
514
|
+
}
|
|
515
|
+
[flow] span{
|
|
516
|
+
display:block;
|
|
517
|
+
width: 15px;
|
|
518
|
+
height: 15px;
|
|
519
|
+
margin:auto;
|
|
520
|
+
background-color: rgba(0, 0, 0,.4);
|
|
521
|
+
border-radius: 50%;
|
|
522
|
+
color:var(--theme-white-color);
|
|
523
|
+
line-height:1.2
|
|
524
|
+
}
|
|
525
|
+
[flow] [past] span{
|
|
526
|
+
background-color: rgba(255, 255, 255,.9);
|
|
527
|
+
color:var(--primary-text-color)
|
|
528
|
+
}
|
|
529
|
+
[flow] [now] span{
|
|
530
|
+
background-color: #84D600;
|
|
531
|
+
color:var(--theme-white-color);
|
|
532
|
+
}
|
|
533
|
+
[flow] [now]{
|
|
534
|
+
font-weight:bold
|
|
535
|
+
}
|
|
536
|
+
[flow] [past] span:before,[flow] [now] span:before{
|
|
537
|
+
background-color: rgba(255, 255, 255,.9);
|
|
538
|
+
}
|
|
539
|
+
[flow] li:first-child span:before{
|
|
540
|
+
display:none
|
|
541
|
+
}
|
|
442
542
|
`
|
|
443
543
|
];
|
|
444
544
|
__decorate([
|
|
@@ -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,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,8BAA8B,CAAA;AAErC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,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,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGjC,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IAAnF;;QAyBI,aAAQ,GAAQ,EAAE,CAAA;QAClB,qBAAgB,GAAQ,EAAE,CAAA;IAuerC,CAAC;IAjeC,IAAI,OAAO;;QACT,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,QAA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E;gBACT,gBAAgB;aACjB;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAA;YAClC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,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;;AA/fM,gCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;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;AA9B1B,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAigBrC;SAjgBY,yBAAyB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '@things-factory/organization'\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, CommonGristStyles, 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 CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n padding: 5px;\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` ${this.activityContent()}`\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 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 label: 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 label: item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\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 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 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\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) {\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;AAErC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,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,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGjC,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IAAnF;;QAwGI,aAAQ,GAAQ,EAAE,CAAA;QAClB,qBAAgB,GAAQ,EAAE,CAAA;IA4frC,CAAC;IAtfC,IAAI,OAAO;;QACT,MAAM,EAAE,YAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDZ;YACD,SAAS,EAAE;gBACT,gBAAgB;aACjB;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAA;YAClC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,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;;AAnmBM,gCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiGF;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;AA7G1B,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAqmBrC;SArmBY,yBAAyB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '@things-factory/organization'\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, CommonGristStyles, 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 CommonGristStyles,\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 [worklist-summary]{\n display:flex;\n padding:0 var(--padding-default);\n color:var(--theme-white-color)\n }\n [worklist-summary] div{\n border-left:var(--border-dark-color);\n padding:var(--padding-narrow) var(--padding-default)\n }\n [assigned]{\n background-color:#599B4D;\n }\n [submitted]{\n background-color:#4B8BE1;\n }\n [rejected]{\n background-color:#CB3A33;\n }\n [worklist-summary] mwc-icon{\n padding:var(--padding-default) var(--padding-default) 0 0;\n font-size: 24px;\n }\n [worklist-summary] [desc]{\n font-size:var(--fontsize-small)\n }\n [worklist-summary] [assignee]{\n text-align:center;\n font-size:var(--fontsize-small);\n line-height:1.3;\n }\n [assignee] span{\n display:block;\n font-size:var(--fontsize-large);\n font-weight:bold\n }\n [flow] ul{\n list-style:none;\n margin:0;padding:0;\n display:flex;\n }\n [flow] li{\n width:85px;\n text-align:center;\n font-size:var(--fontsize-small);\n }\n [flow] span:before{\n content: \"\";\n height: 2px;\n width: 70px;\n display: block;\n position: absolute;\n margin-left: -70px;\n margin-top: 6px;\n background-color: rgba(0, 0, 0,.4);\n }\n [flow] span{\n display:block;\n width: 15px;\n height: 15px;\n margin:auto;\n background-color: rgba(0, 0, 0,.4);\n border-radius: 50%;\n color:var(--theme-white-color);\n line-height:1.2\n }\n [flow] [past] span{\n background-color: rgba(255, 255, 255,.9);\n color:var(--primary-text-color)\n }\n [flow] [now] span{\n background-color: #84D600;\n color:var(--theme-white-color);\n }\n [flow] [now]{\n font-weight:bold\n }\n [flow] [past] span:before,[flow] [now] span:before{\n background-color: rgba(255, 255, 255,.9);\n }\n [flow] li:first-child span:before{\n display:none\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 <div worklist-summary submitted> \n <mwc-icon>description</mwc-icon>\n\n <div desc>\n assigned, submitted, rejected 스타일 작성해놨음\n </div>\n\n <div assignee>\n assignee\n <span>홍길동</span>\n </div>\n\n <div flow>\n <ul>\n <li past><span>1</span>myself</li>\n <li now><span>2</span>경리실장</li>\n <li><span>3</span>사장님</li>\n </ul>\n </div>\n </div>\n ${this.activityContent()}`\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 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 label: 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 label: item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\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 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 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\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) {\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"]}
|