@things-factory/kpi 1.0.0-alpha.5 → 9.0.9
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/README.md +74 -0
- package/client/pages/kpi/kpi-list-page.ts +97 -47
- package/client/pages/kpi/kpi-overview-sample.ts +260 -0
- package/client/pages/kpi/kpi-overview.ts +271 -0
- package/client/pages/kpi-category/kpi-category-list-page.ts +39 -50
- package/client/pages/kpi-dashboard/kpi-alert-panel.ts +114 -0
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +285 -0
- package/client/pages/kpi-dashboard/kpi-grade-visualization.ts +75 -0
- package/client/pages/kpi-dashboard/kpi-history-viewer.ts +58 -0
- package/client/pages/kpi-dashboard/kpi-list-summary.ts +100 -0
- package/client/pages/kpi-dashboard/kpi-performance-summary.ts +124 -0
- package/client/pages/kpi-dashboard/kpi-value-entry.ts +78 -0
- package/client/pages/kpi-grade/kpi-grade-list-page.ts +58 -68
- package/client/pages/kpi-history/kpi-history-list-page.ts +146 -0
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +67 -63
- package/client/pages/kpi-value/kpi-value-list-page.ts +73 -72
- package/client/pages/kpi-value/kpi-value-manual-entry-form.ts +168 -0
- package/client/pages/kpi-value/kpi-value-manual-entry-page.ts +173 -0
- package/client/route.ts +35 -0
- package/dist-client/pages/kpi/kpi-importer.js +16 -17
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -1
- package/dist-client/pages/kpi/kpi-list-page.js +128 -68
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
- package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
- package/dist-client/pages/kpi/kpi-overview.js +290 -0
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js +16 -17
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -1
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +70 -71
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +24 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +305 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +139 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js +16 -17
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -1
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +89 -89
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +16 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +155 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +16 -17
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +98 -84
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-importer.js +16 -17
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +104 -93
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.d.ts +14 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js +201 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.d.ts +41 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js +180 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +27 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -1
- package/dist-server/index.js +2 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1752188906708-SeedKpiCategory.d.ts +5 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js +56 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js.map +1 -0
- package/dist-server/migrations/1752190849681-SeedKpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js +107 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js.map +1 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.d.ts +5 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js +271 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +48 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/index.d.ts +3 -4
- package/dist-server/service/index.js +4 -6
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
- package/dist-server/service/kpi/aggregate-kpi.js +88 -0
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +2 -0
- package/dist-server/service/kpi/event-subscriber.js +10 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -1
- package/dist-server/service/kpi/index.d.ts +2 -1
- package/dist-server/service/kpi/kpi-formula.service.d.ts +24 -0
- package/dist-server/service/kpi/kpi-formula.service.js +64 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +6 -2
- package/dist-server/service/kpi/kpi-history.js +29 -11
- package/dist-server/service/kpi/kpi-history.js.map +1 -1
- package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
- package/dist-server/service/kpi/kpi-mutation.js +215 -10
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
- package/dist-server/service/kpi/kpi-query.d.ts +10 -0
- package/dist-server/service/kpi/kpi-query.js +87 -3
- package/dist-server/service/kpi/kpi-query.js.map +1 -1
- package/dist-server/service/kpi/kpi-type.d.ts +14 -3
- package/dist-server/service/kpi/kpi-type.js +81 -18
- package/dist-server/service/kpi/kpi-type.js.map +1 -1
- package/dist-server/service/kpi/kpi.d.ts +14 -3
- package/dist-server/service/kpi/kpi.js +96 -19
- package/dist-server/service/kpi/kpi.js.map +1 -1
- package/dist-server/service/kpi-alert/index.d.ts +2 -0
- package/dist-server/service/kpi-alert/index.js +6 -0
- package/dist-server/service/kpi-alert/index.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js +71 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +1 -1
- package/dist-server/service/kpi-category/kpi-category-mutation.js +36 -10
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +2 -0
- package/dist-server/service/kpi-category/kpi-category-query.js +18 -2
- package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -5
- package/dist-server/service/kpi-category/kpi-category-type.js +16 -20
- package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category.d.ts +7 -9
- package/dist-server/service/kpi-category/kpi-category.js +40 -38
- package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
- package/dist-server/service/kpi-grade/index.d.ts +1 -2
- package/dist-server/service/kpi-grade/index.js +2 -4
- package/dist-server/service/kpi-grade/index.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js +33 -10
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-query.js +2 -2
- package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +13 -4
- package/dist-server/service/kpi-grade/kpi-grade-type.js +54 -18
- package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade.d.ts +8 -8
- package/dist-server/service/kpi-grade/kpi-grade.js +48 -40
- package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -1
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +134 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +1 -2
- package/dist-server/service/kpi-metric/index.js +2 -4
- package/dist-server/service/kpi-metric/index.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +139 -13
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-query.js +3 -3
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +17 -4
- package/dist-server/service/kpi-metric/kpi-metric-type.js +69 -11
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +11 -8
- package/dist-server/service/kpi-metric/kpi-metric.js +62 -37
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-mutation.js +66 -11
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +15 -2
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +19 -10
- package/dist-server/service/kpi-value/kpi-value-type.js +87 -24
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value.d.ts +15 -9
- package/dist-server/service/kpi-value/kpi-value.js +86 -32
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/implement-plan/01-entity-type-resolver.md +57 -0
- package/implement-plan/02-dataset-integration.md +35 -0
- package/implement-plan/03-kpivalue-automation.md +34 -0
- package/implement-plan/04-version-history.md +33 -0
- package/implement-plan/05-grade-visualization.md +33 -0
- package/implement-plan/06-graphql-frontend.md +30 -0
- package/implement-plan/07-test-docs.md +35 -0
- package/implement-plan/TODO.md +41 -0
- package/package.json +18 -6
- package/server/index.ts +2 -1
- package/server/migrations/1752188906708-SeedKpiCategory.ts +61 -0
- package/server/migrations/1752190849681-SeedKpi.ts +112 -0
- package/server/migrations/1752191090459-SeedKpiGrade.ts +270 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +55 -0
- package/server/service/index.ts +4 -6
- package/server/service/kpi/aggregate-kpi.ts +82 -0
- package/server/service/kpi/event-subscriber.ts +12 -0
- package/server/service/kpi/kpi-formula.service.ts +63 -0
- package/server/service/kpi/kpi-history.ts +29 -21
- package/server/service/kpi/kpi-mutation.ts +194 -12
- package/server/service/kpi/kpi-query.ts +57 -2
- package/server/service/kpi/kpi-type.ts +72 -19
- package/server/service/kpi/kpi.ts +96 -20
- package/server/service/kpi-alert/index.ts +3 -0
- package/server/service/kpi-alert/kpi-alert-query.ts +59 -0
- package/server/service/kpi-alert/kpi-alert-type.ts +20 -0
- package/server/service/kpi-category/kpi-category-mutation.ts +17 -4
- package/server/service/kpi-category/kpi-category-query.ts +20 -3
- package/server/service/kpi-category/kpi-category-type.ts +17 -19
- package/server/service/kpi-category/kpi-category.ts +39 -37
- package/server/service/kpi-grade/index.ts +2 -4
- package/server/service/kpi-grade/kpi-grade-mutation.ts +13 -4
- package/server/service/kpi-grade/kpi-grade-query.ts +5 -2
- package/server/service/kpi-grade/kpi-grade-type.ts +46 -19
- package/server/service/kpi-grade/kpi-grade.ts +44 -38
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +128 -0
- package/server/service/kpi-metric/index.ts +2 -4
- package/server/service/kpi-metric/kpi-metric-mutation.ts +123 -7
- package/server/service/kpi-metric/kpi-metric-query.ts +9 -3
- package/server/service/kpi-metric/kpi-metric-type.ts +56 -13
- package/server/service/kpi-metric/kpi-metric.ts +55 -35
- package/server/service/kpi-value/kpi-value-mutation.ts +52 -14
- package/server/service/kpi-value/kpi-value-query.ts +12 -2
- package/server/service/kpi-value/kpi-value-type.ts +80 -25
- package/server/service/kpi-value/kpi-value.ts +81 -29
- package/things-factory.config.js +12 -4
- package/translations/en.json +12 -1
- package/translations/ja.json +12 -1
- package/translations/ko.json +12 -1
- package/translations/ms.json +12 -1
- package/translations/zh.json +12 -1
- package/client/pages/kpe-metric/kpe-metric-importer.ts +0 -90
- package/client/pages/kpe-metric/kpe-metric-list-page.ts +0 -398
- package/client/pages/kpi-formula/kpi-formula-importer.ts +0 -90
- package/client/pages/kpi-formula/kpi-formula-list-page.ts +0 -398
- package/client/pages/metric/metric-importer.ts +0 -90
- package/client/pages/metric/metric-list-page.ts +0 -398
- package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +0 -23
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js +0 -93
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +0 -1
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +0 -66
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +0 -370
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +0 -23
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js +0 -93
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +0 -66
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +0 -370
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +0 -1
- package/dist-client/pages/metric/metric-importer.d.ts +0 -23
- package/dist-client/pages/metric/metric-importer.js +0 -93
- package/dist-client/pages/metric/metric-importer.js.map +0 -1
- package/dist-client/pages/metric/metric-list-page.d.ts +0 -66
- package/dist-client/pages/metric/metric-list-page.js +0 -370
- package/dist-client/pages/metric/metric-list-page.js.map +0 -1
- package/dist-server/service/kpi-formula/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-formula/event-subscriber.js +0 -21
- package/dist-server/service/kpi-formula/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-formula/index.d.ts +0 -7
- package/dist-server/service/kpi-formula/index.js +0 -12
- package/dist-server/service/kpi-formula/index.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +0 -25
- package/dist-server/service/kpi-formula/kpi-formula-history.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-history.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +0 -10
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +0 -11
- package/dist-server/service/kpi-formula/kpi-formula-query.js +0 -79
- package/dist-server/service/kpi-formula/kpi-formula-query.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +0 -20
- package/dist-server/service/kpi-formula/kpi-formula-type.js +0 -77
- package/dist-server/service/kpi-formula/kpi-formula-type.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula.d.ts +0 -24
- package/dist-server/service/kpi-formula/kpi-formula.js +0 -109
- package/dist-server/service/kpi-formula/kpi-formula.js.map +0 -1
- package/dist-server/service/kpi-grade/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-grade/event-subscriber.js +0 -21
- package/dist-server/service/kpi-grade/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +0 -25
- package/dist-server/service/kpi-grade/kpi-grade-history.js +0 -128
- package/dist-server/service/kpi-grade/kpi-grade-history.js.map +0 -1
- package/dist-server/service/kpi-metric/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-metric/event-subscriber.js +0 -21
- package/dist-server/service/kpi-metric/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +0 -25
- package/dist-server/service/kpi-metric/kpi-metric-history.js +0 -128
- package/dist-server/service/kpi-metric/kpi-metric-history.js.map +0 -1
- package/server/service/kpi-formula/event-subscriber.ts +0 -17
- package/server/service/kpi-formula/index.ts +0 -9
- package/server/service/kpi-formula/kpi-formula-history.ts +0 -116
- package/server/service/kpi-formula/kpi-formula-mutation.ts +0 -137
- package/server/service/kpi-formula/kpi-formula-query.ts +0 -48
- package/server/service/kpi-formula/kpi-formula-type.ts +0 -55
- package/server/service/kpi-formula/kpi-formula.ts +0 -95
- package/server/service/kpi-grade/event-subscriber.ts +0 -17
- package/server/service/kpi-grade/kpi-grade-history.ts +0 -116
- package/server/service/kpi-metric/event-subscriber.ts +0 -17
- package/server/service/kpi-metric/kpi-metric-history.ts +0 -116
|
@@ -4,22 +4,46 @@ import { getRepository } from '@things-factory/shell'
|
|
|
4
4
|
|
|
5
5
|
import { KpiValue } from './kpi-value'
|
|
6
6
|
import { NewKpiValue, KpiValuePatch } from './kpi-value-type'
|
|
7
|
+
import { Kpi } from '../kpi/kpi'
|
|
8
|
+
import { KpiValueInputType } from './kpi-value'
|
|
7
9
|
|
|
8
10
|
@Resolver(KpiValue)
|
|
9
11
|
export class KpiValueMutation {
|
|
10
12
|
@Directive('@transaction')
|
|
11
|
-
@Mutation(returns => KpiValue, { description: '
|
|
12
|
-
async createKpiValue(
|
|
13
|
+
@Mutation(returns => KpiValue, { description: 'Create a new KPI value with the provided details.' })
|
|
14
|
+
async createKpiValue(
|
|
15
|
+
@Arg('kpiValue', { description: 'Input object containing details for the new KPI value.' }) kpiValue: NewKpiValue,
|
|
16
|
+
@Ctx() context: ResolverContext
|
|
17
|
+
): Promise<KpiValue> {
|
|
13
18
|
const { domain, user, tx } = context.state
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
let kpi = kpiValue.kpiId ? await getRepository(Kpi).findOne({ where: { id: kpiValue.kpiId } }) : undefined
|
|
21
|
+
|
|
22
|
+
let inputType: KpiValueInputType | undefined = undefined
|
|
23
|
+
if (kpiValue.inputType) {
|
|
24
|
+
if (typeof kpiValue.inputType === 'string') {
|
|
25
|
+
inputType = KpiValueInputType[kpiValue.inputType as keyof typeof KpiValueInputType]
|
|
26
|
+
} else {
|
|
27
|
+
inputType = kpiValue.inputType
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const entity: Partial<KpiValue> = {
|
|
32
|
+
kpi,
|
|
33
|
+
kpiId: kpiValue.kpiId,
|
|
34
|
+
version: kpiValue.version,
|
|
35
|
+
valueDate: kpiValue.valueDate,
|
|
36
|
+
value: kpiValue.value,
|
|
37
|
+
groupId: kpiValue.groupId,
|
|
38
|
+
groupType: kpiValue.groupType,
|
|
39
|
+
source: kpiValue.source,
|
|
40
|
+
domain: domain,
|
|
18
41
|
creator: user,
|
|
19
42
|
updater: user
|
|
20
|
-
}
|
|
43
|
+
}
|
|
44
|
+
if (inputType) entity.inputType = inputType
|
|
21
45
|
|
|
22
|
-
return
|
|
46
|
+
return await getRepository(KpiValue, tx).save(entity)
|
|
23
47
|
}
|
|
24
48
|
|
|
25
49
|
@Directive('@transaction')
|
|
@@ -36,13 +60,28 @@ export class KpiValueMutation {
|
|
|
36
60
|
where: { domain: { id: domain.id }, id }
|
|
37
61
|
})
|
|
38
62
|
|
|
39
|
-
|
|
63
|
+
let kpi = patch.kpiId ? await getRepository(Kpi).findOne({ where: { id: patch.kpiId } }) : kpiValue.kpi
|
|
64
|
+
|
|
65
|
+
let inputType: KpiValueInputType | undefined = undefined
|
|
66
|
+
if (patch.inputType) {
|
|
67
|
+
if (typeof patch.inputType === 'string') {
|
|
68
|
+
inputType = KpiValueInputType[patch.inputType as keyof typeof KpiValueInputType]
|
|
69
|
+
} else {
|
|
70
|
+
inputType = patch.inputType
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
inputType = kpiValue.inputType
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const entity: any = {
|
|
40
77
|
...kpiValue,
|
|
41
78
|
...patch,
|
|
79
|
+
kpi,
|
|
42
80
|
updater: user
|
|
43
|
-
}
|
|
81
|
+
}
|
|
82
|
+
if (inputType) entity.inputType = inputType
|
|
44
83
|
|
|
45
|
-
return
|
|
84
|
+
return await repository.save(entity)
|
|
46
85
|
}
|
|
47
86
|
|
|
48
87
|
@Directive('@transaction')
|
|
@@ -67,7 +106,7 @@ export class KpiValueMutation {
|
|
|
67
106
|
domain,
|
|
68
107
|
creator: user,
|
|
69
108
|
updater: user
|
|
70
|
-
})
|
|
109
|
+
} as any)
|
|
71
110
|
|
|
72
111
|
results.push({ ...result, cuFlag: '+' })
|
|
73
112
|
}
|
|
@@ -82,7 +121,7 @@ export class KpiValueMutation {
|
|
|
82
121
|
...kpiValue,
|
|
83
122
|
...updateRecord,
|
|
84
123
|
updater: user
|
|
85
|
-
})
|
|
124
|
+
} as any)
|
|
86
125
|
|
|
87
126
|
results.push({ ...result, cuFlag: 'M' })
|
|
88
127
|
}
|
|
@@ -114,7 +153,6 @@ export class KpiValueMutation {
|
|
|
114
153
|
id: In(ids)
|
|
115
154
|
})
|
|
116
155
|
|
|
117
|
-
|
|
118
156
|
return true
|
|
119
157
|
}
|
|
120
158
|
|
|
@@ -128,7 +166,7 @@ export class KpiValueMutation {
|
|
|
128
166
|
|
|
129
167
|
await Promise.all(
|
|
130
168
|
kpiValues.map(async (kpiValue: KpiValuePatch) => {
|
|
131
|
-
const createdKpiValue: KpiValue = await getRepository(KpiValue, tx).save({ domain, ...kpiValue })
|
|
169
|
+
const createdKpiValue: KpiValue = await getRepository(KpiValue, tx).save({ domain, ...kpiValue } as any)
|
|
132
170
|
})
|
|
133
171
|
)
|
|
134
172
|
|
|
@@ -3,11 +3,15 @@ import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from
|
|
|
3
3
|
import { User } from '@things-factory/auth-base'
|
|
4
4
|
import { KpiValue } from './kpi-value'
|
|
5
5
|
import { KpiValueList } from './kpi-value-type'
|
|
6
|
+
import { Kpi } from '../kpi/kpi'
|
|
6
7
|
|
|
7
8
|
@Resolver(KpiValue)
|
|
8
9
|
export class KpiValueQuery {
|
|
9
|
-
@Query(returns => KpiValue!, { nullable: true, description: '
|
|
10
|
-
async kpiValue(
|
|
10
|
+
@Query(returns => KpiValue!, { nullable: true, description: 'Fetch a single KPI value by its unique identifier.' })
|
|
11
|
+
async kpiValue(
|
|
12
|
+
@Arg('id', { description: 'Unique identifier of the KPI value to fetch.' }) id: string,
|
|
13
|
+
@Ctx() context: ResolverContext
|
|
14
|
+
): Promise<KpiValue> {
|
|
11
15
|
const { domain } = context.state
|
|
12
16
|
|
|
13
17
|
return await getRepository(KpiValue).findOne({
|
|
@@ -45,4 +49,10 @@ export class KpiValueQuery {
|
|
|
45
49
|
async creator(@Root() kpiValue: KpiValue): Promise<User> {
|
|
46
50
|
return kpiValue.creatorId && (await getRepository(User).findOneBy({ id: kpiValue.creatorId }))
|
|
47
51
|
}
|
|
52
|
+
|
|
53
|
+
@FieldResolver(type => Kpi)
|
|
54
|
+
async kpi(@Root() kpiValue: KpiValue): Promise<Kpi | null> {
|
|
55
|
+
if (!kpiValue.kpiId) return null
|
|
56
|
+
return await getRepository(Kpi).findOneBy({ id: kpiValue.kpiId })
|
|
57
|
+
}
|
|
48
58
|
}
|
|
@@ -1,47 +1,102 @@
|
|
|
1
1
|
import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
|
|
2
2
|
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
|
|
3
|
-
import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
|
|
3
|
+
import { ObjectType, Field, InputType, Int, ID, registerEnumType, Float } from 'type-graphql'
|
|
4
4
|
|
|
5
5
|
import { ObjectRef, ScalarObject } from '@things-factory/shell'
|
|
6
6
|
|
|
7
|
-
import { KpiValue,
|
|
7
|
+
import { KpiValue, KpiValueInputType } from './kpi-value'
|
|
8
8
|
|
|
9
|
-
@InputType()
|
|
9
|
+
@InputType({ description: 'Input type for creating a new KPI value. Used in mutations to provide KPI value details.' })
|
|
10
10
|
export class NewKpiValue {
|
|
11
|
-
@Field()
|
|
12
|
-
|
|
11
|
+
@Field(type => ID, { description: 'ID of the KPI to which this value belongs.' })
|
|
12
|
+
kpiId: string
|
|
13
13
|
|
|
14
|
-
@Field({
|
|
15
|
-
|
|
14
|
+
@Field(type => Int, { description: 'Version of the KPI definition at the time this value is calculated.' })
|
|
15
|
+
version: number
|
|
16
16
|
|
|
17
|
-
@Field(
|
|
18
|
-
|
|
17
|
+
@Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })
|
|
18
|
+
valueDate: string
|
|
19
19
|
|
|
20
|
-
@Field({
|
|
21
|
-
|
|
20
|
+
@Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })
|
|
21
|
+
value: number
|
|
22
22
|
|
|
23
|
-
@Field(
|
|
24
|
-
|
|
23
|
+
@Field(type => ScalarObject, {
|
|
24
|
+
nullable: true,
|
|
25
|
+
description:
|
|
26
|
+
'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
27
|
+
})
|
|
28
|
+
meta?: any
|
|
29
|
+
|
|
30
|
+
@Field({
|
|
31
|
+
nullable: true,
|
|
32
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
33
|
+
})
|
|
34
|
+
groupId?: string
|
|
35
|
+
|
|
36
|
+
@Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })
|
|
37
|
+
groupType?: string
|
|
38
|
+
|
|
39
|
+
@Field(type => KpiValueInputType, {
|
|
40
|
+
nullable: true,
|
|
41
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
42
|
+
})
|
|
43
|
+
inputType?: KpiValueInputType
|
|
44
|
+
|
|
45
|
+
@Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })
|
|
46
|
+
source?: string
|
|
25
47
|
}
|
|
26
48
|
|
|
27
|
-
@InputType(
|
|
49
|
+
@InputType({
|
|
50
|
+
description: 'Input type for updating an existing KPI value. Used in mutations to patch KPI value details.'
|
|
51
|
+
})
|
|
28
52
|
export class KpiValuePatch {
|
|
29
|
-
@Field(type => ID, { nullable: true })
|
|
53
|
+
@Field(type => ID, { nullable: true, description: 'ID of the KPI value to update.' })
|
|
30
54
|
id?: string
|
|
31
55
|
|
|
32
|
-
@Field({ nullable: true })
|
|
33
|
-
|
|
56
|
+
@Field(type => ID, { nullable: true, description: 'ID of the KPI to which this value belongs.' })
|
|
57
|
+
kpiId?: string
|
|
58
|
+
|
|
59
|
+
@Field(type => Int, {
|
|
60
|
+
nullable: true,
|
|
61
|
+
description: 'Version of the KPI definition at the time this value is calculated.'
|
|
62
|
+
})
|
|
63
|
+
version?: number
|
|
64
|
+
|
|
65
|
+
@Field({
|
|
66
|
+
nullable: true,
|
|
67
|
+
description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).'
|
|
68
|
+
})
|
|
69
|
+
valueDate?: string
|
|
70
|
+
|
|
71
|
+
@Field(type => Float, { nullable: true, description: 'The calculated numeric value for this KPI and period.' })
|
|
72
|
+
value?: number
|
|
73
|
+
|
|
74
|
+
@Field(type => ScalarObject, {
|
|
75
|
+
nullable: true,
|
|
76
|
+
description:
|
|
77
|
+
'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
78
|
+
})
|
|
79
|
+
meta?: any
|
|
80
|
+
|
|
81
|
+
@Field({
|
|
82
|
+
nullable: true,
|
|
83
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
84
|
+
})
|
|
85
|
+
groupId?: string
|
|
86
|
+
|
|
87
|
+
@Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })
|
|
88
|
+
groupType?: string
|
|
34
89
|
|
|
35
|
-
@Field(
|
|
36
|
-
|
|
90
|
+
@Field(type => KpiValueInputType, {
|
|
91
|
+
nullable: true,
|
|
92
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
93
|
+
})
|
|
94
|
+
inputType?: KpiValueInputType
|
|
37
95
|
|
|
38
|
-
@Field(
|
|
39
|
-
|
|
96
|
+
@Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })
|
|
97
|
+
source?: string
|
|
40
98
|
|
|
41
|
-
@Field({ nullable: true })
|
|
42
|
-
active?: boolean
|
|
43
|
-
|
|
44
|
-
@Field({ nullable: true })
|
|
99
|
+
@Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })
|
|
45
100
|
cuFlag?: string
|
|
46
101
|
}
|
|
47
102
|
|
|
@@ -8,77 +8,129 @@ import {
|
|
|
8
8
|
ManyToOne,
|
|
9
9
|
PrimaryGeneratedColumn
|
|
10
10
|
} from 'typeorm'
|
|
11
|
-
import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
11
|
+
import { ObjectType, Field, Int, ID, registerEnumType, Float } from 'type-graphql'
|
|
12
12
|
|
|
13
|
-
import { Domain } from '@things-factory/shell'
|
|
14
13
|
import { User } from '@things-factory/auth-base'
|
|
14
|
+
import { Domain, ScalarObject, json5Transformer } from '@things-factory/shell'
|
|
15
|
+
import { config } from '@things-factory/env'
|
|
16
|
+
import { Kpi } from '../kpi/kpi'
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const ORMCONFIG = config.get('ormconfig', {})
|
|
19
|
+
const DATABASE_TYPE = ORMCONFIG.type
|
|
20
|
+
|
|
21
|
+
export enum KpiValueInputType {
|
|
22
|
+
MANUAL = 'MANUAL',
|
|
23
|
+
AUTO = 'AUTO'
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
registerEnumType(
|
|
22
|
-
name: '
|
|
23
|
-
description: '
|
|
26
|
+
registerEnumType(KpiValueInputType, {
|
|
27
|
+
name: 'KpiValueInputType',
|
|
28
|
+
description: 'Type of the input (Manual or Auto)'
|
|
24
29
|
})
|
|
25
30
|
|
|
26
31
|
@Entity()
|
|
27
|
-
@Index('
|
|
28
|
-
|
|
29
|
-
})
|
|
32
|
+
@Index('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType', 'version'], { unique: true })
|
|
33
|
+
@Index('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType'], { unique: false })
|
|
30
34
|
@ObjectType({ description: 'Entity for KpiValue' })
|
|
31
35
|
export class KpiValue {
|
|
32
36
|
@PrimaryGeneratedColumn('uuid')
|
|
33
|
-
@Field(type => ID)
|
|
37
|
+
@Field(type => ID, { description: 'Unique identifier for this KPI value record.' })
|
|
34
38
|
readonly id: string
|
|
35
39
|
|
|
36
40
|
@ManyToOne(type => Domain)
|
|
37
|
-
@Field({ nullable: true })
|
|
41
|
+
@Field({ nullable: true, description: 'Domain (tenant) to which this KPI value belongs.' })
|
|
38
42
|
domain?: Domain
|
|
39
43
|
|
|
40
44
|
@RelationId((kpiValue: KpiValue) => kpiValue.domain)
|
|
45
|
+
@Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI value.' })
|
|
41
46
|
domainId?: string
|
|
42
47
|
|
|
43
|
-
@
|
|
44
|
-
@Field(
|
|
45
|
-
|
|
48
|
+
@ManyToOne(() => Kpi)
|
|
49
|
+
@Field(type => Kpi, {
|
|
50
|
+
nullable: true,
|
|
51
|
+
description: 'Reference to the KPI definition for which this value is calculated.'
|
|
52
|
+
})
|
|
53
|
+
kpi: Kpi
|
|
54
|
+
|
|
55
|
+
@RelationId((kpiValue: KpiValue) => kpiValue.kpi)
|
|
56
|
+
@Field({ description: 'ID of the referenced KPI.' })
|
|
57
|
+
kpiId: string
|
|
58
|
+
|
|
59
|
+
@Column('int')
|
|
60
|
+
@Field(type => Int, { description: 'Version of the KPI definition at the time this value was calculated.' })
|
|
61
|
+
version: number
|
|
62
|
+
|
|
63
|
+
@Column({ type: 'date' })
|
|
64
|
+
@Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })
|
|
65
|
+
valueDate: string
|
|
66
|
+
|
|
67
|
+
@Column('float')
|
|
68
|
+
@Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })
|
|
69
|
+
value: number
|
|
46
70
|
|
|
47
71
|
@Column({ nullable: true })
|
|
48
|
-
@Field({
|
|
49
|
-
|
|
72
|
+
@Field({
|
|
73
|
+
nullable: true,
|
|
74
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
75
|
+
})
|
|
76
|
+
groupId?: string
|
|
50
77
|
|
|
51
|
-
@Column({ nullable:
|
|
52
|
-
@Field({ nullable: true })
|
|
53
|
-
|
|
78
|
+
@Column({ nullable: true })
|
|
79
|
+
@Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })
|
|
80
|
+
groupType?: string
|
|
54
81
|
|
|
55
82
|
@Column({ nullable: true })
|
|
56
|
-
@Field({
|
|
57
|
-
|
|
83
|
+
@Field({
|
|
84
|
+
nullable: true,
|
|
85
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
86
|
+
})
|
|
87
|
+
inputType?: KpiValueInputType
|
|
58
88
|
|
|
59
89
|
@Column({ nullable: true })
|
|
60
|
-
@Field({ nullable: true })
|
|
61
|
-
|
|
90
|
+
@Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })
|
|
91
|
+
source?: string
|
|
92
|
+
|
|
93
|
+
@Column({
|
|
94
|
+
nullable: true,
|
|
95
|
+
type:
|
|
96
|
+
DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
97
|
+
? 'longtext'
|
|
98
|
+
: DATABASE_TYPE == 'oracle'
|
|
99
|
+
? 'clob'
|
|
100
|
+
: DATABASE_TYPE == 'mssql'
|
|
101
|
+
? 'nvarchar'
|
|
102
|
+
: 'varchar',
|
|
103
|
+
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined,
|
|
104
|
+
transformer: json5Transformer
|
|
105
|
+
})
|
|
106
|
+
@Field(type => ScalarObject, {
|
|
107
|
+
nullable: true,
|
|
108
|
+
description:
|
|
109
|
+
'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
110
|
+
})
|
|
111
|
+
meta?: any
|
|
62
112
|
|
|
63
113
|
@CreateDateColumn()
|
|
64
|
-
@Field({ nullable: true })
|
|
114
|
+
@Field({ nullable: true, description: 'Timestamp when this KPI value record was created.' })
|
|
65
115
|
createdAt?: Date
|
|
66
116
|
|
|
67
117
|
@UpdateDateColumn()
|
|
68
|
-
@Field({ nullable: true })
|
|
118
|
+
@Field({ nullable: true, description: 'Timestamp when this KPI value record was last updated.' })
|
|
69
119
|
updatedAt?: Date
|
|
70
120
|
|
|
71
121
|
@ManyToOne(type => User, { nullable: true })
|
|
72
|
-
@Field(type => User, { nullable: true })
|
|
122
|
+
@Field(type => User, { nullable: true, description: 'User who created this KPI value record.' })
|
|
73
123
|
creator?: User
|
|
74
124
|
|
|
75
125
|
@RelationId((kpiValue: KpiValue) => kpiValue.creator)
|
|
126
|
+
@Field({ nullable: true, description: 'ID of the user who created this KPI value record.' })
|
|
76
127
|
creatorId?: string
|
|
77
128
|
|
|
78
129
|
@ManyToOne(type => User, { nullable: true })
|
|
79
|
-
@Field(type => User, { nullable: true })
|
|
130
|
+
@Field(type => User, { nullable: true, description: 'User who last updated this KPI value record.' })
|
|
80
131
|
updater?: User
|
|
81
132
|
|
|
82
133
|
@RelationId((kpiValue: KpiValue) => kpiValue.updater)
|
|
134
|
+
@Field({ nullable: true, description: 'ID of the user who last updated this KPI value record.' })
|
|
83
135
|
updaterId?: string
|
|
84
136
|
}
|
package/things-factory.config.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import route from './dist-client/route'
|
|
2
|
-
import bootstrap from './dist-client/bootstrap'
|
|
2
|
+
// import bootstrap from './dist-client/bootstrap'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
route,
|
|
6
6
|
routes: [
|
|
7
|
-
{ tagname: 'kpi-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
{ tagname: 'kpi-overview', page: 'kpi-overview' },
|
|
8
|
+
{ tagname: 'kpi-dashboard', page: 'kpi-dashboard' },
|
|
9
|
+
{ tagname: 'kpi-list-page', page: 'kpi-list' },
|
|
10
|
+
{ tagname: 'kpi-category-list-page', page: 'kpi-category-list' },
|
|
11
|
+
{ tagname: 'kpi-metric-list-page', page: 'kpi-metric-list' },
|
|
12
|
+
{ tagname: 'kpi-value-list-page', page: 'kpi-value-list' },
|
|
13
|
+
{ tagname: 'kpi-value-manual-entry-page', page: 'kpi-value-manual-entry' },
|
|
14
|
+
{ tagname: 'kpi-grade-list-page', page: 'kpi-grade-list' },
|
|
15
|
+
{ tagname: 'kpi-history-list-page', page: 'kpi-history-list' }
|
|
16
|
+
]
|
|
17
|
+
// bootstrap
|
|
10
18
|
}
|
package/translations/en.json
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"title.kpi list": "KPI List",
|
|
3
|
+
"title.kpi category list": "KPI Catogory List",
|
|
4
|
+
"title.kpi grade list": "KPI Grade List",
|
|
5
|
+
"title.kpi metric list": "KPI Metric List",
|
|
6
|
+
"title.kpi value list": "KPI Value List",
|
|
7
|
+
"title.kpi performance board": "KPI Performance Board",
|
|
8
|
+
"title.kpi management center": "KPI Management Center",
|
|
9
|
+
"title.kpi overview": "KPI Overview",
|
|
10
|
+
"title.kpi value manual entry": "KPI Value Manual Entry",
|
|
11
|
+
"button.enter-kpi-value": "Enter KPI Value"
|
|
12
|
+
}
|
package/translations/ja.json
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"title.kpi list": "KPI リスト",
|
|
3
|
+
"title.kpi category list": "KPI カテゴリ リスト",
|
|
4
|
+
"title.kpi grade list": "KPI グレード リスト",
|
|
5
|
+
"title.kpi metric list": "KPI メトリック リスト",
|
|
6
|
+
"title.kpi value list": "KPI 値 リスト",
|
|
7
|
+
"title.kpi performance board": "KPI パフォーマンス ボード",
|
|
8
|
+
"title.kpi management center": "KPI 管理 センター",
|
|
9
|
+
"title.kpi overview": "KPI 概要",
|
|
10
|
+
"title.kpi value manual entry": "KPI 値 手入力",
|
|
11
|
+
"button.enter-kpi-value": "KPI 値 入力"
|
|
12
|
+
}
|
package/translations/ko.json
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"title.kpi list": "KPI 목록",
|
|
3
|
+
"title.kpi category list": "KPI 카테고리 목록",
|
|
4
|
+
"title.kpi grade list": "KPI 등급 목록",
|
|
5
|
+
"title.kpi metric list": "KPI 지표 목록",
|
|
6
|
+
"title.kpi value list": "KPI 값 목록",
|
|
7
|
+
"title.kpi performance board": "KPI 성과 보드",
|
|
8
|
+
"title.kpi management center": "KPI 관리 센터",
|
|
9
|
+
"title.kpi overview": "KPI 개요",
|
|
10
|
+
"title.kpi value manual entry": "KPI 값 수기 입력",
|
|
11
|
+
"button.enter-kpi-value": "KPI 값 입력"
|
|
12
|
+
}
|
package/translations/ms.json
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"title.kpi list": "Senarai KPI",
|
|
3
|
+
"title.kpi category list": "Senarai Kategori KPI",
|
|
4
|
+
"title.kpi grade list": "Senarai Gred KPI",
|
|
5
|
+
"title.kpi metric list": "Senarai Metrik KPI",
|
|
6
|
+
"title.kpi value list": "Senarai Nilai KPI",
|
|
7
|
+
"title.kpi performance board": "Papan KPI",
|
|
8
|
+
"title.kpi management center": "Pusat Pengurusan KPI",
|
|
9
|
+
"title.kpi overview": "Pengenalan KPI",
|
|
10
|
+
"title.kpi value manual entry": "KPI 値 手入力",
|
|
11
|
+
"button.enter-kpi-value": "KPI 値 入力"
|
|
12
|
+
}
|
package/translations/zh.json
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"title.kpi list": "KPI 列表",
|
|
3
|
+
"title.kpi category list": "KPI 分类列表",
|
|
4
|
+
"title.kpi grade list": "KPI 等级列表",
|
|
5
|
+
"title.kpi metric list": "KPI 指标列表",
|
|
6
|
+
"title.kpi value list": "KPI 值列表",
|
|
7
|
+
"title.kpi performance board": "KPI 绩效看板",
|
|
8
|
+
"title.kpi management center": "KPI 管理中心",
|
|
9
|
+
"title.kpi overview": "KPI 概述",
|
|
10
|
+
"title.kpi value manual entry": "KPI 值手动输入",
|
|
11
|
+
"button.enter-kpi-value": "KPI 值手动输入"
|
|
12
|
+
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/data-grist'
|
|
3
|
-
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement } from 'lit'
|
|
6
|
-
import { property } from 'lit/decorators.js'
|
|
7
|
-
|
|
8
|
-
import { client } from '@operato/graphql'
|
|
9
|
-
import { i18next } from '@operato/i18n'
|
|
10
|
-
import { isMobileDevice } from '@operato/utils'
|
|
11
|
-
import { ButtonContainerStyles } from '@operato/styles'
|
|
12
|
-
|
|
13
|
-
export class KpeMetricImporter extends LitElement {
|
|
14
|
-
static styles = [
|
|
15
|
-
ButtonContainerStyles,
|
|
16
|
-
css`
|
|
17
|
-
:host {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
|
|
21
|
-
background-color: #fff;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ox-grist {
|
|
25
|
-
flex: 1;
|
|
26
|
-
}
|
|
27
|
-
`
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
@property({ type: Array }) kpeMetrics: any[] = []
|
|
31
|
-
@property({ type: Object }) columns = {
|
|
32
|
-
list: { fields: ['name', 'description'] },
|
|
33
|
-
pagination: { infinite: true },
|
|
34
|
-
columns: [
|
|
35
|
-
{
|
|
36
|
-
type: 'string',
|
|
37
|
-
name: 'name',
|
|
38
|
-
header: i18next.t('field.name'),
|
|
39
|
-
width: 150
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: 'string',
|
|
43
|
-
name: 'description',
|
|
44
|
-
header: i18next.t('field.description'),
|
|
45
|
-
width: 200
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: 'checkbox',
|
|
49
|
-
name: 'active',
|
|
50
|
-
header: i18next.t('field.active'),
|
|
51
|
-
width: 60
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
render() {
|
|
58
|
-
return html`
|
|
59
|
-
<ox-grist
|
|
60
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
61
|
-
.config=${this.columns}
|
|
62
|
-
.data=${
|
|
63
|
-
{
|
|
64
|
-
records: this.kpeMetrics
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
></ox-grist>
|
|
68
|
-
|
|
69
|
-
<div class="button-container">
|
|
70
|
-
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
71
|
-
</div>
|
|
72
|
-
`
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async save() {
|
|
76
|
-
const response = await client.mutate({
|
|
77
|
-
mutation: gql`
|
|
78
|
-
mutation importKpeMetrics($kpeMetrics: [KpeMetricPatch!]!) {
|
|
79
|
-
importKpeMetrics(kpeMetrics: $kpeMetrics)
|
|
80
|
-
}
|
|
81
|
-
`,
|
|
82
|
-
variables: { kpeMetrics: this.kpeMetrics }
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
if (response.errors?.length) return
|
|
86
|
-
|
|
87
|
-
this.dispatchEvent(new CustomEvent('imported'))
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|