@things-factory/worklist 10.1.27 → 10.1.29

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 (69) 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 +173 -142
  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 +21 -4
  12. package/dist-client/pages/activity-approval/activity-approval-page.js +256 -173
  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 +6 -0
  15. package/dist-client/pages/activity-catalog/activity-catalog-page.js +43 -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 +220 -161
  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 +7 -2
  35. package/dist-client/pages/activity-thread/activity-thread-page.js +101 -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 +7 -2
  38. package/dist-client/pages/activity-thread/activity-thread-view-page.js +58 -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
  65. package/translations/en.json +27 -14
  66. package/translations/ja.json +27 -14
  67. package/translations/ko.json +27 -14
  68. package/translations/ms.json +27 -14
  69. package/translations/zh.json +27 -14
@@ -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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C,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;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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AS,OAAO,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;YACzF,CAAC;YAEI,OAAO,OAAO,CAAA;QACnB,CAAC,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,8 +28,12 @@ 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(): {
36
+ frame: string;
33
37
  title: any;
34
38
  help: string;
35
39
  menu: string;
@@ -45,7 +49,8 @@ export declare class ActivityThreadPage extends ActivityThreadPage_base {
45
49
  action: () => void;
46
50
  })[];
47
51
  };
48
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
52
+ render(): import("lit-html").TemplateResult<1>;
53
+ private renderThread;
49
54
  /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */
50
55
  hasFields(): boolean;
51
56
  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,13 @@ 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
+ /*
169
+ * 이 화면이 어떤 틀인가 — 동작 줄이 이것을 읽고 자기 오른쪽 끝을 내용에 맞춘다
170
+ * (ADR-0060 결정 9 보탬). 안 적으면 창 폭이고, 그것은 작업면의 모양이다.
171
+ */
172
+ frame: 'document',
173
+ title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
168
174
  help: 'worklist/activity-thread-page',
169
175
  /*
170
176
  * 이 화면은 메뉴에 없다 — 「할 일」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬
@@ -174,11 +180,13 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
174
180
  */
175
181
  menu: 'todo-list',
176
182
  actions: [
177
- savable && { title: i18next.t('button.save'),
183
+ savable && {
184
+ title: i18next.t('button.save'),
178
185
  action: this._saveActivityThread.bind(this),
179
186
  ...CommonButtonStyles.save
180
187
  },
181
- submittable && { title: i18next.t('button.submit'),
188
+ submittable && {
189
+ title: i18next.t('button.submit'),
182
190
  action: this._submitActivityThread.bind(this),
183
191
  ...CommonButtonStyles.submit
184
192
  },
@@ -190,11 +198,13 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
190
198
  // action: this._abortActivityThread.bind(this),
191
199
  // ...CommonButtonStyles.cancel
192
200
  // },
193
- restartable && { title: i18next.t('button.restart'),
201
+ restartable && {
202
+ title: i18next.t('button.restart'),
194
203
  action: this._restartActivityThread.bind(this),
195
204
  ...CommonButtonStyles.save
196
205
  },
197
- { title: i18next.t('button.close'),
206
+ {
207
+ title: i18next.t('button.close'),
198
208
  action: () => {
199
209
  history.back();
200
210
  },
@@ -206,14 +216,24 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
206
216
  }
207
217
  render() {
208
218
  const activityThread = this.activityThread;
209
- if (!activityThread) {
210
- return this.loaded
219
+ /* Reading and failing both drew nothing at all, so a failure looked like an empty screen. */
220
+ return html `<div class="page">
221
+ <ox-page-state
222
+ .loading=${!this.loaded && !this.loadError}
223
+ .error=${this.loadError}
224
+ @retry=${() => this.lastId && this.fetchActivityThread(this.lastId)}
225
+ >${!activityThread
226
+ ? this.loaded
211
227
  ? 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
- }
228
+ <span class="title">${i18next.t('text.no activity thread info')}</span>
229
+ <span class="why">${i18next.t('text.no-activity-thread-why')}</span>
230
+ </div>`
231
+ : nothing
232
+ : this.renderThread(activityThread)}</ox-page-state
233
+ >
234
+ </div>`;
235
+ }
236
+ renderThread(activityThread) {
217
237
  return html `
218
238
  <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
219
239
  ${this.activityContent()}
@@ -309,24 +329,24 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
309
329
  return keyed(this.activityThread?.id, html `
310
330
  ${inputSpec.length
311
331
  ? html `
312
- <section readonly>
313
- <h2>${i18next.t('label.activity-input')}</h2>
314
- ${renderGiven(inputSpec, input)}
315
- </section>
316
- `
332
+ <section readonly>
333
+ <h2>${i18next.t('label.activity-input')}</h2>
334
+ ${renderGiven(inputSpec, input)}
335
+ </section>
336
+ `
317
337
  : ''}
318
338
  ${outputSpec.length
319
339
  ? 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
- `
340
+ <section>
341
+ <h2>${i18next.t('field.artifact')}</h2>
342
+ <ox-properties-dynamic-view
343
+ data-name="output"
344
+ .props=${outputSpec}
345
+ .value=${output}
346
+ @property-change=${e => (this.activityThread.output = e.currentTarget.value)}
347
+ ></ox-properties-dynamic-view>
348
+ </section>
349
+ `
330
350
  : ''}
331
351
  `);
332
352
  }
@@ -337,8 +357,7 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
337
357
  const { output, activityInstance } = this.activityThread;
338
358
  const { uiSource: boardId, input } = activityInstance || {};
339
359
  if (!this.board || this.board.id !== boardId) {
340
- this.board = { id: boardId
341
- };
360
+ this.board = { id: boardId };
342
361
  }
343
362
  /*
344
363
  ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,
@@ -392,13 +411,28 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
392
411
  }
393
412
  }
394
413
  async fetchActivityThread(id) {
395
- const response = await client.query({ query: gql `
414
+ this.lastId = id;
415
+ this.loadError = null;
416
+ let response;
417
+ try {
418
+ response = await client.query({
419
+ query: gql `
396
420
  query activityThread($id: String!) { activityThread(id: $id) ${ActivityThreadFetchResult}
397
421
  }
398
422
  `,
399
- variables: { id
400
- }
401
- });
423
+ variables: { id }
424
+ });
425
+ }
426
+ catch (error) {
427
+ this.loadError = error;
428
+ return;
429
+ }
430
+ if (response.errors?.length || !response.data) {
431
+ this.loadError = response.errors?.length
432
+ ? response.errors
433
+ : new Error(i18next.t('error.activity-thread not found', { activityThread: id }));
434
+ return;
435
+ }
402
436
  this.activityThread = response.data.activityThread;
403
437
  this.loaded = true;
404
438
  this.updateContext();
@@ -409,19 +443,16 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
409
443
  if (uiType === 'board') {
410
444
  output = this.getOutputFromBoard();
411
445
  }
412
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
446
+ const outcome = await ranMutation(() => client.mutate({
447
+ mutation: gql `
413
448
  mutation ($id: String!, $output: Object) { startActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}
414
449
  }
415
450
  `,
416
- variables: { id,
417
- output
418
- }
451
+ variables: { id, output }
419
452
  }));
420
453
  if (outcome.ok) {
421
454
  this.activityThread = outcome.data.startActivityThread;
422
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully')
423
- }
424
- }));
455
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully') } }));
425
456
  }
426
457
  }
427
458
  async _restartActivityThread() {
@@ -430,19 +461,16 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
430
461
  if (uiType === 'board') {
431
462
  output = this.getOutputFromBoard();
432
463
  }
433
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
464
+ const outcome = await ranMutation(() => client.mutate({
465
+ mutation: gql `
434
466
  mutation ($id: String!, $output: Object) { restartActivityThread(id: $id, output: $output) ${ActivityThreadFetchResult}
435
467
  }
436
468
  `,
437
- variables: { id,
438
- output
439
- }
469
+ variables: { id, output }
440
470
  }));
441
471
  if (outcome.ok) {
442
472
  this.activityThread = outcome.data.restartActivityThread;
443
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully')
444
- }
445
- }));
473
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_restarted_successfully') } }));
446
474
  }
447
475
  }
448
476
  async _delegateActivityThread() {
@@ -454,22 +482,17 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
454
482
  if (uiType === 'board') {
455
483
  output = this.getOutputFromBoard();
456
484
  }
457
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
485
+ const outcome = await ranMutation(() => client.mutate({
486
+ mutation: gql `
458
487
  mutation ($id: String!, $save: ActivityThreadSave!) { saveActivityThread(id: $id, save: $save) ${ActivityThreadFetchResult}
459
488
  }
460
489
  `,
461
- variables: { id,
462
- save: { output
463
- }
464
- },
465
- context: { hasUpload: true
466
- }
490
+ variables: { id, save: { output } },
491
+ context: { hasUpload: true }
467
492
  }));
468
493
  if (outcome.ok) {
469
494
  this.activityThread = outcome.data.saveActivityThread;
470
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')
471
- }
472
- }));
495
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } }));
473
496
  }
474
497
  }
475
498
  async _submitActivityThread() {
@@ -478,39 +501,31 @@ let ActivityThreadPage = class ActivityThreadPage extends localize(i18next)(Page
478
501
  if (uiType === 'board') {
479
502
  output = this.getOutputFromBoard();
480
503
  }
481
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
504
+ const outcome = await ranMutation(() => client.mutate({
505
+ mutation: gql `
482
506
  mutation ($id: String!, $output: Object, $reason: String) { submitActivityThread(id: $id, output: $output, reason: $reason) ${ActivityThreadFetchResult}
483
507
  }
484
508
  `,
485
- variables: { id,
486
- output,
487
- reason
488
- },
489
- context: { hasUpload: true
490
- }
509
+ variables: { id, output, reason },
510
+ context: { hasUpload: true }
491
511
  }));
492
512
  if (outcome.ok) {
493
513
  this.activityThread = outcome.data.submitActivityThread;
494
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully')
495
- }
496
- }));
514
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully') } }));
497
515
  }
498
516
  }
499
517
  async _abortActivityThread() {
500
518
  var { id, reason } = this.activityThread;
501
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
519
+ const outcome = await ranMutation(() => client.mutate({
520
+ mutation: gql `
502
521
  mutation ($id: String!, $reason: String) { abortActivityThread(id: $id, reason: $reason) ${ActivityThreadFetchResult}
503
522
  }
504
523
  `,
505
- variables: { id,
506
- reason
507
- }
524
+ variables: { id, reason }
508
525
  }));
509
526
  if (outcome.ok) {
510
527
  this.activityThread = outcome.data.abortActivityThread;
511
- document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully')
512
- }
513
- }));
528
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_aborted_successfully') } }));
514
529
  }
515
530
  }
516
531
  };
@@ -522,6 +537,10 @@ __decorate([
522
537
  state(),
523
538
  __metadata("design:type", Object)
524
539
  ], ActivityThreadPage.prototype, "loaded", void 0);
540
+ __decorate([
541
+ state(),
542
+ __metadata("design:type", Object)
543
+ ], ActivityThreadPage.prototype, "loadError", void 0);
525
544
  __decorate([
526
545
  state(),
527
546
  __metadata("design:type", Object)