@things-factory/worklist 10.1.27 → 10.1.28

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 (64) hide show
  1. package/approval-walk/harness.mjs +255 -0
  2. package/dist-client/pages/activity/activity-list-page.js +6 -11
  3. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  4. package/dist-client/pages/activity/activity-page.d.ts +6 -0
  5. package/dist-client/pages/activity/activity-page.js +171 -131
  6. package/dist-client/pages/activity/activity-page.js.map +1 -1
  7. package/dist-client/pages/activity/starter-list-page.js +6 -11
  8. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  9. package/dist-client/pages/activity-approval/activity-approval-list-page.js +6 -11
  10. package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
  11. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +7 -2
  12. package/dist-client/pages/activity-approval/activity-approval-page.js +146 -138
  13. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  14. package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +5 -0
  15. package/dist-client/pages/activity-catalog/activity-catalog-page.js +38 -32
  16. package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
  17. package/dist-client/pages/activity-instance/activity-instance-list-page.js +79 -105
  18. package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
  19. package/dist-client/pages/activity-instance/activity-instance-search-page.js +3 -6
  20. package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
  21. package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +6 -0
  22. package/dist-client/pages/activity-instance/activity-instance-start-page.js +216 -157
  23. package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
  24. package/dist-client/pages/activity-stats/activity-stats-list-page.js +6 -11
  25. package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
  26. package/dist-client/pages/activity-store/activity-store-page.js +4 -11
  27. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
  28. package/dist-client/pages/activity-supervisor/reporter-list-page.js +6 -11
  29. package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
  30. package/dist-client/pages/activity-template/activity-template-list-page.js +6 -11
  31. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
  32. package/dist-client/pages/activity-thread/activity-thread-list-page.js +6 -11
  33. package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
  34. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +6 -2
  35. package/dist-client/pages/activity-thread/activity-thread-page.js +96 -82
  36. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  37. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +6 -2
  38. package/dist-client/pages/activity-thread/activity-thread-view-page.js +53 -23
  39. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  40. package/dist-client/pages/installable-activity/installable-activity-list-page.js +6 -11
  41. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  42. package/dist-client/pages/todo/approval-done-list-page.js +6 -11
  43. package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
  44. package/dist-client/pages/todo/approval-pending-list-page.js +4 -12
  45. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
  46. package/dist-client/pages/todo/done-list-calendar-page.js +4 -5
  47. package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
  48. package/dist-client/pages/todo/done-list-page.js +6 -11
  49. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  50. package/dist-client/pages/todo/draft-list-page.js +6 -11
  51. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  52. package/dist-client/pages/todo/pickable-list-page.js +6 -11
  53. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  54. package/dist-client/pages/todo/todo-list-page.js +4 -11
  55. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  56. package/dist-client/tsconfig.tsbuildinfo +1 -1
  57. package/dist-server/service/activity/decision-key-declaration.d.ts +11 -2
  58. package/dist-server/service/activity/decision-key-declaration.js +22 -1
  59. package/dist-server/service/activity/decision-key-declaration.js.map +1 -1
  60. package/dist-server/service/installable-activity/installable-activity-query.d.ts +11 -0
  61. package/dist-server/service/installable-activity/installable-activity-query.js +31 -0
  62. package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -1
  63. package/dist-server/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +10 -11
@@ -11,7 +11,7 @@ import { i18next, localize } from '@operato/i18n';
11
11
  import { ranMutation } from '../../components/say-outcome.js';
12
12
  import { notify, openPopup } from '@operato/layout';
13
13
  import { PageView } from '@operato/shell';
14
- import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
14
+ import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
15
15
  import { isMobileDevice } from '@operato/utils';
16
16
  let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18next)(PageView) {
17
17
  constructor() {
@@ -19,20 +19,15 @@ let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18ne
19
19
  this.mode = isMobileDevice() ? 'LIST' : 'GRID';
20
20
  }
21
21
  static { this.styles = [
22
+ /* The work surface frame for a list screen (ADR-0060 decision 8). */
23
+ WorkSurfacePageStyles,
22
24
  ScrollbarStyles,
23
25
  CommonHeaderStyles,
24
26
  css `
25
- :host { display: flex;
26
-
27
- width: 100%;
28
-
27
+ :host {
29
28
  --grid-record-emphasized-background-color: #8b0000;
30
29
  --grid-record-emphasized-color: #ff6b6b;
31
- }
32
-
33
- ox-grist { overflow-y: auto;
34
- flex: 1;
35
- }
30
+ }
36
31
  `
37
32
  ]; }
38
33
  get context() {
@@ -65,7 +60,7 @@ let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18ne
65
60
  render() {
66
61
  const mode = this.mode;
67
62
  return html `
68
- <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
63
+ <ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
69
64
  <div slot="headroom" class="header">
70
65
  <div class="filters">
71
66
  <ox-filters-form autofocus without-search></ox-filters-form>
@@ -1 +1 @@
1
- {"version":3,"file":"activity-thread-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,+BAA+B,CAAA;AAEtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,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,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGxC,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAAhE;;QAmBuB,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IA4MjG,CAAC;aA/NkF,WAAM,GAAG;QACxF,eAAe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e,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QAC9B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC;SACtD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QACrD,CAAC,CAAA;IACD,CAAC;;AA5M4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAoE;AAE5E;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;qDAAA;AArBzB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA+NlC","sourcesContent":["import '@operato/data-grist'\nimport './activity-thread-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { OxPrompt } from '@operato/popup'\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 { PageView } from '@operato/shell'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('activity-thread-list-page')\nexport class ActivityThreadListPage extends localize(i18next)(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 @property({ type: Object }) gristConfig?: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'LIST' : 'GRID'\n\n @query('ox-grist') grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity thread 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-thread-list-page',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityThread.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity thread 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\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 <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) { 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, lifecycle) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityThreads(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 _deleteActivityThread() { if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) { 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!]!) { deleteActivityThreads(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 _updateActivityThread() { let patches = this.grist?.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n ;(patchField as any).cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($patches: [ActivityThreadPatch!]!) { updateMultipleActivityThread(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(activityThread => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityThread[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-thread-importer\n .activityThreads=${records}\n @imported=${() => { history.back()\n this.grist?.fetch()\n }}\n ></activity-thread-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-thread')\n }\n )\n\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-thread-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,+BAA+B,CAAA;AAEtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,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,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAChH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGxC,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAAhE;;QA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AAC,CAAC,CAAA;IACF,CAAC;IAEA,KAAK,CAAC,aAAa,CAAC,OAAO;QAAQ,MAAM,KAAK,GAAG,SAAS,CACtD,IAAI,CAAA;;6BAEmB,OAAO;sBACd,GAAG,EAAE;YAAe,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QAC9B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC;SACtD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QACrD,CAAC,CAAA;IACD,CAAC;;AA5M4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAoE;AAE5E;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;qDAAA;AAhBzB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA0NlC","sourcesContent":["import '@operato/data-grist'\nimport './activity-thread-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { OxPrompt } from '@operato/popup'\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 { PageView } from '@operato/shell'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('activity-thread-list-page')\nexport class ActivityThreadListPage extends localize(i18next)(PageView) { static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig?: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'LIST' : 'GRID'\n\n @query('ox-grist') grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity thread 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-thread-list-page',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityThread.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity thread 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\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) { 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, lifecycle) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityThreads(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 _deleteActivityThread() { if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) { 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!]!) { deleteActivityThreads(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 _updateActivityThread() { let patches = this.grist?.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n ;(patchField as any).cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($patches: [ActivityThreadPatch!]!) { updateMultipleActivityThread(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(activityThread => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityThread[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-thread-importer\n .activityThreads=${records}\n @imported=${() => { history.back()\n this.grist?.fetch()\n }}\n ></activity-thread-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-thread')\n }\n )\n\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
+ import '@operato/list-state/ox-page-state.js';
1
2
  import '@operato/property-editor/ox-properties-dynamic-view.js';
2
3
  import '@operato/board/ox-board-viewer.js';
3
4
  import '../../components/activity-thread-ribon.js';
4
5
  import '../../components/activity-thread-timeline.js';
5
- import { nothing } from 'lit';
6
6
  import { DirectiveResult } from 'lit-html/directive.js';
7
7
  import { PageView } from '@operato/shell';
8
8
  export declare const ActivityThreadStatus: {
@@ -28,6 +28,9 @@ export declare class ActivityThreadPage extends ActivityThreadPage_base {
28
28
  * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.
29
29
  */
30
30
  loaded: boolean;
31
+ /** Why the task could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */
32
+ loadError: unknown;
33
+ private lastId?;
31
34
  board: any;
32
35
  get context(): {
33
36
  title: any;
@@ -45,7 +48,8 @@ export declare class ActivityThreadPage extends ActivityThreadPage_base {
45
48
  action: () => void;
46
49
  })[];
47
50
  };
48
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
51
+ render(): import("lit-html").TemplateResult<1>;
52
+ private renderThread;
49
53
  /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */
50
54
  hasFields(): boolean;
51
55
  activityContent(): DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -1,4 +1,5 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
+ import '@operato/list-state/ox-page-state.js';
2
3
  import '@operato/property-editor/ox-properties-dynamic-view.js';
3
4
  import '@operato/board/ox-board-viewer.js';
4
5
  import '../../components/activity-thread-ribon.js';
@@ -12,7 +13,7 @@ import { client } from '@operato/graphql';
12
13
  import { i18next, localize } from '@operato/i18n';
13
14
  import { ranMutation } from '../../components/say-outcome.js';
14
15
  import { PageView } from '@operato/shell';
15
- import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles';
16
+ import { CommonButtonStyles, DocumentPageStyles, ScrollbarStyles } from '@operato/styles';
16
17
  import { provider } from '@operato/board/board-provider.js';
17
18
  import { ActivityFieldsStyles, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js';
18
19
  const ActivityThreadFetchResult = `\
@@ -84,7 +85,8 @@ const ActivityThreadFetchResult = `\
84
85
  createdAt
85
86
  }
86
87
  }`;
87
- export const ActivityThreadStatus = { Unassigned: 'unassigned',
88
+ export const ActivityThreadStatus = {
89
+ Unassigned: 'unassigned',
88
90
  Assigned: 'assigned',
89
91
  Started: 'started',
90
92
  Delegated: 'delegated',
@@ -105,18 +107,16 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
105
107
  * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.
106
108
  */
107
109
  this.loaded = false;
110
+ /** Why the task could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */
111
+ this.loadError = null;
108
112
  }
109
113
  static { this.styles = [
114
+ /* The frame owns the page shell and the reading column (ADR-0060 decision 8). */
115
+ DocumentPageStyles,
110
116
  ScrollbarStyles,
111
117
  ActivityFieldsStyles,
112
118
  css `
113
119
  :host {
114
- display: flex;
115
- flex-direction: column;
116
-
117
- width: 100%;
118
- overflow: auto;
119
- background: var(--ui-bg, #f0f2f4);
120
120
  color: var(--ui-ink, #17242c);
121
121
  font-size: var(--ui-t-body, 13px);
122
122
  }
@@ -164,7 +164,8 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
164
164
  const submittable = savable;
165
165
  // const delegatable = savable
166
166
  // const abortable = savable
167
- return { title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
167
+ return {
168
+ title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
168
169
  help: 'worklist/activity-thread-page',
169
170
  /*
170
171
  * 이 화면은 메뉴에 없다 — 「할 일」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬
@@ -174,11 +175,13 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
174
175
  */
175
176
  menu: 'todo-list',
176
177
  actions: [
177
- savable && { title: i18next.t('button.save'),
178
+ savable && {
179
+ title: i18next.t('button.save'),
178
180
  action: this._saveActivityThread.bind(this),
179
181
  ...CommonButtonStyles.save
180
182
  },
181
- submittable && { title: i18next.t('button.submit'),
183
+ submittable && {
184
+ title: i18next.t('button.submit'),
182
185
  action: this._submitActivityThread.bind(this),
183
186
  ...CommonButtonStyles.submit
184
187
  },
@@ -190,11 +193,13 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
190
193
  // action: this._abortActivityThread.bind(this),
191
194
  // ...CommonButtonStyles.cancel
192
195
  // },
193
- restartable && { title: i18next.t('button.restart'),
196
+ restartable && {
197
+ title: i18next.t('button.restart'),
194
198
  action: this._restartActivityThread.bind(this),
195
199
  ...CommonButtonStyles.save
196
200
  },
197
- { title: i18next.t('button.close'),
201
+ {
202
+ title: i18next.t('button.close'),
198
203
  action: () => {
199
204
  history.back();
200
205
  },
@@ -206,14 +211,24 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
206
211
  }
207
212
  render() {
208
213
  const activityThread = this.activityThread;
209
- if (!activityThread) {
210
- return this.loaded
214
+ /* Reading and failing both drew nothing at all, so a failure looked like an empty screen. */
215
+ return html `<div class="page">
216
+ <ox-page-state
217
+ .loading=${!this.loaded && !this.loadError}
218
+ .error=${this.loadError}
219
+ @retry=${() => this.lastId && this.fetchActivityThread(this.lastId)}
220
+ >${!activityThread
221
+ ? this.loaded
211
222
  ? html `<div empty>
212
- <span class="title">${i18next.t('text.no activity thread info')}</span>
213
- <span class="why">${i18next.t('text.no-activity-thread-why')}</span>
214
- </div>`
215
- : nothing;
216
- }
223
+ <span class="title">${i18next.t('text.no activity thread info')}</span>
224
+ <span class="why">${i18next.t('text.no-activity-thread-why')}</span>
225
+ </div>`
226
+ : nothing
227
+ : this.renderThread(activityThread)}</ox-page-state
228
+ >
229
+ </div>`;
230
+ }
231
+ renderThread(activityThread) {
217
232
  return html `
218
233
  <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
219
234
  ${this.activityContent()}
@@ -309,24 +324,24 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
309
324
  return keyed(this.activityThread?.id, html `
310
325
  ${inputSpec.length
311
326
  ? html `
312
- <section readonly>
313
- <h2>${i18next.t('label.activity-input')}</h2>
314
- ${renderGiven(inputSpec, input)}
315
- </section>
316
- `
327
+ <section readonly>
328
+ <h2>${i18next.t('label.activity-input')}</h2>
329
+ ${renderGiven(inputSpec, input)}
330
+ </section>
331
+ `
317
332
  : ''}
318
333
  ${outputSpec.length
319
334
  ? html `
320
- <section>
321
- <h2>${i18next.t('field.artifact')}</h2>
322
- <ox-properties-dynamic-view
323
- data-name="output"
324
- .props=${outputSpec}
325
- .value=${output}
326
- @property-change=${e => (this.activityThread.output = e.currentTarget.value)}
327
- ></ox-properties-dynamic-view>
328
- </section>
329
- `
335
+ <section>
336
+ <h2>${i18next.t('field.artifact')}</h2>
337
+ <ox-properties-dynamic-view
338
+ data-name="output"
339
+ .props=${outputSpec}
340
+ .value=${output}
341
+ @property-change=${e => (this.activityThread.output = e.currentTarget.value)}
342
+ ></ox-properties-dynamic-view>
343
+ </section>
344
+ `
330
345
  : ''}
331
346
  `);
332
347
  }
@@ -337,8 +352,7 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
337
352
  const { output, activityInstance } = this.activityThread;
338
353
  const { uiSource: boardId, input } = activityInstance || {};
339
354
  if (!this.board || this.board.id !== boardId) {
340
- this.board = { id: boardId
341
- };
355
+ this.board = { id: boardId };
342
356
  }
343
357
  /*
344
358
  ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,
@@ -392,13 +406,28 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
392
406
  }
393
407
  }
394
408
  async fetchActivityThread(id) {
395
- const response = await client.query({ query: gql `
409
+ this.lastId = id;
410
+ this.loadError = null;
411
+ let response;
412
+ try {
413
+ response = await client.query({
414
+ query: gql `
396
415
  query activityThread($id: String!) { activityThread(id: $id) ${ActivityThreadFetchResult}
397
416
  }
398
417
  `,
399
- variables: { id
400
- }
401
- });
418
+ variables: { id }
419
+ });
420
+ }
421
+ catch (error) {
422
+ this.loadError = error;
423
+ return;
424
+ }
425
+ if (response.errors?.length || !response.data) {
426
+ this.loadError = response.errors?.length
427
+ ? response.errors
428
+ : new Error(i18next.t('error.activity-thread not found', { activityThread: id }));
429
+ return;
430
+ }
402
431
  this.activityThread = response.data.activityThread;
403
432
  this.loaded = true;
404
433
  this.updateContext();
@@ -409,19 +438,16 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
409
438
  if (uiType === 'board') {
410
439
  output = this.getOutputFromBoard();
411
440
  }
412
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
441
+ const outcome = await ranMutation(() => client.mutate({
442
+ mutation: gql `
413
443
  mutation ($id: String!, $output: Object) { startActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}
414
444
  }
415
445
  `,
416
- variables: { id,
417
- output
418
- }
446
+ variables: { id, output }
419
447
  }));
420
448
  if (outcome.ok) {
421
449
  this.activityThread = outcome.data.startActivityThread;
422
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully')
423
- }
424
- }));
450
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully') } }));
425
451
  }
426
452
  }
427
453
  async _restartActivityThread() {
@@ -430,19 +456,16 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
430
456
  if (uiType === 'board') {
431
457
  output = this.getOutputFromBoard();
432
458
  }
433
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
459
+ const outcome = await ranMutation(() => client.mutate({
460
+ mutation: gql `
434
461
  mutation ($id: String!, $output: Object) { restartActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}
435
462
  }
436
463
  `,
437
- variables: { id,
438
- output
439
- }
464
+ variables: { id, output }
440
465
  }));
441
466
  if (outcome.ok) {
442
467
  this.activityThread = outcome.data.restartActivityThread;
443
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully')
444
- }
445
- }));
468
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully') } }));
446
469
  }
447
470
  }
448
471
  async _delegateActivityThread() {
@@ -454,22 +477,17 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
454
477
  if (uiType === 'board') {
455
478
  output = this.getOutputFromBoard();
456
479
  }
457
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
480
+ const outcome = await ranMutation(() => client.mutate({
481
+ mutation: gql `
458
482
  mutation ($id: String!, $save: ActivityThreadSave!) { saveActivityThread(id: $id, save: $save) ${ActivityThreadFetchResult}
459
483
  }
460
484
  `,
461
- variables: { id,
462
- save: { output
463
- }
464
- },
465
- context: { hasUpload: true
466
- }
485
+ variables: { id, save: { output } },
486
+ context: { hasUpload: true }
467
487
  }));
468
488
  if (outcome.ok) {
469
489
  this.activityThread = outcome.data.saveActivityThread;
470
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')
471
- }
472
- }));
490
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } }));
473
491
  }
474
492
  }
475
493
  async _submitActivityThread() {
@@ -478,39 +496,31 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
478
496
  if (uiType === 'board') {
479
497
  output = this.getOutputFromBoard();
480
498
  }
481
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
499
+ const outcome = await ranMutation(() => client.mutate({
500
+ mutation: gql `
482
501
  mutation ($id: String!, $output: Object, $reason: String) { submitActivityThread(id: $id, output: $output, reason: $reason) ${ActivityThreadFetchResult}
483
502
  }
484
503
  `,
485
- variables: { id,
486
- output,
487
- reason
488
- },
489
- context: { hasUpload: true
490
- }
504
+ variables: { id, output, reason },
505
+ context: { hasUpload: true }
491
506
  }));
492
507
  if (outcome.ok) {
493
508
  this.activityThread = outcome.data.submitActivityThread;
494
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully')
495
- }
496
- }));
509
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully') } }));
497
510
  }
498
511
  }
499
512
  async _abortActivityThread() {
500
513
  var { id, reason } = this.activityThread;
501
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
514
+ const outcome = await ranMutation(() => client.mutate({
515
+ mutation: gql `
502
516
  mutation ($id: String!, $reason: String) { abortActivityThread(id: $id, reason: $reason) ${ActivityThreadFetchResult}
503
517
  }
504
518
  `,
505
- variables: { id,
506
- reason
507
- }
519
+ variables: { id, reason }
508
520
  }));
509
521
  if (outcome.ok) {
510
522
  this.activityThread = outcome.data.abortActivityThread;
511
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully')
512
- }
513
- }));
523
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully') } }));
514
524
  }
515
525
  }
516
526
  };
@@ -522,6 +532,10 @@ __decorate([
522
532
  state(),
523
533
  __metadata("design:type", Object)
524
534
  ], ActivityThreadPage.prototype, "loaded", void 0);
535
+ __decorate([
536
+ state(),
537
+ __metadata("design:type", Object)
538
+ ], ActivityThreadPage.prototype, "loadError", void 0);
525
539
  __decorate([
526
540
  state(),
527
541
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"activity-thread-page.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,2CAA2C,CAAA;AAClD,OAAO,8CAA8C,CAAA;AAErD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,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,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAE3D,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,qCAAqC,CAAA;AAE5C,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YAAO,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAA;YAE7E,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAY,MAAM,EAAE,EAAc,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,oCAAoC,CAAC;iBAC1H;aACA,CAAC,CACI,CAAA;QACN,CAAC;IACD,CAAC;IAEA,KAAK,CAAC,oBAAoB;QAAS,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,CAAA;QAEzE,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAQ,QAAQ,EAAE,GAAG,CAAA;6GAC8B,yBAAyB;;OAE/H;YACD,SAAS,EAAE,EAAU,EAAE;gBACrB,MAAM;aACZ;SACA,CAAC,CAAC,CAAA;QAEA,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;YAAO,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAA;YAE5E,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAY,MAAM,EAAE,EAAc,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,mCAAmC,CAAC;iBACzH;aACA,CAAC,CACI,CAAA;QACN,CAAC;IACD,CAAC;;AAjaS;IAAR,KAAK,EAAE;;0DAAoB;AAUnB;IAAR,KAAK,EAAE;;kDAAe;AAEd;IAAR,KAAK,EAAE;;iDAAW;AAqPO;IAAzB,KAAK,CAAC,iBAAiB,CAAC;;yDAAmB;AAjTjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAkd9B","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-thread-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { 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 '@operato/board/board-provider.js'\n\nimport {\n ActivityFieldsStyles,\n inputSpecOf,\n outputSpecOf,\n renderGiven\n} from '../../components/activity-fields.js'\n\nconst ActivityThreadFetchResult = `\\\n{ id\n state\n dueAt\n assignedAt\n assignee { id\n name\n }\n updatedAt\n output\n round\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 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 uiType\n uiSource\n dueAt\n terminatedAt\n terminator { name\n email\n }\n createdAt\n }\n}`\n\nexport const ActivityThreadStatus = { Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Rejected: 'rejected',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-thread-page')\nexport class ActivityThreadPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n ActivityFieldsStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\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 @state() activityThread: any\n /**\n * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**\n *\n * 전에는 값이 없으면 곧바로 「업무활동 정보가 없습니다」를 그렸다. 그런데 이 화면은 열리자마자\n * 조회를 시작하므로, 응답이 오기 전까지 **없다고 단언하는 화면**이 보인다. 목록에서 줄을 눌러\n * 들어온 사람은 방금 본 건이 없다는 말을 먼저 읽는다.\n *\n * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.\n */\n @state() loaded = false\n\n @state() board: any\n\n get context() { const state = this.activityThread?.state\n\n const restartable = [ActivityThreadStatus.Rejected].includes(state)\n const savable = [\n ActivityThreadStatus.Unassigned,\n ActivityThreadStatus.Assigned,\n ActivityThreadStatus.Started\n ].includes(state)\n const submittable = savable\n // const delegatable = savable\n // const abortable = savable\n\n return { title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity-thread-page',\n /*\n * 이 화면은 메뉴에 없다 — 「할 일」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬\n * 항목이 없고, 표시가 사라져 들어온 사람이 자기가 어디에 있는지 잃는다.\n *\n * 어느 목록에서 열리는지는 이 화면이 안다. 그것을 적어 둔다.\n */\n menu: 'todo-list',\n actions: [\n savable && { title: i18next.t('button.save'),\n action: this._saveActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n\n submittable && { title: i18next.t('button.submit'),\n action: this._submitActivityThread.bind(this),\n ...CommonButtonStyles.submit\n },\n\n // delegatable && { // title: i18next.t('button.delegate'),\n // action: this._delegateActivityThread.bind(this),\n // ...CommonButtonStyles.save\n // },\n\n // abortable && { // title: i18next.t('button.abort'),\n // action: this._abortActivityThread.bind(this),\n // ...CommonButtonStyles.cancel\n // },\n\n restartable && { title: i18next.t('button.restart'),\n action: this._restartActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.close'),\n action: () => { history.back()\n },\n ...CommonButtonStyles.back\n }\n ].filter(Boolean /* truthy only */)\n // activityThread: this.activityThread\n }\n }\n\n render() { const activityThread = this.activityThread\n\n if (!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 return html`\n <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>\n ${this.activityContent()}\n <!--\n 보일 항목이 하나도 없으면 편다 — 그때 화면이 「이 업무는 내용을 확인하고 제출하면 끝납니다」\n 라고만 말하고 정작 확인할 것이 타임라인뿐인데, 접혀 있으면 볼 것이 아무것도 없는 화면이 된다.\n -->\n <activity-thread-timeline\n .activityThread=${activityThread}\n ?open=${!this.hasFields()}\n short-form\n ></activity-thread-timeline>\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?.uiType) { 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.activityThread) { return html``\n }\n\n const { uiSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n generatedContent(): DirectiveResult { if (!this.activityThread) { return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const model = activityInstance?.activity?.model\n const inputSpec = inputSpecOf(model)\n const outputSpec = outputSpecOf(model)\n\n if (!output) { output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((output, item) => { output[item.tag] = input[item.tag]\n return output\n }, {})\n }\n\n /*\n * **빈 절은 그리지 않는다.**\n *\n * 처분 승인 액티비티에는 `out` 항목이 하나도 없다. 그런데도 화면이 「Output」 상자를 그려서,\n * 무엇을 적어야 하는지 없는데 적는 자리처럼 보였다. 항목이 없으면 그 절이 없는 것이다.\n *\n * 둘 다 없으면 그 사실을 말한다 — 상태 ribbon 과 제출 버튼만 남은 화면은 사용자에게\n * 「덜 뜬 화면」으로 읽힌다.\n */\n if (!inputSpec.length && !outputSpec.length) {\n return keyed(\n this.activityThread?.id,\n html`<section empty>\n <span class=\"title\">${i18next.t('text.no-activity-fields')}</span>\n <span class=\"why\">${i18next.t('text.no-activity-fields-why')}</span>\n </section>`\n )\n }\n\n return keyed(\n this.activityThread?.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>\n <h2>${i18next.t('field.artifact')}</h2>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityThread.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </section>\n `\n : ''}\n `\n )\n }\n\n boardContent(): DirectiveResult { if (!this.activityThread) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { uiSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) { this.board = { id: boardId\n }\n }\n\n /* \n ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,\n 동일한 id의 보드를 다른 page에 뺏기는 경우가 있다.\n 따라서, Page가 active될 때마다 타임스탬프를 refresh key로 설정하였다.\n */\n return keyed(\n this.activityThread.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() { if (!this.activityThread) { return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { uiSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityThread = this.activityThread\n\n element.addEventListener('change', (e: CustomEvent) => { this.activityThread.output = e.detail\n })\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 updated(changes) { if (changes.has('activityThread')) { this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) { if (this.active && lifecycle.resourceId) { this.fetchActivityThread(lifecycle.resourceId)\n }\n }\n\n async fetchActivityThread(id) { const response = await client.query({ query: gql`\n query activityThread($id: String!) { activityThread(id: $id) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id\n }\n })\n\n this.activityThread = response.data.activityThread\n this.loaded = true\n\n this.updateContext()\n }\n\n async _startActivityThread() { var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance\n\n if (uiType === 'board') { output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $output: Object) { startActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id,\n output\n }\n }))\n\n if (outcome.ok) { this.activityThread = outcome.data.startActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully')\n }\n })\n )\n }\n }\n\n async _restartActivityThread() { var { id, output, activityInstance } = this.activityThread\n var { uiType } = activityInstance\n\n if (uiType === 'board') { output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $output: Object) { restartActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id,\n output\n }\n }))\n\n if (outcome.ok) { this.activityThread = outcome.data.restartActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully')\n }\n })\n )\n }\n }\n\n async _delegateActivityThread() { throw 'not implemented yet'\n }\n\n async _saveActivityThread() { var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance || {}\n\n if (uiType === 'board') { output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $save: ActivityThreadSave!) { saveActivityThread(id: $id, save: $save) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id,\n save: { output\n }\n },\n context: { hasUpload: true\n }\n }))\n\n if (outcome.ok) { this.activityThread = outcome.data.saveActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n\n async _submitActivityThread() { var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance || {}\n\n if (uiType === 'board') { output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $output: Object, $reason: String) { submitActivityThread(id: $id, output: $output, reason: $reason) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id,\n output,\n reason\n },\n context: { hasUpload: true\n }\n }))\n\n if (outcome.ok) { this.activityThread = outcome.data.submitActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully')\n }\n })\n )\n }\n }\n\n async _abortActivityThread() { var { id, reason } = this.activityThread\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($id: String!, $reason: String) { abortActivityThread(id: $id, reason: $reason) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id,\n reason\n }\n }))\n\n if (outcome.ok) { this.activityThread = outcome.data.abortActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully')\n }\n })\n )\n }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-thread-page.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-page.ts"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAA;AAC7C,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,2CAA2C,CAAA;AAClD,OAAO,8CAA8C,CAAA;AAErD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,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,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAE3D,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAElH,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEhC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS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E,EAAE,MAAM,EAAE;SAC1B,CAAC,CACH,CAAA;QAED,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;YACf,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAA;YAEtD,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,mCAAmC,CAAC,EAAE,EAAE,CAAC,CACnG,CAAA;QACH,CAAC;IACH,CAAC;;AAteQ;IAAR,KAAK,EAAE;;0DAAoB;AAUnB;IAAR,KAAK,EAAE;;kDAAe;AAEd;IAAR,KAAK,EAAE;;qDAA0B;AAGzB;IAAR,KAAK,EAAE;;iDAAW;AA0RO;IAAzB,KAAK,CAAC,iBAAiB,CAAC;;yDAAmB;AAtVjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAohB9B","sourcesContent":["import '@operato/list-state/ox-page-state.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-thread-ribon.js'\nimport '../../components/activity-thread-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { DirectiveResult } from 'lit-html/directive.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, DocumentPageStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@operato/board/board-provider.js'\n\nimport { ActivityFieldsStyles, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js'\n\nconst ActivityThreadFetchResult = `\\\n{ id\n state\n dueAt\n assignedAt\n assignee { id\n name\n }\n updatedAt\n output\n round\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 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 uiType\n uiSource\n dueAt\n terminatedAt\n terminator { name\n email\n }\n createdAt\n }\n}`\n\nexport const ActivityThreadStatus = {\n Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Rejected: 'rejected',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-thread-page')\nexport class ActivityThreadPage extends localize(i18next)(PageView) {\n static styles = [\n /* The frame owns the page shell and the reading column (ADR-0060 decision 8). */\n DocumentPageStyles,\n ScrollbarStyles,\n ActivityFieldsStyles,\n css`\n :host {\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 @state() activityThread: any\n /**\n * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**\n *\n * 전에는 값이 없으면 곧바로 「업무활동 정보가 없습니다」를 그렸다. 그런데 이 화면은 열리자마자\n * 조회를 시작하므로, 응답이 오기 전까지 **없다고 단언하는 화면**이 보인다. 목록에서 줄을 눌러\n * 들어온 사람은 방금 본 건이 없다는 말을 먼저 읽는다.\n *\n * 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.\n */\n @state() loaded = false\n /** Why the task could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */\n @state() loadError: unknown = null\n private lastId?: string\n\n @state() board: any\n\n get context() {\n const state = this.activityThread?.state\n\n const restartable = [ActivityThreadStatus.Rejected].includes(state)\n const savable = [\n ActivityThreadStatus.Unassigned,\n ActivityThreadStatus.Assigned,\n ActivityThreadStatus.Started\n ].includes(state)\n const submittable = savable\n // const delegatable = savable\n // const abortable = savable\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity-thread-page',\n /*\n * 이 화면은 메뉴에 없다 — 「할 일」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬\n * 항목이 없고, 표시가 사라져 들어온 사람이 자기가 어디에 있는지 잃는다.\n *\n * 어느 목록에서 열리는지는 이 화면이 안다. 그것을 적어 둔다.\n */\n menu: 'todo-list',\n actions: [\n savable && {\n title: i18next.t('button.save'),\n action: this._saveActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n\n submittable && {\n title: i18next.t('button.submit'),\n action: this._submitActivityThread.bind(this),\n ...CommonButtonStyles.submit\n },\n\n // delegatable && { // title: i18next.t('button.delegate'),\n // action: this._delegateActivityThread.bind(this),\n // ...CommonButtonStyles.save\n // },\n\n // abortable && { // title: i18next.t('button.abort'),\n // action: this._abortActivityThread.bind(this),\n // ...CommonButtonStyles.cancel\n // },\n\n restartable && {\n title: i18next.t('button.restart'),\n action: this._restartActivityThread.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.close'),\n action: () => {\n history.back()\n },\n ...CommonButtonStyles.back\n }\n ].filter(Boolean /* truthy only */)\n // activityThread: this.activityThread\n }\n }\n\n render() {\n const activityThread = this.activityThread\n\n /* Reading and failing both drew nothing at all, so a failure looked like an empty screen. */\n return html`<div class=\"page\">\n <ox-page-state\n .loading=${!this.loaded && !this.loadError}\n .error=${this.loadError}\n @retry=${() => this.lastId && this.fetchActivityThread(this.lastId)}\n >${\n !activityThread\n ? 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 : this.renderThread(activityThread)\n }</ox-page-state\n >\n </div>`\n }\n\n private renderThread(activityThread: any) {\n return html`\n <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>\n ${this.activityContent()}\n <!--\n 보일 항목이 하나도 없으면 편다 — 그때 화면이 「이 업무는 내용을 확인하고 제출하면 끝납니다」\n 라고만 말하고 정작 확인할 것이 타임라인뿐인데, 접혀 있으면 볼 것이 아무것도 없는 화면이 된다.\n -->\n <activity-thread-timeline\n .activityThread=${activityThread}\n ?open=${!this.hasFields()}\n short-form\n ></activity-thread-timeline>\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() {\n switch (this.activityThread?.activityInstance?.uiType) {\n 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() {\n if (!this.activityThread) {\n return html``\n }\n\n const { uiSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n generatedContent(): DirectiveResult {\n if (!this.activityThread) {\n return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const model = activityInstance?.activity?.model\n const inputSpec = inputSpecOf(model)\n const outputSpec = outputSpecOf(model)\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((output, item) => {\n output[item.tag] = input[item.tag]\n return output\n }, {})\n }\n\n /*\n * **빈 절은 그리지 않는다.**\n *\n * 처분 승인 액티비티에는 `out` 항목이 하나도 없다. 그런데도 화면이 「Output」 상자를 그려서,\n * 무엇을 적어야 하는지 없는데 적는 자리처럼 보였다. 항목이 없으면 그 절이 없는 것이다.\n *\n * 둘 다 없으면 그 사실을 말한다 — 상태 ribbon 과 제출 버튼만 남은 화면은 사용자에게\n * 「덜 뜬 화면」으로 읽힌다.\n */\n if (!inputSpec.length && !outputSpec.length) {\n return keyed(\n this.activityThread?.id,\n html`<section empty>\n <span class=\"title\">${i18next.t('text.no-activity-fields')}</span>\n <span class=\"why\">${i18next.t('text.no-activity-fields-why')}</span>\n </section>`\n )\n }\n\n return keyed(\n this.activityThread?.id,\n html`\n ${\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 }\n ${\n outputSpec.length\n ? html`\n <section>\n <h2>${i18next.t('field.artifact')}</h2>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityThread.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </section>\n `\n : ''\n }\n `\n )\n }\n\n boardContent(): DirectiveResult {\n if (!this.activityThread) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { uiSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) {\n this.board = { id: boardId }\n }\n\n /* \n ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,\n 동일한 id의 보드를 다른 page에 뺏기는 경우가 있다.\n 따라서, Page가 active될 때마다 타임스탬프를 refresh key로 설정하였다.\n */\n return keyed(\n this.activityThread.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityThread) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { uiSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityThread = this.activityThread\n\n element.addEventListener('change', (e: CustomEvent) => {\n this.activityThread.output = e.detail\n })\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = outputSpecOf(this.activityThread?.activityInstance?.activity?.model)\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityThread')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityThread(lifecycle.resourceId)\n }\n }\n\n async fetchActivityThread(id) {\n this.lastId = id\n this.loadError = null\n\n let response: any\n try {\n response = await client.query({\n query: gql`\n query activityThread($id: String!) { activityThread(id: $id) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id }\n })\n } catch (error) {\n this.loadError = error\n return\n }\n\n if (response.errors?.length || !response.data) {\n this.loadError = response.errors?.length\n ? response.errors\n : new Error(i18next.t('error.activity-thread not found', { activityThread: id }))\n return\n }\n\n this.activityThread = response.data.activityThread\n this.loaded = true\n\n this.updateContext()\n }\n\n async _startActivityThread() {\n var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance\n\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object) { startActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id, output }\n })\n )\n\n if (outcome.ok) {\n this.activityThread = outcome.data.startActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully') } })\n )\n }\n }\n\n async _restartActivityThread() {\n var { id, output, activityInstance } = this.activityThread\n var { uiType } = activityInstance\n\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object) { restartActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id, output }\n })\n )\n\n if (outcome.ok) {\n this.activityThread = outcome.data.restartActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully') } })\n )\n }\n }\n\n async _delegateActivityThread() {\n throw 'not implemented yet'\n }\n\n async _saveActivityThread() {\n var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance || {}\n\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $save: ActivityThreadSave!) { saveActivityThread(id: $id, save: $save) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id, save: { output } },\n context: { hasUpload: true }\n })\n )\n\n if (outcome.ok) {\n this.activityThread = outcome.data.saveActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } })\n )\n }\n }\n\n async _submitActivityThread() {\n var { id, output, reason, activityInstance } = this.activityThread\n var { uiType } = activityInstance || {}\n\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object, $reason: String) { submitActivityThread(id: $id, output: $output, reason: $reason) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id, output, reason },\n context: { hasUpload: true }\n })\n )\n\n if (outcome.ok) {\n this.activityThread = outcome.data.submitActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully') } })\n )\n }\n }\n\n async _abortActivityThread() {\n var { id, reason } = this.activityThread\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $reason: String) { abortActivityThread(id: $id, reason: $reason) ${ActivityThreadFetchResult}\n }\n `,\n variables: { id, reason }\n })\n )\n\n if (outcome.ok) {\n this.activityThread = outcome.data.abortActivityThread\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully') } })\n )\n }\n }\n}\n"]}