@things-factory/worklist 10.1.26 → 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.
- package/approval-walk/harness.mjs +255 -0
- package/dist-client/pages/activity/activity-list-page.d.ts +0 -2
- package/dist-client/pages/activity/activity-list-page.js +7 -15
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-model-item-list.js +2 -1
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +6 -0
- package/dist-client/pages/activity/activity-page.js +171 -131
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity/starter-list-page.js +6 -11
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.js +8 -12
- package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +7 -2
- package/dist-client/pages/activity-approval/activity-approval-page.js +146 -138
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +10 -0
- package/dist-client/pages/activity-catalog/activity-catalog-page.js +56 -35
- package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +0 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +79 -107
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.js +3 -6
- package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +6 -0
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +216 -157
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +8 -12
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
- package/dist-client/pages/activity-store/activity-store-page.js +4 -11
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +6 -11
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.js +8 -12
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +8 -12
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +6 -2
- package/dist-client/pages/activity-thread/activity-thread-page.js +96 -82
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +6 -2
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +53 -23
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +0 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +7 -16
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.d.ts +0 -2
- package/dist-client/pages/todo/approval-done-list-page.js +7 -15
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.d.ts +0 -2
- package/dist-client/pages/todo/approval-pending-list-page.js +5 -16
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.js +4 -5
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.d.ts +0 -2
- package/dist-client/pages/todo/done-list-page.js +7 -15
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.js +6 -11
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +0 -2
- package/dist-client/pages/todo/pickable-list-page.js +7 -15
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +0 -2
- package/dist-client/pages/todo/todo-list-page.js +5 -15
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity/decision-key-declaration.d.ts +11 -2
- package/dist-server/service/activity/decision-key-declaration.js +22 -1
- package/dist-server/service/activity/decision-key-declaration.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity-query.d.ts +11 -0
- package/dist-server/service/installable-activity/installable-activity-query.js +31 -0
- package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-template-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-template/activity-template-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iCAAiC,CAAA;AACxC,OAAO,wCAAwC,CAAA;AAE/C,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,SAAS,EAAe,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACpF,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,OAA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AAE,KAAK,EAAE,CAAA;QAC9B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;SACxD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QACrD,CAAC,CAAA;IACD,CAAC;;AAlU4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAqE;AAE7E;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;uDAAA;AArBzB,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAqVpC","sourcesContent":["import '@operato/data-grist'\nimport './activity-template-importer.js'\nimport './activity-template-model-item-list.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist, FetchOption, getEditor, getRenderer } 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\nimport { ActivityTypes, ActivityUITypes } from '../../types/types.js'\n\n@customElement('activity-template-list-page')\nexport class ActivityTemplateListPage 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() ? 'CARD' : 'GRID'\n\n @query('ox-grist') grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity template 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-template',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityTemplate.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityTemplate.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity template 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: { thumbnail: 'thumbnail',\n fields: ['name', 'description'],\n details: ['visibility', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n handlers: { click: (columns, data, column, record, rowIndex) => { if (!record.id) return\n const popup = openPopup(html` <activity-template-model-item-list .activity=${record}></activity-template-model-item-list> `, { backdrop: true,\n help: 'worklist/activity-template-model-item-list',\n size: 'large',\n title: i18next.t('title.activity template model item list')\n })\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n }\n },\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: 'select',\n name: 'activityType',\n label: true,\n header: i18next.t('field.activity-type'),\n record: { editable: true,\n options: ActivityTypes\n },\n sortable: true,\n // filter: true,\n width: 60\n },\n { type: 'image',\n name: 'thumbnail',\n header: i18next.t('field.thumbnail'),\n record: { editable: true },\n width: 120\n },\n { type: 'select',\n name: 'uiType',\n label: true,\n header: i18next.t('field.ui-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'uiSource',\n header: i18next.t('field.ui-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.uiType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.uiType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n { type: 'select',\n name: 'viewType',\n label: true,\n header: i18next.t('field.view-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'viewSource',\n header: i18next.t('field.view-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.viewType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.viewType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n { type: 'select',\n name: 'reportType',\n label: true,\n header: i18next.t('field.report-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'reportSource',\n header: i18next.t('field.report-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.reportType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.reportType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\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) { }\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: activityTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n activityType\n model { name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n thumbnail\n active\n uiType\n uiSource\n viewType\n viewSource\n reportType\n reportSource\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 _deleteActivityTemplate() { if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist?.selected.map(record => record.id)\n if (ids && ids.length > 0) { const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteActivityTemplates(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 _updateActivityTemplate() { 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: [ActivityTemplatePatch!]!) { updateMultipleActivityTemplate(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n },\n context: { hasUpload: true\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(activityTemplate => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityTemplate[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-template-importer\n .activityTemplates=${records}\n @imported=${() => { history.back()\n this.grist?.fetch()\n }}\n ></activity-template-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-template')\n }\n )\n\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-template-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-template/activity-template-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iCAAiC,CAAA;AACxC,OAAO,wCAAwC,CAAA;AAE/C,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,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe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CAAA;IACF,CAAC;IAEA,KAAK,CAAC,aAAa,CAAC,OAAO;QAAQ,MAAM,KAAK,GAAG,SAAS,CACtD,IAAI,CAAA;;+BAEqB,OAAO;sBAChB,GAAG,EAAE;YAAe,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QAC9B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;SACxD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;QACrD,CAAC,CAAA;IACD,CAAC;;AAlU4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAqE;AAE7E;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;uDAAA;AAhBzB,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAgVpC","sourcesContent":["import '@operato/data-grist'\nimport './activity-template-importer.js'\nimport './activity-template-model-item-list.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, getEditor, getRenderer } 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\nimport { ActivityTypes, ActivityUITypes } from '../../types/types.js'\n\n@customElement('activity-template-list-page')\nexport class ActivityTemplateListPage 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() ? 'CARD' : 'GRID'\n\n @query('ox-grist') grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity template 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-template',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityTemplate.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityTemplate.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity template 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: { thumbnail: 'thumbnail',\n fields: ['name', 'description'],\n details: ['visibility', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n handlers: { click: (columns, data, column, record, rowIndex) => { if (!record.id) return\n const popup = openPopup(html` <activity-template-model-item-list .activity=${record}></activity-template-model-item-list> `, { backdrop: true,\n help: 'worklist/activity-template-model-item-list',\n size: 'large',\n title: i18next.t('title.activity template model item list')\n })\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n }\n },\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: 'select',\n name: 'activityType',\n label: true,\n header: i18next.t('field.activity-type'),\n record: { editable: true,\n options: ActivityTypes\n },\n sortable: true,\n // filter: true,\n width: 60\n },\n { type: 'image',\n name: 'thumbnail',\n header: i18next.t('field.thumbnail'),\n record: { editable: true },\n width: 120\n },\n { type: 'select',\n name: 'uiType',\n label: true,\n header: i18next.t('field.ui-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'uiSource',\n header: i18next.t('field.ui-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.uiType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.uiType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n { type: 'select',\n name: 'viewType',\n label: true,\n header: i18next.t('field.view-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'viewSource',\n header: i18next.t('field.view-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.viewType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.viewType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n { type: 'select',\n name: 'reportType',\n label: true,\n header: i18next.t('field.report-type'),\n record: { editable: true,\n options: ActivityUITypes\n },\n width: 80\n },\n { type: 'string',\n name: 'reportSource',\n header: i18next.t('field.report-source'),\n record: { editable: true,\n editor: function (value, column, record, rowIndex, field) { var type = record.reportType !== 'board' ? 'script' : 'board'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) { var type = record.reportType !== 'board' ? 'script' : 'board'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\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) { }\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: activityTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n activityType\n model { name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n thumbnail\n active\n uiType\n uiSource\n viewType\n viewSource\n reportType\n reportSource\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 _deleteActivityTemplate() { 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!]!) { deleteActivityTemplates(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 _updateActivityTemplate() { 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: [ActivityTemplatePatch!]!) { updateMultipleActivityTemplate(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n },\n context: { hasUpload: true\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(activityTemplate => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityTemplate[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-template-importer\n .activityTemplates=${records}\n @imported=${() => { history.back()\n this.grist?.fetch()\n }}\n ></activity-template-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-template')\n }\n )\n\n popup.onclosed = () => { this.grist?.fetch()\n }\n }\n}\n"]}
|
|
@@ -4,13 +4,14 @@ import './activity-thread-importer.js';
|
|
|
4
4
|
import gql from 'graphql-tag';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
7
|
+
import { OxPrompt } from '@operato/popup';
|
|
7
8
|
import { DataGrist } from '@operato/data-grist';
|
|
8
9
|
import { client } from '@operato/graphql';
|
|
9
10
|
import { i18next, localize } from '@operato/i18n';
|
|
10
11
|
import { ranMutation } from '../../components/say-outcome.js';
|
|
11
12
|
import { notify, openPopup } from '@operato/layout';
|
|
12
13
|
import { PageView } from '@operato/shell';
|
|
13
|
-
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
14
|
+
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
14
15
|
import { isMobileDevice } from '@operato/utils';
|
|
15
16
|
let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18next)(PageView) {
|
|
16
17
|
constructor() {
|
|
@@ -18,20 +19,15 @@ let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18ne
|
|
|
18
19
|
this.mode = isMobileDevice() ? 'LIST' : 'GRID';
|
|
19
20
|
}
|
|
20
21
|
static { this.styles = [
|
|
22
|
+
/* The work surface frame for a list screen (ADR-0060 decision 8). */
|
|
23
|
+
WorkSurfacePageStyles,
|
|
21
24
|
ScrollbarStyles,
|
|
22
25
|
CommonHeaderStyles,
|
|
23
26
|
css `
|
|
24
|
-
:host {
|
|
25
|
-
|
|
26
|
-
width: 100%;
|
|
27
|
-
|
|
27
|
+
:host {
|
|
28
28
|
--grid-record-emphasized-background-color: #8b0000;
|
|
29
29
|
--grid-record-emphasized-color: #ff6b6b;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
ox-grist { overflow-y: auto;
|
|
33
|
-
flex: 1;
|
|
34
|
-
}
|
|
30
|
+
}
|
|
35
31
|
`
|
|
36
32
|
]; }
|
|
37
33
|
get context() {
|
|
@@ -64,7 +60,7 @@ let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18ne
|
|
|
64
60
|
render() {
|
|
65
61
|
const mode = this.mode;
|
|
66
62
|
return html `
|
|
67
|
-
<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)}>
|
|
68
64
|
<div slot="headroom" class="header">
|
|
69
65
|
<div class="filters">
|
|
70
66
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
@@ -162,7 +158,7 @@ let ActivityThreadListPage = class ActivityThreadListPage extends localize(i18ne
|
|
|
162
158
|
};
|
|
163
159
|
}
|
|
164
160
|
async _deleteActivityThread() {
|
|
165
|
-
if (
|
|
161
|
+
if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {
|
|
166
162
|
const ids = this.grist?.selected.map(record => record.id);
|
|
167
163
|
if (ids && ids.length > 0) {
|
|
168
164
|
const outcome = await ranMutation(() => client.mutate({ mutation: gql `
|
|
@@ -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,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,OAA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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;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 { 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 (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist?.selected.map(record => record.id)\n if (ids && ids.length > 0) { const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { 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,M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AAG,EAAE,CAAA;YACjE,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;gBAAS,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,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
|
|
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 = {
|
|
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 {
|
|
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 && {
|
|
178
|
+
savable && {
|
|
179
|
+
title: i18next.t('button.save'),
|
|
178
180
|
action: this._saveActivityThread.bind(this),
|
|
179
181
|
...CommonButtonStyles.save
|
|
180
182
|
},
|
|
181
|
-
submittable && {
|
|
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 && {
|
|
196
|
+
restartable && {
|
|
197
|
+
title: i18next.t('button.restart'),
|
|
194
198
|
action: this._restartActivityThread.bind(this),
|
|
195
199
|
...CommonButtonStyles.save
|
|
196
200
|
},
|
|
197
|
-
{
|
|
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
|
-
|
|
210
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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({
|
|
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({
|
|
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({
|
|
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
|
-
|
|
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({
|
|
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
|
-
|
|
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({
|
|
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)
|