@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.
- package/approval-walk/harness.mjs +255 -0
- package/dist-client/pages/activity/activity-list-page.js +6 -11
- package/dist-client/pages/activity/activity-list-page.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 +6 -11
- 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 +5 -0
- package/dist-client/pages/activity-catalog/activity-catalog-page.js +38 -32
- package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +79 -105
- 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 +6 -11
- 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 +6 -11
- 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 +6 -11
- 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.js +6 -11
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.js +6 -11
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.js +4 -12
- 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.js +6 -11
- 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.js +6 -11
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.js +4 -11
- 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 +10 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@operato/data-grist';
|
|
3
3
|
import { OxPrompt } from '@operato/popup';
|
|
4
|
-
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
4
|
+
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
5
5
|
import { PageView } from '@operato/shell';
|
|
6
6
|
import { css, html } from 'lit';
|
|
7
7
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
@@ -20,20 +20,15 @@ let ActivityApprovalListPage = class ActivityApprovalListPage extends localize(i
|
|
|
20
20
|
this.mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
21
21
|
}
|
|
22
22
|
static { this.styles = [
|
|
23
|
+
/* The work surface frame for a list screen (ADR-0060 decision 8). */
|
|
24
|
+
WorkSurfacePageStyles,
|
|
23
25
|
ScrollbarStyles,
|
|
24
26
|
CommonHeaderStyles,
|
|
25
27
|
css `
|
|
26
|
-
:host {
|
|
27
|
-
|
|
28
|
-
width: 100%;
|
|
29
|
-
|
|
28
|
+
:host {
|
|
30
29
|
--grid-record-emphasized-background-color: #8b0000;
|
|
31
30
|
--grid-record-emphasized-color: #ff6b6b;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ox-grist { overflow-y: auto;
|
|
35
|
-
flex: 1;
|
|
36
|
-
}
|
|
31
|
+
}
|
|
37
32
|
`
|
|
38
33
|
]; }
|
|
39
34
|
static get scopedElements() {
|
|
@@ -70,7 +65,7 @@ let ActivityApprovalListPage = class ActivityApprovalListPage extends localize(i
|
|
|
70
65
|
render() {
|
|
71
66
|
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
72
67
|
return html `
|
|
73
|
-
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
68
|
+
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
74
69
|
<div slot="headroom" class="header">
|
|
75
70
|
<div class="filters">
|
|
76
71
|
<!-- 검색은 제목 줄이 갖는다(context.search). 여기 폼은 컬럼 필터만 그린다. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-approval-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,IAAM,wBA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AC,CAAC,CAAA;QAEvE,OAAO,aAAa,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAAS,IAAI,OAAO,GAAG,EAAE,CAAA;YACnE,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;gBAAS,OAAO,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAA;YAC3F,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;;+BAEqB,OAAO;sBAChB,GAAG,EAAE;YAAe,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAC7B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;SACxD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpD,CAAC,CAAA;IACD,CAAC;;AA7M4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;uDAAA;AAzBjC,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAoOpC","sourcesContent":["import '@operato/data-grist'\n\nimport { OxPrompt } from '@operato/popup'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { ActivityApprovalImporter } from './activity-approval-importer.js'\n\n@customElement('activity-approval-list-page')\nexport class ActivityApprovalListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'activity-approval-importer': ActivityApprovalImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity approval list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'worklist/activity-approval',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityApproval.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity approval list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <!-- 검색은 제목 줄이 갖는다(context.search). 여기 폼은 컬럼 필터만 그린다. -->\n <ox-filters-form without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityApprovals(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteActivityApproval() { if (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!]!) { deleteActivityApprovals(ids: $ids)\n }\n `,\n variables: { ids\n }\n }))\n\n this.grist.fetch()\n\n if (outcome.ok) {\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateActivityApproval() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($patches: [ActivityApprovalPatch!]!) { updateMultipleActivityApproval(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n }))\n\n this.grist.fetch()\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(activityApproval => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityApproval[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-approval-importer\n .activityApprovals=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></activity-approval-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-approval')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-approval-list-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAChH,OAAO,EAAE,QAAQ,EAAE,MAAM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,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;SACxD,CACG,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpD,CAAC,CAAA;IACD,CAAC;;AA7M4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;uDAAA;AApBjC,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CA+NpC","sourcesContent":["import '@operato/data-grist'\n\nimport { OxPrompt } from '@operato/popup'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { ActivityApprovalImporter } from './activity-approval-importer.js'\n\n@customElement('activity-approval-list-page')\nexport class ActivityApprovalListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n /* 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 static get scopedElements() { return { 'activity-approval-importer': ActivityApprovalImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.activity approval list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'worklist/activity-approval',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteActivityApproval.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.activity approval list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <!-- 검색은 제목 줄이 갖는다(context.search). 여기 폼은 컬럼 필터만 그린다. -->\n <ox-filters-form without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: activityApprovals(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteActivityApproval() { if (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!]!) { deleteActivityApprovals(ids: $ids)\n }\n `,\n variables: { ids\n }\n }))\n\n this.grist.fetch()\n\n if (outcome.ok) {\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateActivityApproval() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const outcome = await ranMutation(() => client.mutate({ mutation: gql`\n mutation ($patches: [ActivityApprovalPatch!]!) { updateMultipleActivityApproval(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n }))\n\n this.grist.fetch()\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(activityApproval => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = activityApproval[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <activity-approval-importer\n .activityApprovals=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></activity-approval-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import activity-approval')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
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-approval-ribon.js';
|
|
5
6
|
import '../../components/activity-thread-timeline.js';
|
|
6
|
-
import {
|
|
7
|
+
import { TemplateResult } from 'lit';
|
|
7
8
|
import { DirectiveResult } from 'lit-html/directive.js';
|
|
8
9
|
import { PageView } from '@operato/shell';
|
|
9
10
|
export declare const ActivityThreadStatus: {
|
|
@@ -28,6 +29,9 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
|
|
|
28
29
|
* 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.
|
|
29
30
|
*/
|
|
30
31
|
loaded: boolean;
|
|
32
|
+
/** Why the approval could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */
|
|
33
|
+
loadError: unknown;
|
|
34
|
+
private lastId?;
|
|
31
35
|
activityThread: any;
|
|
32
36
|
board: any;
|
|
33
37
|
commentInput: HTMLTextAreaElement;
|
|
@@ -61,7 +65,8 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
|
|
|
61
65
|
action: () => void;
|
|
62
66
|
}[];
|
|
63
67
|
};
|
|
64
|
-
render(): TemplateResult<1
|
|
68
|
+
render(): TemplateResult<1>;
|
|
69
|
+
private renderApproval;
|
|
65
70
|
/** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */
|
|
66
71
|
hasFields(): boolean;
|
|
67
72
|
activityContent(): DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
|
+
import '@operato/list-state/ox-page-state.js';
|
|
3
4
|
import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
4
5
|
import '@operato/board/ox-board-viewer.js';
|
|
5
6
|
import '../../components/activity-approval-ribon.js';
|
|
@@ -15,7 +16,7 @@ import { i18next, localize } from '@operato/i18n';
|
|
|
15
16
|
import { ranMutation } from '../../components/say-outcome.js';
|
|
16
17
|
import { approvalGate } from './approval-gate.js';
|
|
17
18
|
import { PageView } from '@operato/shell';
|
|
18
|
-
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles';
|
|
19
|
+
import { CommonButtonStyles, DocumentPageStyles, ScrollbarStyles } from '@operato/styles';
|
|
19
20
|
import { provider } from '@operato/board/board-provider.js';
|
|
20
21
|
import { isReferenceStep } from '@things-factory/organization/dist-client';
|
|
21
22
|
import { ActivityFieldsStyles, declaredLabel, fieldValue, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js';
|
|
@@ -102,7 +103,8 @@ const ActivityApprovalFetchResult = `\
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
}`;
|
|
105
|
-
export const ActivityThreadStatus = {
|
|
106
|
+
export const ActivityThreadStatus = {
|
|
107
|
+
Unassigned: 'unassigned',
|
|
106
108
|
Assigned: 'assigned',
|
|
107
109
|
Started: 'started',
|
|
108
110
|
Delegated: 'delegated',
|
|
@@ -122,19 +124,16 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
122
124
|
* 조회가 끝난 뒤에만 그 말을 한다. 그 전에는 아무 말도 하지 않는다.
|
|
123
125
|
*/
|
|
124
126
|
this.loaded = false;
|
|
127
|
+
/** Why the approval could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */
|
|
128
|
+
this.loadError = null;
|
|
125
129
|
}
|
|
126
130
|
static { this.styles = [
|
|
131
|
+
/* The frame owns the page shell and the reading column (ADR-0060 decision 8). */
|
|
132
|
+
DocumentPageStyles,
|
|
127
133
|
ScrollbarStyles,
|
|
128
134
|
ActivityFieldsStyles,
|
|
129
135
|
css `
|
|
130
136
|
:host {
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-direction: column;
|
|
133
|
-
position: relative;
|
|
134
|
-
|
|
135
|
-
width: 100%;
|
|
136
|
-
overflow: auto;
|
|
137
|
-
background: var(--ui-bg, #f0f2f4);
|
|
138
137
|
color: var(--ui-ink, #17242c);
|
|
139
138
|
font-size: var(--ui-t-body, 13px);
|
|
140
139
|
}
|
|
@@ -348,7 +347,6 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
348
347
|
font-size: var(--ui-t-small, 11.5px);
|
|
349
348
|
color: var(--ui-muted, #57676f);
|
|
350
349
|
}
|
|
351
|
-
|
|
352
350
|
`
|
|
353
351
|
]; }
|
|
354
352
|
/**
|
|
@@ -371,7 +369,8 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
371
369
|
}
|
|
372
370
|
get context() {
|
|
373
371
|
const judgment = this.activityApproval?.judgment;
|
|
374
|
-
return {
|
|
372
|
+
return {
|
|
373
|
+
title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),
|
|
375
374
|
help: 'worklist/activity-approval',
|
|
376
375
|
/*
|
|
377
376
|
* 이 화면은 메뉴에 없다 — 「내 결재함」에서 줄을 눌러 들어온다. 그래서 왼쪽 메뉴가 가리킬
|
|
@@ -393,7 +392,8 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
393
392
|
*/
|
|
394
393
|
actions: judgment
|
|
395
394
|
? [
|
|
396
|
-
{
|
|
395
|
+
{
|
|
396
|
+
title: i18next.t('button.close'),
|
|
397
397
|
action: () => {
|
|
398
398
|
history.back();
|
|
399
399
|
},
|
|
@@ -418,47 +418,39 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
418
418
|
}
|
|
419
419
|
]
|
|
420
420
|
: /*
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
421
|
+
* ── 세 단추의 순서와 무게 (2026-09-06) ──────────────────────────
|
|
422
|
+
* 전에는 반려가 첫 자리였고, 승인 · 반려 · 저장이 모두 같은 모양이었다. 되돌리기 어려운
|
|
423
|
+
* 것이 앞에 서고 무엇이 주된 흐름인지 화면이 말하지 않았다.
|
|
424
|
+
*
|
|
425
|
+
* 승인이 주 동작이다 — 채운 단추 하나. 반려는 대등한 선택이지만 예외 경로라 테두리
|
|
426
|
+
* 단추로 그 옆에 둔다.
|
|
427
|
+
*
|
|
428
|
+
* 「저장」은 이름이 뜻을 말하지 않았다. 이 단추가 저장하는 것은 **의견 하나**이고
|
|
429
|
+
* (saveActivityApproval 은 id 와 comment 만 보낸다), 판단은 미뤄 둔다. 그리고 그 결과는
|
|
430
|
+
* 목록에서 「메모 있음」 표식으로 나타난다(activity-cells 의 approvalMarks). 목록이
|
|
431
|
+
* 부르는 이름과 같은 낱말로 맞춘다.
|
|
432
|
+
*/
|
|
433
433
|
[
|
|
434
|
-
{
|
|
434
|
+
{
|
|
435
|
+
title: i18next.t('button.approve'),
|
|
435
436
|
action: this.approveActivityApproval.bind(this),
|
|
436
437
|
icon: 'approval',
|
|
437
|
-
emphasis: { raised: true,
|
|
438
|
-
outlined: false,
|
|
439
|
-
dense: false,
|
|
440
|
-
danger: false
|
|
441
|
-
}
|
|
438
|
+
emphasis: { raised: true, outlined: false, dense: false, danger: false }
|
|
442
439
|
},
|
|
443
|
-
{
|
|
440
|
+
{
|
|
441
|
+
title: i18next.t('button.reject'),
|
|
444
442
|
action: this.rejectActivityApproval.bind(this),
|
|
445
443
|
icon: 'assignment_return',
|
|
446
|
-
emphasis: { raised: false,
|
|
447
|
-
outlined: true,
|
|
448
|
-
dense: false,
|
|
449
|
-
danger: false
|
|
450
|
-
}
|
|
444
|
+
emphasis: { raised: false, outlined: true, dense: false, danger: false }
|
|
451
445
|
},
|
|
452
|
-
{
|
|
446
|
+
{
|
|
447
|
+
title: i18next.t('button.save-note'),
|
|
453
448
|
action: this.saveActivityApproval.bind(this),
|
|
454
449
|
icon: 'edit_note',
|
|
455
|
-
emphasis: { raised: false,
|
|
456
|
-
outlined: true,
|
|
457
|
-
dense: false,
|
|
458
|
-
danger: false
|
|
459
|
-
}
|
|
450
|
+
emphasis: { raised: false, outlined: true, dense: false, danger: false }
|
|
460
451
|
},
|
|
461
|
-
{
|
|
452
|
+
{
|
|
453
|
+
title: i18next.t('button.close'),
|
|
462
454
|
action: () => {
|
|
463
455
|
history.back();
|
|
464
456
|
},
|
|
@@ -470,14 +462,24 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
470
462
|
};
|
|
471
463
|
}
|
|
472
464
|
render() {
|
|
473
|
-
|
|
474
|
-
|
|
465
|
+
/* Reading and failing both drew nothing at all, so a failure looked like an empty screen. */
|
|
466
|
+
return html `<div class="page">
|
|
467
|
+
<ox-page-state
|
|
468
|
+
.loading=${!this.loaded && !this.loadError}
|
|
469
|
+
.error=${this.loadError}
|
|
470
|
+
@retry=${() => this.lastId && this.fetchActivityApproval(this.lastId)}
|
|
471
|
+
>${this.activityThread
|
|
472
|
+
? this.renderApproval()
|
|
473
|
+
: this.loaded
|
|
475
474
|
? html `<div empty>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
: nothing
|
|
480
|
-
|
|
475
|
+
<span class="title">${i18next.t('text.no activity thread info')}</span>
|
|
476
|
+
<span class="why">${i18next.t('text.no-activity-thread-why')}</span>
|
|
477
|
+
</div>`
|
|
478
|
+
: nothing}</ox-page-state
|
|
479
|
+
>
|
|
480
|
+
</div>`;
|
|
481
|
+
}
|
|
482
|
+
renderApproval() {
|
|
481
483
|
const { terminatedAt } = this.activityApproval;
|
|
482
484
|
const editable = !terminatedAt;
|
|
483
485
|
return html `
|
|
@@ -494,19 +496,19 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
494
496
|
></activity-thread-timeline>
|
|
495
497
|
${editable
|
|
496
498
|
? html `
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
499
|
+
<div comment>
|
|
500
|
+
<section>
|
|
501
|
+
<h2>${i18next.t('field.wl-comment')}</h2>
|
|
502
|
+
<textarea
|
|
503
|
+
placeholder=${String(i18next.t(this.isReference
|
|
502
504
|
? 'text.write-your-comment-as-reference'
|
|
503
505
|
: 'text.explain the reason for approval/rejection'))}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
+
.value=${this.activityApproval?.comment}
|
|
507
|
+
@change=${(e) => {
|
|
506
508
|
this.activityApproval.comment = e.target.value;
|
|
507
509
|
}}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
+
></textarea>
|
|
511
|
+
<!--
|
|
510
512
|
반려는 의견이 필수다(rejectActivityApproval). 전에는 그 규칙을 **누른 뒤에** 토스트로
|
|
511
513
|
알렸다. 되돌릴 수 없는 것과 뜻이 다른 동작은 하기 전에 말한다.
|
|
512
514
|
|
|
@@ -514,12 +516,12 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
514
516
|
and reject buttons are absent for them and a reader whose buttons are missing
|
|
515
517
|
goes looking for them.
|
|
516
518
|
-->
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
519
|
+
<p class="hint">
|
|
520
|
+
${i18next.t(this.isReference ? 'text.reference-comment-hint' : 'text.approval-comment-hint')}
|
|
521
|
+
</p>
|
|
522
|
+
</section>
|
|
523
|
+
</div>
|
|
524
|
+
`
|
|
523
525
|
: nothing}
|
|
524
526
|
`;
|
|
525
527
|
}
|
|
@@ -652,48 +654,48 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
652
654
|
${subject?.found ? html `<div class="subject">${this.slotText(subject)}</div>` : ''}
|
|
653
655
|
${reason
|
|
654
656
|
? html `
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
<div class="block">
|
|
658
|
+
<div class="label">${i18next.t('field.reason')}</div>
|
|
659
|
+
<div class="said ${this.hasWords(reason) ? '' : 'none'}">
|
|
660
|
+
${this.hasWords(reason) ? this.slotText(reason) : i18next.t('text.no-reason-given')}
|
|
661
|
+
</div>
|
|
659
662
|
</div>
|
|
660
|
-
|
|
661
|
-
`
|
|
663
|
+
`
|
|
662
664
|
: ''}
|
|
663
665
|
${this.renderReversibility(reversibility)}
|
|
664
666
|
${evidence.length
|
|
665
667
|
? html `
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
668
|
+
<div class="block">
|
|
669
|
+
<div class="label">${i18next.t('label.what-it-was-judged-from')}</div>
|
|
670
|
+
${evidence.map(slot => html `
|
|
671
|
+
<div class="evidence">
|
|
672
|
+
${declaredLabel(slot) ? html `<div class="label">${declaredLabel(slot)}</div>` : ''}
|
|
673
|
+
<div>${this.slotText(slot)}</div>
|
|
674
|
+
</div>
|
|
675
|
+
`)}
|
|
676
|
+
</div>
|
|
677
|
+
`
|
|
676
678
|
: ''}
|
|
677
679
|
${currentState?.found
|
|
678
680
|
? html `
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
681
|
+
<div class="current-state">
|
|
682
|
+
<div class="label">${declaredLabel(currentState) || i18next.t('label.current-state')}</div>
|
|
683
|
+
<div>${this.slotText(currentState)}</div>
|
|
684
|
+
</div>
|
|
685
|
+
`
|
|
684
686
|
: ''}
|
|
685
687
|
${consequences.length
|
|
686
688
|
? html `
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
689
|
+
<div class="block">
|
|
690
|
+
<div class="label">${i18next.t('label.what-changes')}</div>
|
|
691
|
+
${consequences.map(slot => html `
|
|
692
|
+
<div class="consequence">
|
|
693
|
+
${declaredLabel(slot) ? html `<div class="label">${declaredLabel(slot)}</div>` : ''}
|
|
694
|
+
<div>${this.slotText(slot)}</div>
|
|
695
|
+
</div>
|
|
696
|
+
`)}
|
|
697
|
+
</div>
|
|
698
|
+
`
|
|
697
699
|
: ''}
|
|
698
700
|
</section>
|
|
699
701
|
`);
|
|
@@ -731,8 +733,7 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
731
733
|
<div class="reversibility" ?irreversible=${!said.reversible}>
|
|
732
734
|
<md-icon>${said.reversible ? 'undo' : 'lock'}</md-icon>
|
|
733
735
|
<span
|
|
734
|
-
>${said.caveat ||
|
|
735
|
-
i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</span
|
|
736
|
+
>${said.caveat || i18next.t(said.reversible ? 'text.approval-is-reversible' : 'text.approval-is-irreversible')}</span
|
|
736
737
|
>
|
|
737
738
|
</div>
|
|
738
739
|
`;
|
|
@@ -810,19 +811,19 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
810
811
|
return keyed(this.activityApproval.id, html `
|
|
811
812
|
${inputSpec.length
|
|
812
813
|
? html `
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
814
|
+
<section readonly>
|
|
815
|
+
<h2>${i18next.t('label.activity-input')}</h2>
|
|
816
|
+
${renderGiven(inputSpec, input)}
|
|
817
|
+
</section>
|
|
818
|
+
`
|
|
818
819
|
: ''}
|
|
819
820
|
${outputSpec.length
|
|
820
821
|
? html `
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
822
|
+
<section readonly>
|
|
823
|
+
<h2>${i18next.t('field.artifact')}</h2>
|
|
824
|
+
${renderGiven(outputSpec, output)}
|
|
825
|
+
</section>
|
|
826
|
+
`
|
|
826
827
|
: ''}
|
|
827
828
|
`);
|
|
828
829
|
}
|
|
@@ -833,8 +834,7 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
833
834
|
const { output, activityInstance } = this.activityThread;
|
|
834
835
|
const { viewSource: boardId, input } = activityInstance || {};
|
|
835
836
|
if (!this.board || this.board.id !== boardId) {
|
|
836
|
-
this.board = { id: boardId
|
|
837
|
-
};
|
|
837
|
+
this.board = { id: boardId };
|
|
838
838
|
}
|
|
839
839
|
return keyed(this.activityApproval.id, html `
|
|
840
840
|
<ox-board-viewer
|
|
@@ -917,13 +917,28 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
async fetchActivityApproval(id) {
|
|
920
|
-
|
|
920
|
+
this.lastId = id;
|
|
921
|
+
this.loadError = null;
|
|
922
|
+
let response;
|
|
923
|
+
try {
|
|
924
|
+
response = await client.query({
|
|
925
|
+
query: gql `
|
|
921
926
|
query activityApproval($id: String!) { activityApproval(id: $id) ${ActivityApprovalFetchResult}
|
|
922
927
|
}
|
|
923
928
|
`,
|
|
924
|
-
|
|
925
|
-
}
|
|
926
|
-
}
|
|
929
|
+
variables: { id }
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
catch (error) {
|
|
933
|
+
this.loadError = error;
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
if (response.errors?.length || !response.data?.activityApproval) {
|
|
937
|
+
this.loadError = response.errors?.length
|
|
938
|
+
? response.errors
|
|
939
|
+
: new Error(i18next.t('error.activity-approval not found', { activityApproval: id }));
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
927
942
|
this.activityApproval = response.data.activityApproval;
|
|
928
943
|
this.loaded = true;
|
|
929
944
|
this.activityThread = this.activityApproval.activityThread;
|
|
@@ -952,27 +967,22 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
952
967
|
async rejectActivityApproval() {
|
|
953
968
|
var { id, comment } = this.activityApproval;
|
|
954
969
|
if (!comment) {
|
|
955
|
-
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.enter a comment')
|
|
956
|
-
}
|
|
957
|
-
}));
|
|
970
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.enter a comment') } }));
|
|
958
971
|
this.commentInput.focus();
|
|
959
972
|
return;
|
|
960
973
|
}
|
|
961
|
-
const outcome = await ranMutation(() => client.mutate({
|
|
974
|
+
const outcome = await ranMutation(() => client.mutate({
|
|
975
|
+
mutation: gql `
|
|
962
976
|
mutation ($id: String!, $comment: String!) { rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
|
|
963
977
|
}
|
|
964
978
|
`,
|
|
965
|
-
variables: { id,
|
|
966
|
-
comment
|
|
967
|
-
}
|
|
979
|
+
variables: { id, comment }
|
|
968
980
|
}));
|
|
969
981
|
if (outcome.ok) {
|
|
970
982
|
this.activityApproval = outcome.data.rejectActivityApproval;
|
|
971
983
|
this.activityThread = this.activityApproval.activityThread;
|
|
972
984
|
this.updateContext();
|
|
973
|
-
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_rejected_successfully')
|
|
974
|
-
}
|
|
975
|
-
}));
|
|
985
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_rejected_successfully') } }));
|
|
976
986
|
}
|
|
977
987
|
}
|
|
978
988
|
async approveActivityApproval() {
|
|
@@ -980,40 +990,34 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
|
|
|
980
990
|
if (!(await this.confirmIfIrreversible())) {
|
|
981
991
|
return;
|
|
982
992
|
}
|
|
983
|
-
const outcome = await ranMutation(() => client.mutate({
|
|
993
|
+
const outcome = await ranMutation(() => client.mutate({
|
|
994
|
+
mutation: gql `
|
|
984
995
|
mutation ($id: String!, $comment: String) { approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
|
|
985
996
|
}
|
|
986
997
|
`,
|
|
987
|
-
variables: { id,
|
|
988
|
-
comment
|
|
989
|
-
}
|
|
998
|
+
variables: { id, comment }
|
|
990
999
|
}));
|
|
991
1000
|
if (outcome.ok) {
|
|
992
1001
|
this.activityApproval = outcome.data.approveActivityApproval;
|
|
993
1002
|
this.activityThread = this.activityApproval.activityThread;
|
|
994
1003
|
this.updateContext();
|
|
995
|
-
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_approved_successfully')
|
|
996
|
-
}
|
|
997
|
-
}));
|
|
1004
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_approved_successfully') } }));
|
|
998
1005
|
}
|
|
999
1006
|
}
|
|
1000
1007
|
async saveActivityApproval() {
|
|
1001
1008
|
var { id, comment } = this.activityApproval;
|
|
1002
|
-
const outcome = await ranMutation(() => client.mutate({
|
|
1009
|
+
const outcome = await ranMutation(() => client.mutate({
|
|
1010
|
+
mutation: gql `
|
|
1003
1011
|
mutation ($id: String!, $comment: String) { saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
|
|
1004
1012
|
}
|
|
1005
1013
|
`,
|
|
1006
|
-
variables: { id,
|
|
1007
|
-
comment
|
|
1008
|
-
}
|
|
1014
|
+
variables: { id, comment }
|
|
1009
1015
|
}));
|
|
1010
1016
|
if (outcome.ok) {
|
|
1011
1017
|
this.activityApproval = outcome.data.saveActivityApproval;
|
|
1012
1018
|
this.activityThread = this.activityApproval.activityThread;
|
|
1013
1019
|
this.updateContext();
|
|
1014
|
-
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully')
|
|
1015
|
-
}
|
|
1016
|
-
}));
|
|
1020
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } }));
|
|
1017
1021
|
}
|
|
1018
1022
|
}
|
|
1019
1023
|
};
|
|
@@ -1025,6 +1029,10 @@ __decorate([
|
|
|
1025
1029
|
state(),
|
|
1026
1030
|
__metadata("design:type", Object)
|
|
1027
1031
|
], ActivityApprovalPage.prototype, "loaded", void 0);
|
|
1032
|
+
__decorate([
|
|
1033
|
+
state(),
|
|
1034
|
+
__metadata("design:type", Object)
|
|
1035
|
+
], ActivityApprovalPage.prototype, "loadError", void 0);
|
|
1028
1036
|
__decorate([
|
|
1029
1037
|
state(),
|
|
1030
1038
|
__metadata("design:type", Object)
|