@things-factory/kpi 9.1.19 → 10.0.0-beta.2

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 (140) hide show
  1. package/client/pages/kpi/kpi-list-page.ts +339 -525
  2. package/client/pages/kpi/kpi-tree-page.ts +135 -207
  3. package/client/pages/kpi-metric/kpi-metric-list-page.ts +146 -226
  4. package/client/pages/kpi-metric-value/kpi-metric-value-editor-page.ts +187 -295
  5. package/client/pages/kpi-metric-value/kpi-metric-value-list-page.ts +123 -194
  6. package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.ts +57 -91
  7. package/client/pages/kpi-statistic/kpi-statistic-editor-page.ts +180 -278
  8. package/client/pages/kpi-statistic/kpi-statistic-list-page.ts +186 -286
  9. package/client/pages/kpi-value/kpi-value-editor-page.ts +189 -292
  10. package/client/pages/kpi-value/kpi-value-list-page.ts +170 -264
  11. package/dist-client/pages/kpi/kpi-list-page.d.ts +0 -6
  12. package/dist-client/pages/kpi/kpi-list-page.js +150 -282
  13. package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
  14. package/dist-client/pages/kpi/kpi-tree-page.d.ts +1 -7
  15. package/dist-client/pages/kpi/kpi-tree-page.js +76 -127
  16. package/dist-client/pages/kpi/kpi-tree-page.js.map +1 -1
  17. package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +0 -6
  18. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +62 -116
  19. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
  20. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +1 -7
  21. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +82 -140
  22. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -1
  23. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +0 -6
  24. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +54 -98
  25. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
  26. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +1 -7
  27. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +30 -57
  28. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -1
  29. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.d.ts +1 -7
  30. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +91 -153
  31. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js.map +1 -1
  32. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.d.ts +0 -6
  33. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +81 -155
  34. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js.map +1 -1
  35. package/dist-client/pages/kpi-value/kpi-value-editor-page.d.ts +1 -7
  36. package/dist-client/pages/kpi-value/kpi-value-editor-page.js +80 -136
  37. package/dist-client/pages/kpi-value/kpi-value-editor-page.js.map +1 -1
  38. package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +0 -6
  39. package/dist-client/pages/kpi-value/kpi-value-list-page.js +73 -134
  40. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
  41. package/dist-client/tsconfig.tsbuildinfo +1 -1
  42. package/dist-server/service/index.d.ts +1 -1
  43. package/dist-server/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +18 -18
  45. package/client/tsconfig.json +0 -11
  46. package/dist-server/tsconfig.json +0 -10
  47. package/server/@types/index.d.ts +0 -11
  48. package/server/calculator/evaluator.ts +0 -45
  49. package/server/calculator/functions.ts +0 -67
  50. package/server/calculator/index.ts +0 -4
  51. package/server/calculator/parser.ts +0 -137
  52. package/server/calculator/provider.ts +0 -10
  53. package/server/controllers/index.ts +0 -2
  54. package/server/controllers/kpi-metric-value-provider.ts +0 -79
  55. package/server/controllers/kpi-value-provider.ts +0 -51
  56. package/server/index.ts +0 -6
  57. package/server/migrations/1752190849680-seed-kpi-metrics.ts +0 -124
  58. package/server/migrations/1752190849681-seed-kpi.ts +0 -356
  59. package/server/migrations/1752192090123-add-grades-to-kpi.ts +0 -67
  60. package/server/migrations/1752192090124-add-kpi-statistics.ts +0 -719
  61. package/server/migrations/1752192090128-seed-kpi-org-scope.ts +0 -132
  62. package/server/migrations/1752192090129-seed-kpi-values.ts +0 -207
  63. package/server/migrations/grade-data/x11-performance-table.json +0 -962
  64. package/server/migrations/grade-data/x12-performance-table.json +0 -611
  65. package/server/migrations/grade-data/x14-performance-table.json +0 -42
  66. package/server/migrations/grade-data/x21-performance-table.json +0 -889
  67. package/server/migrations/grade-data/x22-performance-table.json +0 -1064
  68. package/server/migrations/grade-data/x23-performance-table.json +0 -42
  69. package/server/migrations/grade-data/x31-performance-table.json +0 -644
  70. package/server/migrations/grade-data/x32-performance-table.json +0 -993
  71. package/server/migrations/grade-data/x33-performance-table.json +0 -195
  72. package/server/migrations/grade-data/x34-performance-table.json +0 -12
  73. package/server/migrations/grade-data/x35-performance-table.json +0 -42
  74. package/server/migrations/grade-data/x41-performance-table.json +0 -825
  75. package/server/migrations/grade-data/x42-performance-table.json +0 -786
  76. package/server/migrations/grade-data/x43-performance-table.json +0 -12
  77. package/server/migrations/grade-data/x44-performance-table.json +0 -42
  78. package/server/migrations/grade-data/x51-performance-table.json +0 -924
  79. package/server/migrations/grade-data/x52-performance-table.json +0 -42
  80. package/server/migrations/grade-data/x61-performance-table.json +0 -261
  81. package/server/migrations/grade-data/x62-performance-table.json +0 -42
  82. package/server/migrations/index.ts +0 -9
  83. package/server/migrations/seed-data/kpi-metrics-seed.json +0 -454
  84. package/server/migrations/seed-data/kpi-org-scope-seed.json +0 -1676
  85. package/server/migrations/seed-data/kpi-scopes-seed.json +0 -121
  86. package/server/migrations/seed-data/kpi-values-seed.json +0 -402
  87. package/server/migrations/seed-data/kpis-seed.json +0 -488
  88. package/server/migrations/seed-data/scope-definitions-seed.json +0 -90
  89. package/server/routes.ts +0 -81
  90. package/server/service/index.ts +0 -51
  91. package/server/service/kpi/aggregate-kpi.ts +0 -103
  92. package/server/service/kpi/event-subscriber.ts +0 -29
  93. package/server/service/kpi/index.ts +0 -9
  94. package/server/service/kpi/kpi-formula.service.ts +0 -164
  95. package/server/service/kpi/kpi-grade.types.ts +0 -28
  96. package/server/service/kpi/kpi-history.ts +0 -126
  97. package/server/service/kpi/kpi-mutation.ts +0 -553
  98. package/server/service/kpi/kpi-query.ts +0 -224
  99. package/server/service/kpi/kpi-type.ts +0 -151
  100. package/server/service/kpi/kpi.ts +0 -254
  101. package/server/service/kpi-alert/index.ts +0 -3
  102. package/server/service/kpi-alert/kpi-alert-query.ts +0 -59
  103. package/server/service/kpi-alert/kpi-alert-type.ts +0 -20
  104. package/server/service/kpi-metric/aggregate-kpi-metric.ts +0 -132
  105. package/server/service/kpi-metric/index.ts +0 -7
  106. package/server/service/kpi-metric/kpi-metric-mutation.ts +0 -309
  107. package/server/service/kpi-metric/kpi-metric-query.ts +0 -70
  108. package/server/service/kpi-metric/kpi-metric-type.ts +0 -111
  109. package/server/service/kpi-metric/kpi-metric.ts +0 -134
  110. package/server/service/kpi-metric-value/index.ts +0 -7
  111. package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +0 -270
  112. package/server/service/kpi-metric-value/kpi-metric-value-query.ts +0 -62
  113. package/server/service/kpi-metric-value/kpi-metric-value-type.ts +0 -82
  114. package/server/service/kpi-metric-value/kpi-metric-value.ts +0 -93
  115. package/server/service/kpi-org-scope/index.ts +0 -6
  116. package/server/service/kpi-org-scope/kpi-org-scope-mutation.ts +0 -173
  117. package/server/service/kpi-org-scope/kpi-org-scope-query.ts +0 -127
  118. package/server/service/kpi-org-scope/kpi-org-scope-type.ts +0 -68
  119. package/server/service/kpi-org-scope/kpi-org-scope.ts +0 -123
  120. package/server/service/kpi-scope/index.ts +0 -11
  121. package/server/service/kpi-scope/kpi-scope-mutation.ts +0 -129
  122. package/server/service/kpi-scope/kpi-scope-query.ts +0 -63
  123. package/server/service/kpi-scope/kpi-scope-type.ts +0 -96
  124. package/server/service/kpi-scope/kpi-scope.ts +0 -143
  125. package/server/service/kpi-statistic/index.ts +0 -7
  126. package/server/service/kpi-statistic/kpi-statistic-batch.service.ts +0 -231
  127. package/server/service/kpi-statistic/kpi-statistic-calculation.service.ts +0 -410
  128. package/server/service/kpi-statistic/kpi-statistic-mutation.ts +0 -291
  129. package/server/service/kpi-statistic/kpi-statistic-query.ts +0 -146
  130. package/server/service/kpi-statistic/kpi-statistic-type.ts +0 -152
  131. package/server/service/kpi-statistic/kpi-statistic.ts +0 -199
  132. package/server/service/kpi-value/index.ts +0 -7
  133. package/server/service/kpi-value/kpi-value-mutation.ts +0 -432
  134. package/server/service/kpi-value/kpi-value-query.ts +0 -61
  135. package/server/service/kpi-value/kpi-value-score.service.ts +0 -106
  136. package/server/service/kpi-value/kpi-value-type.ts +0 -122
  137. package/server/service/kpi-value/kpi-value.ts +0 -160
  138. package/server/service/utils/value-date-util.ts +0 -119
  139. package/server/tsconfig.json +0 -10
  140. package/server/types/global.d.ts +0 -8
@@ -6,7 +6,7 @@ import '@operato/data-grist/ox-record-creator.js'
6
6
  import './kpi-metric-value-manual-entry-form.js'
7
7
 
8
8
  import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
9
- import { PageView, store } from '@operato/shell'
9
+ import { PageView } from '@operato/shell'
10
10
  import { css, html } from 'lit'
11
11
  import { customElement, property, query } from 'lit/decorators.js'
12
12
  import { ScopedElementsMixin } from '@open-wc/scoped-elements'
@@ -18,27 +18,22 @@ import { OxPopup, OxPrompt } from '@operato/popup'
18
18
  import { isMobileDevice } from '@operato/utils'
19
19
  import { p13n } from '@operato/p13n'
20
20
 
21
- import { connect } from 'pwa-helpers/connect-mixin'
22
21
  import gql from 'graphql-tag'
23
22
 
24
23
  @customElement('kpi-metric-value-list-page')
25
- export class KpiMetricValueListPage extends connect(store)(p13n(localize(i18next)(ScopedElementsMixin(PageView)))) {
26
- static styles = [
24
+ export class KpiMetricValueListPage extends p13n(localize(i18next)(ScopedElementsMixin(PageView))) { static styles = [
27
25
  ScrollbarStyles,
28
26
  CommonGristStyles,
29
27
  CommonHeaderStyles,
30
28
  css`
31
- :host {
32
- display: flex;
29
+ :host { display: flex;
33
30
  width: 100%;
34
- }
35
- ox-grist {
36
- overflow-y: auto;
31
+ }
32
+ ox-grist { overflow-y: auto;
37
33
  flex: 1;
38
- }
39
- ox-filters-form {
40
- flex: 1;
41
- }
34
+ }
35
+ ox-filters-form { flex: 1;
36
+ }
42
37
  `
43
38
  ]
44
39
 
@@ -46,50 +41,38 @@ export class KpiMetricValueListPage extends connect(store)(p13n(localize(i18next
46
41
  @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
47
42
  @query('ox-grist') private grist!: DataGrist
48
43
 
49
- get context() {
50
- return {
51
- title: i18next.t('title.kpi metric value list'),
52
- search: {
53
- handler: (search: string) => {
54
- this.grist.searchText = search
55
- },
44
+ get context() { return { title: i18next.t('title.kpi metric value list'),
45
+ search: { handler: (search: string) => { this.grist.searchText = search
46
+ },
56
47
  value: this.grist.searchText
57
- },
58
- filter: {
59
- handler: () => {
60
- this.grist.toggleHeadroom()
61
- }
62
- },
48
+ },
49
+ filter: { handler: () => { this.grist.toggleHeadroom()
50
+ }
51
+ },
63
52
  help: 'kpi/kpi-metric-value',
64
53
  actions: [
65
- {
66
- title: i18next.t('button.bulk edit'),
54
+ { title: i18next.t('button.bulk edit'),
67
55
  action: this._openEditor.bind(this),
68
56
  ...CommonButtonStyles.edit
69
- },
70
- {
71
- title: i18next.t('button.save'),
57
+ },
58
+ { title: i18next.t('button.save'),
72
59
  action: this._updateKpiMetricValue.bind(this),
73
60
  ...CommonButtonStyles.save
74
- },
75
- {
76
- title: i18next.t('button.delete'),
61
+ },
62
+ { title: i18next.t('button.delete'),
77
63
  action: this._deleteKpiMetricValue.bind(this),
78
64
  ...CommonButtonStyles.delete
79
- }
65
+ }
80
66
  ],
81
- exportable: {
82
- name: i18next.t('title.kpi metric value list'),
67
+ exportable: { name: i18next.t('title.kpi metric value list'),
83
68
  data: this.exportHandler.bind(this)
84
- },
85
- importable: {
86
- handler: this.importHandler.bind(this)
87
- }
88
- }
89
- }
69
+ },
70
+ importable: { handler: this.importHandler.bind(this)
71
+ }
72
+ }
73
+ }
90
74
 
91
- render() {
92
- const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
75
+ render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
93
76
  return html`
94
77
  <ox-grist
95
78
  .mode=${mode}
@@ -116,221 +99,170 @@ export class KpiMetricValueListPage extends connect(store)(p13n(localize(i18next
116
99
  <ox-grist-personalizer slot="setting"></ox-grist-personalizer>
117
100
  </ox-grist>
118
101
  `
119
- }
102
+ }
120
103
 
121
- async pageInitialized() {
122
- this.gristConfig = {
123
- list: {
124
- fields: ['metric', 'valueDate', 'value', 'org', 'meta', 'createdAt', 'updatedAt', 'creator', 'updater'],
104
+ async pageInitialized() { this.gristConfig = { list: { fields: ['metric', 'valueDate', 'value', 'org', 'meta', 'createdAt', 'updatedAt', 'creator', 'updater'],
125
105
  details: ['metric', 'valueDate', 'value', 'org', 'meta', 'createdAt', 'updatedAt', 'creator', 'updater']
126
- },
106
+ },
127
107
  columns: [
128
108
  { type: 'gutter', gutterName: 'sequence' },
129
109
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
130
110
  // KPI Metric Value 수정 버튼 추가
131
- {
132
- type: 'gutter',
111
+ { type: 'gutter',
133
112
  gutterName: 'button',
134
113
  icon: 'edit',
135
114
  title: '수정',
136
- handlers: {
137
- click: (columns, data, column, record, rowIndex) => {
138
- this._editKpiMetricValue(record)
139
- }
140
- }
141
- },
142
- {
143
- type: 'string',
115
+ handlers: { click: (columns, data, column, record, rowIndex) => { this._editKpiMetricValue(record)
116
+ }
117
+ }
118
+ },
119
+ { type: 'string',
144
120
  name: 'metric',
145
121
  header: 'Metric',
146
122
  record: { editable: false, renderer: (v, c, r) => r.metric?.name },
147
123
  width: 150
148
- },
124
+ },
149
125
  { type: 'string', name: 'valueDate', header: '날짜', record: { editable: true }, width: 120 },
150
126
  { type: 'number', name: 'value', header: '값', record: { editable: true }, width: 120 },
151
127
  { type: 'string', name: 'org', header: '조직', record: { editable: false }, width: 120 },
152
128
  { type: 'object', name: 'meta', header: '메타', record: { editable: false }, width: 120 },
153
129
  { type: 'datetime', name: 'createdAt', header: '생성일', record: { editable: false }, width: 180 },
154
130
  { type: 'datetime', name: 'updatedAt', header: '수정일', record: { editable: false }, width: 180 },
155
- {
156
- type: 'resource-object',
131
+ { type: 'resource-object',
157
132
  name: 'creator',
158
133
  header: '생성자',
159
134
  record: { editable: false, renderer: (v, c, r) => r.creator?.name },
160
135
  width: 120
161
- },
162
- {
163
- type: 'resource-object',
136
+ },
137
+ { type: 'resource-object',
164
138
  name: 'updater',
165
139
  header: '수정자',
166
140
  record: { editable: false, renderer: (v, c, r) => r.updater?.name },
167
141
  width: 120
168
- }
142
+ }
169
143
  ],
170
- rows: {
171
- appendable: false,
172
- selectable: {
173
- multiple: true
174
- }
175
- },
144
+ rows: { appendable: false,
145
+ selectable: { multiple: true
146
+ }
147
+ },
176
148
  sorters: [{ name: 'valueDate' }]
177
- }
178
- }
149
+ }
150
+ }
179
151
 
180
- pageUpdated(changes: any, lifecycle: any) {
181
- if (this.active) {
182
- this.grist.fetch()
183
- }
184
- }
152
+ pageUpdated(changes: any, lifecycle: any) { if (this.active) { this.grist.fetch()
153
+ }
154
+ }
185
155
 
186
- async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
187
- const response = await client.query({
188
- query: gql`
189
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
190
- responses: kpiMetricValues(filters: $filters, pagination: $pagination, sortings: $sortings) {
191
- items {
192
- id
193
- metric {
194
- id
156
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`
157
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: kpiMetricValues(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
158
+ metric { id
195
159
  name
196
- }
160
+ }
197
161
  valueDate
198
162
  value
199
163
  meta
200
164
  org
201
- updater {
202
- id
165
+ updater { id
203
166
  name
204
- }
167
+ }
205
168
  updatedAt
206
- creator {
207
- id
169
+ creator { id
208
170
  name
209
- }
171
+ }
210
172
  createdAt
211
- }
173
+ }
212
174
  total
213
- }
214
- }
175
+ }
176
+ }
215
177
  `,
216
- variables: {
217
- filters,
178
+ variables: { filters,
218
179
  pagination: { page, limit },
219
180
  sortings
220
- }
221
- })
222
- return {
223
- total: response.data.responses.total || 0,
181
+ }
182
+ })
183
+ return { total: response.data.responses.total || 0,
224
184
  records: response.data.responses.items || []
225
- }
226
- }
185
+ }
186
+ }
227
187
 
228
- async _deleteKpiMetricValue() {
229
- if (
230
- await OxPrompt.open({
231
- title: i18next.t('text.are_you_sure'),
188
+ async _deleteKpiMetricValue() { if (
189
+ await OxPrompt.open({ title: i18next.t('text.are_you_sure'),
232
190
  text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
233
191
  confirmButton: { text: i18next.t('button.confirm') },
234
192
  cancelButton: { text: i18next.t('button.cancel') }
235
- })
236
- ) {
237
- const ids = this.grist.selected.map(record => record.id)
238
- if (ids && ids.length > 0) {
239
- const response = await client.mutate({
240
- mutation: gql`
241
- mutation ($ids: [String!]!) {
242
- deleteKpiMetricValues(ids: $ids)
243
- }
193
+ })
194
+ ) { const ids = this.grist.selected.map(record => record.id)
195
+ if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`
196
+ mutation ($ids: [String!]!) { deleteKpiMetricValues(ids: $ids)
197
+ }
244
198
  `,
245
199
  variables: { ids }
246
- })
247
- if (!response.errors) {
248
- this.grist.fetch()
200
+ })
201
+ if (!response.errors) { this.grist.fetch()
249
202
  notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') }) })
250
- }
251
- }
252
- }
253
- }
203
+ }
204
+ }
205
+ }
206
+ }
254
207
 
255
- async _updateKpiMetricValue() {
256
- let patches = this.grist.dirtyRecords
257
- if (patches && patches.length) {
258
- patches = patches.map(patch => {
259
- let patchField: any = patch.id ? { id: patch.id } : {}
208
+ async _updateKpiMetricValue() { let patches = this.grist.dirtyRecords
209
+ if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}
260
210
  const dirtyFields = patch.__dirtyfields__
261
- for (let key in dirtyFields) {
262
- patchField[key] = dirtyFields[key].after
263
- }
211
+ for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after
212
+ }
264
213
  patchField.cuFlag = patch.__dirty__
265
214
  return patchField
266
- })
267
- const response = await client.mutate({
268
- mutation: gql`
269
- mutation ($patches: [KpiMetricValuePatch!]!) {
270
- updateMultipleKpiMetricValue(patches: $patches) {
271
- id
272
- metric {
273
- id
215
+ })
216
+ const response = await client.mutate({ mutation: gql`
217
+ mutation ($patches: [KpiMetricValuePatch!]!) { updateMultipleKpiMetricValue(patches: $patches) { id
218
+ metric { id
274
219
  name
275
- }
220
+ }
276
221
  valueDate
277
222
  value
278
- }
279
- }
223
+ }
224
+ }
280
225
  `,
281
226
  variables: { patches }
282
- })
283
- if (!response.errors) {
284
- this.grist.fetch()
285
- }
286
- }
287
- }
227
+ })
228
+ if (!response.errors) { this.grist.fetch()
229
+ }
230
+ }
231
+ }
288
232
 
289
- async creationCallback(metricValue) {
290
- try {
291
- const response = await client.mutate({
292
- mutation: gql`
293
- mutation ($metricValue: NewKpiMetricValue!) {
294
- createKpiMetricValue(metricValue: $metricValue) {
295
- id
296
- }
297
- }
233
+ async creationCallback(metricValue) { try { const response = await client.mutate({ mutation: gql`
234
+ mutation ($metricValue: NewKpiMetricValue!) { createKpiMetricValue(metricValue: $metricValue) { id
235
+ }
236
+ }
298
237
  `,
299
238
  variables: { metricValue },
300
239
  context: { hasUpload: true }
301
- })
302
- if (!response.errors) {
303
- this.grist.fetch()
240
+ })
241
+ if (!response.errors) { this.grist.fetch()
304
242
  document.dispatchEvent(
305
243
  new CustomEvent('notify', { detail: { message: i18next.t('text.data_created_successfully') } })
306
244
  )
307
- }
245
+ }
308
246
  return true
309
- } catch (ex) {
310
- console.error(ex)
247
+ } catch (ex) { console.error(ex)
311
248
  document.dispatchEvent(new CustomEvent('notify', { detail: { type: 'error', message: i18next.t('text.error') } }))
312
249
  return false
313
- }
314
- }
250
+ }
251
+ }
315
252
 
316
- async exportHandler() {
317
- const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
253
+ async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
318
254
  const targetFieldSet = new Set(['id', 'metric', 'valueDate', 'value', 'org', 'meta'])
319
- return exportTargets.map(metricValue => {
320
- let tempObj = {}
321
- for (const field of targetFieldSet) {
322
- tempObj[field] = metricValue[field]
323
- }
255
+ return exportTargets.map(metricValue => { let tempObj = {}
256
+ for (const field of targetFieldSet) { tempObj[field] = metricValue[field]
257
+ }
324
258
  return tempObj
325
- })
326
- }
259
+ })
260
+ }
327
261
 
328
- async importHandler(records) {
329
- // 임포트 팝업 등은 추후 구현
330
- }
262
+ async importHandler(records) { // 임포트 팝업 등은 추후 구현
263
+ }
331
264
 
332
- async _editKpiMetricValue(metricValue) {
333
- const popup = await openPopup(
265
+ async _editKpiMetricValue(metricValue) { const popup = await openPopup(
334
266
  html`
335
267
  <kpi-metric-value-manual-entry-form
336
268
  .metric=${metricValue.metric}
@@ -338,24 +270,21 @@ export class KpiMetricValueListPage extends connect(store)(p13n(localize(i18next
338
270
  .value=${metricValue.value}
339
271
  .org=${metricValue.org}
340
272
  .meta=${metricValue.meta ? JSON.stringify(metricValue.meta) : ''}
341
- @saved=${() => {
342
- this.grist.fetch()
273
+ @saved=${() => { this.grist.fetch()
343
274
  popup.close()
344
- }}
275
+ }}
345
276
  ></kpi-metric-value-manual-entry-form>
346
277
  `,
347
- {
348
- title: `${metricValue.metric?.name || ''} 값 수정`,
278
+ { title: `${metricValue.metric?.name || ''} 값 수정`,
349
279
  size: 'medium',
350
280
  backdrop: true
351
- }
281
+ }
352
282
  )
353
- }
283
+ }
354
284
 
355
- async _openEditor() {
356
- const { KpiMetricValueEditorPage } = await import('./kpi-metric-value-editor-page.js')
285
+ async _openEditor() { const { KpiMetricValueEditorPage } = await import('./kpi-metric-value-editor-page.js')
357
286
  await openPopup(html`
358
287
  <${KpiMetricValueEditorPage}></${KpiMetricValueEditorPage}>
359
288
  `)
360
- }
289
+ }
361
290
  }