@things-factory/worklist 10.1.6 → 10.1.7

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.
Files changed (85) hide show
  1. package/dist-client/components/activity-instance-preview.js +5 -4
  2. package/dist-client/components/activity-instance-preview.js.map +1 -1
  3. package/dist-client/components/activity-starter-form.js +14 -10
  4. package/dist-client/components/activity-starter-form.js.map +1 -1
  5. package/dist-client/components/activity-thread-timeline.d.ts +2 -2
  6. package/dist-client/components/decision-slots.d.ts +38 -9
  7. package/dist-client/components/decision-slots.js +24 -10
  8. package/dist-client/components/decision-slots.js.map +1 -1
  9. package/dist-client/components/mutation-outcome.d.ts +57 -0
  10. package/dist-client/components/mutation-outcome.js +78 -0
  11. package/dist-client/components/mutation-outcome.js.map +1 -0
  12. package/dist-client/components/say-outcome.d.ts +25 -0
  13. package/dist-client/components/say-outcome.js +51 -0
  14. package/dist-client/components/say-outcome.js.map +1 -0
  15. package/dist-client/pages/activity/activity-list-page.js +28 -12
  16. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  17. package/dist-client/pages/activity/activity-model-item-list.js +4 -3
  18. package/dist-client/pages/activity/activity-model-item-list.js.map +1 -1
  19. package/dist-client/pages/activity/activity-page.d.ts +2 -2
  20. package/dist-client/pages/activity/activity-page.js +25 -21
  21. package/dist-client/pages/activity/activity-page.js.map +1 -1
  22. package/dist-client/pages/activity-approval/activity-approval-importer.js +4 -3
  23. package/dist-client/pages/activity-approval/activity-approval-importer.js.map +1 -1
  24. package/dist-client/pages/activity-approval/activity-approval-list-page.js +8 -9
  25. package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
  26. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +3 -1
  27. package/dist-client/pages/activity-approval/activity-approval-page.js +76 -28
  28. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  29. package/dist-client/pages/activity-instance/activity-instance-start-page.js +24 -18
  30. package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
  31. package/dist-client/pages/activity-instance/activity-instance-view.js +1 -0
  32. package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
  33. package/dist-client/pages/activity-stats/activity-stats-importer.js +4 -3
  34. package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -1
  35. package/dist-client/pages/activity-stats/activity-stats-list-page.js +8 -9
  36. package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
  37. package/dist-client/pages/activity-template/activity-template-importer.js +4 -3
  38. package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -1
  39. package/dist-client/pages/activity-template/activity-template-list-page.js +8 -9
  40. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
  41. package/dist-client/pages/activity-template/activity-template-model-item-list.js +4 -3
  42. package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -1
  43. package/dist-client/pages/activity-thread/activity-thread-importer.js +4 -3
  44. package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -1
  45. package/dist-client/pages/activity-thread/activity-thread-list-page.js +8 -9
  46. package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
  47. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -1
  48. package/dist-client/pages/activity-thread/activity-thread-page.js +22 -20
  49. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  50. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -1
  51. package/dist-client/pages/activity-thread/activity-thread-view-page.js +1 -0
  52. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  53. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +1 -1
  54. package/dist-client/pages/todo/draft-list-page.js +1 -0
  55. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  56. package/dist-client/route.d.ts +1 -1
  57. package/dist-client/tsconfig.tsbuildinfo +1 -1
  58. package/dist-server/controllers/activity-installation/installable-to-activity.d.ts +14 -1
  59. package/dist-server/controllers/activity-installation/installable-to-activity.js +14 -1
  60. package/dist-server/controllers/activity-installation/installable-to-activity.js.map +1 -1
  61. package/dist-server/controllers/activity-instance/draft.js +3 -0
  62. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  63. package/dist-server/controllers/activity-instance/entitlement.d.ts +25 -0
  64. package/dist-server/controllers/activity-instance/entitlement.js +108 -0
  65. package/dist-server/controllers/activity-instance/entitlement.js.map +1 -0
  66. package/dist-server/controllers/activity-instance/issue.js +10 -0
  67. package/dist-server/controllers/activity-instance/issue.js.map +1 -1
  68. package/dist-server/controllers/activity-instance/pick.js +8 -0
  69. package/dist-server/controllers/activity-instance/pick.js.map +1 -1
  70. package/dist-server/service/activity/index.d.ts +1 -1
  71. package/dist-server/service/activity-instance/activity-instance-mutation.js +20 -9
  72. package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
  73. package/dist-server/service/activity-instance/activity-instance-query.js +25 -2
  74. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  75. package/dist-server/service/activity-instance/index.d.ts +1 -1
  76. package/dist-server/service/activity-template/index.d.ts +1 -1
  77. package/dist-server/service/activity-thread/index.d.ts +1 -1
  78. package/dist-server/service/index.d.ts +3 -3
  79. package/dist-server/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +11 -11
  81. package/translations/en.json +5 -0
  82. package/translations/ja.json +5 -0
  83. package/translations/ko.json +5 -0
  84. package/translations/ms.json +5 -0
  85. package/translations/zh.json +5 -0
@@ -8,6 +8,7 @@ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
8
8
  import { DataGrist } from '@operato/data-grist';
9
9
  import { client } from '@operato/graphql';
10
10
  import { i18next, localize } from '@operato/i18n';
11
+ import { ranMutation } from '../../components/say-outcome.js';
11
12
  import { notify, openPopup } from '@operato/layout';
12
13
  import { isMobileDevice } from '@operato/utils';
13
14
  import gql from 'graphql-tag';
@@ -170,15 +171,15 @@ let ActivityApprovalListPage = class ActivityApprovalListPage extends localize(i
170
171
  if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
171
172
  const ids = this.grist.selected.map(record => record.id);
172
173
  if (ids && ids.length > 0) {
173
- const response = await client.mutate({ mutation: gql `
174
+ const outcome = await ranMutation(() => client.mutate({ mutation: gql `
174
175
  mutation ($ids: [String!]!) { deleteActivityApprovals(ids: $ids)
175
176
  }
176
177
  `,
177
178
  variables: { ids
178
179
  }
179
- });
180
- if (!response.errors) {
181
- this.grist.fetch();
180
+ }));
181
+ this.grist.fetch();
182
+ if (outcome.ok) {
182
183
  notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
183
184
  });
184
185
  }
@@ -197,17 +198,15 @@ let ActivityApprovalListPage = class ActivityApprovalListPage extends localize(i
197
198
  patchField.cuFlag = patch.__dirty__;
198
199
  return patchField;
199
200
  });
200
- const response = await client.mutate({ mutation: gql `
201
+ const outcome = await ranMutation(() => client.mutate({ mutation: gql `
201
202
  mutation ($patches: [ActivityApprovalPatch!]!) { updateMultipleActivityApproval(patches: $patches) { name
202
203
  }
203
204
  }
204
205
  `,
205
206
  variables: { patches
206
207
  }
207
- });
208
- if (!response.errors) {
209
- this.grist.fetch();
210
- }
208
+ }));
209
+ this.grist.fetch();
211
210
  }
212
211
  }
213
212
  async exportHandler() {
@@ -1 +1 @@
1
- {"version":3,"file":"activity-approval-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,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AM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;uDAAA;AAzBjC,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAmOpC","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { ActivityApprovalImporter } from './activity-approval-importer.js'\n\n@customElement('activity-approval-list-page')\nexport class ActivityApprovalListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'activity-approval-importer': ActivityApprovalImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity approval list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'worklist/activity-approval',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityApproval.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity approval list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <!-- 검색은 제목 줄이 갖는다(context.search). 여기 폼은 컬럼 필터만 그린다. -->\n <ox-filters-form without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityApprovals(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteActivityApproval() { if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteActivityApprovals(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateActivityApproval() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [ActivityApprovalPatch!]!) { updateMultipleActivityApproval(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(activityApproval => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityApproval[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-approval-importer\n .activityApprovals=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></activity-approval-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-approval')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-approval-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAAvF;;QAuBuB,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IA6MjG,CAAC;aApOyG,WAAM,GAAG;QAC/G,eAAe;QACf,kBAAkB;QAClB,GAAG,CAAA;;;;;;;;;;;;KAYF;KACF,AAhB6G,CAgB7G;IAED,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AEA,KAAK,CAAC,aAAa,CAAC,OAAO;QAAQ,MAAM,KAAK,GAAG,SAAS,CACtD,IAAI,CAAA;;+BAEqB,OAAO;sBAChB,GAAG,EAAE;YAAe,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAC7B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;SACxD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpD,CAAC,CAAA;IACD,CAAC;;AA7M4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;uDAAA;AAzBjC,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAoOpC","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { ActivityApprovalImporter } from './activity-approval-importer.js'\n\n@customElement('activity-approval-list-page')\nexport class ActivityApprovalListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'activity-approval-importer': ActivityApprovalImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity approval list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'worklist/activity-approval',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityApproval.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity approval list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <!-- 검색은 제목 줄이 갖는다(context.search). 여기 폼은 컬럼 필터만 그린다. -->\n <ox-filters-form without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityApprovals(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteActivityApproval() { if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) { const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteActivityApprovals(ids: $ids)\n }\n `,\n variables: { ids\n }\n }))\n\n this.grist.fetch()\n\n if (outcome.ok) {\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateActivityApproval() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($patches: [ActivityApprovalPatch!]!) { updateMultipleActivityApproval(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n }))\n\n this.grist.fetch()\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(activityApproval => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityApproval[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-approval-importer\n .activityApprovals=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></activity-approval-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-approval')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
@@ -61,7 +61,7 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
61
61
  action: () => void;
62
62
  }[];
63
63
  };
64
- render(): TemplateResult<1> | typeof nothing;
64
+ render(): typeof nothing | TemplateResult<1>;
65
65
  /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */
66
66
  hasFields(): boolean;
67
67
  activityContent(): DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -147,6 +147,8 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
147
147
  * the page redraws; a name nobody ever registers simply never resolves, and the statement stands.
148
148
  */
149
149
  customElementContent(): any;
150
+ /** The activity names a screen and nothing registered it. Says what to judge by instead. */
151
+ private screenNotLoaded;
150
152
  oxBoardViewer: any;
151
153
  getOutputFromBoard(): any;
152
154
  /**
@@ -11,12 +11,13 @@ import { customElement, query, state } from 'lit/decorators.js';
11
11
  import { keyed } from 'lit/directives/keyed.js';
12
12
  import { client } from '@operato/graphql';
13
13
  import { i18next, localize } from '@operato/i18n';
14
+ import { ranMutation } from '../../components/say-outcome.js';
14
15
  import { PageView } from '@operato/shell';
15
16
  import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles';
16
17
  import { provider } from '@things-factory/board-ui/dist-client/board-provider.js';
17
18
  import { isReferenceStep } from '@things-factory/organization/dist-client';
18
19
  import { ActivityFieldsStyles, fieldValue, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js';
19
- import { decisionSlots, reversibilityOf, slotOfRole, slotsOfRole } from '../../components/decision-slots.js';
20
+ import { decisionSlots, reversibilityIsMalformed, reversibilityOf, slotOfRole, slotsOfRole } from '../../components/decision-slots.js';
20
21
  const ActivityApprovalFetchResult = `\
21
22
  { id
22
23
  judgment
@@ -540,8 +541,36 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
540
541
  /* board 는 전체 화면을 쓰는 캔버스라 카드에 담지 않는다(hostedContent 머리말). */
541
542
  case 'board':
542
543
  return this.boardContent();
543
- case 'custom-element':
544
- return this.hostedContent(this.customElementContent());
544
+ case 'custom-element': {
545
+ /*
546
+ * The wrapper is for the element, not for the notice.
547
+ *
548
+ * hostedContent puts the content in a card so every ui type sits at the same place with the
549
+ * same frame. The not-loaded notice is already a card — wrapping it drew a card inside a
550
+ * card, two borders deep, and its margins landed unevenly: 16 above and none below, inside
551
+ * a box that had its own padding. The generated branch returns the same notice unwrapped
552
+ * and looks right.
553
+ */
554
+ const { viewSource: tagName } = this.activityThread?.activityInstance || {};
555
+ /*
556
+ * Naming no element is not the same as naming one that is missing.
557
+ *
558
+ * A template that stops providing a screen clears the field — installActivity does not
559
+ * blank what a template leaves undefined, so clearing is written as an empty string. That
560
+ * left viewType saying custom-element with nothing named, and this branch answered "the
561
+ * screen could not be loaded": a failure, for an activity that simply has no screen of its
562
+ * own. Those read as different things to whoever is approving, and the second one is not
563
+ * true.
564
+ *
565
+ * With nothing named, the generated screen is what this activity has — and it draws a
566
+ * decision when the activity declares one, which the two plant forms that hit this do.
567
+ */
568
+ if (!tagName) {
569
+ return this.generatedContent();
570
+ }
571
+ const element = this.customElementContent();
572
+ return element ? this.hostedContent(element) : this.screenNotLoaded();
573
+ }
545
574
  case 'page':
546
575
  case 'external':
547
576
  return html ``;
@@ -693,14 +722,30 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
693
722
  * why they must not share a sentence.
694
723
  */
695
724
  renderReversibility(slot) {
696
- const reversible = reversibilityOf(slot);
697
- if (reversible === undefined) {
725
+ const said = reversibilityOf(slot);
726
+ if (!said) {
727
+ if (reversibilityIsMalformed(slot)) {
728
+ /*
729
+ * Declared, and the value is there, but not the shape this role takes — a bare sentence
730
+ * where { reversible, caveat } belongs. Nothing is drawn, because this side cannot tell
731
+ * which way it goes; the log is so a developer does not have to find it by hand, which is
732
+ * how it was found the first time.
733
+ */
734
+ console.error(`[worklist] reversibility at "${slot?.inputPath}" is not { reversible, caveat } — nothing drawn`);
735
+ }
698
736
  return '';
699
737
  }
738
+ /*
739
+ * The module's own sentence when it wrote one. 「버린 자재는 돌아오지 않습니다」 says why, which
740
+ * the plain wording cannot; the boolean beside it is what decides how heavily this is drawn.
741
+ */
700
742
  return html `
701
- <div class="reversibility" ?irreversible=${!reversible}>
702
- <md-icon>${reversible ? 'undo' : 'lock'}</md-icon>
703
- <span>${i18next.t(reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</span>
743
+ <div class="reversibility" ?irreversible=${!said.reversible}>
744
+ <md-icon>${said.reversible ? 'undo' : 'lock'}</md-icon>
745
+ <span
746
+ >${said.caveat ||
747
+ i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</span
748
+ >
704
749
  </div>
705
750
  `;
706
751
  }
@@ -814,14 +859,10 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
814
859
  }
815
860
  const { output, activityInstance } = this.activityThread;
816
861
  const { viewSource: tagName, input } = activityInstance || {};
817
- if (!tagName || !customElements.get(tagName)) {
818
- if (tagName) {
819
- customElements.whenDefined(tagName).then(() => this.requestUpdate());
820
- }
821
- return html `<section empty>
822
- <span class="title">${i18next.t('text.approval-view-not-loaded')}</span>
823
- <span class="why">${i18next.t('text.no-approval-content-why')}</span>
824
- </section>`;
862
+ if (!customElements.get(tagName)) {
863
+ customElements.whenDefined(tagName).then(() => this.requestUpdate());
864
+ /* The caller draws the notice — unwrapped, because the notice is its own card. */
865
+ return undefined;
825
866
  }
826
867
  const element = document.createElement(tagName);
827
868
  element.id = 'custom-content';
@@ -831,6 +872,13 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
831
872
  element.activityApproval = this.activityApproval;
832
873
  return element;
833
874
  }
875
+ /** The activity names a screen and nothing registered it. Says what to judge by instead. */
876
+ screenNotLoaded() {
877
+ return html `<section empty>
878
+ <span class="title">${i18next.t('text.approval-view-not-loaded')}</span>
879
+ <span class="why">${i18next.t('text.no-approval-content-why')}</span>
880
+ </section>`;
881
+ }
834
882
  getOutputFromBoard() {
835
883
  const outputSpec = outputSpecOf(this.activityThread?.activityInstance?.activity?.model);
836
884
  const data = this.oxBoardViewer.getSceneValues();
@@ -880,16 +928,16 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
880
928
  this.commentInput.focus();
881
929
  return;
882
930
  }
883
- const response = await client.mutate({ mutation: gql `
931
+ const outcome = await ranMutation(() => client.mutate({ mutation: gql `
884
932
  mutation ($id: String!, $comment: String!) { rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
885
933
  }
886
934
  `,
887
935
  variables: { id,
888
936
  comment
889
937
  }
890
- });
891
- if (!response.errors) {
892
- this.activityApproval = response.data.rejectActivityApproval;
938
+ }));
939
+ if (outcome.ok) {
940
+ this.activityApproval = outcome.data.rejectActivityApproval;
893
941
  this.activityThread = this.activityApproval.activityThread;
894
942
  this.updateContext();
895
943
  document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_rejected_successfully')
@@ -899,16 +947,16 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
899
947
  }
900
948
  async approveActivityApproval() {
901
949
  var { id, comment } = this.activityApproval;
902
- const response = await client.mutate({ mutation: gql `
950
+ const outcome = await ranMutation(() => client.mutate({ mutation: gql `
903
951
  mutation ($id: String!, $comment: String) { approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
904
952
  }
905
953
  `,
906
954
  variables: { id,
907
955
  comment
908
956
  }
909
- });
910
- if (!response.errors) {
911
- this.activityApproval = response.data.approveActivityApproval;
957
+ }));
958
+ if (outcome.ok) {
959
+ this.activityApproval = outcome.data.approveActivityApproval;
912
960
  this.activityThread = this.activityApproval.activityThread;
913
961
  this.updateContext();
914
962
  document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_approved_successfully')
@@ -918,16 +966,16 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
918
966
  }
919
967
  async saveActivityApproval() {
920
968
  var { id, comment } = this.activityApproval;
921
- const response = await client.mutate({ mutation: gql `
969
+ const outcome = await ranMutation(() => client.mutate({ mutation: gql `
922
970
  mutation ($id: String!, $comment: String) { saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
923
971
  }
924
972
  `,
925
973
  variables: { id,
926
974
  comment
927
975
  }
928
- });
929
- if (!response.errors) {
930
- this.activityApproval = response.data.saveActivityApproval;
976
+ }));
977
+ if (outcome.ok) {
978
+ this.activityApproval = outcome.data.saveActivityApproval;
931
979
  this.activityThread = this.activityApproval.activityThread;
932
980
  this.updateContext();
933
981
  document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')
@@ -1 +1 @@
1
- {"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC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ewer.js'\nimport '../../components/activity-approval-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui/dist-client/board-provider.js'\nimport { isReferenceStep } from '@things-factory/organization/dist-client'\n\nimport {\n ActivityFieldsStyles,\n fieldValue,\n inputSpecOf,\n outputSpecOf,\n renderGiven\n} from '../../components/activity-fields.js'\nimport {\n DecisionSlot,\n decisionSlots,\n reversibilityOf,\n slotOfRole,\n slotsOfRole\n} from '../../components/decision-slots.js'\n\nconst ActivityApprovalFetchResult = `\\\n{ id\n judgment\n comment\n approver { id\n name\n }\n round\n order\n createdAt\n terminatedAt\n activityThread { state\n dueAt\n assignedAt\n assignee { id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals { round\n order\n approver { name\n }\n judgment\n comment\n createdAt\n updatedAt\n terminatedAt\n }\n activityThreadHistories { transaction\n reason\n updater { name\n }\n updatedAt\n state\n output\n }\n activityInstance { id\n name\n description\n state\n activity { id\n label\n decisionKeys { role\n inputPath\n tKey\n unit\n }\n model { 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 { type\n value\n participation\n approver { id\n name\n description\n controlNo\n }\n }\n thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = { Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n ActivityFieldsStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background: var(--ui-bg, #f0f2f4);\n color: var(--ui-ink, #17242c);\n font-size: var(--ui-t-body, 13px);\n }\n\n /* 카드가 담아 주므로 안에 들어오는 화면은 자기 면과 여백을 갖지 않는다. */\n /*\n * 줄어들지 않는다 — 줄어들면 본문이 잘린다.\n *\n * flex 항목인데 크기를 안 정해 두면 기본이 flex: 0 1 auto 다. **1 이 줄어든다는 뜻이다** —\n * 세로가 모자라면 브라우저가 이 칸부터 줄이는데, 여기엔 카드 모서리를 따라 자르려고\n * overflow: hidden 이 걸려 있어서 줄어든 만큼이 **스크롤도 없이 사라진다.**\n *\n * 완료 조회에서 실측했다(1400x620): 칸이 242px 로 줄고 내용은 362px 이라 「업무 내용」 절이\n * 대부분 잘렸고, 잘린 자리 바로 아래에서 타임라인이 시작하니 타임라인이 본문을 덮은 것처럼\n * 보였다. 세로가 넉넉하면 줄일 일이 없어 안 드러난다.\n *\n * 안에 오는 것은 문서다. 높이를 정해 주어야 하는 것은 board 뿐이고 board 는 이 칸을 거치지\n * 않는다(activityContent 참조). 문서는 제 높이로 서고, 모자라면 페이지 전체가 스크롤한다 —\n * :host 의 overflow: auto 가 그 자리다.\n */\n section[hosted] {\n flex: none;\n padding: 0;\n overflow: hidden;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n activity-thread-timeline {\n margin: var(--spacing-large, 16px);\n }\n\n /*\n * 의견 칸 — 이 화면에서 **결재자가 유일하게 적는 자리**다.\n *\n * 화면 아래에 붙어 있어(sticky) 목록을 내려 읽는 동안에도 보인다. 그 자리를 지키되 모양은\n * 다른 절과 같은 카드로 둔다. 전에는 회색 면(surface-variant)에 다른 테두리라 이 화면에서\n * 혼자 다른 부품처럼 보였다.\n */\n /*\n * 의견 — 이 화면에서 **결재자가 유일하게 적는 자리**다.\n *\n * 화면 아래에 붙어 있어(sticky) 내용을 내려 읽는 동안에도 보인다. 그 자리를 지키되 모양은\n * 다른 절과 같은 카드로 둔다. 전에는 회색 면(surface-variant)에 다른 테두리라 이 화면에서\n * 혼자 다른 부품처럼 보였다.\n */\n div[comment] {\n position: sticky;\n bottom: 0;\n padding-bottom: var(--spacing-large, 16px);\n background: var(--ui-bg, #f0f2f4);\n }\n\n /*\n * 이 화면에서 **사용자가 유일하게 손대는 자리**라는 것을 모양으로 말한다.\n *\n * 나머지 절은 전부 읽는 것이고, 판단은 아래 툴바의 단추가 받는다. 그런데 의견 칸이 읽는\n * 절들과 똑같은 카드라 「내 차례가 어디인지」가 화면에 없었다. 왼쪽에 강조색 띠를 둔다 —\n * sticky 라 툴바 바로 위에 붙으므로 띠와 단추가 한 덩어리로 읽힌다.\n */\n div[comment] section {\n border-left: 3px solid var(--ui-accent, #00727e);\n }\n\n div[comment] textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\n height: 76px;\n padding: 10px 12px;\n background: var(--ui-panel, #ffffff);\n border: 1px solid var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n color: var(--ui-ink, #17242c);\n font: inherit;\n font-size: var(--ui-t-body, 13px);\n resize: none;\n outline: none;\n }\n\n div[comment] textarea:focus {\n border-color: var(--ui-accent, #00727e);\n }\n\n div[comment] .hint {\n margin: 7px 0 0;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-faint, #8a959c);\n word-break: keep-all;\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 */\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 section[decision] .policy {\n margin-top: 14px;\n padding-top: 11px;\n border-top: 1px solid var(--ui-line, #d5dce0);\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n `\n ]\n\n @state() activityApproval: any\n /**\n * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**\n *\n * 전에는 값이 없으면 곧바로 「업무활동 정보가 없습니다」를 그렸다. 그런데 이 화면은 열리자마자\n * 조회를 시작하므로, 응답이 오기 전까지 **없다고 단언하는 화면**이 보인다. 목록에서 줄을 눌러\n * 들어온 사람은 방금 본 건이 없다는 말을 먼저 읽는다.\n *\n * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.\n */\n @state() loaded = false\n\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n /**\n * Is the reader seated here as a reference — someone who comments and does not decide?\n *\n * The rule comes from organization's client types, the same function its own approval-line editor\n * and list use, so the two wire spellings of the enum are handled in one place. The approval line\n * answers rather than ActivityApproval.participation, matching what the server refuses on\n * (isReferenceOrder in approval-line.ts): the line decides who comes next, so letting the row\n * decide who may judge would leave two authorities with nothing to settle a disagreement.\n *\n * The value comes back false while the query is still out. That is the same answer as for an\n * approver, so the buttons show for a moment on a reference's screen — pressing one is refused by\n * the server, which is why the server closed first.\n */\n get isReference(): boolean {\n const approvalLine = this.activityThread?.activityInstance?.approvalLine\n const order = Number(this.activityApproval?.order ?? 0)\n\n return isReferenceStep(approvalLine?.[order - 1])\n }\n\n get context() { const judgment = this.activityApproval?.judgment\n\n return { title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n /*\n * 이 화면은 메뉴에 없다 — 「내 결재함」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬\n * 항목이 없고, 표시가 사라져 들어온 사람이 자기가 어디에 있는지 잃는다.\n *\n * 어느 목록에서 열리는지는 이 화면이 안다. 그것을 적어 둔다.\n */\n menu: 'approval-pending-list',\n /*\n * A reference is offered neither approve nor reject.\n *\n * ActivityApprovalJudgment has carried Closed for this seat from the start — \"the case ended\"\n * rather than a judgment — so a reference row was never meant to end in approved or rejected.\n * The buttons were offered anyway, and the server accepted them until 2026-09-09.\n *\n * What stays is the note, because a comment is the whole point of the seat, and close. The\n * hint under the textarea says which seat this is; buttons that simply vanish leave the\n * reader looking for them.\n */\n actions: judgment\n ? [\n { title: i18next.t('button.close'),\n action: () => { history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n : this.isReference\n ? [\n {\n title: i18next.t('button.save-note'),\n action: this.saveActivityApproval.bind(this),\n icon: 'edit_note',\n emphasis: { raised: true, outlined: false, dense: false, danger: false }\n },\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back,\n icon: 'close'\n }\n ]\n : /*\n * ── 세 단추의 순서와 무게 (2026-09-06) ──────────────────────────\n * 전에는 반려가 첫 자리였고, 승인 · 반려 · 저장이 모두 같은 모양이었다. 되돌리기 어려운\n * 것이 앞에 서고 무엇이 주된 흐름인지 화면이 말하지 않았다.\n *\n * 승인이 주 동작이다 — 채운 단추 하나. 반려는 대등한 선택이지만 예외 경로라 테두리\n * 단추로 그 옆에 둔다.\n *\n * 「저장」은 이름이 뜻을 말하지 않았다. 이 단추가 저장하는 것은 **의견 하나**이고\n * (saveActivityApproval 은 id 와 comment 만 보낸다), 판단은 미뤄 둔다. 그리고 그 결과는\n * 목록에서 「메모 있음」 표식으로 나타난다(activity-cells 의 approvalMarks). 목록이\n * 부르는 이름과 같은 낱말로 맞춘다.\n */\n [\n { title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n icon: 'approval',\n emphasis: { raised: true,\n outlined: false,\n dense: false,\n danger: false\n }\n },\n\n { title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n icon: 'assignment_return',\n emphasis: { raised: false,\n outlined: true,\n dense: false,\n danger: false\n }\n },\n\n { title: i18next.t('button.save-note'),\n action: this.saveActivityApproval.bind(this),\n icon: 'edit_note',\n emphasis: { raised: false,\n outlined: true,\n dense: false,\n danger: false\n }\n },\n { title: i18next.t('button.close'),\n action: () => { history.back()\n },\n ...CommonButtonStyles.back,\n icon: 'close'\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() { if (!this.activityThread) {\n return this.loaded\n ? html`<div empty>\n <span class=\"title\">${i18next.t('text.no activity thread info')}</span>\n <span class=\"why\">${i18next.t('text.no-activity-thread-why')}</span>\n </div>`\n : nothing\n }\n\n const { terminatedAt } = this.activityApproval\n const editable = !terminatedAt\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <!--\n 보일 항목이 하나도 없으면 타임라인을 편다 — 그때는 화면이 「아래 타임라인의 상신 사유와\n 이력을 보고 판단하세요」로 여기를 가리키므로, 접혀 있으면 그 안내가 거짓말이 된다.\n -->\n <activity-thread-timeline\n .activityThread=${this.activityThread}\n ?open=${!this.hasFields()}\n short-form\n ></activity-thread-timeline>\n ${editable\n ? html`\n <div comment>\n <section>\n <h2>${i18next.t('field.wl-comment')}</h2>\n <textarea\n placeholder=${String(\n i18next.t(\n this.isReference\n ? 'text.write-your-comment-as-reference'\n : 'text.explain the reason for approval/rejection'\n )\n )}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\n <!--\n 반려는 의견이 필수다(rejectActivityApproval). 전에는 그 규칙을 **누른 뒤에** 토스트로\n 알렸다. 되돌릴 수 없는 것과 뜻이 다른 동작은 하기 전에 말한다.\n\n A reference reads a different line: this one names the seat, because the approve\n and reject buttons are absent for them and a reader whose buttons are missing\n goes looking for them.\n -->\n <p class=\"hint\">\n ${i18next.t(this.isReference ? 'text.reference-comment-hint' : 'text.approval-comment-hint')}\n </p>\n </section>\n </div>\n `\n : nothing}\n `\n }\n\n /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */\n hasFields(): boolean {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return inputSpecOf(model).length > 0 || outputSpecOf(model).length > 0\n }\n\n activityContent() { switch (this.activityThread?.activityInstance?.viewType) { case 'template':\n return this.hostedContent(this.templateContent())\n case 'generated':\n return this.generatedContent()\n /* board 는 전체 화면을 쓰는 캔버스라 카드에 담지 않는다(hostedContent 머리말). */\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.hostedContent(this.customElementContent())\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n /**\n * 화면 종류가 달라도 **같은 자리에 같은 모양으로 놓인다.**\n *\n * worklist 는 네 가지로 내용을 그린다(generated · custom-element · template · board). 그중\n * generated 만 절 카드 안에 있었고 나머지 셋은 면 위에 맨몸으로 놓였다. 그래서 같은 결재 화면이\n * 액티비티에 따라 카드였다가 아니었다가 했다 — 아래의 타임라인 · 의견은 늘 카드라 위계도 어긋났다.\n *\n * board 는 뺀다. 전체 폭 · 전체 높이를 쓰는 캔버스라 카드 안에 넣으면 여백이 두 겹이 되고 크기가\n * 어긋난다.\n *\n * 카드는 여백을 두지 않는다(padding: 0). 안에 들어오는 것이 자기 조판을 갖고 있고, 두 겹으로\n * 주면 안쪽 내용이 카드 가운데로 밀린다.\n */\n hostedContent(content: unknown) {\n return html`<section hosted>${content}</section>`\n }\n\n templateContent() { if (!this.activityApproval) { return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n /**\n * 결재자가 보는 내용 — **전부 읽기 전용이다.**\n *\n * 전에는 「Output」 절을 편집기로 그리고 변경을 activityApproval.output 에 적었다. 그런데\n * approveActivityApproval / rejectActivityApproval 은 id 와 comment 만 보낸다 — 그 값은 어디에도\n * 가지 않는다. 결재자가 적을 수 있는 것은 의견 하나이고, 그것은 화면 아래 칸이 받는다.\n */\n /**\n * The decision the activity declared, or nothing when it declared none.\n *\n * Returning nothing is how generatedContent 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 — plant hit that with its `policy` value — and an empty\n * bar on the screen would read as \"there is no reason\" when the truth is that this record has no\n * such value. What cannot be shown is left out; what is shown is only what the payload actually\n * 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 */\n decisionContent() {\n const { activityInstance } = this.activityThread || {}\n const slots = decisionSlots(activityInstance?.activity?.decisionKeys, activityInstance?.input)\n\n if (!slots.length) {\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 policy = slotOfRole(slots, 'policy')\n const evidence = slotsOfRole(slots, 'evidence').filter(slot => slot.found)\n const currentState = slotOfRole(slots, 'currentState')\n const reversibility = slotOfRole(slots, 'reversibility')\n\n const drawable =\n [headline, subject, policy, currentState].some(slot => slot?.found) ||\n !!reason ||\n consequences.length ||\n evidence.length ||\n reversibilityOf(reversibility) !== undefined\n\n /*\n * Every declared slot missed this payload. Saying so is not this screen's job — falling back to\n * the model at least shows the values that are there, and the reader is no worse off than before\n * the declaration existed.\n */\n if (!drawable) {\n return nothing\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <section decision>\n ${headline?.found ? html`<div class=\"headline\">${this.slotText(headline)}</div>` : ''}\n ${subject?.found ? html`<div class=\"subject\">${this.slotText(subject)}</div>` : ''}\n ${reason\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('field.reason')}</div>\n <div class=\"said ${this.hasWords(reason) ? '' : 'none'}\">\n ${this.hasWords(reason) ? this.slotText(reason) : i18next.t('text.no-reason-given')}\n </div>\n </div>\n `\n : ''}\n ${this.renderReversibility(reversibility)}\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 ${slot.tKey ? html`<div class=\"label\">${i18next.t(slot.tKey)}</div>` : ''}\n <div>${fieldValue(slot.value)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''}\n ${currentState?.found\n ? html`\n <div class=\"current-state\">\n <div class=\"label\">${i18next.t(currentState.tKey || 'label.current-state')}</div>\n <div>${fieldValue(currentState.value)}</div>\n </div>\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 ${slot.tKey ? html`<div class=\"label\">${i18next.t(slot.tKey)}</div>` : ''}\n <div>${fieldValue(slot.value)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''}\n ${policy?.found\n ? html`\n <div class=\"policy\">\n ${i18next.t('label.why-approval')} — ${this.slotText(policy)}\n </div>\n `\n : ''}\n </section>\n `\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 */\n private renderReversibility(slot?: DecisionSlot) {\n const reversible = reversibilityOf(slot)\n\n if (reversible === undefined) {\n return ''\n }\n\n return html`\n <div class=\"reversibility\" ?irreversible=${!reversible}>\n <md-icon>${reversible ? 'undo' : 'lock'}</md-icon>\n <span>${i18next.t(reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</span>\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 private slotText(slot: DecisionSlot): unknown {\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 /** Did a person actually write something here. Whitespace is not words. */\n private hasWords(slot: DecisionSlot): boolean {\n return typeof slot.value === 'string' ? slot.value.trim().length > 0 : slot.found && slot.value != null\n }\n\n generatedContent(): DirectiveResult { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread || {}\n const { input } = activityInstance || {}\n\n /*\n * The declaration goes first. It answers \"what happens if I approve\", which is the question this\n * screen exists for; the model answers \"what are the values\", which is the fallback.\n */\n const decision = this.decisionContent()\n\n if (decision !== nothing) {\n return decision as DirectiveResult\n }\n\n const model = activityInstance?.activity?.model\n const inputSpec = inputSpecOf(model)\n const outputSpec = outputSpecOf(model)\n\n /*\n * **결재 화면에서 내용이 비어 있는 것은 경고다.**\n *\n * 업무 상세라면 「적을 것이 없다」로 끝난다. 여기서는 다르다 — 무엇을 승인하는지 모르는 채로\n * 승인 · 반려 버튼이 그대로 눌린다. 그 사실을 화면이 말하고, 대신 무엇을 보고 판단할지 알려\n * 준다(타임라인의 상신 사유).\n */\n if (!inputSpec.length && !outputSpec.length) {\n return keyed(\n this.activityApproval.id,\n html`<section empty>\n <span class=\"title\">${i18next.t('text.no-approval-content')}</span>\n <span class=\"why\">${i18next.t('text.no-approval-content-why')}</span>\n </section>`\n )\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n ${inputSpec.length\n ? html`\n <section readonly>\n <h2>${i18next.t('label.activity-input')}</h2>\n ${renderGiven(inputSpec, input)}\n </section>\n `\n : ''}\n ${outputSpec.length\n ? html`\n <section readonly>\n <h2>${i18next.t('field.artifact')}</h2>\n ${renderGiven(outputSpec, output)}\n </section>\n `\n : ''}\n `\n )\n }\n\n boardContent(): DirectiveResult { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) { this.board = { id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n /**\n * The element the activity names, or a plain statement that it could not be loaded.\n *\n * document.createElement answers something for any name, so an activity pointing at an element\n * nobody registered used to produce an empty card. The approver got a screen with nothing on it\n * and the approve button still worked — plant shipped two such forms in one day and found them by\n * reading the file list, not by opening the screen.\n *\n * The reader is told what to judge by instead. Same shape as the empty generated screen: what is\n * missing, and where to look — the submission reason and the history in the timeline below.\n *\n * ── Waiting for a late definition ─────────────────────────────────────────\n * An element can be registered after this page renders, and answering \"not loaded\" forever in\n * that case would be a screen inventing a defect. whenDefined resolves whenever it arrives and\n * the page redraws; a name nobody ever registers simply never resolves, and the statement stands.\n */\n customElementContent() { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n if (!tagName || !customElements.get(tagName)) {\n if (tagName) {\n customElements.whenDefined(tagName).then(() => this.requestUpdate())\n }\n\n return html`<section empty>\n <span class=\"title\">${i18next.t('text.approval-view-not-loaded')}</span>\n <span class=\"why\">${i18next.t('text.no-approval-content-why')}</span>\n </section>`\n }\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() { const outputSpec = outputSpecOf(this.activityThread?.activityInstance?.activity?.model)\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => { output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n /**\n * 화면이 열리면 **의견 칸에 캐럿을 둔다.**\n *\n * 결재자가 이 화면에서 적는 것은 의견 하나다. 나머지는 전부 읽는 것이고, 판단은 아래 버튼이\n * 받는다. 그러면 열자마자 커서가 있어야 하는 자리는 하나뿐이다.\n *\n * 조건 둘을 지킨다.\n *\n * 활성 탭일 때만 MDI 라 뒤에 있는 탭이 응답을 받으면 앞 탭의 입력을 빼앗는다\n * 한 건에 한 번 갱신마다 focus 를 부르면 사용자가 옮긴 커서를 계속 되돌린다\n *\n * preventScroll 을 준다 — 화면을 아래로 끌어내리면 정작 무엇을 승인하는지가 위로 사라진다.\n */\n private focusedFor?: string\n\n private focusComment() {\n const id = this.activityApproval?.id\n\n if (!id || !this.active || this.activityApproval?.terminatedAt || this.focusedFor === id) {\n return\n }\n\n this.commentInput?.focus({ preventScroll: true })\n this.focusedFor = id\n }\n\n updated(changes) { if (changes.has('activityApproval')) { this.updateContext()\n this.focusComment()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) { if (this.active && lifecycle.resourceId) { this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) { const response = await client.query({ query: gql`\n query activityApproval($id: String!) { activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.loaded = true\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() { var { id, comment } = this.activityApproval\n\n if (!comment) { document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String!) { rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n })\n\n if (!response.errors) { this.activityApproval = response.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() { var { id, comment } = this.activityApproval\n\n const response = await client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String) { approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n })\n\n if (!response.errors) { this.activityApproval = response.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() { var { id, comment } = this.activityApproval\n\n const response = await client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String) { saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n })\n\n if (!response.errors) { this.activityApproval = response.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,6CAA6C,CAAA;AACpD,OAAO,8CAA8C,CAAA;AAErD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,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AAI,CAAC,aAAa,EAAE,CAAA;YAEpB,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAY,MAAM,EAAE,EAAc,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAAC;iBACvH;aACA,CAAC,CACI,CAAA;QACN,CAAC;IACD,CAAC;;AAluBS;IAAR,KAAK,EAAE;;8DAAsB;AAUrB;IAAR,KAAK,EAAE;;oDAAe;AAEd;IAAR,KAAK,EAAE;;4DAAoB;AACnB;IAAR,KAAK,EAAE;;mDAAW;AAEA;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAgB,mBAAmB;IAErD;;;;;;;;;;;;OAYG;;0DAdkD;AAwkB3B;IAAzB,KAAK,CAAC,iBAAiB,CAAC;;2DAAmB;AAn0BjC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA+8BhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-approval-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui/dist-client/board-provider.js'\nimport { isReferenceStep } from '@things-factory/organization/dist-client'\n\nimport {\n ActivityFieldsStyles,\n fieldValue,\n inputSpecOf,\n outputSpecOf,\n renderGiven\n} from '../../components/activity-fields.js'\nimport {\n DecisionSlot,\n decisionSlots,\n reversibilityIsMalformed,\n reversibilityOf,\n slotOfRole,\n slotsOfRole\n} from '../../components/decision-slots.js'\n\nconst ActivityApprovalFetchResult = `\\\n{ id\n judgment\n comment\n approver { id\n name\n }\n round\n order\n createdAt\n terminatedAt\n activityThread { state\n dueAt\n assignedAt\n assignee { id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals { round\n order\n approver { name\n }\n judgment\n comment\n createdAt\n updatedAt\n terminatedAt\n }\n activityThreadHistories { transaction\n reason\n updater { name\n }\n updatedAt\n state\n output\n }\n activityInstance { id\n name\n description\n state\n activity { id\n label\n decisionKeys { role\n inputPath\n tKey\n unit\n }\n model { 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 { type\n value\n participation\n approver { id\n name\n description\n controlNo\n }\n }\n thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = { Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n ActivityFieldsStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background: var(--ui-bg, #f0f2f4);\n color: var(--ui-ink, #17242c);\n font-size: var(--ui-t-body, 13px);\n }\n\n /* 카드가 담아 주므로 안에 들어오는 화면은 자기 면과 여백을 갖지 않는다. */\n /*\n * 줄어들지 않는다 — 줄어들면 본문이 잘린다.\n *\n * flex 항목인데 크기를 안 정해 두면 기본이 flex: 0 1 auto 다. **1 이 줄어든다는 뜻이다** —\n * 세로가 모자라면 브라우저가 이 칸부터 줄이는데, 여기엔 카드 모서리를 따라 자르려고\n * overflow: hidden 이 걸려 있어서 줄어든 만큼이 **스크롤도 없이 사라진다.**\n *\n * 완료 조회에서 실측했다(1400x620): 칸이 242px 로 줄고 내용은 362px 이라 「업무 내용」 절이\n * 대부분 잘렸고, 잘린 자리 바로 아래에서 타임라인이 시작하니 타임라인이 본문을 덮은 것처럼\n * 보였다. 세로가 넉넉하면 줄일 일이 없어 안 드러난다.\n *\n * 안에 오는 것은 문서다. 높이를 정해 주어야 하는 것은 board 뿐이고 board 는 이 칸을 거치지\n * 않는다(activityContent 참조). 문서는 제 높이로 서고, 모자라면 페이지 전체가 스크롤한다 —\n * :host 의 overflow: auto 가 그 자리다.\n */\n section[hosted] {\n flex: none;\n padding: 0;\n overflow: hidden;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n activity-thread-timeline {\n margin: var(--spacing-large, 16px);\n }\n\n /*\n * 의견 칸 — 이 화면에서 **결재자가 유일하게 적는 자리**다.\n *\n * 화면 아래에 붙어 있어(sticky) 목록을 내려 읽는 동안에도 보인다. 그 자리를 지키되 모양은\n * 다른 절과 같은 카드로 둔다. 전에는 회색 면(surface-variant)에 다른 테두리라 이 화면에서\n * 혼자 다른 부품처럼 보였다.\n */\n /*\n * 의견 — 이 화면에서 **결재자가 유일하게 적는 자리**다.\n *\n * 화면 아래에 붙어 있어(sticky) 내용을 내려 읽는 동안에도 보인다. 그 자리를 지키되 모양은\n * 다른 절과 같은 카드로 둔다. 전에는 회색 면(surface-variant)에 다른 테두리라 이 화면에서\n * 혼자 다른 부품처럼 보였다.\n */\n div[comment] {\n position: sticky;\n bottom: 0;\n padding-bottom: var(--spacing-large, 16px);\n background: var(--ui-bg, #f0f2f4);\n }\n\n /*\n * 이 화면에서 **사용자가 유일하게 손대는 자리**라는 것을 모양으로 말한다.\n *\n * 나머지 절은 전부 읽는 것이고, 판단은 아래 툴바의 단추가 받는다. 그런데 의견 칸이 읽는\n * 절들과 똑같은 카드라 「내 차례가 어디인지」가 화면에 없었다. 왼쪽에 강조색 띠를 둔다 —\n * sticky 라 툴바 바로 위에 붙으므로 띠와 단추가 한 덩어리로 읽힌다.\n */\n div[comment] section {\n border-left: 3px solid var(--ui-accent, #00727e);\n }\n\n div[comment] textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\n height: 76px;\n padding: 10px 12px;\n background: var(--ui-panel, #ffffff);\n border: 1px solid var(--ui-line, #d5dce0);\n border-radius: var(--ui-r-small, 6px);\n color: var(--ui-ink, #17242c);\n font: inherit;\n font-size: var(--ui-t-body, 13px);\n resize: none;\n outline: none;\n }\n\n div[comment] textarea:focus {\n border-color: var(--ui-accent, #00727e);\n }\n\n div[comment] .hint {\n margin: 7px 0 0;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-faint, #8a959c);\n word-break: keep-all;\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 */\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 section[decision] .policy {\n margin-top: 14px;\n padding-top: 11px;\n border-top: 1px solid var(--ui-line, #d5dce0);\n font-size: var(--ui-t-small, 11.5px);\n color: var(--ui-muted, #57676f);\n }\n `\n ]\n\n @state() activityApproval: any\n /**\n * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**\n *\n * 전에는 값이 없으면 곧바로 「업무활동 정보가 없습니다」를 그렸다. 그런데 이 화면은 열리자마자\n * 조회를 시작하므로, 응답이 오기 전까지 **없다고 단언하는 화면**이 보인다. 목록에서 줄을 눌러\n * 들어온 사람은 방금 본 건이 없다는 말을 먼저 읽는다.\n *\n * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.\n */\n @state() loaded = false\n\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n /**\n * Is the reader seated here as a reference — someone who comments and does not decide?\n *\n * The rule comes from organization's client types, the same function its own approval-line editor\n * and list use, so the two wire spellings of the enum are handled in one place. The approval line\n * answers rather than ActivityApproval.participation, matching what the server refuses on\n * (isReferenceOrder in approval-line.ts): the line decides who comes next, so letting the row\n * decide who may judge would leave two authorities with nothing to settle a disagreement.\n *\n * The value comes back false while the query is still out. That is the same answer as for an\n * approver, so the buttons show for a moment on a reference's screen — pressing one is refused by\n * the server, which is why the server closed first.\n */\n get isReference(): boolean {\n const approvalLine = this.activityThread?.activityInstance?.approvalLine\n const order = Number(this.activityApproval?.order ?? 0)\n\n return isReferenceStep(approvalLine?.[order - 1])\n }\n\n get context() { const judgment = this.activityApproval?.judgment\n\n return { title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n /*\n * 이 화면은 메뉴에 없다 — 「내 결재함」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬\n * 항목이 없고, 표시가 사라져 들어온 사람이 자기가 어디에 있는지 잃는다.\n *\n * 어느 목록에서 열리는지는 이 화면이 안다. 그것을 적어 둔다.\n */\n menu: 'approval-pending-list',\n /*\n * A reference is offered neither approve nor reject.\n *\n * ActivityApprovalJudgment has carried Closed for this seat from the start — \"the case ended\"\n * rather than a judgment — so a reference row was never meant to end in approved or rejected.\n * The buttons were offered anyway, and the server accepted them until 2026-09-09.\n *\n * What stays is the note, because a comment is the whole point of the seat, and close. The\n * hint under the textarea says which seat this is; buttons that simply vanish leave the\n * reader looking for them.\n */\n actions: judgment\n ? [\n { title: i18next.t('button.close'),\n action: () => { history.back()\n },\n ...CommonButtonStyles.back\n }\n ]\n : this.isReference\n ? [\n {\n title: i18next.t('button.save-note'),\n action: this.saveActivityApproval.bind(this),\n icon: 'edit_note',\n emphasis: { raised: true, outlined: false, dense: false, danger: false }\n },\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back,\n icon: 'close'\n }\n ]\n : /*\n * ── 세 단추의 순서와 무게 (2026-09-06) ──────────────────────────\n * 전에는 반려가 첫 자리였고, 승인 · 반려 · 저장이 모두 같은 모양이었다. 되돌리기 어려운\n * 것이 앞에 서고 무엇이 주된 흐름인지 화면이 말하지 않았다.\n *\n * 승인이 주 동작이다 — 채운 단추 하나. 반려는 대등한 선택이지만 예외 경로라 테두리\n * 단추로 그 옆에 둔다.\n *\n * 「저장」은 이름이 뜻을 말하지 않았다. 이 단추가 저장하는 것은 **의견 하나**이고\n * (saveActivityApproval 은 id 와 comment 만 보낸다), 판단은 미뤄 둔다. 그리고 그 결과는\n * 목록에서 「메모 있음」 표식으로 나타난다(activity-cells 의 approvalMarks). 목록이\n * 부르는 이름과 같은 낱말로 맞춘다.\n */\n [\n { title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n icon: 'approval',\n emphasis: { raised: true,\n outlined: false,\n dense: false,\n danger: false\n }\n },\n\n { title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n icon: 'assignment_return',\n emphasis: { raised: false,\n outlined: true,\n dense: false,\n danger: false\n }\n },\n\n { title: i18next.t('button.save-note'),\n action: this.saveActivityApproval.bind(this),\n icon: 'edit_note',\n emphasis: { raised: false,\n outlined: true,\n dense: false,\n danger: false\n }\n },\n { title: i18next.t('button.close'),\n action: () => { history.back()\n },\n ...CommonButtonStyles.back,\n icon: 'close'\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() { if (!this.activityThread) {\n return this.loaded\n ? html`<div empty>\n <span class=\"title\">${i18next.t('text.no activity thread info')}</span>\n <span class=\"why\">${i18next.t('text.no-activity-thread-why')}</span>\n </div>`\n : nothing\n }\n\n const { terminatedAt } = this.activityApproval\n const editable = !terminatedAt\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <!--\n 보일 항목이 하나도 없으면 타임라인을 편다 — 그때는 화면이 「아래 타임라인의 상신 사유와\n 이력을 보고 판단하세요」로 여기를 가리키므로, 접혀 있으면 그 안내가 거짓말이 된다.\n -->\n <activity-thread-timeline\n .activityThread=${this.activityThread}\n ?open=${!this.hasFields()}\n short-form\n ></activity-thread-timeline>\n ${editable\n ? html`\n <div comment>\n <section>\n <h2>${i18next.t('field.wl-comment')}</h2>\n <textarea\n placeholder=${String(\n i18next.t(\n this.isReference\n ? 'text.write-your-comment-as-reference'\n : 'text.explain the reason for approval/rejection'\n )\n )}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\n <!--\n 반려는 의견이 필수다(rejectActivityApproval). 전에는 그 규칙을 **누른 뒤에** 토스트로\n 알렸다. 되돌릴 수 없는 것과 뜻이 다른 동작은 하기 전에 말한다.\n\n A reference reads a different line: this one names the seat, because the approve\n and reject buttons are absent for them and a reader whose buttons are missing\n goes looking for them.\n -->\n <p class=\"hint\">\n ${i18next.t(this.isReference ? 'text.reference-comment-hint' : 'text.approval-comment-hint')}\n </p>\n </section>\n </div>\n `\n : nothing}\n `\n }\n\n /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */\n hasFields(): boolean {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return inputSpecOf(model).length > 0 || outputSpecOf(model).length > 0\n }\n\n activityContent() { switch (this.activityThread?.activityInstance?.viewType) { case 'template':\n return this.hostedContent(this.templateContent())\n case 'generated':\n return this.generatedContent()\n /* board 는 전체 화면을 쓰는 캔버스라 카드에 담지 않는다(hostedContent 머리말). */\n case 'board':\n return this.boardContent()\n case 'custom-element': {\n /*\n * The wrapper is for the element, not for the notice.\n *\n * hostedContent puts the content in a card so every ui type sits at the same place with the\n * same frame. The not-loaded notice is already a card — wrapping it drew a card inside a\n * card, two borders deep, and its margins landed unevenly: 16 above and none below, inside\n * a box that had its own padding. The generated branch returns the same notice unwrapped\n * and looks right.\n */\n const { viewSource: tagName } = this.activityThread?.activityInstance || {}\n\n /*\n * Naming no element is not the same as naming one that is missing.\n *\n * A template that stops providing a screen clears the field — installActivity does not\n * blank what a template leaves undefined, so clearing is written as an empty string. That\n * left viewType saying custom-element with nothing named, and this branch answered \"the\n * screen could not be loaded\": a failure, for an activity that simply has no screen of its\n * own. Those read as different things to whoever is approving, and the second one is not\n * true.\n *\n * With nothing named, the generated screen is what this activity has — and it draws a\n * decision when the activity declares one, which the two plant forms that hit this do.\n */\n if (!tagName) {\n return this.generatedContent()\n }\n\n const element = this.customElementContent()\n\n return element ? this.hostedContent(element) : this.screenNotLoaded()\n }\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n /**\n * 화면 종류가 달라도 **같은 자리에 같은 모양으로 놓인다.**\n *\n * worklist 는 네 가지로 내용을 그린다(generated · custom-element · template · board). 그중\n * generated 만 절 카드 안에 있었고 나머지 셋은 면 위에 맨몸으로 놓였다. 그래서 같은 결재 화면이\n * 액티비티에 따라 카드였다가 아니었다가 했다 — 아래의 타임라인 · 의견은 늘 카드라 위계도 어긋났다.\n *\n * board 는 뺀다. 전체 폭 · 전체 높이를 쓰는 캔버스라 카드 안에 넣으면 여백이 두 겹이 되고 크기가\n * 어긋난다.\n *\n * 카드는 여백을 두지 않는다(padding: 0). 안에 들어오는 것이 자기 조판을 갖고 있고, 두 겹으로\n * 주면 안쪽 내용이 카드 가운데로 밀린다.\n */\n hostedContent(content: unknown) {\n return html`<section hosted>${content}</section>`\n }\n\n templateContent() { if (!this.activityApproval) { return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n /**\n * 결재자가 보는 내용 — **전부 읽기 전용이다.**\n *\n * 전에는 「Output」 절을 편집기로 그리고 변경을 activityApproval.output 에 적었다. 그런데\n * approveActivityApproval / rejectActivityApproval 은 id 와 comment 만 보낸다 — 그 값은 어디에도\n * 가지 않는다. 결재자가 적을 수 있는 것은 의견 하나이고, 그것은 화면 아래 칸이 받는다.\n */\n /**\n * The decision the activity declared, or nothing when it declared none.\n *\n * Returning nothing is how generatedContent 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 — plant hit that with its `policy` value — and an empty\n * bar on the screen would read as \"there is no reason\" when the truth is that this record has no\n * such value. What cannot be shown is left out; what is shown is only what the payload actually\n * 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 */\n decisionContent() {\n const { activityInstance } = this.activityThread || {}\n const slots = decisionSlots(activityInstance?.activity?.decisionKeys, activityInstance?.input)\n\n if (!slots.length) {\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 policy = slotOfRole(slots, 'policy')\n const evidence = slotsOfRole(slots, 'evidence').filter(slot => slot.found)\n const currentState = slotOfRole(slots, 'currentState')\n const reversibility = slotOfRole(slots, 'reversibility')\n\n const drawable =\n [headline, subject, policy, currentState].some(slot => slot?.found) ||\n !!reason ||\n consequences.length ||\n evidence.length ||\n reversibilityOf(reversibility) !== undefined\n\n /*\n * Every declared slot missed this payload. Saying so is not this screen's job — falling back to\n * the model at least shows the values that are there, and the reader is no worse off than before\n * the declaration existed.\n */\n if (!drawable) {\n return nothing\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <section decision>\n ${headline?.found ? html`<div class=\"headline\">${this.slotText(headline)}</div>` : ''}\n ${subject?.found ? html`<div class=\"subject\">${this.slotText(subject)}</div>` : ''}\n ${reason\n ? html`\n <div class=\"block\">\n <div class=\"label\">${i18next.t('field.reason')}</div>\n <div class=\"said ${this.hasWords(reason) ? '' : 'none'}\">\n ${this.hasWords(reason) ? this.slotText(reason) : i18next.t('text.no-reason-given')}\n </div>\n </div>\n `\n : ''}\n ${this.renderReversibility(reversibility)}\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 ${slot.tKey ? html`<div class=\"label\">${i18next.t(slot.tKey)}</div>` : ''}\n <div>${fieldValue(slot.value)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''}\n ${currentState?.found\n ? html`\n <div class=\"current-state\">\n <div class=\"label\">${i18next.t(currentState.tKey || 'label.current-state')}</div>\n <div>${fieldValue(currentState.value)}</div>\n </div>\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 ${slot.tKey ? html`<div class=\"label\">${i18next.t(slot.tKey)}</div>` : ''}\n <div>${fieldValue(slot.value)}</div>\n </div>\n `\n )}\n </div>\n `\n : ''}\n ${policy?.found\n ? html`\n <div class=\"policy\">\n ${i18next.t('label.why-approval')} — ${this.slotText(policy)}\n </div>\n `\n : ''}\n </section>\n `\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 */\n private 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(\n `[worklist] reversibility at \"${slot?.inputPath}\" is not { reversible, caveat } — nothing drawn`\n )\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.reversible ? 'undo' : 'lock'}</md-icon>\n <span\n >${said.caveat ||\n i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</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 private slotText(slot: DecisionSlot): unknown {\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 /** Did a person actually write something here. Whitespace is not words. */\n private hasWords(slot: DecisionSlot): boolean {\n return typeof slot.value === 'string' ? slot.value.trim().length > 0 : slot.found && slot.value != null\n }\n\n generatedContent(): DirectiveResult { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread || {}\n const { input } = activityInstance || {}\n\n /*\n * The declaration goes first. It answers \"what happens if I approve\", which is the question this\n * screen exists for; the model answers \"what are the values\", which is the fallback.\n */\n const decision = this.decisionContent()\n\n if (decision !== nothing) {\n return decision as DirectiveResult\n }\n\n const model = activityInstance?.activity?.model\n const inputSpec = inputSpecOf(model)\n const outputSpec = outputSpecOf(model)\n\n /*\n * **결재 화면에서 내용이 비어 있는 것은 경고다.**\n *\n * 업무 상세라면 「적을 것이 없다」로 끝난다. 여기서는 다르다 — 무엇을 승인하는지 모르는 채로\n * 승인 · 반려 버튼이 그대로 눌린다. 그 사실을 화면이 말하고, 대신 무엇을 보고 판단할지 알려\n * 준다(타임라인의 상신 사유).\n */\n if (!inputSpec.length && !outputSpec.length) {\n return keyed(\n this.activityApproval.id,\n html`<section empty>\n <span class=\"title\">${i18next.t('text.no-approval-content')}</span>\n <span class=\"why\">${i18next.t('text.no-approval-content-why')}</span>\n </section>`\n )\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n ${inputSpec.length\n ? html`\n <section readonly>\n <h2>${i18next.t('label.activity-input')}</h2>\n ${renderGiven(inputSpec, input)}\n </section>\n `\n : ''}\n ${outputSpec.length\n ? html`\n <section readonly>\n <h2>${i18next.t('field.artifact')}</h2>\n ${renderGiven(outputSpec, output)}\n </section>\n `\n : ''}\n `\n )\n }\n\n boardContent(): DirectiveResult { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) { this.board = { id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n /**\n * The element the activity names, or a plain statement that it could not be loaded.\n *\n * document.createElement answers something for any name, so an activity pointing at an element\n * nobody registered used to produce an empty card. The approver got a screen with nothing on it\n * and the approve button still worked — plant shipped two such forms in one day and found them by\n * reading the file list, not by opening the screen.\n *\n * The reader is told what to judge by instead. Same shape as the empty generated screen: what is\n * missing, and where to look — the submission reason and the history in the timeline below.\n *\n * ── Waiting for a late definition ─────────────────────────────────────────\n * An element can be registered after this page renders, and answering \"not loaded\" forever in\n * that case would be a screen inventing a defect. whenDefined resolves whenever it arrives and\n * the page redraws; a name nobody ever registers simply never resolves, and the statement stands.\n */\n customElementContent() { if (!this.activityApproval) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n if (!customElements.get(tagName)) {\n customElements.whenDefined(tagName).then(() => this.requestUpdate())\n\n /* The caller draws the notice — unwrapped, because the notice is its own card. */\n return undefined\n }\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n /** The activity names a screen and nothing registered it. Says what to judge by instead. */\n private screenNotLoaded() {\n return html`<section empty>\n <span class=\"title\">${i18next.t('text.approval-view-not-loaded')}</span>\n <span class=\"why\">${i18next.t('text.no-approval-content-why')}</span>\n </section>`\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() { const outputSpec = outputSpecOf(this.activityThread?.activityInstance?.activity?.model)\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => { output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n /**\n * 화면이 열리면 **의견 칸에 캐럿을 둔다.**\n *\n * 결재자가 이 화면에서 적는 것은 의견 하나다. 나머지는 전부 읽는 것이고, 판단은 아래 버튼이\n * 받는다. 그러면 열자마자 커서가 있어야 하는 자리는 하나뿐이다.\n *\n * 조건 둘을 지킨다.\n *\n * 활성 탭일 때만 MDI 라 뒤에 있는 탭이 응답을 받으면 앞 탭의 입력을 빼앗는다\n * 한 건에 한 번 갱신마다 focus 를 부르면 사용자가 옮긴 커서를 계속 되돌린다\n *\n * preventScroll 을 준다 — 화면을 아래로 끌어내리면 정작 무엇을 승인하는지가 위로 사라진다.\n */\n private focusedFor?: string\n\n private focusComment() {\n const id = this.activityApproval?.id\n\n if (!id || !this.active || this.activityApproval?.terminatedAt || this.focusedFor === id) {\n return\n }\n\n this.commentInput?.focus({ preventScroll: true })\n this.focusedFor = id\n }\n\n updated(changes) { if (changes.has('activityApproval')) { this.updateContext()\n this.focusComment()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) { if (this.active && lifecycle.resourceId) { this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) { const response = await client.query({ query: gql`\n query activityApproval($id: String!) { activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.loaded = true\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() { var { id, comment } = this.activityApproval\n\n if (!comment) { document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String!) { rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n }))\n\n if (outcome.ok) { this.activityApproval = outcome.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() { var { id, comment } = this.activityApproval\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String) { approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n }))\n\n if (outcome.ok) { this.activityApproval = outcome.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() { var { id, comment } = this.activityApproval\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $comment: String) { saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: { id,\n comment\n }\n }))\n\n if (outcome.ok) { this.activityApproval = outcome.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}