@things-factory/quotation 10.1.123 → 10.1.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist-client/bootstrap.js +1 -7
  2. package/dist-client/bootstrap.js.map +1 -1
  3. package/dist-client/index.d.ts +2 -1
  4. package/dist-client/index.js +2 -1
  5. package/dist-client/index.js.map +1 -1
  6. package/dist-client/pages/quotation-editor.d.ts +43 -0
  7. package/dist-client/pages/quotation-editor.js +313 -0
  8. package/dist-client/pages/quotation-editor.js.map +1 -0
  9. package/dist-client/pages/quotation-list.d.ts +36 -0
  10. package/dist-client/pages/quotation-list.js +113 -0
  11. package/dist-client/pages/quotation-list.js.map +1 -0
  12. package/dist-client/quotation-attach.d.ts +16 -0
  13. package/dist-client/quotation-attach.js +8 -0
  14. package/dist-client/quotation-attach.js.map +1 -0
  15. package/dist-client/quotation-words.d.ts +1 -0
  16. package/dist-client/quotation-words.js +13 -0
  17. package/dist-client/quotation-words.js.map +1 -0
  18. package/dist-client/route.d.ts +1 -1
  19. package/dist-client/route.js +4 -4
  20. package/dist-client/route.js.map +1 -1
  21. package/dist-client/tsconfig.tsbuildinfo +1 -1
  22. package/dist-server/index.d.ts +1 -0
  23. package/dist-server/index.js +1 -0
  24. package/dist-server/index.js.map +1 -1
  25. package/dist-server/service/index.d.ts +8 -3
  26. package/dist-server/service/index.js +9 -17
  27. package/dist-server/service/index.js.map +1 -1
  28. package/dist-server/service/quotation/index.d.ts +8 -5
  29. package/dist-server/service/quotation/index.js +8 -6
  30. package/dist-server/service/quotation/index.js.map +1 -1
  31. package/dist-server/service/quotation/quotation-event-query.d.ts +9 -0
  32. package/dist-server/service/quotation/quotation-event-query.js +55 -0
  33. package/dist-server/service/quotation/quotation-event-query.js.map +1 -0
  34. package/dist-server/service/quotation/quotation-event.d.ts +22 -0
  35. package/dist-server/service/quotation/quotation-event.js +98 -0
  36. package/dist-server/service/quotation/quotation-event.js.map +1 -0
  37. package/dist-server/service/quotation/quotation-item-query.d.ts +8 -0
  38. package/dist-server/service/quotation/quotation-item-query.js +45 -0
  39. package/dist-server/service/quotation/quotation-item-query.js.map +1 -0
  40. package/dist-server/service/quotation/quotation-item.d.ts +18 -0
  41. package/dist-server/service/quotation/quotation-item.js +75 -0
  42. package/dist-server/service/quotation/quotation-item.js.map +1 -0
  43. package/dist-server/service/quotation/quotation-mutation.d.ts +7 -6
  44. package/dist-server/service/quotation/quotation-mutation.js +66 -140
  45. package/dist-server/service/quotation/quotation-mutation.js.map +1 -1
  46. package/dist-server/service/quotation/quotation-query.d.ts +10 -5
  47. package/dist-server/service/quotation/quotation-query.js +69 -41
  48. package/dist-server/service/quotation/quotation-query.js.map +1 -1
  49. package/dist-server/service/quotation/quotation-rules.d.ts +6 -0
  50. package/dist-server/service/quotation/quotation-rules.js +22 -0
  51. package/dist-server/service/quotation/quotation-rules.js.map +1 -0
  52. package/dist-server/service/quotation/quotation-service.d.ts +23 -0
  53. package/dist-server/service/quotation/quotation-service.js +114 -0
  54. package/dist-server/service/quotation/quotation-service.js.map +1 -0
  55. package/dist-server/service/quotation/quotation-type.d.ts +4 -18
  56. package/dist-server/service/quotation/quotation-type.js +9 -63
  57. package/dist-server/service/quotation/quotation-type.js.map +1 -1
  58. package/dist-server/service/quotation/quotation.d.ts +19 -11
  59. package/dist-server/service/quotation/quotation.js +41 -44
  60. package/dist-server/service/quotation/quotation.js.map +1 -1
  61. package/dist-server/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +16 -6
  63. package/things-factory.config.js +2 -2
  64. package/translations/en.json +36 -1
  65. package/translations/ko.json +36 -1
  66. package/dist-client/actions/main.d.ts +0 -1
  67. package/dist-client/actions/main.js +0 -2
  68. package/dist-client/actions/main.js.map +0 -1
  69. package/dist-client/activities/activity-quotation-edit.d.ts +0 -14
  70. package/dist-client/activities/activity-quotation-edit.js +0 -87
  71. package/dist-client/activities/activity-quotation-edit.js.map +0 -1
  72. package/dist-client/activities/activity-quotation-view.d.ts +0 -14
  73. package/dist-client/activities/activity-quotation-view.js +0 -87
  74. package/dist-client/activities/activity-quotation-view.js.map +0 -1
  75. package/dist-client/pages/main.d.ts +0 -1
  76. package/dist-client/pages/main.js +0 -36
  77. package/dist-client/pages/main.js.map +0 -1
  78. package/dist-client/pages/quotation/quotation-importer.d.ts +0 -23
  79. package/dist-client/pages/quotation/quotation-importer.js +0 -93
  80. package/dist-client/pages/quotation/quotation-importer.js.map +0 -1
  81. package/dist-client/pages/quotation/quotation-list-page.d.ts +0 -55
  82. package/dist-client/pages/quotation/quotation-list-page.js +0 -262
  83. package/dist-client/pages/quotation/quotation-list-page.js.map +0 -1
  84. package/dist-client/reducers/main.d.ts +0 -6
  85. package/dist-client/reducers/main.js +0 -14
  86. package/dist-client/reducers/main.js.map +0 -1
  87. package/dist-server/activities/activity-quotation.d.ts +0 -42
  88. package/dist-server/activities/activity-quotation.js +0 -114
  89. package/dist-server/activities/activity-quotation.js.map +0 -1
  90. package/dist-server/activities/index.d.ts +0 -1
  91. package/dist-server/activities/index.js +0 -17
  92. package/dist-server/activities/index.js.map +0 -1
  93. package/dist-server/service/quotation/event-subscriber.d.ts +0 -7
  94. package/dist-server/service/quotation/event-subscriber.js +0 -21
  95. package/dist-server/service/quotation/event-subscriber.js.map +0 -1
  96. package/dist-server/service/quotation/quotation-history.d.ts +0 -25
  97. package/dist-server/service/quotation/quotation-history.js +0 -132
  98. package/dist-server/service/quotation/quotation-history.js.map +0 -1
@@ -1,262 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@operato/data-grist';
3
- import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
4
- import { PageView } from '@operato/shell';
5
- import { css, html } from 'lit';
6
- import { customElement, property, query } from 'lit/decorators.js';
7
- import { ScopedElementsMixin } from '@open-wc/scoped-elements';
8
- import { DataGrist } from '@operato/data-grist';
9
- import { client } from '@operato/graphql';
10
- import { i18next, localize } from '@operato/i18n';
11
- import { notify, openPopup } from '@operato/layout';
12
- import { isMobileDevice } from '@operato/utils';
13
- import gql from 'graphql-tag';
14
- import { QuotationImporter } from './quotation-importer';
15
- let QuotationListPage = class QuotationListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
16
- constructor() {
17
- super(...arguments);
18
- this.mode = isMobileDevice() ? 'CARD' : 'GRID';
19
- }
20
- static { this.styles = [
21
- /* The work surface frame for a list screen (ADR-0060 decision 8). */
22
- WorkSurfacePageStyles,
23
- ScrollbarStyles,
24
- CommonGristStyles,
25
- CommonHeaderStyles,
26
- css `
27
- :host {
28
- --grid-record-emphasized-background-color: #8b0000;
29
- --grid-record-emphasized-color: #ff6b6b;
30
- }
31
-
32
- ox-filters-form { flex: 1;
33
- }
34
- `
35
- ]; }
36
- static get scopedElements() {
37
- return { 'quotation-importer': QuotationImporter
38
- };
39
- }
40
- get context() {
41
- return { title: i18next.t('title.quotation list'),
42
- search: { handler: (search) => {
43
- this.grist.searchText = search;
44
- },
45
- value: this.grist?.searchText || '' },
46
- filter: { handler: () => {
47
- this.grist.toggleHeadroom();
48
- }
49
- },
50
- help: 'quotation/quotation',
51
- actions: [
52
- { title: i18next.t('button.save'),
53
- action: this._updateQuotation.bind(this),
54
- ...CommonButtonStyles.save
55
- },
56
- { title: i18next.t('button.delete'),
57
- action: this._deleteQuotation.bind(this),
58
- ...CommonButtonStyles.delete
59
- }
60
- ],
61
- exportable: { name: i18next.t('title.quotation list'),
62
- data: this.exportHandler.bind(this)
63
- },
64
- importable: { handler: this.importHandler.bind(this)
65
- } };
66
- }
67
- render() {
68
- const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
69
- return html `
70
- <ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
71
- <div slot="headroom" class="header">
72
- <div class="filters">
73
- <ox-filters-form without-search autofocus></ox-filters-form>
74
-
75
- <div id="modes">
76
- <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
77
- <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
78
- <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
79
- </div>
80
- </div>
81
- </div>
82
- </ox-grist>
83
- `;
84
- }
85
- async pageInitialized(lifecycle) {
86
- this.gristConfig = { list: { fields: ['name', 'description'],
87
- details: ['active', 'updatedAt']
88
- },
89
- columns: [
90
- { type: 'gutter', gutterName: 'sequence' },
91
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
92
- { type: 'string',
93
- name: 'name',
94
- header: i18next.t('field.name'),
95
- record: { editable: true
96
- },
97
- filter: 'search',
98
- sortable: true,
99
- width: 150
100
- },
101
- { type: 'string',
102
- name: 'description',
103
- header: i18next.t('field.description'),
104
- record: { editable: true
105
- },
106
- filter: 'search',
107
- width: 200
108
- },
109
- { type: 'checkbox',
110
- name: 'active',
111
- label: true,
112
- header: i18next.t('field.active'),
113
- record: { editable: true
114
- },
115
- filter: true,
116
- sortable: true,
117
- width: 60
118
- },
119
- { type: 'resource-object',
120
- name: 'updater',
121
- header: i18next.t('field.updater'),
122
- record: { editable: false
123
- },
124
- sortable: true,
125
- width: 120
126
- },
127
- { type: 'datetime',
128
- name: 'updatedAt',
129
- header: i18next.t('field.updated_at'),
130
- record: { editable: false
131
- },
132
- sortable: true,
133
- width: 180
134
- }
135
- ],
136
- rows: { selectable: { multiple: true
137
- }
138
- },
139
- sorters: [
140
- { name: 'name'
141
- }
142
- ]
143
- };
144
- }
145
- async pageUpdated(changes, lifecycle) {
146
- if (this.active) { // do something here when this page just became as active
147
- }
148
- }
149
- async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
150
- const response = await client.query({ query: gql `
151
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: quotations(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
152
- name
153
- description
154
- active
155
- updater { id
156
- name
157
- }
158
- updatedAt
159
- }
160
- total
161
- }
162
- }
163
- `,
164
- variables: { filters,
165
- pagination: { page, limit },
166
- sortings
167
- }
168
- });
169
- return { total: response.data.responses.total || 0,
170
- records: response.data.responses.items || []
171
- };
172
- }
173
- async _deleteQuotation() {
174
- if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
175
- const ids = this.grist.selected.map(record => record.id);
176
- if (ids && ids.length > 0) {
177
- const response = await client.mutate({ mutation: gql `
178
- mutation ($ids: [String!]!) { deleteQuotations(ids: $ids)
179
- }
180
- `,
181
- variables: { ids
182
- }
183
- });
184
- if (!response.errors) {
185
- this.grist.fetch();
186
- notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
187
- });
188
- }
189
- }
190
- }
191
- }
192
- async _updateQuotation() {
193
- let patches = this.grist.dirtyRecords;
194
- if (patches && patches.length) {
195
- patches = patches.map(patch => {
196
- let patchField = patch.id ? { id: patch.id } : {};
197
- const dirtyFields = patch.__dirtyfields__;
198
- for (let key in dirtyFields) {
199
- patchField[key] = dirtyFields[key].after;
200
- }
201
- patchField.cuFlag = patch.__dirty__;
202
- return patchField;
203
- });
204
- const response = await client.mutate({ mutation: gql `
205
- mutation ($patches: [QuotationPatch!]!) { updateMultipleQuotation(patches: $patches) { name
206
- }
207
- }
208
- `,
209
- variables: { patches
210
- }
211
- });
212
- if (!response.errors) {
213
- this.grist.fetch();
214
- }
215
- }
216
- }
217
- async exportHandler() {
218
- const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
219
- const targetFieldSet = new Set(['id', 'name', 'description', 'active']);
220
- return exportTargets.map(quotation => {
221
- let tempObj = {};
222
- for (const field of targetFieldSet) {
223
- tempObj[field] = quotation[field];
224
- }
225
- return tempObj;
226
- });
227
- }
228
- async importHandler(records) {
229
- const popup = openPopup(html `
230
- <quotation-importer
231
- .quotations=${records}
232
- @imported=${() => {
233
- history.back();
234
- this.grist.fetch();
235
- }}
236
- ></quotation-importer>
237
- `, { backdrop: true,
238
- size: 'large',
239
- title: i18next.t('title.import quotation')
240
- });
241
- popup.onclosed = () => {
242
- this.grist.fetch();
243
- };
244
- }
245
- };
246
- __decorate([
247
- property({ type: Object }),
248
- __metadata("design:type", Object)
249
- ], QuotationListPage.prototype, "gristConfig", void 0);
250
- __decorate([
251
- property({ type: String }),
252
- __metadata("design:type", String)
253
- ], QuotationListPage.prototype, "mode", void 0);
254
- __decorate([
255
- query('ox-grist'),
256
- __metadata("design:type", DataGrist)
257
- ], QuotationListPage.prototype, "grist", void 0);
258
- QuotationListPage = __decorate([
259
- customElement('quotation-list-page')
260
- ], QuotationListPage);
261
- export { QuotationListPage };
262
- //# sourceMappingURL=quotation-list-page.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quotation-list-page.js","sourceRoot":"","sources":["../../../client/pages/quotation/quotation-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACnI,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,EAAgB,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM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B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gDAAA;AAxBjC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAuO7B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, 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 { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { QuotationImporter } from './quotation-importer'\n\n@customElement('quotation-list-page')\nexport class QuotationListPage 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 CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-filters-form { flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'quotation-importer': QuotationImporter\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.quotation 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: 'quotation/quotation',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateQuotation.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteQuotation.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.quotation 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 <ox-filters-form without-search autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\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: quotations(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 _deleteQuotation() { 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 response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteQuotations(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateQuotation() { 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 response = await client.mutate({ mutation: gql`\n mutation ($patches: [QuotationPatch!]!) { updateMultipleQuotation(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\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(quotation => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = quotation[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <quotation-importer\n .quotations=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></quotation-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import quotation')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- declare const quotation: (state: {
2
- quotation: string;
3
- } | undefined, action: any) => {
4
- quotation: string;
5
- };
6
- export default quotation;
@@ -1,14 +0,0 @@
1
- import { UPDATE_QUOTATION } from '../actions/main';
2
- const INITIAL_STATE = {
3
- quotation: 'ABC'
4
- };
5
- const quotation = (state = INITIAL_STATE, action) => {
6
- switch (action.type) {
7
- case UPDATE_QUOTATION:
8
- return { ...state };
9
- default:
10
- return state;
11
- }
12
- };
13
- export default quotation;
14
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/reducers/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,KAAK;CACjB,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,aAAa,EAAE,MAAM,EAAE,EAAE;IAClD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,gBAAgB;YACnB,OAAO,EAAE,GAAG,KAAK,EAAE,CAAA;QAErB;YACE,OAAO,KAAK,CAAA;IAChB,CAAC;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA","sourcesContent":["import { UPDATE_QUOTATION } from '../actions/main'\n\nconst INITIAL_STATE = {\n quotation: 'ABC'\n}\n\nconst quotation = (state = INITIAL_STATE, action) => {\n switch (action.type) {\n case UPDATE_QUOTATION:\n return { ...state }\n\n default:\n return state\n }\n}\n\nexport default quotation\n"]}
@@ -1,42 +0,0 @@
1
- import { ActivityInstance, UpdateActivityInstanceStateAddendum } from '@things-factory/worklist';
2
- declare function callback(activityInstance: ActivityInstance, addendum: UpdateActivityInstanceStateAddendum, context: ResolverContext): Promise<void>;
3
- export declare const ActivityQuotation: {
4
- name: string;
5
- description: string;
6
- release: string;
7
- provider: string;
8
- category: string;
9
- activityType: string;
10
- priority: number;
11
- searchKeys: {
12
- name: string;
13
- description: string;
14
- inputKey: string;
15
- tKey: string;
16
- }[];
17
- startable: boolean;
18
- startingType: string;
19
- multiple: any;
20
- model: {
21
- name: string;
22
- description: string;
23
- tag: string;
24
- hidden: boolean;
25
- mandatory: boolean;
26
- inout: string;
27
- type: string;
28
- options: {};
29
- unit: any;
30
- quantifier: number[];
31
- spec: {};
32
- }[];
33
- uiType: string;
34
- uiSource: string;
35
- viewType: string;
36
- viewSource: string;
37
- reportType: string;
38
- reportSource: string;
39
- thumbnail: string;
40
- callback: typeof callback;
41
- };
42
- export {};
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActivityQuotation = void 0;
4
- const worklist_1 = require("@things-factory/worklist");
5
- async function callback(activityInstance, addendum, context) {
6
- const { domain, tx } = context.state;
7
- const { input, output, state } = activityInstance;
8
- const { causedBy } = addendum || {};
9
- if (state == worklist_1.ActivityInstanceStatus.Ended) {
10
- const activity = (await tx.getRepository(worklist_1.Activity).findOneBy({
11
- domain: { id: domain.id },
12
- name: 'Quotation'
13
- }));
14
- /*
15
- quotation 액티비티는 한명의 assignee(thread)만 수행하도록 한다. 따라서, output 중에서 샘플 한 개만을 data로 취한다.
16
- 만약, 여러 assignees(threads)가 수행하는 액티비티인 경우에는 output 전체를 data로 처리한다.
17
- */
18
- const assignees = Object.keys(output);
19
- const data = assignees.length > 0 && output[assignees[0]];
20
- if (activity) {
21
- /*
22
- custom logic goes here.
23
- 주로,
24
- */
25
- }
26
- else {
27
- console.error('Quotation Activity not installed.');
28
- }
29
- }
30
- else if (state == worklist_1.ActivityInstanceStatus.Aborted) {
31
- }
32
- }
33
- exports.ActivityQuotation = {
34
- name: 'Quotation',
35
- description: 'An activity that issues a quotation',
36
- release: '1.0.0',
37
- provider: 'hatiolab.com',
38
- category: '',
39
- activityType: 'user',
40
- priority: 1,
41
- searchKeys: [
42
- // sample search keys
43
- {
44
- name: 'customer',
45
- description: 'Customer Code',
46
- inputKey: 'customer',
47
- tKey: 'customer'
48
- },
49
- {
50
- name: 'product',
51
- description: 'Product Code',
52
- inputKey: 'product',
53
- tKey: 'product'
54
- }
55
- ],
56
- /*
57
- startable 설정된 액티비티는 수동으로 업무를 시작하여, 할당할 수 있음을 의미한다.
58
- issuer로 정의된 역할을 갖는 사용자가 시작할 수 있으며, issuer가 정의되지 않았다면 모든 사용자가 시작할 수 있다.
59
- 업무를 시작하는 과정에서 assignees와 approval-line은 액티비티의 설정을 디폴트로 하지만 수동으로 조정할 수 있다.
60
- */
61
- startable: true,
62
- /* (미구현 속성)
63
- startingType 설정된 액티비티는 'issue' 또는 'post' 이 될 수 있다. 'post' 타입은 혼자서 start, assign, end 까지 한번에 다하는 특성을 갖는다. 이 액티비티를 수행하는 사용자는 draft(초안)과 post(완료)단계만 인식하게 된다.
64
- 이 경우의 모델은 모두 'in' 또는 'inout'의 속성을 갖는 것이 좋다. 'out' 속성의 데이타는 입력될 기회를 갖지 못한다.
65
- 이 경우의 assignees 설정은 의미가 없다.
66
- 이 경우에도 approval-line이 설정되어 있다면, 승인 프로세스에 의해서 처리된다.
67
- 'issue' 타입인 경우에는 모델의 'in' 또는 'inout' 속성을 채워서 assignee에게 할당하는 방식이므로 assignee가 설정되어야 한다.
68
- */
69
- startingType: 'post',
70
- /* (미구현 속성)
71
- multiple 속성은 'parallel', 'sequential' 값을 설정할 수 있다. parallel로 설정하면, 다중 인스턴스(여기서는 다중 쓰레드)로 처리하되 병렬처리되며,
72
- sequential로 설정하면 순차적으로 다중 인스턴스가 수행된다.
73
- 설정하지 않으면, single 인스턴스로 수행된다는 의미이며, 이 경우 assignees가 여럿이 설정되어있어도 1명에게만 할당되게 된다.
74
- 이 경우에는 액티비티 인스턴스의 결과 데이타(output)도 단일 쓰레드의 output이 그대로 적용된다.
75
- */
76
- multiple: null,
77
- model: [
78
- {
79
- name: 'customer',
80
- description: 'Customer Code',
81
- tag: 'customer',
82
- hidden: true,
83
- mandatory: true,
84
- inout: 'in',
85
- type: 'string',
86
- options: {},
87
- unit: null,
88
- quantifier: [1],
89
- spec: {}
90
- },
91
- {
92
- name: 'product',
93
- description: 'Product Code',
94
- tag: 'product',
95
- hidden: true,
96
- mandatory: true,
97
- inout: 'in',
98
- type: 'string',
99
- options: {},
100
- unit: null,
101
- quantifier: [1],
102
- spec: {}
103
- }
104
- ],
105
- uiType: 'custom-element',
106
- uiSource: 'activity-quotation-edit',
107
- viewType: 'custom-element',
108
- viewSource: 'activity-quotation-view',
109
- reportType: 'custom-element',
110
- reportSource: 'activity-quotation-report',
111
- thumbnail: '/assets/images/quotation-activity.png',
112
- callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
113
- };
114
- //# sourceMappingURL=activity-quotation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity-quotation.js","sourceRoot":"","sources":["../../server/activities/activity-quotation.ts"],"names":[],"mappings":";;;AAAA,uDAMiC;AAEjC,KAAK,UAAU,QAAQ,CACrB,gBAAkC,EAClC,QAA6C,EAC7C,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAA;IACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAA;IAEnC,IAAI,KAAK,IAAI,iCAAsB,CAAC,KAAK,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,SAAS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AI;YACf,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,cAAc;YAC3B,GAAG,EAAE,SAAS;YACd,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;KACF;IACD,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,yBAAyB;IACnC,QAAQ,EAAE,gBAAgB;IAC1B,UAAU,EAAE,yBAAyB;IACrC,UAAU,EAAE,gBAAgB;IAC5B,YAAY,EAAE,2BAA2B;IACzC,SAAS,EAAE,uCAAuC;IAClD,QAAQ,CAAC,mFAAmF;CAC7F,CAAA","sourcesContent":["import {\n Activity,\n ActivityInstance,\n ActivityInstanceStatus,\n ActivityThread,\n UpdateActivityInstanceStateAddendum\n} from '@things-factory/worklist'\n\nasync function callback(\n activityInstance: ActivityInstance,\n addendum: UpdateActivityInstanceStateAddendum,\n context: ResolverContext\n) {\n const { domain, tx } = context.state\n const { input, output, state } = activityInstance\n const { causedBy } = addendum || {}\n\n if (state == ActivityInstanceStatus.Ended) {\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'Quotation'\n })) as Activity\n\n /* \n quotation 액티비티는 한명의 assignee(thread)만 수행하도록 한다. 따라서, output 중에서 샘플 한 개만을 data로 취한다.\n 만약, 여러 assignees(threads)가 수행하는 액티비티인 경우에는 output 전체를 data로 처리한다.\n */\n const assignees = Object.keys(output)\n const data = assignees.length > 0 && output[assignees[0]]\n\n if (activity) {\n /* \n custom logic goes here.\n 주로, \n */\n } else {\n console.error('Quotation Activity not installed.')\n }\n } else if (state == ActivityInstanceStatus.Aborted) {\n }\n}\n\nexport const ActivityQuotation = {\n name: 'Quotation',\n description: 'An activity that issues a quotation',\n release: '1.0.0',\n provider: 'hatiolab.com',\n category: '',\n activityType: 'user',\n priority: 1,\n searchKeys: [\n // sample search keys\n {\n name: 'customer',\n description: 'Customer Code',\n inputKey: 'customer',\n tKey: 'customer'\n },\n {\n name: 'product',\n description: 'Product Code',\n inputKey: 'product',\n tKey: 'product'\n }\n ],\n /* \n startable 설정된 액티비티는 수동으로 업무를 시작하여, 할당할 수 있음을 의미한다.\n issuer로 정의된 역할을 갖는 사용자가 시작할 수 있으며, issuer가 정의되지 않았다면 모든 사용자가 시작할 수 있다.\n 업무를 시작하는 과정에서 assignees와 approval-line은 액티비티의 설정을 디폴트로 하지만 수동으로 조정할 수 있다.\n */\n startable: true,\n /* (미구현 속성) \n startingType 설정된 액티비티는 'issue' 또는 'post' 이 될 수 있다. 'post' 타입은 혼자서 start, assign, end 까지 한번에 다하는 특성을 갖는다. 이 액티비티를 수행하는 사용자는 draft(초안)과 post(완료)단계만 인식하게 된다.\n 이 경우의 모델은 모두 'in' 또는 'inout'의 속성을 갖는 것이 좋다. 'out' 속성의 데이타는 입력될 기회를 갖지 못한다.\n 이 경우의 assignees 설정은 의미가 없다.\n 이 경우에도 approval-line이 설정되어 있다면, 승인 프로세스에 의해서 처리된다.\n 'issue' 타입인 경우에는 모델의 'in' 또는 'inout' 속성을 채워서 assignee에게 할당하는 방식이므로 assignee가 설정되어야 한다.\n */\n startingType: 'post',\n /* (미구현 속성)\n multiple 속성은 'parallel', 'sequential' 값을 설정할 수 있다. parallel로 설정하면, 다중 인스턴스(여기서는 다중 쓰레드)로 처리하되 병렬처리되며,\n sequential로 설정하면 순차적으로 다중 인스턴스가 수행된다.\n 설정하지 않으면, single 인스턴스로 수행된다는 의미이며, 이 경우 assignees가 여럿이 설정되어있어도 1명에게만 할당되게 된다.\n 이 경우에는 액티비티 인스턴스의 결과 데이타(output)도 단일 쓰레드의 output이 그대로 적용된다.\n */\n multiple: null,\n model: [\n {\n name: 'customer',\n description: 'Customer Code',\n tag: 'customer',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'product',\n description: 'Product Code',\n tag: 'product',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n }\n ],\n uiType: 'custom-element',\n uiSource: 'activity-quotation-edit',\n viewType: 'custom-element',\n viewSource: 'activity-quotation-view',\n reportType: 'custom-element',\n reportSource: 'activity-quotation-report',\n thumbnail: '/assets/images/quotation-activity.png',\n callback /* Called when there is a change in the lifecycle of a task (activity-instance). */\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const worklist_1 = require("@things-factory/worklist");
4
- /* IMPORT ACTIVITY TEMPLATES */
5
- const activity_quotation_1 = require("./activity-quotation");
6
- [
7
- /* ACTIVITY TEMPLATES */
8
- activity_quotation_1.ActivityQuotation
9
- ].forEach(template => {
10
- worklist_1.ActivityInstallations.installActivityTemplate(template);
11
- });
12
- /*
13
- Add the following line to server/index.ts so that activities can be registered when loading a module.
14
- --
15
- import './activities'
16
- */
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/activities/index.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAEhE,+BAA+B;AAC/B,6DACC;AAAA;IACC,wBAAwB;IACxB,sCAAiB;CAClB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,gCAAqB,CAAC,uBAAuB,CAAC,QAAe,CAAC,CAAA;AAChE,CAAC,CAAC,CAAA;AAEF;;;;EAIE","sourcesContent":["import { ActivityInstallations } from '@things-factory/worklist'\n\n/* IMPORT ACTIVITY TEMPLATES */\nimport { ActivityQuotation } from './activity-quotation'\n;[\n /* ACTIVITY TEMPLATES */\n ActivityQuotation\n].forEach(template => {\n ActivityInstallations.installActivityTemplate(template as any)\n})\n\n/* \nAdd the following line to server/index.ts so that activities can be registered when loading a module.\n--\nimport './activities'\n*/\n"]}
@@ -1,7 +0,0 @@
1
- import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
- import { Quotation } from './quotation';
3
- import { QuotationHistory } from './quotation-history';
4
- export declare class QuotationHistoryEntitySubscriber extends HistoryEntitySubscriber<Quotation, QuotationHistory> {
5
- get entity(): typeof Quotation;
6
- get historyEntity(): typeof QuotationHistory;
7
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuotationHistoryEntitySubscriber = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const typeorm_history_1 = require("@operato/typeorm-history");
7
- const quotation_1 = require("./quotation");
8
- const quotation_history_1 = require("./quotation-history");
9
- let QuotationHistoryEntitySubscriber = class QuotationHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
- get entity() {
11
- return quotation_1.Quotation;
12
- }
13
- get historyEntity() {
14
- return quotation_history_1.QuotationHistory;
15
- }
16
- };
17
- exports.QuotationHistoryEntitySubscriber = QuotationHistoryEntitySubscriber;
18
- exports.QuotationHistoryEntitySubscriber = QuotationHistoryEntitySubscriber = tslib_1.__decorate([
19
- (0, typeorm_1.EventSubscriber)()
20
- ], QuotationHistoryEntitySubscriber);
21
- //# sourceMappingURL=event-subscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/quotation/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2CAAuC;AACvC,2DAAsD;AAG/C,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,yCAAoD;IACxG,IAAW,MAAM;QACf,OAAO,qBAAS,CAAA;IAClB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,oCAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AARY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,yBAAe,GAAE;GACL,gCAAgC,CAQ5C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Quotation } from './quotation'\nimport { QuotationHistory } from './quotation-history'\n\n@EventSubscriber()\nexport class QuotationHistoryEntitySubscriber extends HistoryEntitySubscriber<Quotation, QuotationHistory> {\n public get entity() {\n return Quotation\n }\n\n public get historyEntity() {\n return QuotationHistory\n }\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
2
- import { User } from '@things-factory/auth-base';
3
- import { Domain } from '@things-factory/shell';
4
- import { Quotation, QuotationStatus } from './quotation';
5
- export declare class QuotationHistory implements HistoryEntityInterface<Quotation> {
6
- readonly id: string;
7
- version?: number;
8
- domain?: Domain;
9
- domainId?: string;
10
- name: string;
11
- description?: string;
12
- active?: boolean;
13
- state?: QuotationStatus;
14
- params?: string;
15
- createdAt?: Date;
16
- updatedAt?: Date;
17
- deletedAt?: Date;
18
- creator?: User;
19
- creatorId?: string;
20
- updater?: User;
21
- updaterId?: string;
22
- thumbnail?: string;
23
- originalId: string;
24
- action: HistoryActionType;
25
- }