@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
@@ -1 +1 @@
1
- {"version":3,"file":"activity-instance-search-page.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-search-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6BAA6B,CAAA;AAEpC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAA4B,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAI5D,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAApE;;QAqBI,eAAU,GAA4B,EAAE,CAAA;QAGxC,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM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CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;oBACvF,OAAO,MAAM,CAAA;gBACxB,CAAC,EAAE,EAAE,CAAC;aACL,CAAA;QACD,CAAC,CAAC,CAAA;QAEC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC/C,CAAC;;AA5PS;IAAR,KAAK,EAAE;;8DAAoB;AACnB;IAAR,KAAK,EAAE;;4DAAc;AACb;IAAR,KAAK,EAAE;;8DAAyC;AAExC;IAAR,KAAK,EAAE;;+DAAiB;AAChB;IAAR,KAAK,EAAE;;wDAAoE;AAEjD;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;yDAAA;AA1BjC,0BAA0B;IADtC,aAAa,CAAC,+BAA+B,CAAC;GAClC,0BAA0B,CAgRtC","sourcesContent":["import '@operato/data-grist'\nimport './activity-instance-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { OxPopup } from '@operato/popup'\nimport { declaredLabel } from '../../components/activity-fields.js'\nimport { ActivitySearchKeyItem } from '../../types/activity-search-key-item-type.js'\n\n@customElement('activity-instance-search-page')\nexport class ActivityInstanceSearchPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n\n .header { grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() activityId?: string\n @state() activity: any\n @state() searchKeys: ActivitySearchKeyItem[] = []\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity instance search'),\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: 'dataset/activity-instance-search-page',\n actions: [],\n exportable: { name: i18next.t('title.activity instance search'),\n data: this._exportableData.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n pageUpdated(changes, lifecycle) { if (this.active) { this.activityId = lifecycle.resourceId\n return\n }\n }\n\n async updated(changes) { if (changes.has('activityId')) { const response = await client.query({ query: gql`\n query ($id: String!) { activity(id: $id) { id\n name\n description\n searchKeys { name\n description\n inputKey\n tKey\n }\n }\n }\n `,\n variables: { id: this.activityId\n }\n })\n\n this.activity = response.data.activity\n this.searchKeys = this.activity?.searchKeys\n this.refreshGristConfig()\n }\n }\n\n getSearchKeyColumns() { return (\n this.searchKeys?.map((item, index) => { return { type: 'string',\n name: `key0${index + 1}`,\n header: declaredLabel(item) || `key0${index + 1}`,\n record: { editable: false\n },\n sortable: true,\n filter: 'i_like',\n width: 120,\n imex: true\n }\n }) || []\n )\n }\n\n refreshGristConfig() { this.gristConfig = { pagination: { pages: [50, 100, 200] },\n list: { fields: ['name', 'description'],\n details: ['updatedAt', 'updater']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter',\n gutterName: 'button',\n icon: 'assignment',\n iconOnly: false,\n title: i18next.t('button.view'),\n width: 72,\n handlers: { click: (columns, data, column, record, rowIndex) => { openPopup(\n html`\n <activity-instance-view\n activity-instance-id=${record.id}\n style=\"background-color: white;\"\n ></activity-instance-view>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.activity instance view')\n }\n )\n }\n }\n },\n { type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: { editable: false\n },\n filter: 'search',\n sortable: true,\n width: 250,\n imex: true\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false\n },\n filter: 'search',\n width: 300,\n imex: true\n },\n { type: 'string',\n name: 'state',\n header: i18next.t('label.status'),\n record: { editable: false\n },\n width: 80,\n imex: true\n },\n ...this.getSearchKeyColumns(),\n { type: 'json5',\n name: 'input',\n header: i18next.t('field.input'),\n record: { editable: false\n },\n hidden: true,\n imex: true\n },\n { type: 'json5',\n name: 'output',\n header: i18next.t('field.artifact'),\n record: { editable: false\n },\n hidden: true,\n imex: true\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n sortable: true,\n label: true,\n width: 90,\n imex: true\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n sortable: true,\n label: true,\n width: 180,\n imex: true\n }\n ],\n rows: { appendable: false,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'createdAt',\n desc: true\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { if (!this.activity) { return { records: [], total: 0 }\n }\n\n const response = await client.query({ query: gql`\n query ($activityId: String!, $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityInstancesByActivity(\n activityId: $activityId\n filters: $filters\n pagination: $pagination\n sortings: $sortings\n ) { items { id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { activityId: this.activityId,\n 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 _exportableData() { let records = [] as GristRecord[]\n if (this.grist.selected && this.grist.selected.length > 0) { records = this.grist.selected\n } else { records = this.grist.data.records\n }\n\n var headerSetting = this.grist.compiledConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .map(column => { return column.imex === true\n ? { header: column.header.renderer(column),\n key: column.name,\n width: column.width,\n type: column.type\n }\n : column.imex\n })\n\n var data = records.map(item => { return { id: item.id,\n ...this.gristConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .reduce((record, column) => { const key = column.imex === true ? column.name : column.imex.key\n record[key] = key\n .split('.')\n .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)\n return record\n }, {})\n }\n })\n\n return { header: headerSetting, data: data }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-instance-search-page.js","sourceRoot":"","sources":["../../../client/pages/activity-instance/activity-instance-search-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6BAA6B,CAAA;AAEpC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAA4B,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,cAA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,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAA;oBACxG,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG;yBACd,KAAK,CAAC,GAAG,CAAC;yBACV,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;oBACvF,OAAO,MAAM,CAAA;gBACxB,CAAC,EAAE,EAAE,CAAC;aACL,CAAA;QACD,CAAC,CAAC,CAAA;QAEC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC/C,CAAC;;AA5PS;IAAR,KAAK,EAAE;;8DAAoB;AACnB;IAAR,KAAK,EAAE;;4DAAc;AACb;IAAR,KAAK,EAAE;;8DAAyC;AAExC;IAAR,KAAK,EAAE;;+DAAiB;AAChB;IAAR,KAAK,EAAE;;wDAAoE;AAEjD;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;yDAAA;AAvBjC,0BAA0B;IADtC,aAAa,CAAC,+BAA+B,CAAC;GAClC,0BAA0B,CA6QtC","sourcesContent":["import '@operato/data-grist'\nimport './activity-instance-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { OxPopup } from '@operato/popup'\nimport { declaredLabel } from '../../components/activity-fields.js'\nimport { ActivitySearchKeyItem } from '../../types/activity-search-key-item-type.js'\n\n@customElement('activity-instance-search-page')\nexport class ActivityInstanceSearchPage 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\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n\n .header { grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() activityId?: string\n @state() activity: any\n @state() searchKeys: ActivitySearchKeyItem[] = []\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity instance search'),\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: 'dataset/activity-instance-search-page',\n actions: [],\n exportable: { name: i18next.t('title.activity instance search'),\n data: this._exportableData.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n pageUpdated(changes, lifecycle) { if (this.active) { this.activityId = lifecycle.resourceId\n return\n }\n }\n\n async updated(changes) { if (changes.has('activityId')) { const response = await client.query({ query: gql`\n query ($id: String!) { activity(id: $id) { id\n name\n description\n searchKeys { name\n description\n inputKey\n tKey\n }\n }\n }\n `,\n variables: { id: this.activityId\n }\n })\n\n this.activity = response.data.activity\n this.searchKeys = this.activity?.searchKeys\n this.refreshGristConfig()\n }\n }\n\n getSearchKeyColumns() { return (\n this.searchKeys?.map((item, index) => { return { type: 'string',\n name: `key0${index + 1}`,\n header: declaredLabel(item) || `key0${index + 1}`,\n record: { editable: false\n },\n sortable: true,\n filter: 'i_like',\n width: 120,\n imex: true\n }\n }) || []\n )\n }\n\n refreshGristConfig() { this.gristConfig = { pagination: { pages: [50, 100, 200] },\n list: { fields: ['name', 'description'],\n details: ['updatedAt', 'updater']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter',\n gutterName: 'button',\n icon: 'assignment',\n iconOnly: false,\n title: i18next.t('button.view'),\n width: 72,\n handlers: { click: (columns, data, column, record, rowIndex) => { openPopup(\n html`\n <activity-instance-view\n activity-instance-id=${record.id}\n style=\"background-color: white;\"\n ></activity-instance-view>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.activity instance view')\n }\n )\n }\n }\n },\n { type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: { editable: false\n },\n filter: 'search',\n sortable: true,\n width: 250,\n imex: true\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false\n },\n filter: 'search',\n width: 300,\n imex: true\n },\n { type: 'string',\n name: 'state',\n header: i18next.t('label.status'),\n record: { editable: false\n },\n width: 80,\n imex: true\n },\n ...this.getSearchKeyColumns(),\n { type: 'json5',\n name: 'input',\n header: i18next.t('field.input'),\n record: { editable: false\n },\n hidden: true,\n imex: true\n },\n { type: 'json5',\n name: 'output',\n header: i18next.t('field.artifact'),\n record: { editable: false\n },\n hidden: true,\n imex: true\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n sortable: true,\n label: true,\n width: 90,\n imex: true\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n sortable: true,\n label: true,\n width: 180,\n imex: true\n }\n ],\n rows: { appendable: false,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'createdAt',\n desc: true\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { if (!this.activity) { return { records: [], total: 0 }\n }\n\n const response = await client.query({ query: gql`\n query ($activityId: String!, $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityInstancesByActivity(\n activityId: $activityId\n filters: $filters\n pagination: $pagination\n sortings: $sortings\n ) { items { id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { activityId: this.activityId,\n 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 _exportableData() { let records = [] as GristRecord[]\n if (this.grist.selected && this.grist.selected.length > 0) { records = this.grist.selected\n } else { records = this.grist.data.records\n }\n\n var headerSetting = this.grist.compiledConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .map(column => { return column.imex === true\n ? { header: column.header.renderer(column),\n key: column.name,\n width: column.width,\n type: column.type\n }\n : column.imex\n })\n\n var data = records.map(item => { return { id: item.id,\n ...this.gristConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .reduce((record, column) => { const key = column.imex === true ? column.name : column.imex.key\n record[key] = key\n .split('.')\n .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)\n return record\n }, {})\n }\n })\n\n return { header: headerSetting, data: data }\n }\n}\n"]}
@@ -1,3 +1,4 @@
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 '@things-factory/organization';
@@ -12,6 +13,10 @@ export declare class ActivityInstanceStartPage extends ActivityInstanceStartPage
12
13
  activityInstance: any;
13
14
  board: any;
14
15
  customHtmlElement: any;
16
+ loaded: boolean;
17
+ loadError: unknown;
18
+ /** The id this screen last read, so retry asks for the same task. */
19
+ private lastId?;
15
20
  viewer: any;
16
21
  get context(): {
17
22
  title: any;
@@ -30,6 +35,7 @@ export declare class ActivityInstanceStartPage extends ActivityInstanceStartPage
30
35
  })[];
31
36
  };
32
37
  render(): TemplateResult<1>;
38
+ renderActivity(): TemplateResult<1>;
33
39
  activityContent(): DirectiveResult;
34
40
  templateContent(): DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
35
41
  getInputSpec(): any;
@@ -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 '@things-factory/organization';
@@ -20,28 +21,34 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
20
21
  super(...arguments);
21
22
  this.activity = {};
22
23
  this.activityInstance = {};
24
+ this.loaded = false;
25
+ this.loadError = null;
23
26
  }
24
27
  static { this.styles = [
25
28
  ScrollbarStyles,
26
29
  css `
27
- :host { display: flex;
30
+ :host {
31
+ display: flex;
28
32
  flex-direction: column;
29
33
  overflow: auto;
30
- }
34
+ }
31
35
 
32
- ox-board-viewer { width: 100%;
36
+ ox-board-viewer {
37
+ width: 100%;
33
38
  height: 100%;
34
- }
39
+ }
35
40
 
36
- #custom-content { flex: 1;
37
- }
41
+ #custom-content {
42
+ flex: 1;
43
+ }
38
44
  `
39
45
  ]; }
40
46
  get context() {
41
47
  const { startingType } = this.activity;
42
48
  const { state } = this.activityInstance;
43
49
  const issuable = state === 'draft';
44
- return { title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
50
+ return {
51
+ title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
45
52
  help: 'worklist/activity-instance-start-page',
46
53
  /*
47
54
  * 이 화면은 메뉴에 없다 — 「작성 중」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬
@@ -51,11 +58,13 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
51
58
  */
52
59
  menu: 'draft-list',
53
60
  actions: [
54
- issuable && { title: i18next.t('button.draft'),
61
+ issuable && {
62
+ title: i18next.t('button.draft'),
55
63
  action: this.draftActivityInstance.bind(this),
56
64
  ...CommonButtonStyles.save
57
65
  },
58
- issuable && { title: i18next.t(startingType == 'issue' ? 'button.issue' : 'button.post'),
66
+ issuable && {
67
+ title: i18next.t(startingType == 'issue' ? 'button.issue' : 'button.post'),
59
68
  action: this.issueActivityInstance.bind(this),
60
69
  ...CommonButtonStyles.submit
61
70
  }
@@ -64,6 +73,18 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
64
73
  };
65
74
  }
66
75
  render() {
76
+ /*
77
+ * Reading and failing both drew the same empty ribbon, so a task that could not be read looked
78
+ * like a task with nothing in it (ADR-0060 decision 8).
79
+ */
80
+ return html `<ox-page-state
81
+ .loading=${!this.loaded && !this.loadError}
82
+ .error=${this.loadError}
83
+ @retry=${() => this.lastId && this.fetchActivityInstance(this.lastId)}
84
+ >${this.renderActivity()}</ox-page-state
85
+ >`;
86
+ }
87
+ renderActivity() {
67
88
  return html `
68
89
  <activity-instance-ribon .activityInstance=${this.activityInstance}></activity-instance-ribon>
69
90
 
@@ -98,11 +119,7 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
98
119
  return (model || [])
99
120
  .filter(item => item.inout === 'in' || item.inout === 'inout')
100
121
  .map(item => {
101
- return { ...item,
102
- name: item.tag,
103
- label: item.tKey || item.name,
104
- property: item.options
105
- };
122
+ return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options };
106
123
  });
107
124
  }
108
125
  getOutputSpec() {
@@ -110,11 +127,7 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
110
127
  return (model || [])
111
128
  .filter(item => item.inout === 'inout' || item.inout === 'out')
112
129
  .map(item => {
113
- return { ...item,
114
- name: item.tag,
115
- label: item.tKey || item.name,
116
- property: item.options
117
- };
130
+ return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options };
118
131
  });
119
132
  }
120
133
  generatedContent() {
@@ -160,8 +173,7 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
160
173
  }
161
174
  const { uiSource: boardId, input, output } = this.activityInstance;
162
175
  if (!this.board || this.board.id !== boardId) {
163
- this.board = { id: boardId
164
- };
176
+ this.board = { id: boardId };
165
177
  }
166
178
  /*
167
179
  ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,
@@ -232,50 +244,67 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
232
244
  }
233
245
  }
234
246
  async fetchActivityInstance(id) {
235
- const response = await client.query({ query: gql `
236
- query activityInstance($id: String!) { activityInstance(id: $id) { id
237
- name
238
- description
239
- state
240
- activity { id
241
- startingType
242
- model { name
243
- description
244
- active
245
- tag
246
- inout
247
+ this.lastId = id;
248
+ this.loadError = null;
249
+ try {
250
+ const response = await client.query({
251
+ query: gql `
252
+ query activityInstance($id: String!) {
253
+ activityInstance(id: $id) {
254
+ id
255
+ name
256
+ description
257
+ state
258
+ activity {
259
+ id
260
+ startingType
261
+ model {
262
+ name
263
+ description
264
+ active
265
+ tag
266
+ inout
267
+ type
268
+ unit
269
+ options
270
+ quantifier
271
+ spec
272
+ }
273
+ }
274
+ thumbnail
275
+ input
276
+ output
277
+ uiType
278
+ uiSource
279
+ approvalLine {
247
280
  type
248
- unit
249
- options
250
- quantifier
251
- spec
252
- }
253
- }
254
- thumbnail
255
- input
256
- output
257
- uiType
258
- uiSource
259
- approvalLine { type
260
- value
261
- participation
262
- approver { id
263
- name
264
- description
265
- controlNo
266
- }
267
- }
268
- dueAt
269
- createdAt
270
- }
271
- }
272
- `,
273
- variables: { id
281
+ value
282
+ participation
283
+ approver {
284
+ id
285
+ name
286
+ description
287
+ controlNo
288
+ }
289
+ }
290
+ dueAt
291
+ createdAt
274
292
  }
275
- });
276
- this.customHtmlElement = undefined;
277
- this.activityInstance = response.data.activityInstance;
278
- this.activity = this.activityInstance.activity;
293
+ }
294
+ `,
295
+ variables: { id }
296
+ });
297
+ if (response.errors?.length || !response.data?.activityInstance) {
298
+ throw (response.errors?.[0] || new Error(i18next.t('error.activity-instance not found', { activityInstance: id })));
299
+ }
300
+ this.customHtmlElement = undefined;
301
+ this.activityInstance = response.data.activityInstance;
302
+ this.activity = this.activityInstance.activity;
303
+ this.loaded = true;
304
+ }
305
+ catch (error) {
306
+ this.loadError = error;
307
+ }
279
308
  }
280
309
  async draftActivityInstance() {
281
310
  var { id: activityId } = this.activity;
@@ -288,7 +317,8 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
288
317
  description ||= this.activity.description;
289
318
  assignees ||= this.activity.assignees;
290
319
  approvalLine ||= this.activity.approvalLine;
291
- var activityInstance = { id,
320
+ var activityInstance = {
321
+ id,
292
322
  activityId,
293
323
  name,
294
324
  description,
@@ -302,53 +332,61 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
302
332
  assignees,
303
333
  approvalLine
304
334
  };
305
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
306
- mutation ($activityInstance: ActivityInstanceDraft!) { draftActivityInstance(activityInstance: $activityInstance) { id
307
- name
308
- description
309
- input
310
- output
311
- state
312
- activity { id
313
- startingType
314
- model { name
315
- description
316
- active
317
- tag
318
- inout
335
+ const outcome = await ranMutation(() => client.mutate({
336
+ mutation: gql `
337
+ mutation ($activityInstance: ActivityInstanceDraft!) {
338
+ draftActivityInstance(activityInstance: $activityInstance) {
339
+ id
340
+ name
341
+ description
342
+ input
343
+ output
344
+ state
345
+ activity {
346
+ id
347
+ startingType
348
+ model {
349
+ name
350
+ description
351
+ active
352
+ tag
353
+ inout
354
+ type
355
+ unit
356
+ options
357
+ quantifier
358
+ spec
359
+ }
360
+ }
361
+ assignees {
319
362
  type
320
- unit
321
- options
322
- quantifier
323
- spec
324
- }
325
- }
326
- assignees { type
327
- value
328
- assignee { id
329
- name
330
- description
331
- controlNo
332
- }
333
- }
334
- approvalLine { type
335
- value
336
- participation
337
- approver { id
338
- name
339
- description
340
- controlNo
341
- }
342
- }
343
- uiType
344
- uiSource
345
- threadsMin
346
- threadsMax
347
- }
348
- }
349
- `,
350
- variables: { activityInstance
363
+ value
364
+ assignee {
365
+ id
366
+ name
367
+ description
368
+ controlNo
369
+ }
370
+ }
371
+ approvalLine {
372
+ type
373
+ value
374
+ participation
375
+ approver {
376
+ id
377
+ name
378
+ description
379
+ controlNo
380
+ }
381
+ }
382
+ uiType
383
+ uiSource
384
+ threadsMin
385
+ threadsMax
351
386
  }
387
+ }
388
+ `,
389
+ variables: { activityInstance }
352
390
  }));
353
391
  if (!outcome.ok) {
354
392
  return;
@@ -356,7 +394,9 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
356
394
  this.customHtmlElement = undefined;
357
395
  this.activityInstance = outcome.data.draftActivityInstance;
358
396
  this.activity = this.activityInstance.activity;
359
- notify({ message: i18next.t('text.info_x_successfully', { x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`
397
+ notify({
398
+ message: i18next.t('text.info_x_successfully', {
399
+ x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`
360
400
  })
361
401
  });
362
402
  }
@@ -366,7 +406,8 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
366
406
  ;
367
407
  [input, output] = this.getInOutFromBoard();
368
408
  }
369
- const activityInstance = { id,
409
+ const activityInstance = {
410
+ id,
370
411
  name: name || this.activity.name,
371
412
  description: description || this.activity.description,
372
413
  threadsMin,
@@ -377,53 +418,61 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
377
418
  assignees,
378
419
  approvalLine
379
420
  };
380
- const outcome = await ranMutation(() => client.mutate({ mutation: gql `
381
- mutation ($activityInstance: ActivityInstanceIssue!) { issueActivityInstance(activityInstance: $activityInstance) { id
382
- name
383
- description
384
- input
385
- output
386
- state
387
- activity { id
388
- startingType
389
- model { name
390
- description
391
- active
392
- tag
393
- inout
421
+ const outcome = await ranMutation(() => client.mutate({
422
+ mutation: gql `
423
+ mutation ($activityInstance: ActivityInstanceIssue!) {
424
+ issueActivityInstance(activityInstance: $activityInstance) {
425
+ id
426
+ name
427
+ description
428
+ input
429
+ output
430
+ state
431
+ activity {
432
+ id
433
+ startingType
434
+ model {
435
+ name
436
+ description
437
+ active
438
+ tag
439
+ inout
440
+ type
441
+ unit
442
+ options
443
+ quantifier
444
+ spec
445
+ }
446
+ }
447
+ assignees {
394
448
  type
395
- unit
396
- options
397
- quantifier
398
- spec
399
- }
400
- }
401
- assignees { type
402
- value
403
- assignee { id
404
- name
405
- description
406
- controlNo
407
- }
408
- }
409
- approvalLine { type
410
- value
411
- participation
412
- approver { id
413
- name
414
- description
415
- controlNo
416
- }
417
- }
418
- uiType
419
- uiSource
420
- threadsMin
421
- threadsMax
422
- }
423
- }
424
- `,
425
- variables: { activityInstance
449
+ value
450
+ assignee {
451
+ id
452
+ name
453
+ description
454
+ controlNo
455
+ }
456
+ }
457
+ approvalLine {
458
+ type
459
+ value
460
+ participation
461
+ approver {
462
+ id
463
+ name
464
+ description
465
+ controlNo
466
+ }
467
+ }
468
+ uiType
469
+ uiSource
470
+ threadsMin
471
+ threadsMax
426
472
  }
473
+ }
474
+ `,
475
+ variables: { activityInstance }
427
476
  }));
428
477
  if (!outcome.ok) {
429
478
  return;
@@ -431,7 +480,9 @@ let ActivityInstanceStartPage = class ActivityInstanceStartPage extends localize
431
480
  this.customHtmlElement = undefined;
432
481
  this.activityInstance = outcome.data.issueActivityInstance;
433
482
  this.activity = this.activityInstance.activity;
434
- notify({ message: i18next.t('text.info_x_successfully', { x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`
483
+ notify({
484
+ message: i18next.t('text.info_x_successfully', {
485
+ x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`
435
486
  })
436
487
  });
437
488
  }
@@ -452,6 +503,14 @@ __decorate([
452
503
  state(),
453
504
  __metadata("design:type", Object)
454
505
  ], ActivityInstanceStartPage.prototype, "customHtmlElement", void 0);
506
+ __decorate([
507
+ state(),
508
+ __metadata("design:type", Object)
509
+ ], ActivityInstanceStartPage.prototype, "loaded", void 0);
510
+ __decorate([
511
+ state(),
512
+ __metadata("design:type", Object)
513
+ ], ActivityInstanceStartPage.prototype, "loadError", void 0);
455
514
  __decorate([
456
515
  query('ox-board-viewer'),
457
516
  __metadata("design:type", Object)