@things-factory/worklist 10.1.169 → 10.1.170
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/dist-client/components/decision-content.d.ts +1 -1
- package/dist-client/components/decision-content.js +16 -4
- package/dist-client/components/decision-content.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +10 -2
- package/dist-client/pages/activity-instance/activity-instance-view.js +18 -22
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity-summary/index.d.ts +1 -1
- package/dist-server/service/activity-thread/index.d.ts +1 -1
- package/dist-server/service/index.d.ts +3 -3
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist-client/pages/todo/done-list-page.d.ts +0 -38
- package/dist-client/pages/todo/done-list-page.js +0 -382
- package/dist-client/pages/todo/done-list-page.js.map +0 -1
|
@@ -11,7 +11,7 @@ import { nothing, TemplateResult } from 'lit';
|
|
|
11
11
|
/**
|
|
12
12
|
* The fields a page asks for to draw the decision - every field renderDecision reads.
|
|
13
13
|
*
|
|
14
|
-
* `name` is the label when
|
|
14
|
+
* `name` is the label when the translation `tKey` names is missing (decisionLabel), and `valueTKey` with `params`
|
|
15
15
|
* builds the value sentence at reading time (slotText). Leaving them out drew the sentence frozen
|
|
16
16
|
* at issue, in the language of whoever raised it, with nothing to say a field was missing.
|
|
17
17
|
*/
|
|
@@ -14,7 +14,7 @@ import { COMPENSABLE, decisionDrawable, decisionSlots, reversibilityIsMalformed,
|
|
|
14
14
|
/**
|
|
15
15
|
* The fields a page asks for to draw the decision - every field renderDecision reads.
|
|
16
16
|
*
|
|
17
|
-
* `name` is the label when
|
|
17
|
+
* `name` is the label when the translation `tKey` names is missing (decisionLabel), and `valueTKey` with `params`
|
|
18
18
|
* builds the value sentence at reading time (slotText). Leaving them out drew the sentence frozen
|
|
19
19
|
* at issue, in the language of whoever raised it, with nothing to say a field was missing.
|
|
20
20
|
*/
|
|
@@ -75,7 +75,7 @@ export function renderDecision(decisionKeys, input) {
|
|
|
75
75
|
<div class="label">${i18next.t('label.what-it-was-judged-from')}</div>
|
|
76
76
|
${evidence.map(slot => html `
|
|
77
77
|
<div class="evidence">
|
|
78
|
-
${
|
|
78
|
+
${decisionLabel(slot) ? html `<div class="label">${decisionLabel(slot)}</div>` : ''}
|
|
79
79
|
<div>${slotText(slot)}</div>
|
|
80
80
|
</div>
|
|
81
81
|
`)}
|
|
@@ -85,7 +85,7 @@ export function renderDecision(decisionKeys, input) {
|
|
|
85
85
|
${currentState?.found
|
|
86
86
|
? html `
|
|
87
87
|
<div class="current-state">
|
|
88
|
-
<div class="label">${
|
|
88
|
+
<div class="label">${decisionLabel(currentState) || i18next.t('label.current-state')}</div>
|
|
89
89
|
<div>${slotText(currentState)}</div>
|
|
90
90
|
</div>
|
|
91
91
|
`
|
|
@@ -96,7 +96,7 @@ export function renderDecision(decisionKeys, input) {
|
|
|
96
96
|
<div class="label">${i18next.t('label.what-changes')}</div>
|
|
97
97
|
${consequences.map(slot => html `
|
|
98
98
|
<div class="consequence">
|
|
99
|
-
${
|
|
99
|
+
${decisionLabel(slot) ? html `<div class="label">${decisionLabel(slot)}</div>` : ''}
|
|
100
100
|
<div>${slotText(slot)}</div>
|
|
101
101
|
</div>
|
|
102
102
|
`)}
|
|
@@ -106,6 +106,18 @@ export function renderDecision(decisionKeys, input) {
|
|
|
106
106
|
</section>
|
|
107
107
|
`;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* A slot's own label - only where the declaration names one with `tKey`.
|
|
111
|
+
*
|
|
112
|
+
* A decision key's `name` is the developer's note ("Never shown on a screen", ActivityDecisionKeyItem),
|
|
113
|
+
* and without `tKey` the screen shows no label. declaredLabel falls back to `name` whenever `tKey` is
|
|
114
|
+
* absent - right for a search key, whose name is its column, and wrong here: asking for `name` put
|
|
115
|
+
* "what approving does" under 「승인하면 달라지는 것」 on a Korean screen (2026-10-16). The fallback
|
|
116
|
+
* stays for a declared key whose translation is missing.
|
|
117
|
+
*/
|
|
118
|
+
function decisionLabel(slot) {
|
|
119
|
+
return slot.tKey ? declaredLabel(slot) : '';
|
|
120
|
+
}
|
|
109
121
|
/**
|
|
110
122
|
* Whether approving can be undone, drawn as the frame around the decision.
|
|
111
123
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision-content.js","sourceRoot":"","sources":["../../client/components/decision-content.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EACL,WAAW,EAEX,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;EAQhC,CAAA;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAAC,YAAiB,EAAE,KAAU;IAC1D,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;IAEhD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC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AAM,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;AAC9F,CAAC;AAED,2EAA2E;AAC3E,SAAS,QAAQ,CAAC,IAAkB;IAClC,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAA;AACzG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiHvC,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { i18next } from '@operato/i18n'\n\nimport { declaredLabel, fieldValue } from './activity-fields.js'\nimport {\n COMPENSABLE,\n DecisionSlot,\n decisionDrawable,\n decisionSlots,\n reversibilityIsMalformed,\n reversibilityOf,\n slotOfRole,\n slotsOfRole\n} from './decision-slots.js'\n\n/**\n * The decision an activity declared, drawn the one way every screen draws it.\n *\n * The approval screen drew it and the task screen did not. An activity whose model is all hidden -\n * the expenditure request carries its payee and lines only for its decisionKeys - then showed the\n * approver what was asked and showed the person who asked an empty box. Both read the same\n * declaration and the same input, so one drawing serves both.\n */\n\n/**\n * The fields a page asks for to draw the decision - every field renderDecision reads.\n *\n * `name` is the label when no translation has `tKey` (declaredLabel), and `valueTKey` with `params`\n * builds the value sentence at reading time (slotText). Leaving them out drew the sentence frozen\n * at issue, in the language of whoever raised it, with nothing to say a field was missing.\n */\nexport const DecisionKeysFields = `decisionKeys {\n role\n inputPath\n name\n tKey\n valueTKey\n params\n unit\n}`\n\n/**\n * The decision, or `nothing` when the activity declared none or none of it is in this input.\n *\n * Returning nothing is how a page knows to fall back to the model. An activity with no\n * decisionKeys draws exactly what it drew before.\n *\n * A slot whose path led nowhere is skipped rather than drawn empty. Older instances of an activity\n * predate a field the declaration names and an empty bar on the screen would read as \"there is no\n * reason\" when the truth is that this record has no such value. What cannot be shown is left out;\n * what is shown is only what the payload actually carries.\n *\n * `reason` is the exception. Missing and blank mean the same thing to whoever is reading - nobody\n * wrote one - so both draw the grey line rather than disappearing. A reason that silently vanishes\n * would let an approver assume it was never asked for.\n */\nexport function renderDecision(decisionKeys: any, input: any): TemplateResult | typeof nothing {\n const slots = decisionSlots(decisionKeys, input)\n\n if (!decisionDrawable(slots)) {\n return nothing\n }\n\n const headline = slotOfRole(slots, 'headline')\n const subject = slotOfRole(slots, 'subject')\n const reason = slotOfRole(slots, 'reason')\n const consequences = slotsOfRole(slots, 'consequence').filter(slot => slot.found)\n const evidence = slotsOfRole(slots, 'evidence').filter(slot => slot.found)\n const currentState = slotOfRole(slots, 'currentState')\n const reversibility = slotOfRole(slots, 'reversibility')\n\n return html`\n <section decision>\n ${headline?.found ? html`<div class=\"headline\">${slotText(headline)}</div>` : ''}\n ${subject?.found ? html`<div class=\"subject\">${slotText(subject)}</div>` : ''}\n ${\n reason\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('field.reason')}</div>\n <div class=\"said ${hasWords(reason) ? '' : 'none'}\">\n ${hasWords(reason) ? slotText(reason) : i18next.t('text.no-reason-given')}\n </div>\n </div>\n `\n : ''\n }\n ${renderReversibility(reversibility)}\n ${\n evidence.length\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('label.what-it-was-judged-from')}</div>\n ${evidence.map(\n slot => html`\n <div class=\"evidence\">\n ${declaredLabel(slot) ? html`<div class=\"label\">${declaredLabel(slot)}</div>` : ''}\n <div>${slotText(slot)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''\n }\n ${\n currentState?.found\n ? html`\n <div class=\"current-state\">\n <div class=\"label\">${declaredLabel(currentState) || i18next.t('label.current-state')}</div>\n <div>${slotText(currentState)}</div>\n </div>\n `\n : ''\n }\n ${\n consequences.length\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('label.what-changes')}</div>\n ${consequences.map(\n slot => html`\n <div class=\"consequence\">\n ${declaredLabel(slot) ? html`<div class=\"label\">${declaredLabel(slot)}</div>` : ''}\n <div>${slotText(slot)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''\n }\n </section>\n `\n}\n\n/**\n * Whether approving can be undone, drawn as the frame around the decision.\n *\n * Only an explicit true or false draws. Anything else - the path led nowhere, or the value is not\n * a boolean - draws nothing, because saying \"this can be undone\" on a screen that does not know is\n * the one mistake this line must never make.\n *\n * This is not rejectionIsFinal. That one says whether **rejecting** ends the case for good; this\n * says whether **approving** can be taken back. The twin actuation carries both, which is exactly\n * why they must not share a sentence.\n */\nfunction renderReversibility(slot?: DecisionSlot) {\n const said = reversibilityOf(slot)\n\n if (!said) {\n if (reversibilityIsMalformed(slot)) {\n /*\n * Declared, and the value is there, but not the shape this role takes - a bare sentence\n * where { reversible, caveat } belongs. Nothing is drawn, because this side cannot tell\n * which way it goes; the log is so a developer does not have to find it by hand, which is\n * how it was found the first time.\n */\n console.error(`[worklist] reversibility at \"${slot?.inputPath}\" is not { reversible, caveat } — nothing drawn`)\n }\n\n return ''\n }\n\n /*\n * The module's own sentence when it wrote one. 「버린 자재는 돌아오지 않습니다」 says why, which\n * the plain wording cannot; the boolean beside it is what decides how heavily this is drawn.\n */\n return html`\n <div class=\"reversibility\" ?irreversible=${!said.reversible}>\n <md-icon>${said.kind === COMPENSABLE ? 'history' : said.reversible ? 'undo' : 'lock'}</md-icon>\n <span\n >${\n said.caveat || (said.kind === COMPENSABLE\n ? i18next.t('text.approval-is-compensable', { defaultValue: 'The original decision remains. A subsequent corrective action is required.' })\n : i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible'))\n }</span\n >\n </div>\n `\n}\n\n/**\n * One slot's value as something to read.\n *\n * A scalar prints with its unit when one was declared. Anything shaped - an object, a list - goes\n * through fieldValue, the same laying-out the model sections use, so a payload reads the same way\n * wherever it appears and a four-level object does not become one long line.\n *\n * ── The sentence is built here, not frozen when the request was raised ──\n * Eighteen doors write a Korean sentence at issue and the issue snapshots it, so it stands in the\n * language of whoever raised it and an approver reading another language never catches up. Where\n * a door declares `valueTKey`, the sentence is made at reading time instead, out of the values\n * the request did freeze.\n *\n * **A door that has not moved yet draws exactly what it drew before.** That is what lets plant\n * move them one at a time instead of eighteen at once, and it covers a door that moved into a\n * locale nobody has written yet: an empty `defaultValue` means a missing key falls through to the\n * frozen sentence rather than printing `approval.…` on the card.\n */\nfunction slotText(slot: DecisionSlot): unknown {\n const said = sentenceOf(slot)\n\n if (said) {\n return said\n }\n\n const scalar = slot.value !== null && slot.value !== undefined && typeof slot.value !== 'object'\n\n if (scalar && slot.unit) {\n return `${slot.value} ${slot.unit}`\n }\n\n return scalar ? String(slot.value) : fieldValue(slot.value)\n}\n\n/** The sentence this slot declares, when it declares one and the locale has it. */\nfunction sentenceOf(slot: DecisionSlot): string {\n if (!slot.valueTKey) {\n return ''\n }\n\n return String(i18next.t(slot.valueTKey, { ...(slot.params || {}), defaultValue: '' }) || '')\n}\n\n/** Did a person actually write something here. Whitespace is not words. */\nfunction hasWords(slot: DecisionSlot): boolean {\n return typeof slot.value === 'string' ? slot.value.trim().length > 0 : slot.found && slot.value != null\n}\n\n/*\n * The decision, drawn from the activity's declaration.\n *\n * The order is the declaration's and the weight descends with it: what is being asked reads\n * first at title size, then what it is about, then the words a person wrote, then what changes\n * on approval, and last why it came up at all.\n */\nexport const DecisionContentStyles = css`\n section[decision] .headline {\n font-size: var(--ui-t-headline, 19px);\n font-weight: 600;\n line-height: 1.35;\n color: var(--ui-ink, #17242c);\n word-break: keep-all;\n }\n\n section[decision] .subject {\n margin-top: 3px;\n font-family: var(--ui-mono, ui-monospace, Menlo, monospace);\n font-size: var(--ui-t-body, 13px);\n color: var(--ui-muted, #57676f);\n }\n\n section[decision] .block {\n margin-top: 14px;\n }\n\n section[decision] .block > .label {\n margin-bottom: 4px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /* What a person wrote is set apart, because it is the only part nobody computed. */\n section[decision] .said {\n padding: 9px 11px;\n border-left: 3px solid var(--ui-line, #d5dce0);\n background: var(--ui-line-soft, #f2f5f7);\n color: var(--ui-ink, #17242c);\n word-break: break-word;\n }\n\n section[decision] .none {\n color: var(--ui-faint, #8a959c);\n }\n\n section[decision] .consequence {\n margin-top: 8px;\n padding: 9px 11px;\n border: 1px solid var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n }\n\n section[decision] .consequence > .label {\n margin-bottom: 3px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /*\n * Whether approving can be undone reads as the frame around the decision, not as one of its\n * consequences. Among them it carries the same weight as \"four orders get pushed back\", and\n * on an approval that moves equipment it is the heaviest line on the screen.\n */\n section[decision] .reversibility {\n display: flex;\n align-items: center;\n gap: 6px;\n\n margin-top: 12px;\n padding: 8px 11px;\n border-radius: var(--ui-r-small, 6px);\n\n background: var(--ui-line-soft, #f2f5f7);\n color: var(--ui-muted, #57676f);\n font-size: var(--ui-t-small, 11.5px);\n }\n\n section[decision] .reversibility[irreversible] {\n background: var(--md-sys-color-error-container, #ffdad6);\n color: var(--md-sys-color-on-error-container, #410002);\n font-weight: 600;\n }\n\n section[decision] .reversibility md-icon {\n font-size: 1.15em;\n }\n\n /*\n * What the decision was made from. Set flatter than the consequences - it is the record the\n * approver checks, not something the approval brings about.\n */\n section[decision] .evidence {\n margin-top: 8px;\n padding: 7px 0 7px 11px;\n border-left: 2px solid var(--ui-line, #d5dce0);\n }\n\n section[decision] .evidence > .label {\n margin-bottom: 2px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /*\n * What is true right now sits apart from what the approval would change. Sharing the box the\n * consequences use would say the approval causes these readings.\n */\n section[decision] .current-state {\n margin-top: 14px;\n padding: 9px 11px;\n border: 1px dashed var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n }\n\n section[decision] .current-state > .label {\n margin-bottom: 3px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n`\n"]}
|
|
1
|
+
{"version":3,"file":"decision-content.js","sourceRoot":"","sources":["../../client/components/decision-content.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EACL,WAAW,EAEX,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;EAQhC,CAAA;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAAC,YAAiB,EAAE,KAAU;IAC1D,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;IAEhD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC1C,MAA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C,SAAS,EAAE,CAAC;QACpB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;AAC9F,CAAC;AAED,2EAA2E;AAC3E,SAAS,QAAQ,CAAC,IAAkB;IAClC,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAA;AACzG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiHvC,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { i18next } from '@operato/i18n'\n\nimport { declaredLabel, fieldValue } from './activity-fields.js'\nimport {\n COMPENSABLE,\n DecisionSlot,\n decisionDrawable,\n decisionSlots,\n reversibilityIsMalformed,\n reversibilityOf,\n slotOfRole,\n slotsOfRole\n} from './decision-slots.js'\n\n/**\n * The decision an activity declared, drawn the one way every screen draws it.\n *\n * The approval screen drew it and the task screen did not. An activity whose model is all hidden -\n * the expenditure request carries its payee and lines only for its decisionKeys - then showed the\n * approver what was asked and showed the person who asked an empty box. Both read the same\n * declaration and the same input, so one drawing serves both.\n */\n\n/**\n * The fields a page asks for to draw the decision - every field renderDecision reads.\n *\n * `name` is the label when the translation `tKey` names is missing (decisionLabel), and `valueTKey` with `params`\n * builds the value sentence at reading time (slotText). Leaving them out drew the sentence frozen\n * at issue, in the language of whoever raised it, with nothing to say a field was missing.\n */\nexport const DecisionKeysFields = `decisionKeys {\n role\n inputPath\n name\n tKey\n valueTKey\n params\n unit\n}`\n\n/**\n * The decision, or `nothing` when the activity declared none or none of it is in this input.\n *\n * Returning nothing is how a page knows to fall back to the model. An activity with no\n * decisionKeys draws exactly what it drew before.\n *\n * A slot whose path led nowhere is skipped rather than drawn empty. Older instances of an activity\n * predate a field the declaration names and an empty bar on the screen would read as \"there is no\n * reason\" when the truth is that this record has no such value. What cannot be shown is left out;\n * what is shown is only what the payload actually carries.\n *\n * `reason` is the exception. Missing and blank mean the same thing to whoever is reading - nobody\n * wrote one - so both draw the grey line rather than disappearing. A reason that silently vanishes\n * would let an approver assume it was never asked for.\n */\nexport function renderDecision(decisionKeys: any, input: any): TemplateResult | typeof nothing {\n const slots = decisionSlots(decisionKeys, input)\n\n if (!decisionDrawable(slots)) {\n return nothing\n }\n\n const headline = slotOfRole(slots, 'headline')\n const subject = slotOfRole(slots, 'subject')\n const reason = slotOfRole(slots, 'reason')\n const consequences = slotsOfRole(slots, 'consequence').filter(slot => slot.found)\n const evidence = slotsOfRole(slots, 'evidence').filter(slot => slot.found)\n const currentState = slotOfRole(slots, 'currentState')\n const reversibility = slotOfRole(slots, 'reversibility')\n\n return html`\n <section decision>\n ${headline?.found ? html`<div class=\"headline\">${slotText(headline)}</div>` : ''}\n ${subject?.found ? html`<div class=\"subject\">${slotText(subject)}</div>` : ''}\n ${\n reason\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('field.reason')}</div>\n <div class=\"said ${hasWords(reason) ? '' : 'none'}\">\n ${hasWords(reason) ? slotText(reason) : i18next.t('text.no-reason-given')}\n </div>\n </div>\n `\n : ''\n }\n ${renderReversibility(reversibility)}\n ${\n evidence.length\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('label.what-it-was-judged-from')}</div>\n ${evidence.map(\n slot => html`\n <div class=\"evidence\">\n ${decisionLabel(slot) ? html`<div class=\"label\">${decisionLabel(slot)}</div>` : ''}\n <div>${slotText(slot)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''\n }\n ${\n currentState?.found\n ? html`\n <div class=\"current-state\">\n <div class=\"label\">${decisionLabel(currentState) || i18next.t('label.current-state')}</div>\n <div>${slotText(currentState)}</div>\n </div>\n `\n : ''\n }\n ${\n consequences.length\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('label.what-changes')}</div>\n ${consequences.map(\n slot => html`\n <div class=\"consequence\">\n ${decisionLabel(slot) ? html`<div class=\"label\">${decisionLabel(slot)}</div>` : ''}\n <div>${slotText(slot)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''\n }\n </section>\n `\n}\n\n/**\n * A slot's own label - only where the declaration names one with `tKey`.\n *\n * A decision key's `name` is the developer's note (\"Never shown on a screen\", ActivityDecisionKeyItem),\n * and without `tKey` the screen shows no label. declaredLabel falls back to `name` whenever `tKey` is\n * absent - right for a search key, whose name is its column, and wrong here: asking for `name` put\n * \"what approving does\" under 「승인하면 달라지는 것」 on a Korean screen (2026-10-16). The fallback\n * stays for a declared key whose translation is missing.\n */\nfunction decisionLabel(slot: DecisionSlot): string {\n return slot.tKey ? declaredLabel(slot) : ''\n}\n\n/**\n * Whether approving can be undone, drawn as the frame around the decision.\n *\n * Only an explicit true or false draws. Anything else - the path led nowhere, or the value is not\n * a boolean - draws nothing, because saying \"this can be undone\" on a screen that does not know is\n * the one mistake this line must never make.\n *\n * This is not rejectionIsFinal. That one says whether **rejecting** ends the case for good; this\n * says whether **approving** can be taken back. The twin actuation carries both, which is exactly\n * why they must not share a sentence.\n */\nfunction renderReversibility(slot?: DecisionSlot) {\n const said = reversibilityOf(slot)\n\n if (!said) {\n if (reversibilityIsMalformed(slot)) {\n /*\n * Declared, and the value is there, but not the shape this role takes - a bare sentence\n * where { reversible, caveat } belongs. Nothing is drawn, because this side cannot tell\n * which way it goes; the log is so a developer does not have to find it by hand, which is\n * how it was found the first time.\n */\n console.error(`[worklist] reversibility at \"${slot?.inputPath}\" is not { reversible, caveat } — nothing drawn`)\n }\n\n return ''\n }\n\n /*\n * The module's own sentence when it wrote one. 「버린 자재는 돌아오지 않습니다」 says why, which\n * the plain wording cannot; the boolean beside it is what decides how heavily this is drawn.\n */\n return html`\n <div class=\"reversibility\" ?irreversible=${!said.reversible}>\n <md-icon>${said.kind === COMPENSABLE ? 'history' : said.reversible ? 'undo' : 'lock'}</md-icon>\n <span\n >${\n said.caveat || (said.kind === COMPENSABLE\n ? i18next.t('text.approval-is-compensable', { defaultValue: 'The original decision remains. A subsequent corrective action is required.' })\n : i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible'))\n }</span\n >\n </div>\n `\n}\n\n/**\n * One slot's value as something to read.\n *\n * A scalar prints with its unit when one was declared. Anything shaped - an object, a list - goes\n * through fieldValue, the same laying-out the model sections use, so a payload reads the same way\n * wherever it appears and a four-level object does not become one long line.\n *\n * ── The sentence is built here, not frozen when the request was raised ──\n * Eighteen doors write a Korean sentence at issue and the issue snapshots it, so it stands in the\n * language of whoever raised it and an approver reading another language never catches up. Where\n * a door declares `valueTKey`, the sentence is made at reading time instead, out of the values\n * the request did freeze.\n *\n * **A door that has not moved yet draws exactly what it drew before.** That is what lets plant\n * move them one at a time instead of eighteen at once, and it covers a door that moved into a\n * locale nobody has written yet: an empty `defaultValue` means a missing key falls through to the\n * frozen sentence rather than printing `approval.…` on the card.\n */\nfunction slotText(slot: DecisionSlot): unknown {\n const said = sentenceOf(slot)\n\n if (said) {\n return said\n }\n\n const scalar = slot.value !== null && slot.value !== undefined && typeof slot.value !== 'object'\n\n if (scalar && slot.unit) {\n return `${slot.value} ${slot.unit}`\n }\n\n return scalar ? String(slot.value) : fieldValue(slot.value)\n}\n\n/** The sentence this slot declares, when it declares one and the locale has it. */\nfunction sentenceOf(slot: DecisionSlot): string {\n if (!slot.valueTKey) {\n return ''\n }\n\n return String(i18next.t(slot.valueTKey, { ...(slot.params || {}), defaultValue: '' }) || '')\n}\n\n/** Did a person actually write something here. Whitespace is not words. */\nfunction hasWords(slot: DecisionSlot): boolean {\n return typeof slot.value === 'string' ? slot.value.trim().length > 0 : slot.found && slot.value != null\n}\n\n/*\n * The decision, drawn from the activity's declaration.\n *\n * The order is the declaration's and the weight descends with it: what is being asked reads\n * first at title size, then what it is about, then the words a person wrote, then what changes\n * on approval, and last why it came up at all.\n */\nexport const DecisionContentStyles = css`\n section[decision] .headline {\n font-size: var(--ui-t-headline, 19px);\n font-weight: 600;\n line-height: 1.35;\n color: var(--ui-ink, #17242c);\n word-break: keep-all;\n }\n\n section[decision] .subject {\n margin-top: 3px;\n font-family: var(--ui-mono, ui-monospace, Menlo, monospace);\n font-size: var(--ui-t-body, 13px);\n color: var(--ui-muted, #57676f);\n }\n\n section[decision] .block {\n margin-top: 14px;\n }\n\n section[decision] .block > .label {\n margin-bottom: 4px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /* What a person wrote is set apart, because it is the only part nobody computed. */\n section[decision] .said {\n padding: 9px 11px;\n border-left: 3px solid var(--ui-line, #d5dce0);\n background: var(--ui-line-soft, #f2f5f7);\n color: var(--ui-ink, #17242c);\n word-break: break-word;\n }\n\n section[decision] .none {\n color: var(--ui-faint, #8a959c);\n }\n\n section[decision] .consequence {\n margin-top: 8px;\n padding: 9px 11px;\n border: 1px solid var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n }\n\n section[decision] .consequence > .label {\n margin-bottom: 3px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /*\n * Whether approving can be undone reads as the frame around the decision, not as one of its\n * consequences. Among them it carries the same weight as \"four orders get pushed back\", and\n * on an approval that moves equipment it is the heaviest line on the screen.\n */\n section[decision] .reversibility {\n display: flex;\n align-items: center;\n gap: 6px;\n\n margin-top: 12px;\n padding: 8px 11px;\n border-radius: var(--ui-r-small, 6px);\n\n background: var(--ui-line-soft, #f2f5f7);\n color: var(--ui-muted, #57676f);\n font-size: var(--ui-t-small, 11.5px);\n }\n\n section[decision] .reversibility[irreversible] {\n background: var(--md-sys-color-error-container, #ffdad6);\n color: var(--md-sys-color-on-error-container, #410002);\n font-weight: 600;\n }\n\n section[decision] .reversibility md-icon {\n font-size: 1.15em;\n }\n\n /*\n * What the decision was made from. Set flatter than the consequences - it is the record the\n * approver checks, not something the approval brings about.\n */\n section[decision] .evidence {\n margin-top: 8px;\n padding: 7px 0 7px 11px;\n border-left: 2px solid var(--ui-line, #d5dce0);\n }\n\n section[decision] .evidence > .label {\n margin-bottom: 2px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n\n /*\n * What is true right now sits apart from what the approval would change. Sharing the box the\n * consequences use would say the approval causes these readings.\n */\n section[decision] .current-state {\n margin-top: 14px;\n padding: 9px 11px;\n border: 1px dashed var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n }\n\n section[decision] .current-state > .label {\n margin-bottom: 3px;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n`\n"]}
|
|
@@ -17,11 +17,19 @@ export declare class ActivityInstanceView extends ActivityInstanceView_base {
|
|
|
17
17
|
* decision, every model field being hidden. The declaration goes first and the given values are
|
|
18
18
|
* the fallback, as on the task screen (thread-sections).
|
|
19
19
|
*/
|
|
20
|
-
renderRequest(): import("lit-html").TemplateResult
|
|
20
|
+
renderRequest(): typeof nothing | import("lit-html").TemplateResult;
|
|
21
21
|
renderActivityThread(activityInstance: ActivityInstance, activityThread: ActivityThread): import("lit-html").TemplateResult<1>;
|
|
22
22
|
renderActivityApproval(activityApproval: ActivityApproval): import("lit-html").TemplateResult<1>;
|
|
23
23
|
renderSearchKeys(): import("lit-html").TemplateResult<1>;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* What the assignee wrote - the fields the model declares as output and does not hide.
|
|
26
|
+
*
|
|
27
|
+
* This listed every model field by its developer name, hidden ones too, with the value read from the
|
|
28
|
+
* output: an expenditure request showed requestId · month · requester · payee · lines, all empty,
|
|
29
|
+
* under 「산출물」. 상신함 opens this view for anyone who put something up, so it draws what the task
|
|
30
|
+
* screen draws, and nothing when the activity has nothing to write.
|
|
31
|
+
*/
|
|
32
|
+
renderWritten(output: any): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
25
33
|
updated(changes: any): void;
|
|
26
34
|
fetchActivityInstance(): Promise<void>;
|
|
27
35
|
}
|
|
@@ -6,7 +6,7 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
6
6
|
import { client } from '@operato/graphql';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
|
-
import { ActivityFieldsStyles, declaredLabel, inputSpecOf, renderGiven } from '../../components/activity-fields.js';
|
|
9
|
+
import { ActivityFieldsStyles, declaredLabel, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js';
|
|
10
10
|
import { DecisionContentStyles, DecisionKeysFields, renderDecision } from '../../components/decision-content.js';
|
|
11
11
|
import { WorklistStateColors } from '../../components/state-ribon.js';
|
|
12
12
|
import { ActivityInstance } from '../../types/activity-instance.js';
|
|
@@ -295,10 +295,7 @@ let ActivityInstanceView = class ActivityInstanceView extends localize(i18next)(
|
|
|
295
295
|
<div><label>${i18next.t('field.round')}</label> ${round}</div>
|
|
296
296
|
</div>
|
|
297
297
|
|
|
298
|
-
|
|
299
|
-
<span subtitle>${i18next.t('field.artifact')}</span>
|
|
300
|
-
${this.renderInOut(output || {})}
|
|
301
|
-
</div>
|
|
298
|
+
${this.renderWritten(output || {})}
|
|
302
299
|
<div timeline>
|
|
303
300
|
<span subtitle>${i18next.t('label.timeline')}</span>
|
|
304
301
|
|
|
@@ -348,23 +345,22 @@ let ActivityInstanceView = class ActivityInstanceView extends localize(i18next)(
|
|
|
348
345
|
</table>
|
|
349
346
|
`;
|
|
350
347
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
`;
|
|
348
|
+
/**
|
|
349
|
+
* What the assignee wrote - the fields the model declares as output and does not hide.
|
|
350
|
+
*
|
|
351
|
+
* This listed every model field by its developer name, hidden ones too, with the value read from the
|
|
352
|
+
* output: an expenditure request showed requestId · month · requester · payee · lines, all empty,
|
|
353
|
+
* under 「산출물」. 상신함 opens this view for anyone who put something up, so it draws what the task
|
|
354
|
+
* screen draws, and nothing when the activity has nothing to write.
|
|
355
|
+
*/
|
|
356
|
+
renderWritten(output) {
|
|
357
|
+
const written = outputSpecOf(this.activityInstance.activity?.model);
|
|
358
|
+
return written.length
|
|
359
|
+
? html `<div>
|
|
360
|
+
<span subtitle>${i18next.t('field.artifact')}</span>
|
|
361
|
+
${renderGiven(written, output)}
|
|
362
|
+
</div>`
|
|
363
|
+
: nothing;
|
|
368
364
|
}
|
|
369
365
|
updated(changes) {
|
|
370
366
|
if (changes.has('activityInstanceId')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-view.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-view.ts"],"names":[],"mappings":";AAAA,OAAO,0EAA0E,CAAA;AAEjF,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAA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 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { ActivityFieldsStyles, declaredLabel, inputSpecOf, renderGiven } from '../../components/activity-fields.js'\nimport { DecisionContentStyles, DecisionKeysFields, renderDecision } from '../../components/decision-content.js'\nimport { WorklistStateColors } from '../../components/state-ribon.js'\nimport { ActivityInstance } from '../../types/activity-instance.js'\nimport { ActivityThread } from '../../types/activity-thread.js'\nimport { ActivityApproval } from '../../types/activity-approval.js'\nimport { entity360Name } from '@operato/layout'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n@customElement('activity-instance-view')\nexport class ActivityInstanceView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n WorklistStateColors,\n ActivityFieldsStyles,\n DecisionContentStyles,\n css`\n :host {\n display: flex;\n overflow: auto;\n font-size: var(--fontsize-default);\n }\n [instance-container] {\n flex: 1;\n background-color: var(--md-sys-color-background);\n border-right: var(--border-dim-color);\n padding: var(--spacing-large);\n color: var(--md-sys-color-secondary);\n }\n [thread-container] {\n flex: 2;\n padding: var(--spacing-large);\n }\n [instance-container] div {\n margin-bottom: var(--spacing-medium);\n padding-bottom: var(--spacing-medium);\n border-bottom: var(--border-dim-color);\n }\n /* The state speaks through the icon's colour on a quiet disc, as in the ribbons - a filled disc\n under an on-primary icon read under 3:1 for three states. */\n [header] md-icon {\n background-color: var(--md-sys-color-surface-container-high);\n float: left;\n margin-right: var(--spacing-medium);\n padding: var(--spacing-medium);\n border-radius: 50%;\n float: left;\n font-size: 1.8em;\n color: var(--worklist-state-color, var(--ui-muted, #57676f));\n }\n [header] strong {\n display: block;\n font: bold 22px / 1.1 var(--theme-font);\n }\n [header] {\n overflow: hidden;\n font-size: var(--fontsize-small);\n }\n [instance-container] div label {\n display: inline-block;\n margin-right: var(--spacing-medium);\n min-width: 50px;\n }\n [issuer] md-icon {\n opacity: 0.5;\n position: relative;\n top: 4px;\n font-size: 20px;\n }\n span[status] {\n width: 15px;\n height: 15px;\n position: relative;\n top: 2px;\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n display: inline-block;\n margin-right: var(--spacing-small);\n border-radius: 50%;\n }\n [thread-container] table {\n width: 100%;\n border-collapse: collapse;\n }\n [thread-container] th {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n }\n [thread-container] td {\n padding: var(--spacing-small);\n border-bottom: var(--grid-record-border-bottom);\n }\n [assignee] * {\n vertical-align: middle;\n }\n [assignee] md-icon {\n opacity: 0.5;\n }\n [subtitle] {\n display: block;\n margin: var(--spacing-large) 0 var(--spacing-small) 0;\n padding: var(--spacing-small) var(--spacing-medium);\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-variant);\n font: bold 16px var(--theme-font);\n border: 2px solid var(--md-sys-color-outline);\n border-radius: 999px;\n }\n [timeline] ol {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n [timeline] li {\n display: flex;\n }\n [timeline] [info] {\n color: var(--md-sys-color-on-surface);\n background: var(--md-sys-color-surface-variant);\n\n flex: 1;\n }\n [timeline] [date] {\n opacity: 0.7;\n width: 130px;\n font-size: var(--fontsize-small);\n }\n [timeline] [info] strong {\n float: right;\n }\n [timeline] [status] {\n margin: 0 var(--spacing-small);\n display: block;\n border-radius: 50%;\n width: 12px;\n height: 12px;\n position: relative;\n top: 3px;\n /* The ring separates the dot from the line behind it, so it is the page's own colour. */\n border: 2px solid var(--md-sys-color-surface);\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n }\n [timeline] [status]::before {\n content: '';\n height: 60px;\n width: 2px;\n display: block;\n position: relative;\n margin-left: 5px;\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n opacity: 0.2;\n }\n [timeline] [info] md-icon {\n position: relative;\n top: 3px;\n font-size: var(--fontsize-large);\n }\n [timeline] [info] p {\n /* A fixed light grey under text that follows the theme was light-on-light in the dark theme. */\n background-color: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n margin: var(--spacing-small) 0 var(--spacing-medium) 0;\n padding: var(--spacing-small) var(--spacing-medium);\n border-radius: var(--border-radius);\n font-size: var(--fontsize-small);\n text-align: justify;\n }\n [timeline] [info] p::before {\n content: '';\n float: right;\n margin-top: -10px;\n margin-right: 20px;\n border: 7px solid transparent;\n border-bottom-color: var(--md-sys-color-surface-container);\n border-top: 0;\n }\n [thread] div {\n border-bottom: var(--border-dim-color);\n padding: var(--spacing-small);\n text-align: right;\n overflow: hidden;\n }\n [thread] div label {\n float: left;\n width: 25%;\n text-align: left;\n }\n `\n ]\n\n @property({\n type: String,\n attribute: 'activity-instance-id'\n })\n activityInstanceId?: string\n\n @state() activityInstance?: ActivityInstance\n\n render() {\n if (!this.activityInstance) {\n return html`<div>no activity instance info.</div>`\n }\n\n const { id, name, description, state, issuer, assignedAt, startedAt, activityThreads, terminatedAt, updatedAt } =\n this.activityInstance\n\n return html`\n <div instance-container>\n <div header>\n <md-icon>description</md-icon>\n <strong>${name}</strong>\n ${description}\n </div>\n\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\n </div>\n\n <div issuer>\n <label>${i18next.t('field.issuer')}</label>\n <md-icon>account_circle</md-icon>\n <strong>${entity360Name(issuer)}</strong>\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label>${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.started-at')}</label>${startedAt && formatter.format(new Date(startedAt))}</div>\n <div><label>${i18next.t('field.updated-at')}</label>${updatedAt && formatter.format(new Date(updatedAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label>${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n </div>\n <div thread-container>\n ${this.renderRequest()}\n ${activityThreads?.map(activityThread => this.renderActivityThread(this.activityInstance!, activityThread))}\n </div>\n `\n }\n\n /**\n * What was asked - the same drawing the task and approval screens use.\n *\n * 상신함 opens what I put up here. Without this the view showed the name, the state and the\n * history, and not the request itself: an expenditure request's payee and lines live only in its\n * decision, every model field being hidden. The declaration goes first and the given values are\n * the fallback, as on the task screen (thread-sections).\n */\n renderRequest() {\n const { activity, input } = this.activityInstance!\n const decision = renderDecision(activity?.decisionKeys, input)\n\n if (decision !== nothing) {\n return decision\n }\n\n const given = inputSpecOf(activity?.model)\n\n return given.length\n ? html`<section readonly>\n <h2>${i18next.t('label.activity-input')}</h2>\n ${renderGiven(given, input)}\n </section>`\n : nothing\n }\n\n renderActivityThread(activityInstance: ActivityInstance, activityThread: ActivityThread) {\n const {\n state,\n assignee,\n output,\n round,\n activityApprovals = [],\n assignedAt,\n startedAt,\n terminatedAt\n } = activityThread\n const { approvalLine } = activityInstance!\n const { name, email } = assignee || {}\n const approvals = activityApprovals.sort((a, b) =>\n a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1\n )\n const current = approvals[0]?.round == round ? approvals[0].order : -1\n\n return html`\n <div assignee>\n <md-icon>account_circle</md-icon>\n <strong>${name}</strong>\n </div>\n\n <div thread>\n <span subtitle>${i18next.t('label.thread-basics')}</span>\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n <div><label>${i18next.t('field.round')}</label> ${round}</div>\n </div>\n\n <div>\n <span subtitle>${i18next.t('field.artifact')}</span>\n ${this.renderInOut(output || {})}\n </div>\n <div timeline>\n <span subtitle>${i18next.t('label.timeline')}</span>\n\n <div>\n ${approvalLine\n ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`\n : html``}\n </div>\n\n <ol>\n ${approvals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n </div>\n `\n }\n\n renderActivityApproval(activityApproval: ActivityApproval) {\n const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval\n const { name, email } = approver || {}\n\n return html`\n <li>\n <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>\n <span status></span>\n <span info>\n ${i18next.t('label.activity-state-' + (judgment || 'started'))}\n <strong><md-icon>account_circle</md-icon>${name}</strong>\n <p>${comment}</p>\n </span>\n </li>\n `\n }\n\n renderSearchKeys() {\n const { activity } = this.activityInstance!\n const { searchKeys = [] } = activity! || {}\n\n return html`\n <table>\n <tr>\n <th>${i18next.t('label.name')}</th>\n <th>${i18next.t('label.value')}</th>\n </tr>\n\n ${searchKeys?.map(\n (item, index) => html`\n <tr>\n <td>${declaredLabel(item)}</td>\n <td>${this.activityInstance![`key0${index + 1}`]}</td>\n </tr>\n `\n )}\n </table>\n `\n }\n\n renderInOut(data) {\n const { activity } = this.activityInstance!\n const { model } = activity || {}\n\n return html`\n <table>\n <tr>\n <th>${i18next.t('label.name')}</th>\n <th>${i18next.t('label.value')}</th>\n </tr>\n ${model?.map(\n item => html`\n <tr>\n <td>${item.name}</td>\n <td>${item.tag ? data[item.tag] : ''}</td>\n </tr>\n `\n )}\n </table>\n `\n }\n\n updated(changes) {\n if (changes.has('activityInstanceId')) {\n this.fetchActivityInstance()\n }\n }\n\n async fetchActivityInstance() {\n const id = this.activityInstanceId\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n issuer {\n id\n name\n email\n }\n starter {\n name\n email\n }\n activity {\n id\n name\n description\n searchKeys {\n name\n description\n inputKey\n tKey\n }\n ${DecisionKeysFields}\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n hidden\n }\n }\n approvalLine {\n type\n participation\n notifyAfter\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n activityThreads {\n state\n transaction\n output\n assignee {\n id\n name\n email\n }\n round\n activityApprovals {\n round\n order\n approver {\n id\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n assignedAt\n startedAt\n terminatedAt\n }\n updater {\n id\n name\n }\n assignedAt\n startedAt\n terminatedAt\n updatedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityInstance = response.data.activityInstance\n this.setAttribute('state', this.activityInstance?.state || '')\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-instance-view.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-view.ts"],"names":[],"mappings":";AAAA,OAAO,0EAA0E,CAAA;AAEjF,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,oBAAoB,EAA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,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC9B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAA;QAElC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgE3B;YACD,SAAS,EAAE;gBACT,EAAE;aACH;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAA;QACtD,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAA;IAChE,CAAC;;AAjTD;IAJC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,sBAAsB;KAClC,CAAC;;gEACyB;AAElB;IAAR,KAAK,EAAE;8BAAoB,gBAAgB;8DAAA;AA9LjC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA8ehC","sourcesContent":["import '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { ActivityFieldsStyles, declaredLabel, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js'\nimport { DecisionContentStyles, DecisionKeysFields, renderDecision } from '../../components/decision-content.js'\nimport { WorklistStateColors } from '../../components/state-ribon.js'\nimport { ActivityInstance } from '../../types/activity-instance.js'\nimport { ActivityThread } from '../../types/activity-thread.js'\nimport { ActivityApproval } from '../../types/activity-approval.js'\nimport { entity360Name } from '@operato/layout'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n@customElement('activity-instance-view')\nexport class ActivityInstanceView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n WorklistStateColors,\n ActivityFieldsStyles,\n DecisionContentStyles,\n css`\n :host {\n display: flex;\n overflow: auto;\n font-size: var(--fontsize-default);\n }\n [instance-container] {\n flex: 1;\n background-color: var(--md-sys-color-background);\n border-right: var(--border-dim-color);\n padding: var(--spacing-large);\n color: var(--md-sys-color-secondary);\n }\n [thread-container] {\n flex: 2;\n padding: var(--spacing-large);\n }\n [instance-container] div {\n margin-bottom: var(--spacing-medium);\n padding-bottom: var(--spacing-medium);\n border-bottom: var(--border-dim-color);\n }\n /* The state speaks through the icon's colour on a quiet disc, as in the ribbons - a filled disc\n under an on-primary icon read under 3:1 for three states. */\n [header] md-icon {\n background-color: var(--md-sys-color-surface-container-high);\n float: left;\n margin-right: var(--spacing-medium);\n padding: var(--spacing-medium);\n border-radius: 50%;\n float: left;\n font-size: 1.8em;\n color: var(--worklist-state-color, var(--ui-muted, #57676f));\n }\n [header] strong {\n display: block;\n font: bold 22px / 1.1 var(--theme-font);\n }\n [header] {\n overflow: hidden;\n font-size: var(--fontsize-small);\n }\n [instance-container] div label {\n display: inline-block;\n margin-right: var(--spacing-medium);\n min-width: 50px;\n }\n [issuer] md-icon {\n opacity: 0.5;\n position: relative;\n top: 4px;\n font-size: 20px;\n }\n span[status] {\n width: 15px;\n height: 15px;\n position: relative;\n top: 2px;\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n display: inline-block;\n margin-right: var(--spacing-small);\n border-radius: 50%;\n }\n [thread-container] table {\n width: 100%;\n border-collapse: collapse;\n }\n [thread-container] th {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n }\n [thread-container] td {\n padding: var(--spacing-small);\n border-bottom: var(--grid-record-border-bottom);\n }\n [assignee] * {\n vertical-align: middle;\n }\n [assignee] md-icon {\n opacity: 0.5;\n }\n [subtitle] {\n display: block;\n margin: var(--spacing-large) 0 var(--spacing-small) 0;\n padding: var(--spacing-small) var(--spacing-medium);\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-variant);\n font: bold 16px var(--theme-font);\n border: 2px solid var(--md-sys-color-outline);\n border-radius: 999px;\n }\n [timeline] ol {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n [timeline] li {\n display: flex;\n }\n [timeline] [info] {\n color: var(--md-sys-color-on-surface);\n background: var(--md-sys-color-surface-variant);\n\n flex: 1;\n }\n [timeline] [date] {\n opacity: 0.7;\n width: 130px;\n font-size: var(--fontsize-small);\n }\n [timeline] [info] strong {\n float: right;\n }\n [timeline] [status] {\n margin: 0 var(--spacing-small);\n display: block;\n border-radius: 50%;\n width: 12px;\n height: 12px;\n position: relative;\n top: 3px;\n /* The ring separates the dot from the line behind it, so it is the page's own colour. */\n border: 2px solid var(--md-sys-color-surface);\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n }\n [timeline] [status]::before {\n content: '';\n height: 60px;\n width: 2px;\n display: block;\n position: relative;\n margin-left: 5px;\n background-color: var(--worklist-state-color, var(--ui-muted, #57676f));\n opacity: 0.2;\n }\n [timeline] [info] md-icon {\n position: relative;\n top: 3px;\n font-size: var(--fontsize-large);\n }\n [timeline] [info] p {\n /* A fixed light grey under text that follows the theme was light-on-light in the dark theme. */\n background-color: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n margin: var(--spacing-small) 0 var(--spacing-medium) 0;\n padding: var(--spacing-small) var(--spacing-medium);\n border-radius: var(--border-radius);\n font-size: var(--fontsize-small);\n text-align: justify;\n }\n [timeline] [info] p::before {\n content: '';\n float: right;\n margin-top: -10px;\n margin-right: 20px;\n border: 7px solid transparent;\n border-bottom-color: var(--md-sys-color-surface-container);\n border-top: 0;\n }\n [thread] div {\n border-bottom: var(--border-dim-color);\n padding: var(--spacing-small);\n text-align: right;\n overflow: hidden;\n }\n [thread] div label {\n float: left;\n width: 25%;\n text-align: left;\n }\n `\n ]\n\n @property({\n type: String,\n attribute: 'activity-instance-id'\n })\n activityInstanceId?: string\n\n @state() activityInstance?: ActivityInstance\n\n render() {\n if (!this.activityInstance) {\n return html`<div>no activity instance info.</div>`\n }\n\n const { id, name, description, state, issuer, assignedAt, startedAt, activityThreads, terminatedAt, updatedAt } =\n this.activityInstance\n\n return html`\n <div instance-container>\n <div header>\n <md-icon>description</md-icon>\n <strong>${name}</strong>\n ${description}\n </div>\n\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\n </div>\n\n <div issuer>\n <label>${i18next.t('field.issuer')}</label>\n <md-icon>account_circle</md-icon>\n <strong>${entity360Name(issuer)}</strong>\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label>${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.started-at')}</label>${startedAt && formatter.format(new Date(startedAt))}</div>\n <div><label>${i18next.t('field.updated-at')}</label>${updatedAt && formatter.format(new Date(updatedAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label>${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n </div>\n <div thread-container>\n ${this.renderRequest()}\n ${activityThreads?.map(activityThread => this.renderActivityThread(this.activityInstance!, activityThread))}\n </div>\n `\n }\n\n /**\n * What was asked - the same drawing the task and approval screens use.\n *\n * 상신함 opens what I put up here. Without this the view showed the name, the state and the\n * history, and not the request itself: an expenditure request's payee and lines live only in its\n * decision, every model field being hidden. The declaration goes first and the given values are\n * the fallback, as on the task screen (thread-sections).\n */\n renderRequest() {\n const { activity, input } = this.activityInstance!\n const decision = renderDecision(activity?.decisionKeys, input)\n\n if (decision !== nothing) {\n return decision\n }\n\n const given = inputSpecOf(activity?.model)\n\n return given.length\n ? html`<section readonly>\n <h2>${i18next.t('label.activity-input')}</h2>\n ${renderGiven(given, input)}\n </section>`\n : nothing\n }\n\n renderActivityThread(activityInstance: ActivityInstance, activityThread: ActivityThread) {\n const {\n state,\n assignee,\n output,\n round,\n activityApprovals = [],\n assignedAt,\n startedAt,\n terminatedAt\n } = activityThread\n const { approvalLine } = activityInstance!\n const { name, email } = assignee || {}\n const approvals = activityApprovals.sort((a, b) =>\n a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1\n )\n const current = approvals[0]?.round == round ? approvals[0].order : -1\n\n return html`\n <div assignee>\n <md-icon>account_circle</md-icon>\n <strong>${name}</strong>\n </div>\n\n <div thread>\n <span subtitle>${i18next.t('label.thread-basics')}</span>\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n <div><label>${i18next.t('field.round')}</label> ${round}</div>\n </div>\n\n ${this.renderWritten(output || {})}\n <div timeline>\n <span subtitle>${i18next.t('label.timeline')}</span>\n\n <div>\n ${approvalLine\n ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`\n : html``}\n </div>\n\n <ol>\n ${approvals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n </div>\n `\n }\n\n renderActivityApproval(activityApproval: ActivityApproval) {\n const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval\n const { name, email } = approver || {}\n\n return html`\n <li>\n <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>\n <span status></span>\n <span info>\n ${i18next.t('label.activity-state-' + (judgment || 'started'))}\n <strong><md-icon>account_circle</md-icon>${name}</strong>\n <p>${comment}</p>\n </span>\n </li>\n `\n }\n\n renderSearchKeys() {\n const { activity } = this.activityInstance!\n const { searchKeys = [] } = activity! || {}\n\n return html`\n <table>\n <tr>\n <th>${i18next.t('label.name')}</th>\n <th>${i18next.t('label.value')}</th>\n </tr>\n\n ${searchKeys?.map(\n (item, index) => html`\n <tr>\n <td>${declaredLabel(item)}</td>\n <td>${this.activityInstance![`key0${index + 1}`]}</td>\n </tr>\n `\n )}\n </table>\n `\n }\n\n /**\n * What the assignee wrote - the fields the model declares as output and does not hide.\n *\n * This listed every model field by its developer name, hidden ones too, with the value read from the\n * output: an expenditure request showed requestId · month · requester · payee · lines, all empty,\n * under 「산출물」. 상신함 opens this view for anyone who put something up, so it draws what the task\n * screen draws, and nothing when the activity has nothing to write.\n */\n renderWritten(output: any) {\n const written = outputSpecOf(this.activityInstance!.activity?.model)\n\n return written.length\n ? html`<div>\n <span subtitle>${i18next.t('field.artifact')}</span>\n ${renderGiven(written, output)}\n </div>`\n : nothing\n }\n\n updated(changes) {\n if (changes.has('activityInstanceId')) {\n this.fetchActivityInstance()\n }\n }\n\n async fetchActivityInstance() {\n const id = this.activityInstanceId\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n issuer {\n id\n name\n email\n }\n starter {\n name\n email\n }\n activity {\n id\n name\n description\n searchKeys {\n name\n description\n inputKey\n tKey\n }\n ${DecisionKeysFields}\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n hidden\n }\n }\n approvalLine {\n type\n participation\n notifyAfter\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n activityThreads {\n state\n transaction\n output\n assignee {\n id\n name\n email\n }\n round\n activityApprovals {\n round\n order\n approver {\n id\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n assignedAt\n startedAt\n terminatedAt\n }\n updater {\n id\n name\n }\n assignedAt\n startedAt\n terminatedAt\n updatedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityInstance = response.data.activityInstance\n this.setAttribute('state', this.activityInstance?.state || '')\n }\n}\n"]}
|
package/dist-client/route.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function route(page: string): "
|
|
1
|
+
export default function route(page: string): "approval-pending-list" | "todo-list" | "activity" | "done-list-calendar" | "activity-catalog" | "activity-detail" | "work-doors-page" | "approval-done-list" | "draft-list" | "pickable-list" | "starter-list" | "reporter-list" | "activity-list" | "activity-instance-start" | "activity-thread" | "activity-thread-view" | "activity-approval" | "activity-instance-list" | "activity-instance-search" | "activity-template-list" | "activity-store" | "activity-thread-list" | "activity-approval-list" | "installable-activity-list" | "activity-stats-list" | undefined;
|